Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] init-live: default to initrd shell if image isn't found
@ 2012-12-17 11:29 Alex DAMIAN
  2012-12-17 12:04 ` Burton, Ross
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Alex DAMIAN @ 2012-12-17 11:29 UTC (permalink / raw)
  To: openembedded-core, ross.burton, damien.lespiau, dvhart,
	radu.moisan, otavio
  Cc: Alexandru DAMIAN

From: Alexandru DAMIAN <alexandru.damian@intel.com>

If the init live fails to find and mount a root-fs image,
we should dump to a shell so that the developer can figure
what's wrong.

Prior art in Ubuntu. Also, leaving a system stale isn't good form.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index c591f0d..2d6d6f6 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -75,6 +75,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 +91,11 @@ do
   if [ "$found" = "yes" ]; then
       break;
   fi
+  # don't wait for more than 3 seconds
+  C=$(( C + 1 ))
+  if [ $C -gt 3 ]; then
+      fatal "Cannot find root image on media"
+  fi
   sleep 1
 done
 
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-12-18 12:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 11:29 [PATCH] init-live: default to initrd shell if image isn't found Alex DAMIAN
2012-12-17 12:04 ` Burton, Ross
2012-12-17 12:09 ` Otavio Salvador
2012-12-17 12:14   ` Burton, Ross
2012-12-17 12:55 ` [PATCH v2] " Alex DAMIAN
2012-12-17 17:06   ` Darren Hart
2012-12-17 17:09     ` Otavio Salvador
2012-12-17 17:12       ` Burton, Ross
2012-12-17 17:20         ` Otavio Salvador
2012-12-17 19:21     ` Damian, Alexandru
2012-12-17 19:50       ` Darren Hart
2012-12-18  8:53         ` Damian, Alexandru
2012-12-18 12:38 ` [PATCH v3] " Alex DAMIAN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox