From ee6a6c3461694ce09789bf4d852cea2e22fc95e4 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 1 Jul 2016 15:53:51 +0200 Subject: initramfs-framework: add retry loop for slow boot devices (like USB) On some hardware platforms (Gigabyte, qemu), detection of USB devices by the kernel is slow enough such that it happens only after the first attempt to mount the rootfs. We need to keep trying for a while (default: 5s seconds, controlled by roottimeout=) and sleep between each attempt (default: one second, rootdelay=). This change intentionally splits finding the rootfs (in the new "rootfs") and switching to it ("finish"). That is needed to keep udev running while waiting for the rootfs, because it shuts down before "finish" starts. It is also the direction that was discussed on the OE mailing list for future changes to initramfs-framework (like supporting a "live CD" module, which would replace or further augment mounting of the rootfs). (From OE-Core rev: 2a50bb9ee8838e3d026c82dc09aaccb880a264f4) Signed-off-by: Patrick Ohly Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- .../initrdscripts/initramfs-framework/finish | 33 ---------------------- 1 file changed, 33 deletions(-) (limited to 'meta/recipes-core/initrdscripts/initramfs-framework/finish') diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish index d09bbb8bed..717383ebac 100755 --- a/meta/recipes-core/initrdscripts/initramfs-framework/finish +++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish @@ -8,39 +8,6 @@ finish_enabled() { finish_run() { if [ -n "$ROOTFS_DIR" ]; then - if [ -n "$bootparam_rootdelay" ]; then - debug "Sleeping for $rootdelay second(s) to wait root to settle..." - sleep $bootparam_rootdelay - fi - - if [ -n "$bootparam_root" ]; then - debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..." - - if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then - root_uuid=`echo $bootparam_root | cut -c6-` - bootparam_root="/dev/disk/by-uuid/$root_uuid" - fi - - if [ -e "$bootparam_root" ]; then - flags="" - if [ -n "$bootparam_ro" ]; then - if [ -n "$bootparam_rootflags" ]; then - bootparam_rootflags="$bootparam_rootflags," - fi - bootparam_rootflags="${bootparam_rootflags}ro" - fi - if [ -n "$bootparam_rootflags" ]; then - flags="$flags -o$bootparam_rootflags" - fi - if [ -n "$bootparam_rootfstype" ]; then - flags="$flags -t$bootparam_rootfstype" - fi - mount $flags $bootparam_root $ROOTFS_DIR - else - msg "root '$bootparam_root' doesn't exist." - fi - fi - if [ ! -d $ROOTFS_DIR/dev ]; then fatal "ERROR: There's no '/dev' on rootfs." fi -- cgit v1.2.3-54-g00ecf