diff options
Diffstat (limited to 'meta/recipes-core/initrdscripts/files/init-install.sh')
| -rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh index 72ce92b964..572613ecd4 100644 --- a/meta/recipes-core/initrdscripts/files/init-install.sh +++ b/meta/recipes-core/initrdscripts/files/init-install.sh @@ -21,6 +21,8 @@ live_dev_name=${live_dev_name#\/dev/} case $live_dev_name in mmcblk*) ;; + nvme*) + ;; *) live_dev_name=${live_dev_name%%[0-9]*} ;; @@ -28,7 +30,13 @@ esac echo "Searching for hard drives ..." -for device in `ls /sys/block/`; do +# 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 +mmc_devices=`ls /sys/block/ | grep "mmcblk[0-9]\{1,\}$"` || true +devices="$devices $mmc_devices" + +for device in $devices; do case $device in loop*) # skip loop device @@ -118,8 +126,8 @@ if [ ! -b /dev/loop0 ] ; then fi mkdir -p /tmp -if [ ! -L /etc/mtab ]; then - cat /proc/mounts > /etc/mtab +if [ ! -L /etc/mtab ] && [ -e /proc/mounts ]; then + ln -sf /proc/mounts /etc/mtab fi disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") @@ -147,11 +155,17 @@ swap_start=$((rootfs_end)) # 2) they are detected asynchronously (need rootwait) rootwait="" part_prefix="" -if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then +if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \ + [ ! "${device#/dev/nvme}" = "${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 + if [ $grub_version -eq 0 ] ; then bios_boot='' bootfs=${device}${part_prefix}1 |
