diff --git a/initramfs/init b/initramfs/init index e4415a5..ffef357 100755 --- a/initramfs/init +++ b/initramfs/init @@ -63,4 +63,6 @@ setup_telnetd /pineloader # Don't kernel panic just in case if the pineloader script crashes +echo "ERROR: Pineloader script finished, this is not supposed to happen!" +echo "Please telnet to $IP and diagnose the issue." loop_forever diff --git a/initramfs/pineloader b/initramfs/pineloader index 7ef6845..b5bfa7c 100755 --- a/initramfs/pineloader +++ b/initramfs/pineloader @@ -99,15 +99,19 @@ done i=$(select_opt "${choices[@]}") key="${choices[$i]}" -value="${config[$key]}" +value="${config[$key]}" && $value -if [ -z "$value" ]; then - echo "ERROR: The selected boot variables are blank, please debug the issue by telnet to:" - echo "$IP" +if [ -z "$value" ] || [ -z "$KERNEL" ]; then + echo "ERROR: The selected boot variables are blank, please check for syntax, double quote in your config file." else + # Building up the kexec command line + KEXEC_CMD=("kexec" "-l" "$KERNEL") + [[ "$INITRD" ]] && KEXEC_CMD+=("--initrd" "$INITRD") + [[ "$CMDLINE" ]] && KEXEC_CMD+=("--command-line" "$CMDLINE") + mount -o ro $BOOTPART /mnt echo "Loading kernel and ramdisk to memory..." - kexec -l --initrd="$INITRD" --command-line="$CMDLINE" $KERNEL + "${KEXEC_CMD[@]}" echo "Starting kernel..." kexec -e fi