<br><br><div class="gmail_quote">On Tue, Nov 13, 2012 at 7:12 PM, Radu Moisan <span dir="ltr"><<a href="mailto:radu.moisan@intel.com" target="_blank">radu.moisan@intel.com</a>></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 <<a href="mailto:radu.moisan@intel.com">radu.moisan@intel.com</a>><br>
Signed-off-by: Alexandru Damian <<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>><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 "Waiting for udev to settle..."<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 "$CONSOLE" ] && CONSOLE="/dev/console"<br>
<br>
read_args<br>
<br>
-echo "Waiting for removable media..."<br>
-while true<br>
+# boot partiton menu, if one or more bootable partitions exist<br>
+BOOTMENU=`ls /media/sd*/sbin/init 2>/dev/null | wc -l`<br>
+if [ $BOOTMENU -gt 0 ]; then<br>
+ choice=0<br>
+ while [ $choice -le 0 ]; do<br>
+ echo "1). boot live ramfs image"<br>
+ count=2<br>
+ for i in `ls /media/sd*/sbin/init 2>/dev/null | cut -d "/" -f 3`; do<br>
+ echo $count"). boot /dev/"$i<br>
+ choicecmd[$count]=$i<br>
+ count=$(( count + 1))<br>
+ done<br>
+ echo<br>
+ echo -n "Your choice: "<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 "Booting local root ... $ROOT_MOUNT"<br>
+ if [ -d $ROOT_MOUNT ]; then<br>
+ boot_live_root<br>
+ else<br>
+ fatal "Rootfs partition not mounted"<br>
+ fi<br>
+ fi<br>
+fi<br>
+<br>
+echo -n "Waiting for removable media... "<br>
+CNT=0<br>
+while [ $CNT -le 3 ];<br>
do<br>
+ echo -n "$CNT "<br>
+ CNT=$(( $CNT + 1 ))<br>
for i in `ls /media 2>/dev/null`; do<br>
if [ -f /media/$i/$ROOT_IMAGE ] ; then<br>
found="yes"<br>
@@ -91,6 +127,10 @@ do<br>
sleep 1<br>
done<br>
<br>
+if [ "$found" != "yes" ]; then<br>
+ fatal "...could not mount removable media, drop to shell"<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>