template-builder: creation of script for fedora core 17 template building

This commit is contained in:
Olivier Medoc 2013-01-25 09:06:20 +01:00 committed by Marek Marczykowski
parent 7e17847377
commit 588a55f0a6
5 changed files with 47 additions and 0 deletions

5
scripts_fc17/00_prepare.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
rm -f keys base_rpms
ln -sf keys_$DIST keys
ln -sf base_rpms_$DIST base_rpms

12
scripts_fc17/01_install_core.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
echo "-> Initializing RPM database..."
rpm --initdb --root=$INSTALLDIR
rpm --import --root=$INSTALLDIR keys/*
echo "-> Installing core RPM packages..."
rpm -i --root=$INSTALLDIR base_rpms/*.rpm || exit 1
cp scripts_"${DIST}"/resolv.conf $INSTALLDIR/etc
cp scripts_"${DIST}"/network $INSTALLDIR/etc/sysconfig
cp -a /dev/null /dev/zero /dev/random /dev/urandom $INSTALLDIR/dev/

View File

@ -0,0 +1,10 @@
#!/bin/sh
echo "--> Preparing environment..."
mount -t proc proc mnt/proc
export YUM0=$PWD/yum_repo_qubes
yum clean all -c $PWD/yum.conf $YUM_OPTS -y --installroot=$PWD/mnt
yum install -c $PWD/yum.conf $YUM_OPTS -y --installroot=$INSTALLDIR $PKGGROUPS || RETCODE=1
yum update -c $PWD/yum.conf $YUM_OPTS -y --installroot=$INSTALLDIR || RETCODE=1
umount mnt/proc mnt

View File

@ -0,0 +1,12 @@
#!/bin/sh
echo "--> Preparing environment..."
mount -t proc proc $PWD/proc
echo "--> Installing RPMs..."
export YUM0=$PWD/yum_repo_qubes
yum install -c $PWD/yum.conf $YUM_OPTS -y --installroot=$(pwd)/mnt @qubes-vm
echo "--> Installing 3rd party apps"
./add_3rd_party_software.sh
sudo umount $PWD/proc

8
scripts_fc17/09_cleanup.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
rm -f $INSTALLDIR/var/lib/rpm/__db.00* $INSTALLDIR/var/lib/rpm/.rpm.lock
yum -c $PWD/yum.conf $YUM_OPTS clean packages --installroot=$INSTALLDIR
# Make sure that rpm database has right format (for rpm version in template, not host)
echo "--> Rebuilding rpm database..."
chroot `pwd`/mnt /bin/rpm --rebuilddb 2> /dev/null