aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalifornia Sullivan <california.l.sullivan@intel.com>2016-08-09 13:35:52 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-27 23:39:50 +0100
commit7f26cee3d8e4b2e9240b30c21be9fa7661186ccd (patch)
treeab0fb98936d4099a03fe44bbe8dcaccb39c40ebe
parent1aa51cfb4b8d10f478b1a6a68c69a3e35342b1c0 (diff)
downloadopenembedded-core-7f26cee3d8e4b2e9240b30c21be9fa7661186ccd.tar.gz
openembedded-core-7f26cee3d8e4b2e9240b30c21be9fa7661186ccd.tar.bz2
openembedded-core-7f26cee3d8e4b2e9240b30c21be9fa7661186ccd.zip
initrdscripts/init-install*: Add rootwait when installing to USB devices
It can take a bit for USB devices to be detected, so if a USB device is your rootfs and you don't set rootwait you will most likely get a kernel panic. Fix this by adding rootwait to the kernel command line on installation. Fixes [YOCTO #9462]. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi.sh6
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh5
2 files changed, 11 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index d58826a240..d4c5fb3297 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -138,6 +138,12 @@ if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
part_prefix="p"
rootwait="rootwait"
fi
+
+# USB devices also require rootwait
+if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
+ rootwait="rootwait"
+fi
+
bootfs=${device}${part_prefix}1
rootfs=${device}${part_prefix}2
swap=${device}${part_prefix}3
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index c5623eeb26..fddaf6aa82 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -146,6 +146,11 @@ if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
rootwait="rootwait"
fi
+# USB devices also require rootwait
+if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
+ rootwait="rootwait"
+fi
+
if [ $grub_version -eq 0 ] ; then
bios_boot=''
bootfs=${device}${part_prefix}1