<br><br><div class="gmail_quote">On Tue, Nov 13, 2012 at 7:12 PM, Radu Moisan <span dir="ltr">&lt;<a href="mailto:radu.moisan@intel.com" target="_blank">radu.moisan@intel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Allows you to use as root a partition instead of the rootfs.img<br>
for recovering an old install, and fails safe when no rootfs is<br>
found, dropping the user to a shell if something goes wrong.<br>
<br>
Signed-off-by: Radu Moisan &lt;<a href="mailto:radu.moisan@intel.com">radu.moisan@intel.com</a>&gt;<br>
Signed-off-by: Alexandru Damian &lt;<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>&gt;<br>
---<br>
 meta/recipes-core/initrdscripts/files/init-live.sh |   44 +++++++++++++++++++-<br>
 1 file changed, 42 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh<br>
index 5682fd1..81686b9 100644<br>
--- a/meta/recipes-core/initrdscripts/files/init-live.sh<br>
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh<br>
@@ -68,13 +68,49 @@ fatal() {<br>
<br>
 early_setup<br>
<br>
+# wait for the udevd to settle<br>
+echo &quot;Waiting for udev to settle...&quot;<br>
+udevadm settle --timeout=3<br></blockquote><div><br></div><div>I think if we take a timeout it needs to be about 10s or 20s. I have some slow machines that take way more time then 3s.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

 [ -z &quot;$CONSOLE&quot; ] &amp;&amp; CONSOLE=&quot;/dev/console&quot;<br>
<br>
 read_args<br>
<br>
-echo &quot;Waiting for removable media...&quot;<br>
-while true<br>
+# boot partiton menu, if one or more bootable partitions exist<br>
+BOOTMENU=`ls /media/sd*/sbin/init 2&gt;/dev/null | wc -l`<br>
+if [ $BOOTMENU -gt 0 ]; then<br>
+   choice=0<br>
+   while [ $choice -le 0 ]; do<br>
+       echo &quot;1). boot live ramfs image&quot;<br>
+       count=2<br>
+       for i in `ls /media/sd*/sbin/init 2&gt;/dev/null | cut -d &quot;/&quot; -f 3`; do<br>
+           echo $count&quot;). boot /dev/&quot;$i<br>
+           choicecmd[$count]=$i<br>
+           count=$(( count + 1))<br>
+       done<br>
+       echo<br>
+       echo -n &quot;Your choice: &quot;<br>
+       read choice<br>
+   done<br>
+<br>
+   if [ $choice -gt 1 ]; then<br>
+       #ROOT_MOUNT=/media/${choicecmd[${choice}]}<br>
+       ROOT_MOUNT=none #testing<br>
+       echo &quot;Booting local root ... $ROOT_MOUNT&quot;<br>
+       if [ -d $ROOT_MOUNT ]; then<br>
+           boot_live_root<br>
+       else<br>
+           fatal &quot;Rootfs partition not mounted&quot;<br>
+       fi<br>
+   fi<br>
+fi<br>
+<br>
+echo -n &quot;Waiting for removable media... &quot;<br>
+CNT=0<br>
+while [ $CNT -le 3 ];<br>
 do<br>
+  echo -n &quot;$CNT &quot;<br>
+  CNT=$(( $CNT + 1 ))<br>
   for i in `ls /media 2&gt;/dev/null`; do<br>
       if [ -f /media/$i/$ROOT_IMAGE ] ; then<br>
                found=&quot;yes&quot;<br>
@@ -91,6 +127,10 @@ do<br>
   sleep 1<br>
 done<br>
<br>
+if [ &quot;$found&quot; != &quot;yes&quot; ]; then<br>
+   fatal &quot;...could not mount removable media, drop to shell&quot;<br>
+fi<br>
+<br>
 case $label in<br>
     boot)<br>
        mkdir $ROOT_MOUNT<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Otavio Salvador                             O.S. Systems<br>E-mail: <a href="mailto:otavio@ossystems.com.br" target="_blank">otavio@ossystems.com.br</a>  <a href="http://www.ossystems.com.br" target="_blank">http://www.ossystems.com.br</a><br>
Mobile: +55 53 9981-7854              <a href="http://projetos.ossystems.com.br" target="_blank">http://projetos.ossystems.com.br</a><br><br>