]> code.ossystems Code Review - openembedded-core.git/commitdiff
initrdscripts/init-install*: Select install target instead of looping through
authorCalifornia Sullivan <california.l.sullivan@intel.com>
Wed, 13 Jul 2016 00:41:58 +0000 (17:41 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 21 Jul 2016 06:45:01 +0000 (07:45 +0100)
Its not immediately apparent that more than one install target could be
available. With this change we list the available devices up front then
prompt the user for which one to use, reducing confusion.

Fixes [YOCTO #9919].

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initrdscripts/files/init-install-efi.sh
meta/recipes-core/initrdscripts/files/init-install.sh

index d58826a240993ef20341b551658ae27f128b956f..f564f4e2d6ae2bf0dcb354f67a63dea30e6948a4 100644 (file)
@@ -78,17 +78,23 @@ for hdname in $hdnamelist; do
         cat /sys/block/$hdname/device/uevent
     fi
     echo
-    # Get user choice
-    while true; do
-        echo -n "Do you want to install this image there? [y/n] "
-        read answer
-        if [ "$answer" = "y" -o "$answer" = "n" ]; then
+done
+
+# Get user choice
+while true; do
+    echo "Please select an install target or press n to exit ($hdnamelist ): "
+    read answer
+    if [ "$answer" = "n" ]; then
+        echo "Installation manually aborted."
+        exit 1
+    fi
+    for hdname in $hdnamelist; do
+        if [ "$answer" = "$hdname" ]; then
+            TARGET_DEVICE_NAME=$answer
             break
         fi
-        echo "Please answer y or n"
     done
-    if [ "$answer" = "y" ]; then
-        TARGET_DEVICE_NAME=$hdname
+    if [ -n "$TARGET_DEVICE_NAME" ]; then
         break
     fi
 done
index c5623eeb26724846500de7b95332d5da52c0af7f..72ce92b9640baae5ad969d6df85f7f5374d4111e 100644 (file)
@@ -72,17 +72,23 @@ for hdname in $hdnamelist; do
         cat /sys/block/$hdname/device/uevent
     fi
     echo
-    # Get user choice
-    while true; do
-        echo -n "Do you want to install this image there? [y/n] "
-        read answer
-        if [ "$answer" = "y" -o "$answer" = "n" ]; then
+done
+
+# Get user choice
+while true; do
+    echo "Please select an install target or press n to exit ($hdnamelist ): "
+    read answer
+    if [ "$answer" = "n" ]; then
+        echo "Installation manually aborted."
+        exit 1
+    fi
+    for hdname in $hdnamelist; do
+        if [ "$answer" = "$hdname" ]; then
+            TARGET_DEVICE_NAME=$answer
             break
         fi
-        echo "Please answer y or n"
     done
-    if [ "$answer" = "y" ]; then
-        TARGET_DEVICE_NAME=$hdname
+    if [ -n "$TARGET_DEVICE_NAME" ]; then
         break
     fi
 done