summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2012-12-18 14:38:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-19 17:55:02 +0000
commited5d870c70671da1ce439d13819d5d3f78fb81a9 (patch)
tree8ed831ee0da844d69f3ba940d1f9ff0924ac021f /meta/recipes-core/initrdscripts
parentccc394e7c6d3405b87fe862e50485f548b735da3 (diff)
downloadpoky-ed5d870c70671da1ce439d13819d5d3f78fb81a9.tar.gz
init-live: default to initrd shell if image isn't found
Adds "debugshell" command line parameter for live/install images. If the init live fails to find and mount a root-fs image, dumps to a shell after timeout so that the developer can figure what's wrong. Timeout defaults to 30 seconds, but it can be changed as param argument. Prior art in Ubuntu. Also, leaving a system stale isn't good form. (From OE-Core rev: 6f99e530822ac32f32615590e22a9758ac210e84) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Saul Wold <sgw@linux.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-live.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index c591f0d386..e8d7f70c2c 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -45,7 +45,13 @@ read_args() {
45 console_params=$arg 45 console_params=$arg
46 else 46 else
47 console_params="$console_params $arg" 47 console_params="$console_params $arg"
48 fi 48 fi ;;
49 debugshell*)
50 if [ -z "$optarg" ]; then
51 shelltimeout=30
52 else
53 shelltimeout=$optarg
54 fi
49 esac 55 esac
50 done 56 done
51} 57}
@@ -75,6 +81,7 @@ early_setup
75read_args 81read_args
76 82
77echo "Waiting for removable media..." 83echo "Waiting for removable media..."
84C=0
78while true 85while true
79do 86do
80 for i in `ls /media 2>/dev/null`; do 87 for i in `ls /media 2>/dev/null`; do
@@ -90,6 +97,19 @@ do
90 if [ "$found" = "yes" ]; then 97 if [ "$found" = "yes" ]; then
91 break; 98 break;
92 fi 99 fi
100 # don't wait for more than $shelltimeout seconds, if it's set
101 if [ -n "$shelltimeout" ]; then
102 echo -n " " $(( $shelltimeout - $C ))
103 if [ $C -ge $shelltimeout ]; then
104 echo "..."
105 echo "Mounted filesystems"
106 mount | grep media
107 echo "Available block devices"
108 ls /dev/sd*
109 fatal "Cannot find rootfs.img file in /media/* , dropping to a shell "
110 fi
111 C=$(( C + 1 ))
112 fi
93 sleep 1 113 sleep 1
94done 114done
95 115