Ok, I&#39;ll add the print. And re-submit.<div><br></div><div>Alex</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 17, 2012 at 9:50 PM, Darren Hart <span dir="ltr">&lt;<a href="mailto:dvhart@linux.intel.com" target="_blank">dvhart@linux.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"><div class="im"><br>
<br>
On 12/17/2012 11:21 AM, Damian, Alexandru wrote:<br>
&gt; IMHO, if the system has to fatal() here, something VERY wrong is going on.<br>
&gt;<br>
&gt; This isn&#39;t your general debug option, this is a last-resort emergency<br>
&gt; rescue. I suppose that if you need to debug this, the system is so<br>
&gt; problematic you need to deep-dive into it anyway.<br>
&gt;<br>
&gt; I suggest taking it as it is now, and fill in a bugzilla entry about<br>
&gt; handling it better in initramfs-framework as it should be.<br>
&gt;<br>
<br>
</div>I mentioned the below because it is something I&#39;ve had to verify on<br>
several occasions. It is a fairly simple add, and you have the print<br>
statement there anyway. If you choose to skip the extra output, I<br>
suppose I can send a patch to add it next time I run into it.<br>
<br>
--<br>
Darren<br>
<div class="im"><br>
&gt; Alex<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Dec 17, 2012 at 7:06 PM, Darren Hart &lt;<a href="mailto:dvhart@linux.intel.com">dvhart@linux.intel.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:dvhart@linux.intel.com">dvhart@linux.intel.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     On 12/17/2012 04:55 AM, Alex DAMIAN wrote:<br>
</div>&gt;     &gt; From: Alexandru DAMIAN &lt;<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a> &lt;mailto:<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>&gt;&gt;<br>
<div class="im">&gt;     &gt;<br>
&gt;     &gt; Adds &quot;debugshell&quot; command line parameter for live/install images.<br>
&gt;     &gt;<br>
&gt;     &gt; If the init live fails to find and mount a root-fs image,<br>
&gt;     &gt; dumps to a shell after timeout so that the developer can figure<br>
&gt;     &gt; what&#39;s wrong.<br>
&gt;     &gt;<br>
&gt;     &gt; Timeout defaults to 30 seconds, but it can be changed as param<br>
&gt;     &gt; argument.<br>
&gt;     &gt;<br>
&gt;     &gt; Prior art in Ubuntu. Also, leaving a system stale isn&#39;t good form.<br>
&gt;     &gt;<br>
</div>&gt;     &gt; Signed-off-by: Alexandru DAMIAN &lt;<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a> &lt;mailto:<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>&gt;&gt;<br>

<div class="HOEnZb"><div class="h5">&gt;     &gt; ---<br>
&gt;     &gt;  meta/recipes-core/initrdscripts/files/init-live.sh |   18 +++++++++++++++++-<br>
&gt;     &gt;  1 file changed, 17 insertions(+), 1 deletion(-)<br>
&gt;     &gt;<br>
&gt;     &gt; diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh<br>
&gt;     &gt; index c591f0d..d99a8ea 100644<br>
&gt;     &gt; --- a/meta/recipes-core/initrdscripts/files/init-live.sh<br>
&gt;     &gt; +++ b/meta/recipes-core/initrdscripts/files/init-live.sh<br>
&gt;     &gt; @@ -45,7 +45,13 @@ read_args() {<br>
&gt;     &gt;                      console_params=$arg<br>
&gt;     &gt;                  else<br>
&gt;     &gt;                      console_params=&quot;$console_params $arg&quot;<br>
&gt;     &gt; -                fi<br>
&gt;     &gt; +                fi ;;<br>
&gt;     &gt; +            debugshell*)<br>
&gt;     &gt; +                if [ -z &quot;$optarg&quot; ]; then<br>
&gt;     &gt; +                        shelltimeout=30<br>
&gt;     &gt; +                else<br>
&gt;     &gt; +                        shelltimeout=$optarg<br>
&gt;     &gt; +                fi<br>
&gt;     &gt;          esac<br>
&gt;     &gt;      done<br>
&gt;     &gt;  }<br>
&gt;     &gt; @@ -75,6 +81,7 @@ early_setup<br>
&gt;     &gt;  read_args<br>
&gt;     &gt;<br>
&gt;     &gt;  echo &quot;Waiting for removable media...&quot;<br>
&gt;     &gt; +C=0<br>
&gt;     &gt;  while true<br>
&gt;     &gt;  do<br>
&gt;     &gt;    for i in `ls /media 2&gt;/dev/null`; do<br>
&gt;     &gt; @@ -90,6 +97,15 @@ do<br>
&gt;     &gt;    if [ &quot;$found&quot; = &quot;yes&quot; ]; then<br>
&gt;     &gt;        break;<br>
&gt;     &gt;    fi<br>
&gt;     &gt; +  # don&#39;t wait for more than $shelltimeout seconds, if it&#39;s set<br>
&gt;     &gt; +  if [ -n &quot;$shelltimeout&quot; ]; then<br>
&gt;     &gt; +      echo -n &quot; &quot; $(( $shelltimeout - $C ))<br>
&gt;     &gt; +      if [ $C -ge $shelltimeout ]; then<br>
&gt;     &gt; +           echo &quot;...&quot;<br>
&gt;     &gt; +           fatal &quot;Cannot find root image on media, dropping to shell &quot;<br>
&gt;<br>
&gt;     I&#39;d recommend being explicity about what it is looking for when<br>
&gt;     debugshell is used. Which devices where probed, what was the file it<br>
&gt;     looked for. Save the developer from having to find this script in the<br>
&gt;     repository and look it up.<br>
&gt;<br>
&gt;     --<br>
&gt;     Darren<br>
&gt;<br>
&gt;     &gt; +      fi<br>
&gt;     &gt; +      C=$(( C + 1 ))<br>
&gt;     &gt; +  fi<br>
&gt;     &gt;    sleep 1<br>
&gt;     &gt;  done<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;<br>
&gt;     --<br>
&gt;     Darren Hart<br>
&gt;     Intel Open Source Technology Center<br>
&gt;     Yocto Project - Technical Lead - Linux Kernel<br>
&gt;<br>
&gt;<br>
<br>
--<br>
Darren Hart<br>
Intel Open Source Technology Center<br>
Yocto Project - Technical Lead - Linux Kernel<br>
</div></div></blockquote></div><br></div>