mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
Create all images in $BUILDDIR/images
This commit is contained in:
parent
482d3ec9ff
commit
48ea1d8b0b
@ -21,8 +21,8 @@ CACHEDIR=$BUILDDIR/cache
|
||||
APTCACHE=$LOOPDIR/var/cache/apt/archives
|
||||
|
||||
mkdir -p $LOOPDIR
|
||||
mkdir -p $BUILDDIR
|
||||
mkdir -p $CACHEDIR
|
||||
mkdir -p $IMGDIR
|
||||
rm -f $BASEIMG
|
||||
|
||||
echo "`date`, building $BASEIMG" >>$LOGFILE
|
||||
|
@ -28,9 +28,8 @@ check_commands partprobe qemu-img qemu-nbd
|
||||
|
||||
load_qemu_nbd
|
||||
|
||||
mkdir -p $BUILDDIR
|
||||
mkdir -p $IMGDIR
|
||||
mkdir -p $LOOPDIR
|
||||
mkdir -p $GUESTIMGDIR
|
||||
|
||||
# just to be sure
|
||||
do_on_exit qemu-nbd -d $NBDEV
|
||||
@ -39,8 +38,8 @@ do_on_exit umount $LOOPDIR
|
||||
for host in $STRONGSWANHOSTS
|
||||
do
|
||||
log_action "Creating guest image for $host"
|
||||
execute "qemu-img create -b $ROOTIMG -f $IMGEXT $GUESTIMGDIR/$host.$IMGEXT" 0
|
||||
execute "qemu-nbd -c $NBDEV $GUESTIMGDIR/$host.$IMGEXT" 0
|
||||
execute "qemu-img create -b $ROOTIMG -f $IMGEXT $IMGDIR/$host.$IMGEXT" 0
|
||||
execute "qemu-nbd -c $NBDEV $IMGDIR/$host.$IMGEXT" 0
|
||||
partprobe $NBDEV
|
||||
execute "mount $NBDPARTITION $LOOPDIR" 0
|
||||
execute "cp -rf $HOSTSDIR/${host}/etc $LOOPDIR" 0
|
||||
|
@ -27,6 +27,7 @@ load_qemu_nbd
|
||||
|
||||
mkdir -p $LOOPDIR
|
||||
mkdir -p $ROOTIMGCOMPILEDIR
|
||||
mkdir -p $IMGDIR
|
||||
|
||||
log_action "Creating root image $ROOTIMG"
|
||||
execute "qemu-img create -b $BASEIMG -f $IMGEXT $ROOTIMG"
|
||||
|
@ -24,7 +24,7 @@ done
|
||||
|
||||
for host in $STRONGSWANHOSTS
|
||||
do
|
||||
ln -fs $GUESTIMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
|
||||
ln -fs $IMGDIR/$host.$IMGEXT $VIRTIMGSTORE/$host.$IMGEXT
|
||||
log_action "Guest $host"
|
||||
execute "virsh create $CONFDIR/$host.xml"
|
||||
done
|
||||
|
@ -36,26 +36,24 @@ LOGFILE=$BUILDDIR/testing.log
|
||||
# Directory used for loop-mounts
|
||||
LOOPDIR=$BUILDDIR/loop
|
||||
|
||||
# Image extension
|
||||
# Common image settings
|
||||
IMGEXT=qcow2
|
||||
IMGDIR=$BUILDDIR/images
|
||||
|
||||
# Base image settings
|
||||
# The base image is a pristine OS installation created using debootstrap.
|
||||
BASEIMGSIZE=1024
|
||||
BASEIMGSUITE=wheezy
|
||||
BASEIMGARCH=amd64
|
||||
BASEIMG=$BUILDDIR/debian-$BASEIMGSUITE-$BASEIMGARCH.$IMGEXT
|
||||
BASEIMG=$IMGDIR/debian-$BASEIMGSUITE-$BASEIMGARCH.$IMGEXT
|
||||
BASEIMGMIRROR=http://cdn.debian.net/debian
|
||||
|
||||
# Root image settings
|
||||
# The root image is the origin of all guest images. It contains additional
|
||||
# test-specific software and patches.
|
||||
ROOTIMG=$BUILDDIR/root.$IMGEXT
|
||||
# The root image is the origin of all guest images. It is a clone of the base
|
||||
# image and contains additional test-specific software and patches.
|
||||
ROOTIMG=$IMGDIR/root.$IMGEXT
|
||||
ROOTIMGCOMPILEDIR=$BUILDDIR/compile
|
||||
|
||||
# Guest images settings
|
||||
GUESTIMGDIR=$BUILDDIR/guest-images
|
||||
|
||||
# libvirt config
|
||||
NBDEV=/dev/nbd0
|
||||
NBDPARTITION=${NBDEV}p1
|
||||
|
Loading…
x
Reference in New Issue
Block a user