summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorAwais Belal <awais_belal@mentor.com>2015-07-07 12:43:37 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-16 15:09:19 +0100
commit525ba4ce29d4220b9a726d42295946df139aebe7 (patch)
treedf3ec60d38d5387baf686caaf9d1cf46f1870fc0 /meta/recipes-core/initrdscripts
parentca869fdb5cbf16ec0dd775664dcd906beb024d30 (diff)
downloadpoky-525ba4ce29d4220b9a726d42295946df139aebe7.tar.gz
initrdscripts: handle mmc device as installer medium
Platforms which have the capability of using the MMC as an installer medium will present the same MMC device as an installation candidate. This happens because the MMC devices appear as mmcblk<X> and the current script strips up the <X> which is needed to identify an MMC device uniqely. This patch now updates the way device identifier stripping is done and handles the exclusion of installer device from installation candidates more generically. (From OE-Core rev: 80ec9f62791575de4948d7635dc6674abfac2193) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi.sh20
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh20
2 files changed, 32 insertions, 8 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 14939acd69..f339b30ebe 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -18,7 +18,14 @@ swap_ratio=5
18hdnamelist="" 18hdnamelist=""
19live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'` 19live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
20live_dev_name=${live_dev_name#\/dev/} 20live_dev_name=${live_dev_name#\/dev/}
21live_dev_name=${live_dev_name%%[0-9]*} 21# Only strip the digit identifier if the device is not an mmc
22case $live_dev_name in
23 mmcblk*)
24 ;;
25 *)
26 live_dev_name=${live_dev_name%%[0-9]*}
27 ;;
28esac
22 29
23echo "Searching for hard drives ..." 30echo "Searching for hard drives ..."
24 31
@@ -36,9 +43,14 @@ for device in `ls /sys/block/`; do
36 *) 43 *)
37 # skip the device LiveOS is on 44 # skip the device LiveOS is on
38 # Add valid hard drive name to the list 45 # Add valid hard drive name to the list
39 if [ $device != $live_dev_name -a -e /dev/$device ]; then 46 case $device in
40 hdnamelist="$hdnamelist $device" 47 $live_dev_name*)
41 fi 48 # skip the device we are running from
49 ;;
50 *)
51 hdnamelist="$hdnamelist $device"
52 ;;
53 esac
42 ;; 54 ;;
43 esac 55 esac
44done 56done
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 7fccddea03..f9e9768e43 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -17,7 +17,14 @@ swap_ratio=5
17hdnamelist="" 17hdnamelist=""
18live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'` 18live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
19live_dev_name=${live_dev_name#\/dev/} 19live_dev_name=${live_dev_name#\/dev/}
20live_dev_name=${live_dev_name%%[0-9]*} 20# Only strip the digit identifier if the device is not an mmc
21case $live_dev_name in
22 mmcblk*)
23 ;;
24 *)
25 live_dev_name=${live_dev_name%%[0-9]*}
26 ;;
27esac
21 28
22echo "Searching for hard drives ..." 29echo "Searching for hard drives ..."
23 30
@@ -35,9 +42,14 @@ for device in `ls /sys/block/`; do
35 *) 42 *)
36 # skip the device LiveOS is on 43 # skip the device LiveOS is on
37 # Add valid hard drive name to the list 44 # Add valid hard drive name to the list
38 if [ $device != $live_dev_name -a -e /dev/$device ]; then 45 case $device in
39 hdnamelist="$hdnamelist $device" 46 $live_dev_name*)
40 fi 47 # skip the device we are running from
48 ;;
49 *)
50 hdnamelist="$hdnamelist $device"
51 ;;
52 esac
41 ;; 53 ;;
42 esac 54 esac
43done 55done