From aa5803e0e3368172d7674ff760983c568118df16 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Mon, 19 Nov 2012 10:43:42 +0100 Subject: testing: Switch to Debian based guest images Instead of extracting a downloaded Gentoo filesystem tree into a file containing a reiserfs filesystem, create an ext3 filesystem inside a sparse file, mount it and debootstrap an up-to-date Debian system. Use this image as base for all UML guest images. Also, drop support for the various consoles and use xterm unconditionally. --- testing/scripts/build-umlrootfs | 100 ++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 51 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 523a3b536..647c929ea 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -34,7 +34,7 @@ else exit fi -cecho-n " * Looking for gentoo root filesystem at '$ROOTFS'.." +cecho-n " * Looking for root image at '$ROOTFS'.." if [ -f "$ROOTFS" ] then cecho "found it" @@ -45,19 +45,6 @@ fi [ -d $BUILDDIR ] || die "!! Directory '$BUILDDIR' does not exist" -HOSTCONFIGDIR=$BUILDDIR/hosts - -[ -d $HOSTCONFIGDIR ] || die "!! Directory '$HOSTCONFIGDIR' does not exist" - -LOGFILE=$BUILDDIR/testing.log - -if [ ! -f $LOGFILE ] -then - cecho-n " * Logfile '$LOGFILE' does not exist..creating.." - touch $LOGFILE - cgecho "done" -fi - ROOTFSDIR=$BUILDDIR/root-fs if [ ! -d $ROOTFSDIR ] @@ -69,22 +56,18 @@ fi cd $ROOTFSDIR -LOOPDIR=$ROOTFSDIR/loop - if [ ! -d $LOOPDIR ] then mkdir $LOOPDIR fi ###################################################### -# creating reiser-based uml root filesystem +# mount root image # - -cecho-n " * Building basic root filesystem (gentoo).." -dd if=/dev/zero of=gentoo-fs count=$ROOTFSSIZE bs=1M >> $LOGFILE 2>&1 -mkreiserfs -q -f gentoo-fs >> $LOGFILE 2>&1 -mount -o loop gentoo-fs $LOOPDIR >> $LOGFILE 2>&1 -tar xjpf $ROOTFS -C $LOOPDIR >> $LOGFILE 2>&1 +BASE=$BUILDDIR/base.img +cecho-n " * Mounting base image $BASE.." +cp $ROOTFS $BASE +mount -o loop $BASE $LOOPDIR >> $LOGFILE 2>&1 cgecho "done" ###################################################### @@ -93,12 +76,6 @@ cgecho "done" cecho " * Removing /etc/resolv.conf" rm -f $LOOPDIR/etc/resolv.conf -###################################################### -# copying default /etc/hosts to the root filesystem -# -cecho " * Copying '$HOSTCONFIGDIR/default/etc/hosts' to the root filesystem" -cp -fp $HOSTCONFIGDIR/default/etc/hosts $LOOPDIR/etc/hosts - ##################################################### # extracting strongSwan into the root filesystem # @@ -291,7 +268,7 @@ if [ "$USE_KERNEL_PFKEY" = "yes" ] then echo -n " --enable-kernel-pfkey" >> $INSTALLSHELL fi - + if [ "$USE_INTEGRITY_TEST" = "yes" ] then echo -n " --enable-integrity-test" >> $INSTALLSHELL @@ -408,7 +385,7 @@ then fi echo "" >> $INSTALLSHELL -echo "make -j" >> $INSTALLSHELL +echo "make -j5" >> $INSTALLSHELL echo "make install" >> $INSTALLSHELL echo "ldconfig" >> $INSTALLSHELL @@ -417,16 +394,50 @@ chroot $LOOPDIR /bin/bash /install.sh >> $LOGFILE 2>&1 rm -f $INSTALLSHELL cgecho "done" -###################################################### -# copying default /etc/ipsec.d/tables.sql to the root filesystem +##################################### +# preparing ssh for PK authentication # -cecho " * Copying '$HOSTCONFIGDIR/default/etc/ipsec.d/tables.sql' to the root filesystem" -cp -fp $HOSTCONFIGDIR/default/etc/ipsec.d/tables.sql $LOOPDIR/etc/ipsec.d/tables.sql +if [ ! -d ~/.ssh ] +then + cecho-n " * Creating directory '~/.ssh'.." + mkdir ~/.ssh + cgecho "done" +fi + +cecho-n " * Checking for ssh rsa key '~/.ssh/id_rsa.pub'.." +if [ -f ~/.ssh/id_rsa.pub ] +then + cecho "already exists" +else + cecho "not found" + cecho-n " * Generating ssh rsa key pair.." + echo "" | ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa >> $LOGFILE 2>&1 + cgecho "done" +fi + +if [ -f ~/.ssh/known_hosts ] +then + cecho-n " * Backing up ~/.ssh/known_hosts to '~/.ssh/known_hosts.before_uml'.." + cp -fp ~/.ssh/known_hosts ~/.ssh/known_hosts.before_uml + cgecho "done" +fi +rm ~/.ssh/known_hosts +cecho-n " * Creating new '~/.ssh/known_hosts'.." +touch ~/.ssh/known_hosts +cgecho "done" + +for host in $HOSTNAMEIPV4 +do + HOSTNAME=`echo $host | awk -F, '{ print $1 }'` + IP=`echo $host | awk -F, '{ print $2 }'` + cecho-n " * Adding uml host $HOSTNAME ($IP) to '~/.ssh/known_hosts'.." + echo "$HOSTNAME,$IP `cat $LOOPDIR/etc/ssh/ssh_host_rsa_key.pub`" >> ~/.ssh/known_hosts + cgecho "done" +done ###################################################### # copying the host's ssh public key # - if [ ! -d $LOOPDIR/root/.ssh ] then mkdir $LOOPDIR/root/.ssh @@ -441,21 +452,8 @@ cp $LOOPDIR/etc/ssh/ssh_host_rsa_key $LOOPDIR/root/.ssh/id_rsa for host in $STRONGSWANHOSTS do eval ip="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F- '{ print $1 }' | awk '{ print $1 }'`" - echo "$host,$ip `cat $HOSTCONFIGDIR/ssh_host_rsa_key.pub`" >> $LOOPDIR/root/.ssh/known_hosts - echo "`cat $HOSTCONFIGDIR/ssh_host_rsa_key.pub` root@$host" >> $LOOPDIR/root/.ssh/authorized_keys + echo "$host,$ip `cat $LOOPDIR/etc/ssh/ssh_host_rsa_key.pub`" >> $LOOPDIR/root/.ssh/known_hosts + echo "`cat $LOOPDIR/etc/ssh/ssh_host_rsa_key.pub` root@$host" >> $LOOPDIR/root/.ssh/authorized_keys done -###################################################### -# defining an empty modules.dep -# - -if [ $UMLPATCH ] -then - mkdir $LOOPDIR/lib/modules/`basename $UMLPATCH .bz2 | sed s/uml-patch-//`um - touch $LOOPDIR/lib/modules/`basename $UMLPATCH .bz2 | sed s/uml-patch-//`um/modules.dep -else - mkdir $LOOPDIR/lib/modules/$KERNELVERSION - touch $LOOPDIR/lib/modules/$KERNELVERSION/modules.dep -fi - umount $LOOPDIR -- cgit v1.2.3 From e61ce6ee022bf1517e79e2d29a9b2e93ae3342b0 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Wed, 21 Nov 2012 18:08:24 +0100 Subject: Factor out building of strongswan into own Makefile Small Makefiles (recipes) are used to install software from source into the root UML image. --- testing/scripts/build-umlrootfs | 351 ++++------------------------------------ 1 file changed, 29 insertions(+), 322 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 647c929ea..2633f1b28 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -22,22 +22,10 @@ source $DIR/function.sh source $DIR/../testing.conf -STRONGSWANVERSION=`basename $STRONGSWAN .tar.bz2` - -cecho-n " * Looking for strongSwan at '$STRONGSWAN'.." -if [ -f "$STRONGSWAN" ] -then - cecho "found it" - cecho " * strongSwan version is '$STRONGSWANVERSION'" -else - cecho "none" - exit -fi - cecho-n " * Looking for root image at '$ROOTFS'.." if [ -f "$ROOTFS" ] then - cecho "found it" + cgecho "found it" else cecho "none" exit @@ -68,20 +56,9 @@ BASE=$BUILDDIR/base.img cecho-n " * Mounting base image $BASE.." cp $ROOTFS $BASE mount -o loop $BASE $LOOPDIR >> $LOGFILE 2>&1 +mount -t proc none $LOOPDIR/proc >> $LOGFILE 2>&1 cgecho "done" -###################################################### -# remove /etc/resolv.conf -# -cecho " * Removing /etc/resolv.conf" -rm -f $LOOPDIR/etc/resolv.conf - -##################################################### -# extracting strongSwan into the root filesystem -# -cecho " * Extracting strongSwan into the root filesystem" -tar xjf $STRONGSWAN -C $LOOPDIR/root >> $LOGFILE 2>&1 - ###################################################### # setting up mountpoint for shared source tree # @@ -93,306 +70,35 @@ if [ "${SHAREDTREE+set}" = "set" ]; then fi ###################################################### -# installing strongSwan and setting the local timezone +# install software from source using 'recipes' # +mkdir -p $ROOTFSCOMPILEDIR +cecho " * Mounting $ROOTFSCOMPILEDIR as /root/compile.." +mkdir -p $LOOPDIR/root/compile +mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile >> $LOGFILE 2>&1 + +cecho " * Installing software from source.." +RECPDIR=$UMLTESTDIR/testing/scripts/recipes +RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename` +for r in $RECIPES +do + cecho-n " - $r.." + cp $RECPDIR/$r ${LOOPDIR}/root/compile + chroot ${LOOPDIR} make -C /root/compile -f $r >>$LOGFILE 2>&1 + if [ $? != 0 ]; then + cecho "failed" + else + cgecho "done" + fi +done -INSTALLSHELL=${LOOPDIR}/install.sh - -cecho " * Preparing strongSwan installation script" -echo "ln -sf /usr/share/zoneinfo/${TZUML} /etc/localtime" >> $INSTALLSHELL - -echo "cd /root/${STRONGSWANVERSION}" >> $INSTALLSHELL -echo -n "./configure --sysconfdir=/etc" >> $INSTALLSHELL -echo -n " --with-random-device=/dev/urandom" >> $INSTALLSHELL -echo -n " --disable-load-warning" >> $INSTALLSHELL - -if [ "$USE_LIBCURL" = "yes" ] -then - echo -n " --enable-curl" >> $INSTALLSHELL -fi - -if [ "$USE_LDAP" = "yes" ] -then - echo -n " --enable-ldap" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_AKA" = "yes" ] -then - echo -n " --enable-eap-aka" >> $INSTALLSHELL - echo -n " --enable-eap-aka-3gpp2" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_SIM" = "yes" ] -then - echo -n " --enable-eap-sim" >> $INSTALLSHELL - echo -n " --enable-eap-sim-file" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_MD5" = "yes" ] -then - echo -n " --enable-eap-md5" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_MSCHAPV2" = "yes" ] -then - echo -n " --enable-md4" >> $INSTALLSHELL - echo -n " --enable-eap-mschapv2" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_IDENTITY" = "yes" ] -then - echo -n " --enable-eap-identity" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_RADIUS" = "yes" ] -then - echo -n " --enable-eap-radius" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_DYNAMIC" = "yes" ] -then - echo -n " --enable-eap-dynamic" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_TLS" = "yes" ] -then - echo -n " --enable-eap-tls" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_TTLS" = "yes" ] -then - echo -n " --enable-eap-ttls" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_PEAP" = "yes" ] -then - echo -n " --enable-eap-peap" >> $INSTALLSHELL -fi - -if [ "$USE_EAP_TNC" = "yes" ] -then - echo -n " --enable-eap-tnc" >> $INSTALLSHELL -fi - -if [ "$USE_TNC_PDP" = "yes" ] -then - echo -n " --enable-tnc-pdp" >> $INSTALLSHELL -fi - -if [ "$USE_TNC_IMC" = "yes" ] -then - echo -n " --enable-tnc-imc" >> $INSTALLSHELL -fi - -if [ "$USE_TNC_IMV" = "yes" ] -then - echo -n " --enable-tnc-imv" >> $INSTALLSHELL -fi - -if [ "$USE_TNCCS_11" = "yes" ] -then - echo -n " --enable-tnccs-11" >> $INSTALLSHELL -fi - -if [ "$USE_TNCCS_20" = "yes" ] -then - echo -n " --enable-tnccs-20" >> $INSTALLSHELL -fi - -if [ "$USE_TNCCS_DYNAMIC" = "yes" ] -then - echo -n " --enable-tnccs-dynamic" >> $INSTALLSHELL -fi - -if [ "$USE_IMC_TEST" = "yes" ] -then - echo -n " --enable-imc-test" >> $INSTALLSHELL -fi - -if [ "$USE_IMV_TEST" = "yes" ] -then - echo -n " --enable-imv-test" >> $INSTALLSHELL -fi - -if [ "$USE_IMC_SCANNER" = "yes" ] -then - echo -n " --enable-imc-scanner" >> $INSTALLSHELL -fi - -if [ "$USE_IMV_SCANNER" = "yes" ] -then - echo -n " --enable-imv-scanner" >> $INSTALLSHELL -fi - -if [ "$USE_IMC_OS" = "yes" ] -then - echo -n " --enable-imc-os" >> $INSTALLSHELL -fi - -if [ "$USE_IMV_OS" = "yes" ] -then - echo -n " --enable-imv-os" >> $INSTALLSHELL -fi - -if [ "$USE_IMC_ATTESTATION" = "yes" ] -then - echo -n " --enable-imc-attestation" >> $INSTALLSHELL -fi - -if [ "$USE_IMV_ATTESTATION" = "yes" ] -then - echo -n " --enable-imv-attestation" >> $INSTALLSHELL -fi - -if [ "$USE_SQL" = "yes" ] -then - echo -n " --enable-sql --enable-sqlite" >> $INSTALLSHELL - fi - -if [ "$USE_MEDIATION" = "yes" ] -then - echo -n " --enable-mediation" >> $INSTALLSHELL -fi - -if [ "$USE_OPENSSL" = "yes" ] -then - echo -n " --enable-openssl" >> $INSTALLSHELL -fi - -if [ "$USE_BLOWFISH" = "yes" ] -then - echo -n " --enable-blowfish" >> $INSTALLSHELL -fi - -if [ "$USE_KERNEL_PFKEY" = "yes" ] -then - echo -n " --enable-kernel-pfkey" >> $INSTALLSHELL -fi - -if [ "$USE_INTEGRITY_TEST" = "yes" ] -then - echo -n " --enable-integrity-test" >> $INSTALLSHELL -fi - -if [ "$USE_LEAK_DETECTIVE" = "yes" ] -then - echo -n " --enable-leak-detective" >> $INSTALLSHELL -fi - -if [ "$USE_LOAD_TESTER" = "yes" ] -then - echo -n " --enable-load-tester" >> $INSTALLSHELL -fi - -if [ "$USE_TEST_VECTORS" = "yes" ] -then - echo -n " --enable-test-vectors" >> $INSTALLSHELL -fi - -if [ "$USE_GCRYPT" = "yes" ] -then - echo -n " --enable-gcrypt" >> $INSTALLSHELL -fi - -if [ "$USE_SOCKET_DEFAULT" = "yes" ] -then - echo -n " --enable-socket-default" >> $INSTALLSHELL -fi - -if [ "$USE_SOCKET_DYNAMIC" = "yes" ] -then - echo -n " --enable-socket-dynamic" >> $INSTALLSHELL -fi - -if [ "$USE_DHCP" = "yes" ] -then - echo -n " --enable-dhcp" >> $INSTALLSHELL -fi - -if [ "$USE_FARP" = "yes" ] -then - echo -n " --enable-farp" >> $INSTALLSHELL -fi - -if [ "$USE_ADDRBLOCK" = "yes" ] -then - echo -n " --enable-addrblock" >> $INSTALLSHELL -fi - -if [ "$USE_CTR" = "yes" ] -then - echo -n " --enable-ctr" >> $INSTALLSHELL -fi - -if [ "$USE_CCM" = "yes" ] -then - echo -n " --enable-ccm" >> $INSTALLSHELL -fi - -if [ "$USE_GCM" = "yes" ] -then - echo -n " --enable-gcm" >> $INSTALLSHELL -fi - -if [ "$USE_CMAC" = "yes" ] -then - echo -n " --enable-cmac" >> $INSTALLSHELL -fi - -if [ "$USE_HA" = "yes" ] -then - echo -n " --enable-ha" >> $INSTALLSHELL -fi - -if [ "$USE_AF_ALG" = "yes" ] -then - echo -n " --enable-af-alg" >> $INSTALLSHELL -fi - -if [ "$USE_WHITELIST" = "yes" ] -then - echo -n " --enable-whitelist" >> $INSTALLSHELL -fi - -if [ "$USE_XAUTH_GENERIC" = "yes" ] -then - echo -n " --enable-xauth-generic" >> $INSTALLSHELL -fi - -if [ "$USE_XAUTH_EAP" = "yes" ] -then - echo -n " --enable-xauth-eap" >> $INSTALLSHELL -fi - -if [ "$USE_PKCS8" = "yes" ] -then - echo -n " --enable-pkcs8" >> $INSTALLSHELL -fi - -if [ "$USE_IFMAP" = "yes" ] -then - echo -n " --enable-tnc-ifmap" >> $INSTALLSHELL -fi - -if [ "$USE_CISCO_QUIRKS" = "yes" ] -then - echo -n " --enable-cisco-quirks" >> $INSTALLSHELL -fi - -if [ "$USE_UNITY" = "yes" ] -then - echo -n " --enable-unity" >> $INSTALLSHELL -fi - -echo "" >> $INSTALLSHELL -echo "make -j5" >> $INSTALLSHELL -echo "make install" >> $INSTALLSHELL -echo "ldconfig" >> $INSTALLSHELL +umount $LOOPDIR/root/compile -cecho-n " * Compiling $STRONGSWANVERSION within the root file system as chroot.." -chroot $LOOPDIR /bin/bash /install.sh >> $LOGFILE 2>&1 -rm -f $INSTALLSHELL -cgecho "done" +###################################################### +# remove /etc/resolv.conf +# +cecho " * Removing /etc/resolv.conf" +rm -f $LOOPDIR/etc/resolv.conf ##################################### # preparing ssh for PK authentication @@ -456,4 +162,5 @@ do echo "`cat $LOOPDIR/etc/ssh/ssh_host_rsa_key.pub` root@$host" >> $LOOPDIR/root/.ssh/authorized_keys done +umount $LOOPDIR/proc umount $LOOPDIR -- cgit v1.2.3 From 633bee03fcd05908eeff138a77a8970505579032 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 28 Nov 2012 16:07:42 +0100 Subject: Patch EAP-SIM module in FreeRADIUS --- testing/scripts/build-umlrootfs | 1 + 1 file changed, 1 insertion(+) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 2633f1b28..d3395c872 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -80,6 +80,7 @@ mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile >> $LOGFILE 2>&1 cecho " * Installing software from source.." RECPDIR=$UMLTESTDIR/testing/scripts/recipes RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename` +cp -r $RECPDIR/patches $LOOPDIR/root/compile for r in $RECIPES do cecho-n " - $r.." -- cgit v1.2.3 From b460fb1dd29b69917f934e267eff760040c34680 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 28 Nov 2012 16:10:22 +0100 Subject: Drop SHAREDTREE in favor of mounting the compile dir --- testing/scripts/build-umlrootfs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index d3395c872..f321463db 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -59,16 +59,6 @@ mount -o loop $BASE $LOOPDIR >> $LOGFILE 2>&1 mount -t proc none $LOOPDIR/proc >> $LOGFILE 2>&1 cgecho "done" -###################################################### -# setting up mountpoint for shared source tree -# -if [ "${SHAREDTREE+set}" = "set" ]; then - cecho " * setting up shared strongswan tree at '$SHAREDTREE'" - mkdir $LOOPDIR/root/strongswan-shared - echo "" >> $LOOPDIR/etc/fstab - echo "none /root/strongswan-shared hostfs $SHAREDTREE" >> $LOOPDIR/etc/fstab -fi - ###################################################### # install software from source using 'recipes' # @@ -95,6 +85,10 @@ done umount $LOOPDIR/root/compile +cecho " * Setting up shared build tree at /root/compile" +echo "" >> $LOOPDIR/etc/fstab +echo "none /root/compile hostfs $ROOTFSCOMPILEDIR" >> $LOOPDIR/etc/fstab + ###################################################### # remove /etc/resolv.conf # -- cgit v1.2.3 From beff82dd98c20570daf166b39cadcdf76a661e57 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Tue, 4 Dec 2012 18:46:21 +0100 Subject: Adjust strongSwan version handling in HTML output --- testing/scripts/build-umlrootfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index f321463db..85682fa21 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -75,7 +75,8 @@ for r in $RECIPES do cecho-n " - $r.." cp $RECPDIR/$r ${LOOPDIR}/root/compile - chroot ${LOOPDIR} make -C /root/compile -f $r >>$LOGFILE 2>&1 + chroot ${LOOPDIR} make SWANVERSION=$SWANVERSION -C /root/compile -f $r \ + >> $LOGFILE 2>&1 if [ $? != 0 ]; then cecho "failed" else -- cgit v1.2.3 From 18bce26ea663dfd20efe8505c36a5537979a7c8d Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 5 Dec 2012 18:53:20 +0100 Subject: Use key(and password-)less SSH authentication --- testing/scripts/build-umlrootfs | 62 ----------------------------------------- 1 file changed, 62 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 85682fa21..5a885ce4a 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -96,67 +96,5 @@ echo "none /root/compile hostfs $ROOTFSCOMPILEDIR" >> $LOOPDIR/etc/fstab cecho " * Removing /etc/resolv.conf" rm -f $LOOPDIR/etc/resolv.conf -##################################### -# preparing ssh for PK authentication -# -if [ ! -d ~/.ssh ] -then - cecho-n " * Creating directory '~/.ssh'.." - mkdir ~/.ssh - cgecho "done" -fi - -cecho-n " * Checking for ssh rsa key '~/.ssh/id_rsa.pub'.." -if [ -f ~/.ssh/id_rsa.pub ] -then - cecho "already exists" -else - cecho "not found" - cecho-n " * Generating ssh rsa key pair.." - echo "" | ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa >> $LOGFILE 2>&1 - cgecho "done" -fi - -if [ -f ~/.ssh/known_hosts ] -then - cecho-n " * Backing up ~/.ssh/known_hosts to '~/.ssh/known_hosts.before_uml'.." - cp -fp ~/.ssh/known_hosts ~/.ssh/known_hosts.before_uml - cgecho "done" -fi -rm ~/.ssh/known_hosts -cecho-n " * Creating new '~/.ssh/known_hosts'.." -touch ~/.ssh/known_hosts -cgecho "done" - -for host in $HOSTNAMEIPV4 -do - HOSTNAME=`echo $host | awk -F, '{ print $1 }'` - IP=`echo $host | awk -F, '{ print $2 }'` - cecho-n " * Adding uml host $HOSTNAME ($IP) to '~/.ssh/known_hosts'.." - echo "$HOSTNAME,$IP `cat $LOOPDIR/etc/ssh/ssh_host_rsa_key.pub`" >> ~/.ssh/known_hosts - cgecho "done" -done - -###################################################### -# copying the host's ssh public key -# -if [ ! -d $LOOPDIR/root/.ssh ] -then - mkdir $LOOPDIR/root/.ssh -fi -cp ~/.ssh/id_rsa.pub $LOOPDIR/root/.ssh/authorized_keys - -###################################################### -# setup public key based login among all hosts -# -cp $LOOPDIR/etc/ssh/ssh_host_rsa_key $LOOPDIR/root/.ssh/id_rsa - -for host in $STRONGSWANHOSTS -do - eval ip="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F- '{ print $1 }' | awk '{ print $1 }'`" - echo "$host,$ip `cat $LOOPDIR/etc/ssh/ssh_host_rsa_key.pub`" >> $LOOPDIR/root/.ssh/known_hosts - echo "`cat $LOOPDIR/etc/ssh/ssh_host_rsa_key.pub` root@$host" >> $LOOPDIR/root/.ssh/authorized_keys -done - umount $LOOPDIR/proc umount $LOOPDIR -- cgit v1.2.3 From bf3ff0e585a651c4ba61d26146923538af7170ac Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 6 Dec 2012 17:32:44 +0100 Subject: Update build-umlrootfs script to new log format --- testing/scripts/build-umlrootfs | 87 ++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 58 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 5a885ce4a..a0444de38 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -14,87 +14,58 @@ # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -DIR=`dirname $0` +echo "Building root image" -source $DIR/function.sh +DIR=`dirname $0` -[ -f $DIR/../testing.conf ] || die "!! Configuration file 'testing.conf' not found" +. $DIR/function.sh -source $DIR/../testing.conf +[ `id -u` -eq 0 ] || die "You must be root to run $0" -cecho-n " * Looking for root image at '$ROOTFS'.." -if [ -f "$ROOTFS" ] -then - cgecho "found it" -else - cecho "none" - exit -fi +[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found" +. $DIR/../testing.conf -[ -d $BUILDDIR ] || die "!! Directory '$BUILDDIR' does not exist" +[ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" ROOTFSDIR=$BUILDDIR/root-fs - -if [ ! -d $ROOTFSDIR ] -then - cecho-n " * Root file system directory '$ROOTFSDIR' does not exist..creating.." - mkdir $ROOTFSDIR - cgecho "done" -fi - +mkdir -p $ROOTFSDIR +mkdir -p $LOOPDIR +mkdir -p $ROOTFSCOMPILEDIR cd $ROOTFSDIR -if [ ! -d $LOOPDIR ] -then - mkdir $LOOPDIR -fi - -###################################################### -# mount root image -# BASE=$BUILDDIR/base.img -cecho-n " * Mounting base image $BASE.." -cp $ROOTFS $BASE -mount -o loop $BASE $LOOPDIR >> $LOGFILE 2>&1 -mount -t proc none $LOOPDIR/proc >> $LOGFILE 2>&1 -cgecho "done" +log_action "Creating $BASE" +execute "cp $ROOTFS $BASE" + +log_action "Mounting base image $BASE" +execute "mount -o loop $BASE $LOOPDIR" +log_action "Mounting proc filesystem to $LOOPDIR/proc" +execute "mount -t proc none $LOOPDIR/proc" -###################################################### -# install software from source using 'recipes' -# -mkdir -p $ROOTFSCOMPILEDIR -cecho " * Mounting $ROOTFSCOMPILEDIR as /root/compile.." mkdir -p $LOOPDIR/root/compile -mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile >> $LOGFILE 2>&1 +log_action "Mounting $ROOTFSCOMPILEDIR as /root/compile" +execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile" -cecho " * Installing software from source.." +echo "Installing software from source" RECPDIR=$UMLTESTDIR/testing/scripts/recipes RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename` -cp -r $RECPDIR/patches $LOOPDIR/root/compile +execute "cp -r $RECPDIR/patches $LOOPDIR/root/compile" 0 for r in $RECIPES do - cecho-n " - $r.." cp $RECPDIR/$r ${LOOPDIR}/root/compile - chroot ${LOOPDIR} make SWANVERSION=$SWANVERSION -C /root/compile -f $r \ - >> $LOGFILE 2>&1 - if [ $? != 0 ]; then - cecho "failed" - else - cgecho "done" - fi + log_action "Installing from recipe $r" + execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r" done umount $LOOPDIR/root/compile -cecho " * Setting up shared build tree at /root/compile" +log_action "Setting up shared build tree at /root/compile" echo "" >> $LOOPDIR/etc/fstab echo "none /root/compile hostfs $ROOTFSCOMPILEDIR" >> $LOOPDIR/etc/fstab +log_status 0 -###################################################### -# remove /etc/resolv.conf -# -cecho " * Removing /etc/resolv.conf" -rm -f $LOOPDIR/etc/resolv.conf +log_action "Removing /etc/resolv.conf" +execute "rm -f $LOOPDIR/etc/resolv.conf" -umount $LOOPDIR/proc -umount $LOOPDIR +execute "umount $LOOPDIR/proc" 0 +execute "umount $LOOPDIR" 0 -- cgit v1.2.3 From 7c2ef58e86c10e0cf9846dc9211cc68c7e908f7f Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 6 Dec 2012 19:03:45 +0100 Subject: Import testing.conf file in function.sh This is needed to have access to $LOGFILE and possibly other config settings. --- testing/scripts/build-umlrootfs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index a0444de38..6c67a2534 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -16,15 +16,10 @@ echo "Building root image" -DIR=`dirname $0` - -. $DIR/function.sh +. $PWD/scripts/function.sh [ `id -u` -eq 0 ] || die "You must be root to run $0" -[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found" -. $DIR/../testing.conf - [ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" ROOTFSDIR=$BUILDDIR/root-fs -- cgit v1.2.3 From 0cc40637997984029dbcc47234b47c5da8ea0cd2 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Thu, 6 Dec 2012 19:26:48 +0100 Subject: Use do_on_exit() in build scripts for cleanup --- testing/scripts/build-umlrootfs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 6c67a2534..a93adac4c 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -41,6 +41,10 @@ mkdir -p $LOOPDIR/root/compile log_action "Mounting $ROOTFSCOMPILEDIR as /root/compile" execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile" +do_on_exit umount $LOOPDIR/root/compile +do_on_exit umount $LOOPDIR/proc +do_on_exit umount $LOOPDIR + echo "Installing software from source" RECPDIR=$UMLTESTDIR/testing/scripts/recipes RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename` @@ -52,8 +56,6 @@ do execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r" done -umount $LOOPDIR/root/compile - log_action "Setting up shared build tree at /root/compile" echo "" >> $LOOPDIR/etc/fstab echo "none /root/compile hostfs $ROOTFSCOMPILEDIR" >> $LOOPDIR/etc/fstab @@ -61,6 +63,3 @@ log_status 0 log_action "Removing /etc/resolv.conf" execute "rm -f $LOOPDIR/etc/resolv.conf" - -execute "umount $LOOPDIR/proc" 0 -execute "umount $LOOPDIR" 0 -- cgit v1.2.3 From 62a277cfaed19b4fbc4a06e48273516cce6145d7 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 09:41:38 +0100 Subject: Move ROOTFSDIR declaration to testing.conf --- testing/scripts/build-umlrootfs | 1 - 1 file changed, 1 deletion(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index a93adac4c..4340e6ebc 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -22,7 +22,6 @@ echo "Building root image" [ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" -ROOTFSDIR=$BUILDDIR/root-fs mkdir -p $ROOTFSDIR mkdir -p $LOOPDIR mkdir -p $ROOTFSCOMPILEDIR -- cgit v1.2.3 From 9b3316ed2773b276cb9537c4ccde2dd3431b655d Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 11:48:48 +0100 Subject: Use qemu/KVM virtualization instead of UML Guest and network configuration is setup using the libvirt virtualization API. The [start|stop]_testing scripts have been updated accordingly. qemu/KVM does not currently support a hostfs, so the shared build tree mount has been dropped for now. --- testing/scripts/build-umlrootfs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 4340e6ebc..271e532d4 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -55,10 +55,5 @@ do execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r" done -log_action "Setting up shared build tree at /root/compile" -echo "" >> $LOOPDIR/etc/fstab -echo "none /root/compile hostfs $ROOTFSCOMPILEDIR" >> $LOOPDIR/etc/fstab -log_status 0 - log_action "Removing /etc/resolv.conf" execute "rm -f $LOOPDIR/etc/resolv.conf" -- cgit v1.2.3 From bf48ee33e568ee8456fa8324a39b11946f4628a6 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 14:19:11 +0100 Subject: Rename UMLTESTDIR variable to TESTDIR --- testing/scripts/build-umlrootfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 271e532d4..cf11844ce 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -45,7 +45,7 @@ do_on_exit umount $LOOPDIR/proc do_on_exit umount $LOOPDIR echo "Installing software from source" -RECPDIR=$UMLTESTDIR/testing/scripts/recipes +RECPDIR=$TESTDIR/testing/scripts/recipes RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename` execute "cp -r $RECPDIR/patches $LOOPDIR/root/compile" 0 for r in $RECIPES -- cgit v1.2.3 From 8ed98c137321c3f92fb06b58e69aaecf4e531cdc Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 7 Dec 2012 17:54:19 +0100 Subject: Switch from raw images to qcow2 format This allows to use minimal copy-on-write clones of the base image as guest images, which in turn saves a lot of disk space. --- testing/scripts/build-umlrootfs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index cf11844ce..c67e4d557 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -1,5 +1,5 @@ #!/bin/bash -# Create UML root filesystem +# Create guest root image # # Copyright (C) 2004 Eric Marchionni, Patrik Rayo # Zuercher Hochschule Winterthur @@ -22,17 +22,24 @@ echo "Building root image" [ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" +load_qemu_nbd + mkdir -p $ROOTFSDIR mkdir -p $LOOPDIR mkdir -p $ROOTFSCOMPILEDIR cd $ROOTFSDIR -BASE=$BUILDDIR/base.img +BASE=$BUILDDIR/base.qcow2 log_action "Creating $BASE" execute "cp $ROOTFS $BASE" -log_action "Mounting base image $BASE" -execute "mount -o loop $BASE $LOOPDIR" +log_action "Connecting base image to NBD device $NBDEV" +execute "qemu-nbd -c $NBDEV $BASE" +sync + +log_action "Mounting $NBDPARTITION to $LOOPDIR" +execute "mount $NBDPARTITION $LOOPDIR" + log_action "Mounting proc filesystem to $LOOPDIR/proc" execute "mount -t proc none $LOOPDIR/proc" @@ -43,6 +50,7 @@ execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile" do_on_exit umount $LOOPDIR/root/compile do_on_exit umount $LOOPDIR/proc do_on_exit umount $LOOPDIR +do_on_exit qemu-nbd -d $NBDEV echo "Installing software from source" RECPDIR=$TESTDIR/testing/scripts/recipes -- cgit v1.2.3 From b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Sun, 9 Dec 2012 09:49:04 +0100 Subject: Test availability of required commands --- testing/scripts/build-umlrootfs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index c67e4d557..0f8781c25 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -22,6 +22,8 @@ echo "Building root image" [ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" +check_commands qemu-nbd + load_qemu_nbd mkdir -p $ROOTFSDIR -- cgit v1.2.3 From 97265abaf0265d0cc59fb1be02e3239fca3daae3 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Sun, 9 Dec 2012 10:23:37 +0100 Subject: Inform kernel about /dev/nbd0 partition changes --- testing/scripts/build-umlrootfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 0f8781c25..6131c1d1c 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -22,7 +22,7 @@ echo "Building root image" [ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" -check_commands qemu-nbd +check_commands partprobe qemu-nbd load_qemu_nbd @@ -37,7 +37,7 @@ execute "cp $ROOTFS $BASE" log_action "Connecting base image to NBD device $NBDEV" execute "qemu-nbd -c $NBDEV $BASE" -sync +partprobe $NBDEV log_action "Mounting $NBDPARTITION to $LOOPDIR" execute "mount $NBDPARTITION $LOOPDIR" -- cgit v1.2.3 From 74c0839ad6e0da6f299b65ed39fe2f21fa19caf9 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Sun, 9 Dec 2012 10:50:28 +0100 Subject: Run on_exit commands in FILO order --- testing/scripts/build-umlrootfs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index 6131c1d1c..f6bcaa78e 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -37,22 +37,21 @@ execute "cp $ROOTFS $BASE" log_action "Connecting base image to NBD device $NBDEV" execute "qemu-nbd -c $NBDEV $BASE" +do_on_exit qemu-nbd -d $NBDEV partprobe $NBDEV log_action "Mounting $NBDPARTITION to $LOOPDIR" execute "mount $NBDPARTITION $LOOPDIR" +do_on_exit umount $LOOPDIR log_action "Mounting proc filesystem to $LOOPDIR/proc" execute "mount -t proc none $LOOPDIR/proc" +do_on_exit umount $LOOPDIR/proc mkdir -p $LOOPDIR/root/compile log_action "Mounting $ROOTFSCOMPILEDIR as /root/compile" execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile" - do_on_exit umount $LOOPDIR/root/compile -do_on_exit umount $LOOPDIR/proc -do_on_exit umount $LOOPDIR -do_on_exit qemu-nbd -d $NBDEV echo "Installing software from source" RECPDIR=$TESTDIR/testing/scripts/recipes -- cgit v1.2.3 From 258cbd40cff463f4adb57f40d3338e460c7e90f2 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Mon, 10 Dec 2012 10:05:02 +0100 Subject: Unify naming of base,root image settings --- testing/scripts/build-umlrootfs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index f6bcaa78e..1c452f476 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -20,23 +20,20 @@ echo "Building root image" [ `id -u` -eq 0 ] || die "You must be root to run $0" -[ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" +[ -f "$BASEIMG" ] || die "Base image $BASEIMG not found" check_commands partprobe qemu-nbd load_qemu_nbd -mkdir -p $ROOTFSDIR mkdir -p $LOOPDIR -mkdir -p $ROOTFSCOMPILEDIR -cd $ROOTFSDIR +mkdir -p $ROOTIMGCOMPILEDIR -BASE=$BUILDDIR/base.qcow2 -log_action "Creating $BASE" -execute "cp $ROOTFS $BASE" +log_action "Creating root image $ROOTIMG" +execute "cp $BASEIMG $ROOTIMG" -log_action "Connecting base image to NBD device $NBDEV" -execute "qemu-nbd -c $NBDEV $BASE" +log_action "Connecting root image to NBD device $NBDEV" +execute "qemu-nbd -c $NBDEV $ROOTIMG" do_on_exit qemu-nbd -d $NBDEV partprobe $NBDEV @@ -49,8 +46,8 @@ execute "mount -t proc none $LOOPDIR/proc" do_on_exit umount $LOOPDIR/proc mkdir -p $LOOPDIR/root/compile -log_action "Mounting $ROOTFSCOMPILEDIR as /root/compile" -execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile" +log_action "Mounting $ROOTIMGCOMPILEDIR as /root/compile" +execute "mount -o bind $ROOTIMGCOMPILEDIR $LOOPDIR/root/compile" do_on_exit umount $LOOPDIR/root/compile echo "Installing software from source" -- cgit v1.2.3 From 90dd71e41c612211027963764b6993b861edd3f9 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Mon, 10 Dec 2012 10:33:19 +0100 Subject: Rename build-umlrootfs script to build-rootimg --- testing/scripts/build-umlrootfs | 65 ----------------------------------------- 1 file changed, 65 deletions(-) delete mode 100755 testing/scripts/build-umlrootfs (limited to 'testing/scripts/build-umlrootfs') diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs deleted file mode 100755 index 1c452f476..000000000 --- a/testing/scripts/build-umlrootfs +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# Create guest root image -# -# Copyright (C) 2004 Eric Marchionni, Patrik Rayo -# Zuercher Hochschule Winterthur -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. See . -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. - -echo "Building root image" - -. $PWD/scripts/function.sh - -[ `id -u` -eq 0 ] || die "You must be root to run $0" - -[ -f "$BASEIMG" ] || die "Base image $BASEIMG not found" - -check_commands partprobe qemu-nbd - -load_qemu_nbd - -mkdir -p $LOOPDIR -mkdir -p $ROOTIMGCOMPILEDIR - -log_action "Creating root image $ROOTIMG" -execute "cp $BASEIMG $ROOTIMG" - -log_action "Connecting root image to NBD device $NBDEV" -execute "qemu-nbd -c $NBDEV $ROOTIMG" -do_on_exit qemu-nbd -d $NBDEV -partprobe $NBDEV - -log_action "Mounting $NBDPARTITION to $LOOPDIR" -execute "mount $NBDPARTITION $LOOPDIR" -do_on_exit umount $LOOPDIR - -log_action "Mounting proc filesystem to $LOOPDIR/proc" -execute "mount -t proc none $LOOPDIR/proc" -do_on_exit umount $LOOPDIR/proc - -mkdir -p $LOOPDIR/root/compile -log_action "Mounting $ROOTIMGCOMPILEDIR as /root/compile" -execute "mount -o bind $ROOTIMGCOMPILEDIR $LOOPDIR/root/compile" -do_on_exit umount $LOOPDIR/root/compile - -echo "Installing software from source" -RECPDIR=$TESTDIR/testing/scripts/recipes -RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename` -execute "cp -r $RECPDIR/patches $LOOPDIR/root/compile" 0 -for r in $RECIPES -do - cp $RECPDIR/$r ${LOOPDIR}/root/compile - log_action "Installing from recipe $r" - execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r" -done - -log_action "Removing /etc/resolv.conf" -execute "rm -f $LOOPDIR/etc/resolv.conf" -- cgit v1.2.3