[PATCH openbmc v6 13/18] initfs: update: add --help message

Andrew Jeffery andrew at aj.id.au
Thu Jun 23 15:49:58 AEST 2016


On Wed, 2016-06-22 at 19:30 -0500, OpenBMC Patches wrote:
> From: Milton Miller <miltonm at us.ibm.com>
> 
> Now that update is intended for use at runtime and not just by
> the init and shutdown scripts, add a short help message listing
> the options so people don't have to understand how to read shell.
> 
> Signed-off-by: Milton Miller <miltonm at us.ibm.com>
> ---
>  .../obmc-phosphor-initfs/files/obmc-update.sh        | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> 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 06e0e74..1dbf65f 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
> @@ -103,6 +103,24 @@ E="ERROR:"
>  while test "$1" != "${1#-}"
>  do
>  	case "$1" in
> +	--help)
> +		cat <
> +Usage: $0 [options] -- Write images in /run/initramfs to flash (/dev/mtd*)
> +    --help                    Show this message
> +    --no-flash	              Don't attempt to write images to flash

Looks like a tab snuck in and is messing up the alignment

> +    --ignore-size             Don't compare image size to mtd device size
> +    --ignore-mount            Don't check if destination is mounted

Maybe it is worth adding some words about --ignore-mount also setting
--no-flash?

> +    --save-files              Copy whitelisted files to save directory in RAM
> +    --no-save-files           Don't copy whitelisted files to save directory
> +    --copy-files              Copy files from save directory to rwfs mountpoint
> +    --restore-files           Restore files from save directory to rwfs layer
> +    --no-restore-files        Don't restore saved files from ram to rwfs layer
> +    --clean-saved-files       Delete saved whitelisted files from RAM
> +    --no-clean-saved-files    Retain saved whitelisted files in RAM

Hmm, I think we need more words about how copy and restore are
different - I've forgotten and the documentation isn't making it clear
to me.

Cheers,

Andrew

> +HERE

> +
> +	    exit 0 ;;
> +
>  	--no-clean-saved-files)
>  		doclean=
>  		shift ;;
> @@ -135,7 +153,7 @@ do
>  		toram=y
>  		shift ;;
>  	*)
> -		echo 1>&2 "$E Unknown option $1"
> +		echo 1>&2 "$E Unknown option $1.  Try $0 --help."
>  		exit 1 ;;
>  	esac
>  done
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20160623/a696afb7/attachment.sig>


More information about the openbmc mailing list