]> code.ossystems Code Review - openembedded-core.git/commitdiff
initrdscripts: make boot drive detection more generic
authorAwais Belal <awais_belal@mentor.com>
Thu, 21 May 2015 14:28:34 +0000 (19:28 +0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 May 2015 06:55:50 +0000 (07:55 +0100)
The init script that invokes install and install-efi scripts
passes the first parameter that identifies the boot drive but
in cases when this disk is labeled and kernel configurations
allow disk labeling under /run/media/ this would pass the disk
label.
The earlier implementation considered that the drive name will
be passed and in case the label is passed it fails and provides
the boot drive as an option for installation driver.
We now use a more generic approach to identify the boot drive
which can handle both drive name as well as label if passed.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/initrdscripts/files/init-install-efi.sh
meta/recipes-core/initrdscripts/files/init-install.sh

index 329586d74d04ed1bf9b14714a4c66535ba4a5d5f..8dd2749b5e98ccf00b564d4db2916dd1393627cd 100644 (file)
@@ -16,7 +16,8 @@ swap_ratio=5
 
 # Get a list of hard drives
 hdnamelist=""
-live_dev_name=${1%%/*}
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
 live_dev_name=${live_dev_name%%[0-9]*}
 
 echo "Searching for hard drives ..."
index fb537ee3108b5f6bc091f754dd6ce429f5fc480a..cb261630d0dc2a6533c35647ef629ac42d0459f7 100644 (file)
@@ -15,7 +15,8 @@ swap_ratio=5
 
 # Get a list of hard drives
 hdnamelist=""
-live_dev_name=${1%%/*}
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
 live_dev_name=${live_dev_name%%[0-9]*}
 
 echo "Searching for hard drives ..."