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 2/7] obmc-initfs: look for images in /run/initramfs/image-
Date: Mon, 8 Feb 2016 11:25:54 -0500	[thread overview]
Message-ID: <5F7D89AD-A56B-4AC3-B20A-81038EA239AB@fuzziesquirrel.com> (raw)
In-Reply-To: <1454803221-12014-3-git-send-email-openbmc-patches@stwcx.xyz>

Reviewed-by: Brad Bishop <brad@bwbmail.net>

> On Feb 6, 2016, at 7:00 PM, OpenBMC Patches <openbmc-patches@stwcx.xyz> wrote:
> 
> From: Milton Miller <miltonm@us.ibm.com>
> 
> Teach update to look for /run/initramfs/image- not /image-*.
> 
> When describing how to recover from a corrupted flash by grabbing
> the images and running update from the init debug shell, it
> became aparent that while at systemd shutdown /run/initramfs/
> is mounted at /, it is not the case during init.  Use variable
> image to hold this pathname.
> 
> Signed-off-by: Milton Miller <miltonm@us.ibm.com>
> ---
> .../obmc-phosphor-initfs/files/obmc-shutdown.sh              |  7 ++++---
> .../obmc-phosphor-initfs/files/obmc-update.sh                | 12 ++++++------
> 2 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
> index c550e06..d530265 100644
> --- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
> +++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-shutdown.sh
> @@ -25,13 +25,14 @@ do
> done
> set +x
> 
> -if test -s /run/fw_env -a -c /run/mtd:u-boot-env -a ! -e /image-u-boot-env &&
> +image=/run/initramfs/image-
> +if test -s /run/fw_env -a -c /run/mtd:u-boot-env -a ! -e ${image}u-boot-env &&
> 	! cmp /run/mtd:u-boot-env /run/fw_env
> then
> -	ln -sn /run/fw_env /image-u-boot-env
> +	ln -sn /run/fw_env ${image}u-boot-env
> fi
> 
> -if test -x /update && ls /image-* > /dev/null 2>&1
> +if test -x /update && ls $image* > /dev/null 2>&1
> then
> 	exec /update ${1+"$@"}
> fi
> diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
> index 1122e83..f83b1ad 100755
> --- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
> +++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
> @@ -61,10 +61,10 @@ then
> 	umount rw
> fi
> 
> -
> -for f in image-*
> +image=/run/initramfs/image-
> +for f in $image*
> do
> -	m=$(findmtd ${f#image-})
> +	m=$(findmtd ${f#$image})
> 	if test -z "$m"
> 	then
> 		echo 1>&2  "Unable to find mtd partiton for $f"
> @@ -72,10 +72,10 @@ do
> 	fi
> done
> 
> -for f in image-*
> +for f in $image*
> do
> -	m=$(findmtd ${f#image-})
> -	echo "Updating ${f#image-}"
> +	m=$(findmtd ${f#$image})
> +	echo "Updating ${f#$image}..."
> 	# flasheraseall /dev/$m && dd if=$f of=/dev/$m
> 	flashcp -v $f /dev/$m
> done
> -- 
> 2.6.4
> 
> 
> _______________________________________________
> openbmc mailing list
> openbmc@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc

  reply	other threads:[~2016-02-08 16:33 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 [this message]
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
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 2/7] obmc-initfs: look for images in /run/initramfs/image- 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=5F7D89AD-A56B-4AC3-B20A-81038EA239AB@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.