Skip to contentSkip to conversation

initrdscripts/init-install*: Add rootwait when installing to USB devices

PATCH New Alejandro Hernandez 1 participant 1 message Jun 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initrdscripts/init-install*: Add rootwait when installing to USB devices

From: California Sullivan <[email protected]>

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].

(From OE-Core rev: 40e2d36573a7a6bce377b1f9653607065ba5ffb6)

---
 meta/recipes-core/initrdscripts/files/init-install-efi.sh | 6 ++++++
 meta/recipes-core/initrdscripts/files/init-install.sh     | 5 +++++
 2 files changed, 11 insertions(+)
meta/recipes-core/initrdscripts/files/init-install-efi.sh +6 -0
index f564f4e2d6a..bf8a76b96bb 100644
@@ -144,6 +144,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
meta/recipes-core/initrdscripts/files/init-install.sh +5 -0
index 72ce92b9640..5f2599e7242 100644
@@ -152,6 +152,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
Signature · 1 line
2.12.2