From 9c2a0649f2863e6c214d8d16c644055948022642 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Mon, 13 Nov 2017 03:14:08 -0500 Subject: [PATCH] mk-pxelinux-ramfs: improve console output Currently for a user the pxe boot seems unclear and it is hard to follow what is going on. - Report on when (re-)starting the bootscript. - Report configs fetched (Without e.g. on a virsh console one only sees a loop of timeouts.) - Report which config is missing on the PXE_CONF check - Report kexec calls made GitHub-ID: #16 Signed-off-by: Christian Ehrhardt Acked-by: Viktor Mihajlovski Signed-off-by: Michael Holzheu --- netboot/mk-pxelinux-ramfs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/netboot/mk-pxelinux-ramfs b/netboot/mk-pxelinux-ramfs index d1263aec..9da51488 100755 --- a/netboot/mk-pxelinux-ramfs +++ b/netboot/mk-pxelinux-ramfs @@ -164,6 +164,7 @@ echo "$cmd: Making init script" # --- begin init script cat <<'EOF' > $builddir/init #!/bin/sh +script="/sbin/pxeboot.script" /bin/mount -t devtmpfs none /dev /bin/mount -t proc none /proc /bin/mount -t sysfs none /sys @@ -174,8 +175,9 @@ cat <<'EOF' > $builddir/init while true do - /sbin/pxeboot.script + ${script} /bin/sleep 1 + echo "retry ${script}" done EOF # --- end init script @@ -310,7 +312,7 @@ if [ -f $PXE_CONF ] then . $PXE_CONF else - echo waiting for PXE configuration + echo waiting for PXE configuration from DHCP exit fi @@ -347,6 +349,7 @@ then set +e for c in $CONFIGS do + echo "fetching config pxelinux.cfg/$c from $siaddr" if /usr/bin/tftp -g -l /tmp/config -r pxelinux.cfg/$c $siaddr then break @@ -370,11 +373,13 @@ then echo no kernel statement found in config exit else + echo fetch kernel $kernel from $siaddr /usr/bin/tftp -g -l /tmp/kernel -r $kernel $siaddr fi if [ -n "$initrd" ] then + echo fetch initrd $initrd from $siaddr /usr/bin/tftp -g -l /tmp/initrd -r $initrd $siaddr INITRD="--initrd=/tmp/initrd" else @@ -388,6 +393,7 @@ else APPEND="" fi +echo "Kexec load: kexec -l /tmp/kernel $INITRD $APPEND" kexec -l /tmp/kernel $INITRD $APPEND kexec -e EOF