summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorCalifornia Sullivan <california.l.sullivan@intel.com>2016-07-12 17:41:58 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-21 07:47:52 +0100
commit031c2f6ced917a81b4f39dca371773d0275ddf73 (patch)
tree2707945889bec120805761f53713ee1ca8addeb5 /meta/recipes-core/initrdscripts
parent8da54b401d20a69c68153d36d2ad3c5100565051 (diff)
downloadpoky-031c2f6ced917a81b4f39dca371773d0275ddf73.tar.gz
initrdscripts/init-install*: Select install target instead of looping through
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]. (From OE-Core rev: e68774f684543fd75250e56ea88a5e0cb0a2dd0a) 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>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi.sh22
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh22
2 files changed, 28 insertions, 16 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index d58826a240..f564f4e2d6 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -78,17 +78,23 @@ for hdname in $hdnamelist; do
78 cat /sys/block/$hdname/device/uevent 78 cat /sys/block/$hdname/device/uevent
79 fi 79 fi
80 echo 80 echo
81 # Get user choice 81done
82 while true; do 82
83 echo -n "Do you want to install this image there? [y/n] " 83# Get user choice
84 read answer 84while true; do
85 if [ "$answer" = "y" -o "$answer" = "n" ]; then 85 echo "Please select an install target or press n to exit ($hdnamelist ): "
86 read answer
87 if [ "$answer" = "n" ]; then
88 echo "Installation manually aborted."
89 exit 1
90 fi
91 for hdname in $hdnamelist; do
92 if [ "$answer" = "$hdname" ]; then
93 TARGET_DEVICE_NAME=$answer
86 break 94 break
87 fi 95 fi
88 echo "Please answer y or n"
89 done 96 done
90 if [ "$answer" = "y" ]; then 97 if [ -n "$TARGET_DEVICE_NAME" ]; then
91 TARGET_DEVICE_NAME=$hdname
92 break 98 break
93 fi 99 fi
94done 100done
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index c5623eeb26..72ce92b964 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -72,17 +72,23 @@ for hdname in $hdnamelist; do
72 cat /sys/block/$hdname/device/uevent 72 cat /sys/block/$hdname/device/uevent
73 fi 73 fi
74 echo 74 echo
75 # Get user choice 75done
76 while true; do 76
77 echo -n "Do you want to install this image there? [y/n] " 77# Get user choice
78 read answer 78while true; do
79 if [ "$answer" = "y" -o "$answer" = "n" ]; then 79 echo "Please select an install target or press n to exit ($hdnamelist ): "
80 read answer
81 if [ "$answer" = "n" ]; then
82 echo "Installation manually aborted."
83 exit 1
84 fi
85 for hdname in $hdnamelist; do
86 if [ "$answer" = "$hdname" ]; then
87 TARGET_DEVICE_NAME=$answer
80 break 88 break
81 fi 89 fi
82 echo "Please answer y or n"
83 done 90 done
84 if [ "$answer" = "y" ]; then 91 if [ -n "$TARGET_DEVICE_NAME" ]; then
85 TARGET_DEVICE_NAME=$hdname
86 break 92 break
87 fi 93 fi
88done 94done