Hi Holger, I've been looking for a way to automate kfreebsd d-i testing, but found a solution that will also give Jenkins some test coverage of text-mode d-i (whereas it only tests GUI installer at the moment I think?) and the PXE boot images (instead of just CD ISOs). So it would be really nice if we could enable this. Please let me know if this is possible.
I've attached, because I think it was clearer this way, diffs from existing files to the new shellscript and preseed file I've created, that: * currently supports only GRUB2 (which is used for kfreebsd and hurd only - the other PXE boot images are syslinux; should be able to add support for that later) * currently supports only kfreebsd (the hurd PXE boot image for sid doesn't boot at the moment anyway) * given a netboot.tar.gz instead of an ISO file, extracts it in the working directory * edits the grub.cfg - which is not that much of a hack, because it's what a site sysadmin must do to define preseed parameters anyway * sends kernel messages and d-i syslog to the virtual serial port log * only needs a guest VM with 256 MiB memory to run, and 2 GiB disk * doesn't need to run in sudo - I'm wondering why the script I based this on, was doing that? * should (when we've fix the d-i bugs) test-boot the installed system, but that's untested yet, and I also haven't implemented save_logs yet (it would maybe need root privileges on the host to be able to mount the UFS partition, e.g. `mount -o ro,loop,ufstype=44bsd,offset=$n`) I could use some help to write the Jenkins jobfile; I don't have an installation of Jenkins to try this on but have dry-run this script and preseed file in isolation, they seem to work already. Thanks! Regards, -- Steven Chamberlain ste...@pyro.eu.org
--- bin/g-i-installation.sh 2014-09-01 21:15:37.000000000 +0100 +++ bin/d-i-installation-pxe.sh 2014-09-01 23:27:02.000000000 +0100 @@ -9,7 +9,7 @@ # $1 = vnc-display, each job should have a unique one, so jobs can run in parallel # $2 = name # $3 = disksize in GB -# $4 = wget url/jigdo url +# $4 = wget url for netboot.tar.gz # $5 = d-i lang setting (default is 'en') # $6 = d-i locale setting (default is 'en_us') @@ -18,7 +18,7 @@ echo '# $1 = vnc-display, each job should have a unique one, so jobs can run in parallel' echo '# $2 = name' echo '# $3 = disksize in GB' - echo '# $4 = wget url/jigdo url' + echo '# $4 = wget url for netboot.tar.gz' exit 1 fi @@ -30,14 +30,10 @@ DISKSIZE_IN_GB=$3 URL=$4 # $5 and $6 are used below for language setting -RAMSIZE=1024 -if [ "$(basename $URL)" != "amd64" ] ; then - IMAGE=$(pwd)/$(basename $URL) - IMAGE_MNT="/media/cd-$NAME.iso" -else - KERNEL=linux - INITRD=initrd.gz -fi +RAMSIZE=256 + +NETBOOT_TARBALL=$(pwd)/$(basename $URL) +tar -zxvf "$NETBOOT_TARBALL" || exit 1 # # define workspace + results @@ -95,7 +91,7 @@ # # create video # - ffmpeg2theora --videobitrate $VIDEOBITRATE --no-upscaling snapshot_%06d.ppm --framerate 12 --max_size $VIDEOSIZE -o g-i-installation-$NAME.ogv > /dev/null + ffmpeg2theora --videobitrate $VIDEOBITRATE --no-upscaling snapshot_%06d.ppm --framerate 12 --max_size $VIDEOSIZE -o d-i-pxe-installation-$NAME.ogv > /dev/null rm snapshot_??????.ppm # rename .bak files back to .ppm if find . -name "*.ppm.bak" > /dev/null ; then @@ -122,120 +118,63 @@ cd $WORKSPACE echo "Creating raw disk image with ${DISKSIZE_IN_GB} GiB now." qemu-img create -f raw $NAME.raw ${DISKSIZE_IN_GB}G - echo "Doing g-i installation test for $NAME now." + echo "Doing d-i PXE 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 -no-shutdown -enable-kvm -cpu host" VIDEOBITRATE=1200 VIDEOSIZE=1024x768 # don't change this (or adjust what needs to be shaved when ocr'ing later) CONVERTOPTS="-gravity center -background gray10 -extent $VIDEOSIZE" - if [ -n "$IMAGE" ] ; then - QEMU_OPTS="$QEMU_OPTS -cdrom $IMAGE -boot d" - case $NAME in - *_kfreebsd) ;; - *_hurd*) QEMU_OPTS="$QEMU_OPTS -vga std" - gzip -cd $IMAGE_MNT/boot/kernel/gnumach.gz > $WORKSPACE/gnumach - ;; - *) QEMU_KERNEL="--kernel $IMAGE_MNT/install.amd/vmlinuz --initrd $IMAGE_MNT/install.amd/gtk/initrd.gz" - ;; - esac - else - QEMU_KERNEL="--kernel $KERNEL --initrd $INITRD" - fi - QEMU_OPTS="$QEMU_OPTS -drive file=$NAME.raw,index=0,media=disk,cache=unsafe -m $RAMSIZE -net nic,vlan=0 -net user,vlan=0,host=10.0.2.1,dhcpstart=10.0.2.2,dns=10.0.2.254" - QEMU_OPTS="$QEMU_OPTS -serial file:${QEMU_SERIAL_OUT}" + + NET_OPTS="host=10.0.2.1,dhcpstart=10.0.2.2,dns=10.0.2.254" + NET_OPTS="$NET_OPTS,bootfile=grub2pxe,tftp=." + + QEMU_OPTS="$QEMU_OPTS -drive file=$NAME.raw,index=0,media=disk,cache=unsafe" + QEMU_OPTS="$QEMU_OPTS -boot n -net nic,vlan=0 -net user,vlan=0,$NET_OPTS" + QEMU_OPTS="$QEMU_OPTS -m $RAMSIZE -serial file:${QEMU_SERIAL_OUT}" + case $NAME in + *_kfreebsd) ;; + *_hurd*) QEMU_OPTS="$QEMU_OPTS -vga std" + ;; + *) ;; + esac + QEMU_WEBSERVER=http://10.0.2.1/ # preseeding related variables PRESEED_PATH=d-i-preseed-cfgs - PRESEED_URL="url=$QEMU_WEBSERVER/$PRESEED_PATH/${NAME}_$PRESEEDCFG" - INST_LOCALE="locale=$DI_LOCALE" - INST_KEYMAP="keymap=us" # always us! - INST_VIDEO="video=vesa:ywrap,mtrr vga=788" - EXTRA_APPEND="" - case $NAME in - debian*_squeeze*) - INST_KEYMAP="console-keymaps-at/$INST_KEYMAP" - ;; - *_sid_daily*) - EXTRA_APPEND="mirror/suite=sid" - ;; - *) ;; - esac - case $NAME in - debian_*_xfce) - EXTRA_APPEND="$EXTRA_APPEND desktop=xfce" - ;; - debian_*_lxde) - EXTRA_APPEND="$EXTRA_APPEND desktop=lxde" - ;; - debian_*_kde) - EXTRA_APPEND="$EXTRA_APPEND desktop=kde" - ;; - debian_*_rescue*) - EXTRA_APPEND="$EXTRA_APPEND rescue/enable=true" - ;; - debian-edu*-server) - QEMU_OPTS="$QEMU_OPTS -net nic,vlan=1 -net user,vlan=1" - EXTRA_APPEND="$EXTRA_APPEND interface=eth0" - ;; - *) ;; - esac - case $NAME in - *_dark_theme) - EXTRA_APPEND="$EXTRA_APPEND theme=dark" - ;; - debian-edu_*_gnome) - EXTRA_APPEND="$EXTRA_APPEND desktop=gnome" - GUITERMINAL=xterm - ;; - debian-edu_*_lxde) - EXTRA_APPEND="$EXTRA_APPEND desktop=lxde" - GUITERMINAL=xterm - ;; - debian-edu_*_xfce) - EXTRA_APPEND="$EXTRA_APPEND desktop=xfce" - GUITERMINAL=xterm - ;; - debian-edu_*) - EXTRA_APPEND="$EXTRA_APPEND desktop=kde" - GUITERMINAL=konsole + PRESEED_URL="$QEMU_WEBSERVER/$PRESEED_PATH/${NAME}_$PRESEEDCFG" + + ARCH="$(ls debian-installer/)" + case "$ARCH" in + kfreebsd-*) # Boot the fourth menu option (Automated Install) after 3 seconds + sed -i 's#^set default=.*#set default=3#' debian-installer/$ARCH/grub.cfg + sed -i 's#^set timeout=.*#set timeout=2#' debian-installer/$ARCH/grub.cfg + # Prepend additional options + OPTION="preseed/url" ; VALUE="$PRESEED_URL" + sed -i "s#kfreebsd .*#set kFreeBSD.$OPTION='$VALUE'\n \\0#" debian-installer/$ARCH/grub.cfg + # Redirect d-i syslog to virtual serial port + OPTION="preseed/early_command" ; VALUE="sed -ie s/ttyv3/cuau0/ /etc/inittab ; kill -HUP 1" + sed -i "s#kfreebsd .*#set kFreeBSD.$OPTION='$VALUE'\n \\0#" debian-installer/$ARCH/grub.cfg + # Enable kernel logging to virtual serial port + KERNEL_FLAGS="-D" + sed -i "s#kfreebsd .*#\0 $KERNEL_FLAGS#" ;; - *) ;; - esac - case $NAME in - debian-edu_*) - EXTRA_APPEND="$EXTRA_APPEND DEBCONF_DEBUG=developer" + *) # other architectures unsupported yet ;; esac - case $NAME in - debian-edu_*) - # Debian Edu and tasksel do not work the expected way - # with priority=critical, so do not set it. - ;; - *) - EXTRA_APPEND="$EXTRA_APPEND priority=critical" - ;; - esac - APPEND="auto=true $EXTRA_APPEND $INST_LOCALE $INST_KEYMAP $PRESEED_URL $INST_VIDEO -- quiet" - show_preseed $(hostname -f)/$PRESEED_PATH/${NAME}_$PRESEEDCFG + show_preseed "$PRESEED_URL" echo echo "Starting QEMU now:" set -x QEMU_LAUNCHER=$(mktemp) echo "cd $WORKSPACE" > $QEMU_LAUNCHER echo -n "sudo qemu-system-x86_64 $QEMU_OPTS " >> $QEMU_LAUNCHER - if [ -n "$QEMU_KERNEL" ]; then - echo -n "$QEMU_KERNEL " >> $QEMU_LAUNCHER - else # Hurd needs multiboot options jenkins can't escape correctly - echo -n '--kernel '$WORKSPACE'/gnumach --initrd "'$IMAGE_MNT'/boot/initrd.gz \$(ramdisk-create),'$IMAGE_MNT'/boot/kernel/ext2fs.static --multiboot-command-line=\${kernel-command-line} --host-priv-port=\${host-port} --device-master-port=\${device-port} --exec-server-task=\${exec-task} -T typed gunzip:device:rd0 \$(task-create) \$(task-resume),'$IMAGE_MNT'/boot/kernel/ld.so.1 /hurd/exec \$(exec-task=task-create)" ' >> $QEMU_LAUNCHER - fi - echo "--append \"$APPEND\"" >> $QEMU_LAUNCHER (bash -x $QEMU_LAUNCHER && touch $RESULTS/qemu_quit ) & set +x } boot_system() { cd $WORKSPACE - echo "Booting system installed with g-i installation test for $NAME." + echo "Booting system installed with d-i PXE installation test for $NAME." # qemu related variables (incl kernel+initrd) - display first, as we grep for this in the process list QEMU_OPTS="-display vnc=$DISPLAY -no-shutdown -enable-kvm -cpu host" QEMU_OPTS="$QEMU_OPTS -drive file=$NAME.raw,index=0,media=disk,cache=unsafe -m $RAMSIZE -net nic,vlan=0 -net user,vlan=0,host=10.0.2.1,dhcpstart=10.0.2.2,dns=10.0.2.254" @@ -245,12 +184,6 @@ echo "ERROR: no x86 boot sector found in $NAME.raw - it's filetype is $FILE." exit 1 fi - case $NAME in - debian-edu*-server) - QEMU_OPTS="$QEMU_OPTS -net nic,vlan=1 -net user,vlan=1" - ;; - *) ;; - esac QEMU_OPTS="$QEMU_OPTS -serial file:${QEMU_SERIAL_OUT}" echo echo "Starting QEMU_ now:" @@ -271,35 +204,6 @@ backup_screenshot } -rescue_boot() { - # boot in rescue mode - let MY_NR=NR-TRIGGER_NR - TOKEN=$(printf "%04d" $MY_NR) - case $TOKEN in - 0010) do_and_report key tab - ;; - 0020) do_and_report key enter - ;; - 0100) do_and_report key tab - ;; - 0110) do_and_report key enter - ;; - 0150) do_and_report type df - ;; - 0160) do_and_report key enter - ;; - 0170) do_and_report type exit - ;; - 0200) do_and_report key enter - ;; - 0210) do_and_report key down - ;; - 0220) do_and_report key enter - ;; - *) ;; - esac -} - post_install_boot() { # normal boot after installation let MY_NR=NR-TRIGGER_NR @@ -323,512 +227,6 @@ # debian-edu installations differ too much, login individually *) ;; esac - # Debian Edu -test images usually show a screen with known problems - # search for EDUTESTMODE in the code to understand how the next 2 lines are used - EDUTESTMODE=false - [[ "$NAME" =~ ^debian-edu_.*-test.*$ ]] && EDUTESTMODE=true - # - # actions depending on the type of installation - # - case $NAME in - debian_*xfce) case $TOKEN in - 0200) do_and_report key enter - ;; - 0210) do_and_report key alt-f2 - ;; - 0220) do_and_report type "iceweasel" - ;; - 0230) do_and_report key space - ;; - 0240) do_and_report type "www" - ;; - 0250) do_and_report type "." - ;; - 0260) do_and_report type "debian" - ;; - 0270) do_and_report type "." - ;; - 0280) do_and_report type "org" - ;; - 0290) do_and_report key enter - ;; - 0400) do_and_report key alt-f2 - ;; - 0410) do_and_report type xterm - ;; - 0420) do_and_report key enter - ;; - 0430) do_and_report type apt-get - ;; - 0440) do_and_report key space - ;; - 0450) do_and_report type moo - ;; - 0500) do_and_report key enter - ;; - 0510) do_and_report type "su" - ;; - 0520) do_and_report key enter - ;; - 0530) do_and_report type r00tme - ;; - 0540) do_and_report key enter - ;; - 0550) do_and_report type "poweroff" - ;; - 0560) do_and_report key enter - ;; - *) ;; - esac - ;; - debian_*lxde) case $TOKEN in - 0200) do_and_report key alt-f2 - ;; - 0210) do_and_report type "iceweasel" - ;; - 0230) do_and_report key space - ;; - 0240) do_and_report type "www" - ;; - 0250) do_and_report type "." - ;; - 0260) do_and_report type "debian" - ;; - 0270) do_and_report type "." - ;; - 0280) do_and_report type "org" - ;; - 0290) do_and_report key enter - ;; - 0400) do_and_report key alt-f2 - ;; - 0410) do_and_report type lxterminal - ;; - 0420) do_and_report key enter - ;; - 0430) do_and_report type apt-get - ;; - 0440) do_and_report key space - ;; - 0450) do_and_report type moo - ;; - 0520) do_and_report key enter - ;; - 0530) do_and_report type "su" - ;; - 0540) do_and_report key enter - ;; - 0550) do_and_report type r00tme - ;; - 0560) do_and_report key enter - ;; - 0570) case $NAME in - *_hurd*) - do_and_report type "echo 'In tight loop: hit ctl-alt-del to reboot' >/dev/com0" - ;; - *) - do_and_report type "poweroff" - ;; - esac - ;; - 0580) do_and_report key enter - ;; - *) ;; - esac - ;; - debian_*kde) case $TOKEN in - 0300) do_and_report key tab - ;; - 0310) do_and_report key enter - ;; - 0400) do_and_report key alt-f2 - ;; - 0410) do_and_report type "konqueror" - ;; - 0420) do_and_report key space - ;; - 0430) do_and_report type "www" - ;; - 0440) do_and_report type "." - ;; - 0450) do_and_report type "debian" - ;; - 0460) do_and_report type "." - ;; - 0470) do_and_report type "org" - ;; - 0480) do_and_report key enter - ;; - 0600) do_and_report key alt-f2 - ;; - 0610) do_and_report type konsole - ;; - 0620) do_and_report key enter - ;; - 0700) do_and_report type apt-get - ;; - 0710) do_and_report key space - ;; - 0720) do_and_report type moo - ;; - 0730) do_and_report key enter - ;; - 0740) do_and_report type "su" - ;; - 0750) do_and_report key enter - ;; - 0760) do_and_report type r00tme - ;; - 0770) do_and_report key enter - ;; - 0780) do_and_report type "poweroff" - ;; - 0790) do_and_report key enter - ;; - *) ;; - esac - ;; - debian_*gnome) case $TOKEN in - 0150) do_and_report move 530 420 click 1 - ;; - 0200) do_and_report key alt-f2 - ;; - 0210) do_and_report type "iceweasel" - ;; - 0230) do_and_report key space - ;; - 0240) do_and_report type "www" - ;; - 0250) do_and_report type "." - ;; - 0260) do_and_report type "debian" - ;; - 0270) do_and_report type "." - ;; - 0280) do_and_report type "org" - ;; - 0290) do_and_report key enter - ;; - 0400) do_and_report key alt-f2 - ;; - 0410) do_and_report type gnome - ;; - 0420) do_and_report type "-" - ;; - 0430) do_and_report type terminal - ;; - 0440) do_and_report key enter - ;; - 0450) do_and_report type apt-get - ;; - 0460) do_and_report key space - ;; - 0470) do_and_report type moo - ;; - 0520) do_and_report key enter - ;; - 0530) do_and_report type "su" - ;; - 0540) do_and_report key enter - ;; - 0550) do_and_report type r00tme - ;; - 0560) do_and_report key enter - ;; - 0570) do_and_report type "poweroff" - ;; - 0580) do_and_report key enter - ;; - *) ;; - esac - ;; - debian-edu*minimal) case $TOKEN in - # debian-edu installations report error found during installation, go forward in text mode - 0030) $EDUTESTMODE && do_and_report key tab - ;; - 0040) $EDUTESTMODE && do_and_report key enter - ;; - 0050) do_and_report type jenkins - ;; - 0060) do_and_report key enter - ;; - 0070) do_and_report type insecure - ;; - 0080) do_and_report key enter - ;; - 0100) do_and_report type ps - ;; - 0110) do_and_report key space - ;; - 0120) do_and_report type fax - ;; - 0130) do_and_report key enter - ;; - 0140) do_and_report type df - ;; - 0150) do_and_report key enter - ;; - 0160) do_and_report type apt-get - ;; - 0170) do_and_report key space - ;; - 0180) do_and_report type moo - ;; - 0200) do_and_report key enter - ;; - 0220) do_and_report type "su" - ;; - 0230) do_and_report key enter - ;; - 0240) do_and_report type r00tme - ;; - 0250) do_and_report key enter - ;; - 0260) do_and_report type poweroff - ;; - 0270) do_and_report key enter - ;; - *) ;; - esac - ;; - debian-edu*-main-server) case $TOKEN in - # debian-edu installations report error found during installation, go forward, in text mode - 0500) $EDUTESTMODE && do_and_report key tab - ;; - 0550) $EDUTESTMODE && do_and_report key enter - ;; - 0770) do_and_report type root - ;; - 0780) do_and_report key enter - ;; - 0790) do_and_report type r00tme - ;; - 0800) do_and_report key enter - ;; - 0850) do_and_report type ps - ;; - 0860) do_and_report key space - ;; - 0870) do_and_report type fax - ;; - 0880) do_and_report key enter - ;; - 0890) do_and_report type df - ;; - 0900) do_and_report key enter - ;; - 0910) do_and_report type apt-get # apt-get moo - ;; - 0920) do_and_report key space - ;; - 0930) do_and_report type moo - ;; - 0940) do_and_report key enter - ;; - 0950) do_and_report type apt-get # apt-get install w3m - ;; - 0960) do_and_report key space - ;; - 0970) do_and_report type "-y" - ;; - 0980) do_and_report key space - ;; - 0990) do_and_report type install - ;; - 1000) do_and_report key space - ;; - 1010) do_and_report type w3m - ;; - 1020) do_and_report key enter - ;; - 1100) do_and_report type w3m # check nagios - ;; - 1110) do_and_report key space - ;; - 1120) do_and_report type https - ;; - 1125) do_and_report key ":" - ;; - 1130) do_and_report type "//www" - ;; - 1140) do_and_report type "/nagios" - ;; - 1150) do_and_report key enter - ;; - 1200) do_and_report type q - ;; - 1220) do_and_report key enter - ;; - 1350) do_and_report type w3m # check cups - ;; - 1360) do_and_report key space - ;; - 1370) do_and_report type https - ;; - 1375) do_and_report key ":" - ;; - 1380) do_and_report type "//www" - ;; - 1385) do_and_report key ":" - ;; - 1390) do_and_report type "631" - ;; - 1400) do_and_report key enter - ;; - 1500) do_and_report type q - ;; - 1520) do_and_report key enter - ;; - 1600) do_and_report type poweroff # poweroff - ;; - 1610) do_and_report key enter - ;; - *) ;; - esac - ;; - debian-edu*-combi-server) case $TOKEN in - # debian-edu installations report error found during installation, go forward - 0100) $EDUTESTMODE && do_and_report move 760 560 click 1 - ;; - 0770) do_and_report type jenkins - ;; - 0820) do_and_report key enter - ;; - 0830) do_and_report type insecure - ;; - 0840) do_and_report key enter - ;; - 0900) do_and_report key tab - ;; - 0910) do_and_report key enter - ;; - 1000) do_and_report key alt-f2 - ;; - 1010) do_and_report type "iceweasel" - ;; - 1020) do_and_report key space - ;; - 1030) do_and_report type "www" - ;; - 1040) do_and_report type "." - ;; - 1050) do_and_report type "debian" - ;; - 1060) do_and_report type "." - ;; - 1070) do_and_report type "org" - ;; - 1080) do_and_report key enter - ;; - 1200) do_and_report key alt-f2 - ;; - 1210) do_and_report type $GUITERMINAL - ;; - 1220) do_and_report key enter - ;; - 1300) do_and_report type apt-get - ;; - 1310) do_and_report key space - ;; - 1320) do_and_report type moo - ;; - 1330) do_and_report key enter - ;; - 1340) do_and_report type "su" - ;; - 1350) do_and_report key enter - ;; - 1360) do_and_report type r00tme - ;; - 1370) do_and_report key enter - ;; - 1380) do_and_report type "poweroff" - ;; - 1390) do_and_report key enter - ;; - *) ;; - esac - ;; - debian-edu*workstation) case $TOKEN in - # debian-edu installations report error found during installation, go forward - 0100) $EDUTESTMODE && do_and_report move 760 560 click 1 - ;; - 0110) do_and_report type jenkins - ;; - 0120) do_and_report key enter - ;; - 0130) do_and_report type insecure - ;; - 0140) do_and_report key enter - ;; - *) ;; - esac - ;; - debian-edu*standalone*) case $TOKEN in - # debian-edu installations report error found during installation, go forward - 0100) $EDUTESTMODE && do_and_report move 760 560 click 1 - ;; - 0110) do_and_report type jenkins - ;; - 0120) do_and_report key enter - ;; - 0130) do_and_report type insecure - ;; - 0140) do_and_report key enter - ;; - 0300) do_and_report key tab - ;; - 0310) do_and_report key enter - ;; - 0400) do_and_report key alt-f2 - ;; - 0410) do_and_report type "iceweasel" - ;; - 0420) do_and_report key space - ;; - 0430) do_and_report type "www" - ;; - 0440) do_and_report type "." - ;; - 0450) do_and_report type "debian" - ;; - 0460) do_and_report type "." - ;; - 0470) do_and_report type "org" - ;; - 0480) do_and_report key enter - ;; - 0600) do_and_report key alt-f2 - ;; - 0610) do_and_report type $GUITERMINAL - ;; - 0620) do_and_report key enter - ;; - 0700) do_and_report type apt-get - ;; - 0710) do_and_report key space - ;; - 0720) do_and_report type moo - ;; - 0730) do_and_report key enter - ;; - 0740) do_and_report type "su" - ;; - 0750) do_and_report key enter - ;; - 0760) do_and_report type r00tme - ;; - 0770) do_and_report key enter - ;; - 0780) do_and_report type "poweroff" - ;; - 0790) do_and_report key enter - ;; - *) ;; - esac - ;; - *) ;; - esac } @@ -987,122 +385,10 @@ backup_screenshot } -save_logs() { - # - # get logs and other files from the installed system - # - # remove set +e & -x once the code has proven its good - set -x - cd $WORKSPACE - SYSTEM_MNT=/media/$NAME - sudo mkdir -p $SYSTEM_MNT - # FIXME: bugreport guestmount: -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 - case $NAME in - debian-edu_*_workstation) sudo guestmount -a $NAME.raw -m /dev/vg_system/root --ro $SYSTEM_MNT || ( echo "Warning: cannot mount /dev/vg_system/root" ; figlet "fail" ) - ;; - debian-edu_*-server|debian-edu_*minimal) - sudo guestmount -a $NAME.raw -m /dev/vg_system/root --ro $SYSTEM_MNT || ( echo "Warning: cannot mount /dev/vg_system/root" ; figlet "fail" ) - sudo guestmount -a $NAME.raw -m /dev/vg_system/var -o nonempty --ro $SYSTEM_MNT/var || ( echo "Warning: cannot mount /dev/vg_system/var" ; figlet "fail" ) - sudo guestmount -a $NAME.raw -m /dev/vg_system/usr -o nonempty --ro $SYSTEM_MNT/usr || ( echo "Warning: cannot mount /dev/vg_system/usr" ; figlet "fail" ) - ;; - debian-edu_*) sudo guestmount -a $NAME.raw -m /dev/vg_system/root --ro $SYSTEM_MNT || ( echo "Warning: cannot mount /dev/vg_system/root" ; figlet "fail" ) - sudo guestmount -a $NAME.raw -m /dev/vg_system/var -o nonempty --ro $SYSTEM_MNT/var || ( echo "Warning: cannot mount /dev/vg_system/var" ; figlet "fail" ) - ;; - debian_wheezy_*) sudo guestmount -a $NAME.raw -m /dev/debian/root --ro $SYSTEM_MNT || ( echo "Warning: cannot mount /dev/debian/root" ; figlet "fail" ) - ;; - *) sudo guestmount -a $NAME.raw -m /dev/debian-vg/root --ro $SYSTEM_MNT || ( echo "Warning: cannot mount /dev/debian-vg/root" ; figlet "fail" ) - ;; - esac - # - # copy logs (and continue if some logs cannot be copied) - # - set +e - sudo cp -r $SYSTEM_MNT/var/log/installer $SYSTEM_MNT/etc/fstab $RESULTS/log/ - # - # get list of installed packages - # - sudo chroot $SYSTEM_MNT dpkg -l > $RESULTS/log/dpkg-l || ( echo "Warning: cannot run dpkg inside the installed system." ; sudo ls -la $SYSTEM_MNT ; figlet "fail" ) - # - # only on combi-servers: - # mount /opt - # copy LTSP logs and package list - # unmount /opt - # - case $NAME in - debian-edu_*combi-server) sudo guestmount -a $NAME.raw -m /dev/vg_system/opt -o nonempty --ro $SYSTEM_MNT/opt || ( echo "Warning: cannot mount /dev/vg_system/opt" ; figlet "fail" ) - mkdir -p $RESULTS/log/opt - if [ -d $SYSTEM_MNT/opt/ltsp/amd64 ] ; then - LTSPARCH="amd64" - elif [ -d $SYSTEM_MNT/opt/ltsp/i386 ] ; then - LTSPARCH="i386" - else - echo "Warning: no LTSP chroot found." - fi - if [ ! -z "$LTSPARCH" ] ; then - sudo cp -r $SYSTEM_MNT/opt/ltsp/$LTSPARCH/var/log $RESULTS/log/opt/ - sudo chroot $SYSTEM_MNT/opt/ltsp/$LTSPARCH dpkg -l > $RESULTS/log/opt/dpkg-l || ( echo "Warning: cannot run dpkg inside the ltsp chroot." ; sudo ls -la $SYSTEM_MNT/opt/ltsp/$LTSPARCH ; figlet "fail" ) - fi - sudo umount -l $SYSTEM_MNT/opt || ( echo "Warning: cannot un-mount $SYSTEM_MNT/opt" ; figlet "fail" ) - ;; - *) ;; - esac - # - # make sure we can read everything after installation - # - sudo chown -R jenkins:jenkins $RESULTS/log/ - # - # umount guests - # - sync - case $NAME in - debian-edu_*_workstation) ;; - debian-edu_*-server|debian-edu_*minimal) - sudo umount -l $SYSTEM_MNT/var || ( echo "Warning: cannot un-mount $SYSTEM_MNT/var" ; figlet "fail" ) - sudo umount -l $SYSTEM_MNT/usr || ( echo "Warning: cannot un-mount $SYSTEM_MNT/usr" ; figlet "fail" ) - ;; - debian-edu_*) sudo umount -l $SYSTEM_MNT/var || ( echo "Warning: cannot un-mount $SYSTEM_MNT/var" ; figlet "fail" ) - ;; - *) ;; - esac - sudo umount -l $SYSTEM_MNT || ( echo "Warning: cannot un-mount $SYSTEM_MNT" ; figlet "fail" ) -} - trap cleanup_all INT TERM EXIT # -# if there is a CD image... -# -if [ ! -z "$IMAGE" ] ; then - fetch_if_newer "$IMAGE" "$URL" - # is this really an .iso? - if [ $(file "$IMAGE" | grep -cE '(ISO 9660|DOS/MBR boot sector)') -eq 1 ] ; then - # yes, so let's mount it - sudo mkdir -p $IMAGE_MNT - grep -q $IMAGE_MNT /proc/mounts && sudo umount -l $IMAGE_MNT - sleep 1 - sudo mount -o loop,ro $IMAGE $IMAGE_MNT - else - # something went wrong - figlet "no .iso" - echo "ERROR: no valid .iso found" - if [ $(file "$IMAGE" | grep -c "HTML document") -eq 1 ] ; then - mv "$IMAGE" "$IMAGE.html" - lynx --dump "$IMAGE.html" - rm "$IMAGE.html" - fi - exit 1 - fi -else - # - # else netboot gtk - # - fetch_if_newer "$KERNEL" "$URL/$KERNEL" - fetch_if_newer "$INITRD" "$URL/$INITRD" -fi - -# -# run g-i +# run d-i PXE # NR=0 bootstrap_system @@ -1136,7 +422,8 @@ boot_system let START_TRIGGER=NR+500 monitor_system post_install $START_TRIGGER - save_logs +#:XXX: unimplemented yet +# save_logs ;; esac cleanup_all
--- d-i-preseed-cfgs/debian_sid_daily_hurd_lxde_preseed.cfg 2014-09-01 21:15:37.000000000 +0100 +++ d-i-preseed-cfgs/debian_sid_daily_kfreebsd_minimal_preseed.cfg 2014-09-01 23:29:35.000000000 +0100 @@ -11,9 +11,7 @@ #d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8 # Keyboard selection. -# keymap is an alias for keyboard-configuration/xkb-keymap -d-i keymap select us -# d-i keyboard-configuration/toggle select No toggling +d-i keyboard-configuration/xkb-keymap select us ### Network configuration # Disable network configuration entirely. This is useful for cdrom @@ -144,7 +142,7 @@ # /dev/sda, and not e.g. /dev/discs/disc0/disc). # For example, to use the first SCSI/SATA hard disk: #d-i partman-auto/disk string /dev/sda -d-i partman-auto/disk string /dev/hd0 +d-i partman-auto/disk string /dev/ada0 # In addition, you'll need to specify the method to use. # The presently available methods are: @@ -303,11 +301,10 @@ ### Package selection #tasksel tasksel/first multiselect standard, web-server -tasksel tasksel/first multiselect standard, desktop +tasksel tasksel/first multiselect standard # If the desktop task is selected, install the kde and xfce desktops # instead of the default gnome desktop. #tasksel tasksel/desktop multiselect kde, xfce -tasksel tasksel/desktop multiselect lxde # Individual additional packages to install #d-i pkgsel/include string openssh-server build-essential @@ -362,7 +359,6 @@ # This first command is run as early as possible, just after # preseeding is read. #d-i preseed/early_command string anna-install some-udeb -d-i preseed/early_command string sed -i '/^$CMD/i echo "In tight loop: hit ctl-alt-del to reboot" >/dev/com0' /lib/debian-installer/exit # This command is run immediately before the partitioner starts. It may be # useful to apply dynamic partitioner preseeding that depends on the state @@ -374,7 +370,6 @@ # directly, or use the apt-install and in-target commands to easily install # packages and run commands in the target system. #d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh -d-i preseed/late_command string apt-install xdm; echo /usr/bin/xdm >/target/etc/X11/default-display-manager # Alternatively, if you want to install to a location other than the mbr, # uncomment and edit these lines: @@ -385,4 +380,4 @@ #d-i grub-installer/bootdev string (hd0,0) (hd1,0) (hd2,0) # To install to a particular device: #d-i grub-installer/bootdev string /dev/sda -d-i grub-installer/bootdev string /dev/hd0 +d-i grub-installer/bootdev string /dev/ada0
signature.asc
Description: OpenPGP digital signature