Ok, I'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"><<a href="mailto:dvhart@linux.intel.com" target="_blank">dvhart@linux.intel.com</a>></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>
> IMHO, if the system has to fatal() here, something VERY wrong is going on.<br>
><br>
> This isn't your general debug option, this is a last-resort emergency<br>
> rescue. I suppose that if you need to debug this, the system is so<br>
> problematic you need to deep-dive into it anyway.<br>
><br>
> I suggest taking it as it is now, and fill in a bugzilla entry about<br>
> handling it better in initramfs-framework as it should be.<br>
><br>
<br>
</div>I mentioned the below because it is something I'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>
> Alex<br>
><br>
><br>
> On Mon, Dec 17, 2012 at 7:06 PM, Darren Hart <<a href="mailto:dvhart@linux.intel.com">dvhart@linux.intel.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:dvhart@linux.intel.com">dvhart@linux.intel.com</a>>> wrote:<br>
><br>
><br>
><br>
> On 12/17/2012 04:55 AM, Alex DAMIAN wrote:<br>
</div>> > From: Alexandru DAMIAN <<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a> <mailto:<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>>><br>
<div class="im">> ><br>
> > Adds "debugshell" command line parameter for live/install images.<br>
> ><br>
> > If the init live fails to find and mount a root-fs image,<br>
> > dumps to a shell after timeout so that the developer can figure<br>
> > what's wrong.<br>
> ><br>
> > Timeout defaults to 30 seconds, but it can be changed as param<br>
> > argument.<br>
> ><br>
> > Prior art in Ubuntu. Also, leaving a system stale isn't good form.<br>
> ><br>
</div>> > Signed-off-by: Alexandru DAMIAN <<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a> <mailto:<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>>><br>
<div class="HOEnZb"><div class="h5">> > ---<br>
> > meta/recipes-core/initrdscripts/files/init-live.sh | 18 +++++++++++++++++-<br>
> > 1 file changed, 17 insertions(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh<br>
> > index c591f0d..d99a8ea 100644<br>
> > --- a/meta/recipes-core/initrdscripts/files/init-live.sh<br>
> > +++ b/meta/recipes-core/initrdscripts/files/init-live.sh<br>
> > @@ -45,7 +45,13 @@ read_args() {<br>
> > console_params=$arg<br>
> > else<br>
> > console_params="$console_params $arg"<br>
> > - fi<br>
> > + fi ;;<br>
> > + debugshell*)<br>
> > + if [ -z "$optarg" ]; then<br>
> > + shelltimeout=30<br>
> > + else<br>
> > + shelltimeout=$optarg<br>
> > + fi<br>
> > esac<br>
> > done<br>
> > }<br>
> > @@ -75,6 +81,7 @@ early_setup<br>
> > read_args<br>
> ><br>
> > echo "Waiting for removable media..."<br>
> > +C=0<br>
> > while true<br>
> > do<br>
> > for i in `ls /media 2>/dev/null`; do<br>
> > @@ -90,6 +97,15 @@ do<br>
> > if [ "$found" = "yes" ]; then<br>
> > break;<br>
> > fi<br>
> > + # don't wait for more than $shelltimeout seconds, if it's set<br>
> > + if [ -n "$shelltimeout" ]; then<br>
> > + echo -n " " $(( $shelltimeout - $C ))<br>
> > + if [ $C -ge $shelltimeout ]; then<br>
> > + echo "..."<br>
> > + fatal "Cannot find root image on media, dropping to shell "<br>
><br>
> I'd recommend being explicity about what it is looking for when<br>
> debugshell is used. Which devices where probed, what was the file it<br>
> looked for. Save the developer from having to find this script in the<br>
> repository and look it up.<br>
><br>
> --<br>
> Darren<br>
><br>
> > + fi<br>
> > + C=$(( C + 1 ))<br>
> > + fi<br>
> > sleep 1<br>
> > done<br>
> ><br>
> ><br>
><br>
> --<br>
> Darren Hart<br>
> Intel Open Source Technology Center<br>
> Yocto Project - Technical Lead - Linux Kernel<br>
><br>
><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>