mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

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=<seconds>) and sleep between each attempt (default: one second, rootdelay=<seconds>). 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 <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
593 B
Executable File
593 B
Executable File
#!/bin/sh
Copyright (C) 2011 O.S. Systems Software LTDA.
Licensed on MIT
finish_enabled() { return 0 }
finish_run() { if [ -n "$ROOTFS_DIR" ]; then if [ ! -d $ROOTFS_DIR/dev ]; then fatal "ERROR: There's no '/dev' on rootfs." fi
info "Switching root to '$ROOTFS_DIR'..."
debug "Moving /dev, /proc and /sys onto rootfs..."
mount --move /dev $ROOTFS_DIR/dev
mount --move /proc $ROOTFS_DIR/proc
mount --move /sys $ROOTFS_DIR/sys
cd $ROOTFS_DIR
exec switch_root -c /dev/console $ROOTFS_DIR ${bootparam_init:-/sbin/init}
else
debug "No rootfs has been set"
fi
}