From: Darren Hart <dvhart@linux.intel.com>
To: "Damian, Alexandru" <alexandru.damian@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>,
otavio@ossystems.com.br,
Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v2] init-live: default to initrd shell if image isn't found
Date: Mon, 17 Dec 2012 11:50:20 -0800 [thread overview]
Message-ID: <50CF777C.8030705@linux.intel.com> (raw)
In-Reply-To: <CAJ2CSBt1amQV=Mvkmp=vXaxQbYOFewMiYw-pnm31xv28aqWN=g@mail.gmail.com>
On 12/17/2012 11:21 AM, Damian, Alexandru wrote:
> IMHO, if the system has to fatal() here, something VERY wrong is going on.
>
> 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.
>
> 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.
>
I mentioned the below because it is something I've had to verify on
several occasions. It is a fairly simple add, and you have the print
statement there anyway. If you choose to skip the extra output, I
suppose I can send a patch to add it next time I run into it.
--
Darren
> Alex
>
>
> On Mon, Dec 17, 2012 at 7:06 PM, Darren Hart <dvhart@linux.intel.com
> <mailto:dvhart@linux.intel.com>> wrote:
>
>
>
> On 12/17/2012 04:55 AM, Alex DAMIAN wrote:
> > From: Alexandru DAMIAN <alexandru.damian@intel.com <mailto:alexandru.damian@intel.com>>
> >
> > Adds "debugshell" command line parameter for live/install images.
> >
> > If the init live fails to find and mount a root-fs image,
> > dumps to a shell after timeout so that the developer can figure
> > what's wrong.
> >
> > Timeout defaults to 30 seconds, but it can be changed as param
> > argument.
> >
> > Prior art in Ubuntu. Also, leaving a system stale isn't good form.
> >
> > Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com <mailto:alexandru.damian@intel.com>>
> > ---
> > meta/recipes-core/initrdscripts/files/init-live.sh | 18 +++++++++++++++++-
> > 1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
> > index c591f0d..d99a8ea 100644
> > --- a/meta/recipes-core/initrdscripts/files/init-live.sh
> > +++ b/meta/recipes-core/initrdscripts/files/init-live.sh
> > @@ -45,7 +45,13 @@ read_args() {
> > console_params=$arg
> > else
> > console_params="$console_params $arg"
> > - fi
> > + fi ;;
> > + debugshell*)
> > + if [ -z "$optarg" ]; then
> > + shelltimeout=30
> > + else
> > + shelltimeout=$optarg
> > + fi
> > esac
> > done
> > }
> > @@ -75,6 +81,7 @@ early_setup
> > read_args
> >
> > echo "Waiting for removable media..."
> > +C=0
> > while true
> > do
> > for i in `ls /media 2>/dev/null`; do
> > @@ -90,6 +97,15 @@ do
> > if [ "$found" = "yes" ]; then
> > break;
> > fi
> > + # don't wait for more than $shelltimeout seconds, if it's set
> > + if [ -n "$shelltimeout" ]; then
> > + echo -n " " $(( $shelltimeout - $C ))
> > + if [ $C -ge $shelltimeout ]; then
> > + echo "..."
> > + fatal "Cannot find root image on media, dropping to shell "
>
> I'd recommend being explicity about what it is looking for when
> debugshell is used. Which devices where probed, what was the file it
> looked for. Save the developer from having to find this script in the
> repository and look it up.
>
> --
> Darren
>
> > + fi
> > + C=$(( C + 1 ))
> > + fi
> > sleep 1
> > done
> >
> >
>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Technical Lead - Linux Kernel
>
>
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel
next prev parent reply other threads:[~2012-12-17 20:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 11:29 [PATCH] init-live: default to initrd shell if image isn't found Alex DAMIAN
2012-12-17 12:04 ` Burton, Ross
2012-12-17 12:09 ` Otavio Salvador
2012-12-17 12:14 ` Burton, Ross
2012-12-17 12:55 ` [PATCH v2] " Alex DAMIAN
2012-12-17 17:06 ` Darren Hart
2012-12-17 17:09 ` Otavio Salvador
2012-12-17 17:12 ` Burton, Ross
2012-12-17 17:20 ` Otavio Salvador
2012-12-17 19:21 ` Damian, Alexandru
2012-12-17 19:50 ` Darren Hart [this message]
2012-12-18 8:53 ` Damian, Alexandru
2012-12-18 12:38 ` [PATCH v3] " Alex DAMIAN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50CF777C.8030705@linux.intel.com \
--to=dvhart@linux.intel.com \
--cc=alexandru.damian@intel.com \
--cc=damien.lespiau@intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=otavio@ossystems.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox