[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: g-i: Use plain files instead of logical volumes
Holger Levsen
gitlab at salsa.debian.org
Fri Apr 26 12:58:13 BST 2019
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
b7ade757 by Samuel Thibault at 2019-04-26T11:52:21Z
g-i: Use plain files instead of logical volumes
- - - - -
4e6e176f by Holger Levsen at 2019-04-26T11:58:02Z
g-installation: use variable more savely
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/g-i-installation.sh
Changes:
=====================================
bin/g-i-installation.sh
=====================================
@@ -24,8 +24,7 @@ fi
#
DISPLAY=localhost:$EXECUTOR_NUMBER
NAME=$(echo $JOB_NAME | cut -d "_" -f2-)
-VG=jenkins01
-LV=/dev/${VG}/$NAME
+FILEPATH=jenkins-img-$NAME
DISKSIZE_IN_GB=$1
URL=$2
# $3 and $4 are used below for language setting
@@ -136,9 +135,9 @@ cleanup_all() {
# remove lvm volume
#
case $NAME in
- # *debian-edu_jessie*_main-server) echo "Warning: not deleting lvm volume $LV"
+ # *debian-edu_jessie*_main-server) echo "Warning: not deleting file ${FILEPATH}"
# ;;
- *) sudo lvremove -f $LV
+ *) rm -f ${FILEPATH}
;;
esac
rm -f $QEMU_LAUNCHER
@@ -183,10 +182,8 @@ show_preseed() {
bootstrap_system() {
cd $WORKSPACE
- echo "Creating throw-away logical volume with ${DISKSIZE_IN_GB} GiB now."
- sudo lvcreate -L${DISKSIZE_IN_GB}G -n $NAME $VG
echo "Creating raw disk image with ${DISKSIZE_IN_GB} GiB now."
- sudo qemu-img create -f raw $LV ${DISKSIZE_IN_GB}G
+ qemu-img create -f raw ${FILEPATH} ${DISKSIZE_IN_GB}G
echo "Doing g-i installation test for $NAME now."
# qemu related variables (incl kernel+initrd) - display first, as we grep for this in the process list
QEMU_OPTS="-display vnc=$DISPLAY -enable-kvm -cpu host"
@@ -233,7 +230,7 @@ bootstrap_system() {
else
QEMU_KERNEL="--kernel $KERNEL --initrd $INITRD"
fi
- QEMU_OPTS="$QEMU_OPTS -drive file=$LV,index=0,media=disk,cache=unsafe,format=raw -serial file:$RESULTS/serial.log -m $RAMSIZE $QEMU_NET_OPTS"
+ QEMU_OPTS="$QEMU_OPTS -drive file=${FILEPATH},index=0,media=disk,cache=unsafe,format=raw -serial file:$RESULTS/serial.log -m $RAMSIZE $QEMU_NET_OPTS"
INST_LOCALE="locale=$DI_LOCALE"
INST_KEYMAP="keymap=us" # always us!
INST_VIDEO="video=vesa:ywrap,mtrr vga=788"
@@ -366,13 +363,13 @@ boot_system() {
*_hurd*) ;;
*) QEMU_OPTS="$QEMU_OPTS -enable-kvm -cpu host" ;;
esac
- echo "Checking $LV:"
- FILE=$(sudo file -Ls $LV)
+ echo "Checking ${FILEPATH}:"
+ FILE=$(file -Ls ${FILEPATH})
if [ $(echo $FILE | grep -E '(x86 boot sector|DOS/MBR boot sector)' | wc -l) -eq 0 ] ; then
- echo "ERROR: no x86 boot sector found in $LV - its filetype is $FILE."
+ echo "ERROR: no x86 boot sector found in ${FILEPATH} - its filetype is $FILE."
exit 1
fi
- QEMU_OPTS="$QEMU_OPTS -drive file=$LV,index=0,media=disk,cache=unsafe,format=raw -m $RAMSIZE"
+ QEMU_OPTS="$QEMU_OPTS -drive file=${FILEPATH},index=0,media=disk,cache=unsafe,format=raw -m $RAMSIZE"
QEMU_OPTS="$QEMU_OPTS -net nic,vlan=0 -net user,vlan=0,host=10.0.2.1,dhcpstart=10.0.2.2,dns=10.0.2.254"
case $NAME in
debian-edu_*ltsp-server|debian-edu_*combi-server)
@@ -1223,7 +1220,7 @@ save_logs() {
FAILURE=false
# workaround problem in guestmount in wheezy: -o uid doesnt work:
# "sudo guestmount -o uid=$(id -u) -o gid=$(id -g)" would be nicer, but it doesnt work: as root, the files seem to belong to jenkins, but as jenkins they cannot be accessed
- sudo guestmount -a $LV -i --ro $SYSTEM_MNT || { echo "Warning: cannot mount filesystems from $LV" ; export FAILURE=true ; }
+ sudo guestmount -a ${FILEPATH} -i --ro $SYSTEM_MNT || { echo "Warning: cannot mount filesystems from ${FILEPATH}" ; export FAILURE=true ; }
#
# copy logs (and continue if some logs cannot be copied)
#
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/52995f74a6cece6267c75b779b9c46737f4b3308...4e6e176fc5b4e0743cab711ba4f9c5bb6770c2c9
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/52995f74a6cece6267c75b779b9c46737f4b3308...4e6e176fc5b4e0743cab711ba4f9c5bb6770c2c9
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20190426/0f624c02/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list