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