aboutsummaryrefslogtreecommitdiffstats
path: root/testing/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'testing/scripts')
-rwxr-xr-xtesting/scripts/build-baseimage14
-rwxr-xr-xtesting/scripts/build-umlhostfs8
-rwxr-xr-xtesting/scripts/build-umlrootfs19
3 files changed, 19 insertions, 22 deletions
diff --git a/testing/scripts/build-baseimage b/testing/scripts/build-baseimage
index 915d1102a..5bf727fbf 100755
--- a/testing/scripts/build-baseimage
+++ b/testing/scripts/build-baseimage
@@ -23,17 +23,17 @@ APTCACHE=$LOOPDIR/var/cache/apt/archives
mkdir -p $LOOPDIR
mkdir -p $BUILDDIR
mkdir -p $CACHEDIR
-rm -f $ROOTFS
+rm -f $BASEIMG
-echo "`date`, building $ROOTFS" >>$LOGFILE
+echo "`date`, building $BASEIMG" >>$LOGFILE
load_qemu_nbd
-log_action "Creating image $ROOTFS"
-execute "qemu-img create -f qcow2 $ROOTFS ${ROOTFSSIZE}M"
+log_action "Creating base image $BASEIMG"
+execute "qemu-img create -f $IMGEXT $BASEIMG ${BASEIMGSIZE}M"
log_action "Connecting image to NBD device $NBDEV"
-execute "qemu-nbd -c $NBDEV $ROOTFS"
+execute "qemu-nbd -c $NBDEV $BASEIMG"
do_on_exit qemu-nbd -d $NBDEV
log_action "Partitioning disk"
@@ -61,8 +61,8 @@ mkdir -p $APTCACHE
execute "mount -o bind $CACHEDIR $APTCACHE"
do_on_exit graceful_umount $APTCACHE
-log_action "Running debootstrap ($ROOTFSSUITE, $ROOTFSARCH)"
-execute "debootstrap --arch=$ROOTFSARCH --include=$INC --exclude $EXC $ROOTFSSUITE $LOOPDIR $ROOTFSMIRROR"
+log_action "Running debootstrap ($BASEIMGSUITE, $BASEIMGARCH)"
+execute "debootstrap --arch=$BASEIMGARCH --include=$INC --exclude $EXC $BASEIMGSUITE $LOOPDIR $BASEIMGMIRROR"
for service in $SERVICES
do
diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs
index ed026b6e8..fc2660c08 100755
--- a/testing/scripts/build-umlhostfs
+++ b/testing/scripts/build-umlhostfs
@@ -20,10 +20,9 @@ echo "Creating guest images"
[ `id -u` -eq 0 ] || die "You must be root to run $0"
-BASE=$BUILDDIR/base.qcow2
HOSTSDIR=$PWD/hosts
-[ -f $BASE ] || die "Base image $BASE not found"
+[ -f $ROOTIMG ] || die "Root image $ROOTIMG not found"
[ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found"
check_commands partprobe qemu-img qemu-nbd
@@ -32,6 +31,7 @@ load_qemu_nbd
mkdir -p $BUILDDIR
mkdir -p $LOOPDIR
+mkdir -p $GUESTIMGDIR
if [ "$#" -eq 0 ]; then
HOSTS=$STRONGSWANHOSTS
@@ -46,8 +46,8 @@ do_on_exit umount $LOOPDIR
for host in $HOSTS
do
log_action "Creating guest image for $host"
- execute "qemu-img create -b $BASE -f qcow2 $ROOTFSDIR/$host.qcow2" 0
- execute "qemu-nbd -c $NBDEV $ROOTFSDIR/$host.qcow2" 0
+ execute "qemu-img create -b $ROOTIMG -f $IMGEXT $GUESTIMGDIR/$host.$IMGEXT" 0
+ execute "qemu-nbd -c $NBDEV $GUESTIMGDIR/$host.$IMGEXT" 0
partprobe $NBDEV
execute "mount $NBDPARTITION $LOOPDIR" 0
execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0
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"