From ee3ab501da30b8a7e8d9d124df4e89b2f2f961a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Sun, 18 Feb 2024 17:49:32 +0100 Subject: [PATCH] Add rootwait to grub command line to fix USB boot failures Without this, one of my boards fails to reboot from USB drive due to slow USB enumeration. Rootwait is not needed during the Fiwix -> Linux jump, because we use an initramfs there, and the init scripts already wait for USB drives to show up. Linux->Linux kexec, used with a custom early kernel, might need it, so add it there as well to be safe. --- steps/improve/make_bootable.sh | 2 +- steps/jump/linux.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/steps/improve/make_bootable.sh b/steps/improve/make_bootable.sh index acb760a..794011b 100644 --- a/steps/improve/make_bootable.sh +++ b/steps/improve/make_bootable.sh @@ -28,7 +28,7 @@ menuentry 'Linux live-bootstrap' { insmod part_msdos set root='$(grub-probe -d /dev/${DISK} -t bios_hints | sed -e 's/ //g')' set gfxpayload=auto - linux /boot/vmlinuz root=/dev/${DISK} rw $(cat /proc/cmdline) + linux /boot/vmlinuz root=/dev/${DISK} rootwait rw $(cat /proc/cmdline) } EOF diff --git a/steps/jump/linux.sh b/steps/jump/linux.sh index 568834b..da2d616 100755 --- a/steps/jump/linux.sh +++ b/steps/jump/linux.sh @@ -23,10 +23,10 @@ else # kexec time if [ "${BARE_METAL}" = True ]; then kexec -l "/boot/vmlinuz" \ - --append="root=/dev/sda1 rootfstype=ext3 init=/init rw" + --append="root=/dev/sda1 rootfstype=ext3 init=/init rw rootwait" else kexec -l "/boot/vmlinuz" --console-serial \ - --append="console=ttyS0 root=/dev/sda1 rootfstype=ext3 init=/init rw" + --append="console=ttyS0 root=/dev/sda1 rootfstype=ext3 init=/init rw rootwait" fi kexec -e fi