IMHO, if the system has to fatal() here, something VERY wrong is going on.<div><br></div><div>This isn't your general debug option, this is a last-resort emergency rescue. I suppose that if you need to debug this, the system is so problematic you need to deep-dive into it anyway.</div>
<div><br></div><div>I suggest taking it as it is now, and fill in a bugzilla entry about handling it better in initramfs-framework as it should be.</div><div><br></div><div>Alex</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Dec 17, 2012 at 7:06 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="HOEnZb"><div class="h5"><br>
<br>
On 12/17/2012 04:55 AM, Alex DAMIAN wrote:<br>
> From: Alexandru DAMIAN <<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>><br>
><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>
> 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 | 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>
</div></div>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>
<div class="HOEnZb"><div class="h5"><br>
> + fi<br>
> + C=$(( C + 1 ))<br>
> + fi<br>
> sleep 1<br>
> done<br>
><br>
><br>
<br>
--<br>
</div></div><span class="HOEnZb"><font color="#888888">Darren Hart<br>
Intel Open Source Technology Center<br>
Yocto Project - Technical Lead - Linux Kernel<br>
</font></span></blockquote></div><br></div>