[oe-commits] [openembedded-core] 05/16: init-install: add support for install image to Intel VROC raid disk

git at git.openembedded.org git at git.openembedded.org
Mon Mar 25 11:19:15 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e96891d75be34c6d227e67f22f3a7b304226d4bb
Author: Liwei Song <liwei.song at windriver.com>
AuthorDate: Wed Mar 20 23:19:14 2019 -0400

    init-install: add support for install image to Intel VROC raid disk
    
    Intel VROC raid device named as /dev/mdXX, now it only can boot with
    initramfs method because it need mdadm to do initial work in it, so do
    not remove initrd for such kind device.
    
    It also use "p" as partition prefix, adjust it to aviod use a wrong device name
    durning install.
    
    Signed-off-by: Liwei Song <liwei.song at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 .../initrdscripts/files/init-install-efi.sh        | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index b6855b5..c23132a 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -44,9 +44,10 @@ echo "Searching for hard drives ..."
 
 # Some eMMC devices have special sub devices such as mmcblk0boot0 etc
 # we're currently only interested in the root device so pick them wisely
-devices=`ls /sys/block/ | grep -v mmcblk` || true
+devices=`ls /sys/block/ | grep -v "mmcblk\|md\|dm"` || true
 mmc_devices=`ls /sys/block/ | grep "mmcblk[0-9]\{1,\}$"` || true
-devices="$devices $mmc_devices"
+md_devices=`cat /proc/mdstat  |grep -w active |awk -F":" '{print $1}'` || true
+devices="$devices $mmc_devices $md_devices"
 
 for device in $devices; do
     case $device in
@@ -165,6 +166,14 @@ if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
     rootwait="rootwait"
 fi
 
+# MD raid device use partition prefix charater 'p'
+# and it need a larger capacity to store initrd,
+# considering some debug purpose, enlarge it to 1G.
+if [ ! "${device#/dev/md}" = "${device}" ]; then
+    part_prefix="p"
+    boot_size=1024
+fi
+
 # USB devices also require rootwait
 if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
     rootwait="rootwait"
@@ -251,8 +260,14 @@ if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
     # Update grub config for the installed image
     # Delete the install entry
     sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
-    # Delete the initrd lines
-    sed -i "/initrd /d" $GRUBCFG
+    # initrd is necessary to boot from MD device
+    if [ ! "${device#/dev/md}" = "${device}" ]; then
+       cp /run/media/$1/initrd /boot
+       cp /run/media/$1/startup.nsh /boot
+    else
+       # Delete the initrd lines
+       sed -i "/initrd /d" $GRUBCFG
+    fi
     # Delete any LABEL= strings
     sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
     # Replace root= and add additional standard boot options

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list