All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Bishop <bradleyb@fuzziesquirrel.com>
To: OpenBMC Patches <openbmc-patches@stwcx.xyz>
Cc: openbmc@lists.ozlabs.org
Subject: Re: [PATCH openbmc 4/7] obmc-initfs: factor debug and takeover
Date: Mon, 8 Feb 2016 11:58:41 -0500	[thread overview]
Message-ID: <B5DF9697-ED72-4B82-BCE0-FC2051ECC33C@fuzziesquirrel.com> (raw)
In-Reply-To: <1454803221-12014-5-git-send-email-openbmc-patches@stwcx.xyz>


> On Feb 6, 2016, at 7:00 PM, OpenBMC Patches <openbmc-patches@stwcx.xyz> wrote:
> 
> From: Milton Miller <miltonm@us.ibm.com>
> 
> Factor out sulogin and init takeover with a message.  This is mostly
> a refactor and message update with no significant logic flow.  It
> makes the repair opertunity logic consistent.

opportunity

> 
> Signed-off-by: Milton Miller <miltonm@us.ibm.com>
> ---
> .../obmc-phosphor-initfs/files/obmc-init.sh        | 46 ++++++++++++++++------
> 1 file changed, 35 insertions(+), 11 deletions(-)
> 
> diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
> index 0109925..daa4f5c 100644
> --- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
> +++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
> @@ -30,6 +30,32 @@ findmtd() {
> 	echo $m
> }
> 
> +debug_takeover() {
> +	echo "$@"
> +	test -n "$@" && echo Enter password to try to manually fix.
> +	cat << HERE
> +After fixing run exit to continue this script, or reboot -f to retry, or
> +touch /takeover and exit to become PID 1 allowing editing of this script.
> +HERE
> +
> +	while ! sulogin && ! test -f /takeover
> +	do
> +		echo getty failed, retrying
> +	done
> +
> +	# Touch /takeover in the above getty to become pid 1
> +	if test -e /takeover
> +	then
> +		cat << HERE
> +Takeover of init requested.  Executing /bin/sh as PID 1.
> +When finished exec new init or cleanup and run reboot -f.
> +Warning: No job control!  Shell exit will panic the system!
> +HERE
> +		export PS1=init#\ 
> +		exec /bin/sh
> +	fi
> +}
> +
> env=$(findmtd u-boot-env)
> if test -n $env
> then
> @@ -52,21 +78,19 @@ init=/sbin/init
> 
> echo rofs = $rofs $rofst   rwfs = $rwfs $rwfst
> 
> -if grep -w debug-init-sh /proc/cmdline ||
> -	! mount $rwdev $rwdir -t $rwfst -o $rwopts
> +if grep -w debug-init-sh /proc/cmdline
> then
> -	echo Please mount the rw file system on $rwdir from this shell
> -	while ! sulogin && ! test -f /takeover
> -	do
> -		echo getty failed, retrying
> -	done
> +	debug_takeover "Debug initial shell requested by command line."
> fi
> 
> -# Touch /takeover in the above getty to become pid 1
> -if test -e /takeover
> +if ! mount $rwdev $rwdir -t $rwfst -o $rwopts
> then
> -	export PS1=init#\ 
> -	exec /bin/sh
> +	msg="$(cat)" << HERE
> +Mounting read-write $rwdev filesystem failed.  Please fix and run
> +	mount $rwdev $rwdir -t $rwfs -o $rwopts
> +to to continue, or do change nothing to run from RAM for this boot.
> +HERE
> +	debug_takeover "$msg"
> fi
> 
> mount $rodev $rodir -t $rofst -o $roopts
> -- 
> 2.6.4
> 
> 
> _______________________________________________
> openbmc mailing list
> openbmc@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc

  reply	other threads:[~2016-02-08 16:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-07  0:00 [PATCH openbmc 0/7] initfs: check and auto-repair read/write file system OpenBMC Patches
2016-02-07  0:00 ` [PATCH openbmc 1/7] obmc-initfs: minor updates OpenBMC Patches
2016-02-08 16:25   ` Brad Bishop
2016-02-09  0:55   ` Andrew Jeffery
2016-02-07  0:00 ` [PATCH openbmc 2/7] obmc-initfs: look for images in /run/initramfs/image- OpenBMC Patches
2016-02-08 16:25   ` Brad Bishop
2016-02-07  0:00 ` [PATCH openbmc 3/7] obmc-initfs: use varables for paths and mount arguments OpenBMC Patches
2016-02-08 16:37   ` Brad Bishop
2016-02-09  0:46   ` Andrew Jeffery
2016-02-07  0:00 ` [PATCH openbmc 4/7] obmc-initfs: factor debug and takeover OpenBMC Patches
2016-02-08 16:58   ` Brad Bishop [this message]
2016-02-07  0:00 ` [PATCH openbmc 5/7] obmc-initfs: run fsck on read/write file system OpenBMC Patches
2016-02-08 17:03   ` Brad Bishop
2016-02-07  0:00 ` [PATCH openbmc 6/7] obmc-initfs: run update as a sub-script OpenBMC Patches
2016-02-08 17:05   ` Brad Bishop
2016-02-07  0:00 ` [PATCH openbmc 7/7] obmc-initfs: shutdown when rofs is a loop mounted image in /run OpenBMC Patches
2016-02-08 17:07   ` Brad Bishop
  -- strict thread matches above, loose matches on Subject: below --
2016-02-06  0:20 [PATCH openbmc 0/7] initfs: check and auto-repair read/write file system OpenBMC Patches
2016-02-06  0:20 ` [PATCH openbmc 4/7] obmc-initfs: factor debug and takeover OpenBMC Patches

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=B5DF9697-ED72-4B82-BCE0-FC2051ECC33C@fuzziesquirrel.com \
    --to=bradleyb@fuzziesquirrel.com \
    --cc=openbmc-patches@stwcx.xyz \
    --cc=openbmc@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.