aboutsummaryrefslogtreecommitdiffstats
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:50:03 +0000
commit6f99e530822ac32f32615590e22a9758ac210e84 (patch)
tree5ea4103e5e94d0d2b66396cfda85acd95f7e0861 /meta/recipes-core/initrdscripts
parenta19592b684d482a7c011495f1c761f38c316319a (diff)
downloadopenembedded-core-6f99e530822ac32f32615590e22a9758ac210e84.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. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
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() {
console_params=$arg
else
console_params="$console_params $arg"
- fi
+ fi ;;
+ debugshell*)
+ if [ -z "$optarg" ]; then
+ shelltimeout=30
+ else
+ shelltimeout=$optarg
+ fi
esac
done
}
@@ -75,6 +81,7 @@ early_setup
read_args
echo "Waiting for removable media..."
+C=0
while true
do
for i in `ls /media 2>/dev/null`; do
@@ -90,6 +97,19 @@ do
if [ "$found" = "yes" ]; then
break;
fi
+ # don't wait for more than $shelltimeout seconds, if it's set
+ if [ -n "$shelltimeout" ]; then
+ echo -n " " $(( $shelltimeout - $C ))
+ if [ $C -ge $shelltimeout ]; then
+ echo "..."
+ echo "Mounted filesystems"
+ mount | grep media
+ echo "Available block devices"
+ ls /dev/sd*
+ fatal "Cannot find rootfs.img file in /media/* , dropping to a shell "
+ fi
+ C=$(( C + 1 ))
+ fi
sleep 1
done