From b06971bb777bb00296a85c5205ba3a6853e73934 Mon Sep 17 00:00:00 2001 From: Steven Chamberlain Date: Tue, 11 Nov 2014 21:02:20 +0000 Subject: Initial support for testing netboot PXE installers --- bin/g-i-installation.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/bin/g-i-installation.sh b/bin/g-i-installation.sh index 83565fb2..e975a4d2 100644 --- a/bin/g-i-installation.sh +++ b/bin/g-i-installation.sh @@ -30,7 +30,10 @@ DISKSIZE_IN_GB=$1 URL=$2 # $3 and $4 are used below for language setting RAMSIZE=1024 -if [ "$(basename $URL)" != "amd64" ] ; then +if [ "$(basename $URL)" = "netboot.tar.gz" ] ; then + # URL is for a PXE netboot installer, rather than a CD .iso + NETBOOT=$(pwd)/$(basename $URL) +elif [ "$(basename $URL)" != "amd64" ] ; then IMAGE=$(pwd)/$(basename $URL) IMAGE_MNT="/media/cd-$NAME.iso" else @@ -195,7 +198,13 @@ bootstrap_system() { PRESEEDCFG="preseed.cfg" PRESEED_PATH=d-i-preseed-cfgs PRESEED_URL="url=$QEMU_WEBSERVER/$PRESEED_PATH/${NAME}_$PRESEEDCFG" - if [ -n "$IMAGE" ] ; then + # + # boot configuration + # + if [ -n "$NETBOOT" ] ; then + GRUB_CFG="debian-installer/$ARCH/grub.cfg" + QEMU_NET_OPTS="$QEMU_NET_OPTS,bootfile=grub2pxe,tftp=." + elif [ -n "$IMAGE" ] ; then QEMU_OPTS="$QEMU_OPTS -cdrom $IMAGE -boot d" case $NAME in *_kfreebsd) ;; @@ -1156,9 +1165,20 @@ save_logs() { trap cleanup_all INT TERM EXIT # -# if there is a CD image... +# install image preparation # -if [ ! -z "$IMAGE" ] ; then +if [ ! -z "$NETBOOT" ] ; then + # + # if there is a netboot installer tarball... + # + fetch_if_newer "$NETBOOT" "$URL" + # try to extract, otherwise abort + sha256sum "$NETBOOT" + tar -zxvf "$NETBOOT" || exit +elif [ ! -z "$IMAGE" ] ; then + # + # if there is a CD image... + # fetch_if_newer "$IMAGE" "$URL" # is this really an .iso? if [ $(file "$IMAGE" | grep -cE '(ISO 9660|DOS/MBR boot sector)') -eq 1 ] ; then -- cgit v1.2.3-54-g00ecf