mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option
Date: Tue, 10 Jul 2018 09:29:50 +0200	[thread overview]
Message-ID: <20180710072950.joa2yju3thachsrx@pengutronix.de> (raw)
In-Reply-To: <1530948157-28476-1-git-send-email-jon@ringle.org>

On Sat, Jul 07, 2018 at 03:22:36AM -0400, jon@ringle.org wrote:
> From: Jon Ringle <jringle@gridpoint.com>
> 
> Signed-off-by: Jon Ringle <jringle@gridpoint.com>

Please document this in the image package section in doc/ref_manual.rst.

> ---
>  platforms/image-root-tgz.in            | 11 +++++++++++
>  rules/image-root-tgz.make              |  1 +
>  rules/post/ptxd_make_image_common.make |  3 ++-
>  scripts/lib/ptxd_make_image_archive.sh |  4 ++--
>  scripts/lib/ptxd_make_image_common.sh  |  2 ++
>  5 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/platforms/image-root-tgz.in b/platforms/image-root-tgz.in
> index fce1516..51246f8 100644
> --- a/platforms/image-root-tgz.in
> +++ b/platforms/image-root-tgz.in
> @@ -5,3 +5,14 @@ config IMAGE_ROOT_TGZ
>  	prompt "Generate images/root.tgz"
>  	help
>  	  FIXME
> +
> +if IMAGE_ROOT_TGZ

add an empty line here.

> +config IMAGE_ROOT_TGZ_LABEL
> +	string
> +	prompt "label"
> +	default "${PTXCONF_PROJECT_VENDOR}-${PTXCONF_PROJECT}${PTXCONF_PROJECT_VERSION}"

I'm not sure such a default is a good idea. I've seen some pretty strange
vendor / project strings and I'm not sure how tar will handle those.
I think keeping the default empty is saver here. Maybe put this as an
example in the help text.

> +	help
> +	  This string gets expanded to form the label. An empty string produces no label.

break.

> +
> +endif
> +
> diff --git a/rules/image-root-tgz.make b/rules/image-root-tgz.make
> index c93e8c9..07a8370 100644
> --- a/rules/image-root-tgz.make
> +++ b/rules/image-root-tgz.make
> @@ -20,6 +20,7 @@ IMAGE_ROOT_TGZ		:= image-root-tgz
>  IMAGE_ROOT_TGZ_DIR	:= $(BUILDDIR)/$(IMAGE_ROOT_TGZ)
>  IMAGE_ROOT_TGZ_IMAGE	:= $(IMAGEDIR)/root.tgz
>  IMAGE_ROOT_TGZ_PKGS	= $(PTX_PACKAGES_INSTALL)
> +IMAGE_ROOT_TGZ_LABEL	:= $(call remove_quotes, $(PTXCONF_IMAGE_ROOT_TGZ_LABEL))
>  
>  # ----------------------------------------------------------------------------
>  # Image
> diff --git a/rules/post/ptxd_make_image_common.make b/rules/post/ptxd_make_image_common.make
> index a1a5e78..8aa8c0a 100644
> --- a/rules/post/ptxd_make_image_common.make
> +++ b/rules/post/ptxd_make_image_common.make
> @@ -21,7 +21,8 @@ world/image/env/impl = \
>  	image_env="$(call ptx/escape,$($(1)_ENV))"		\
>  	image_pkgs="$(call ptx/escape,$($(1)_PKGS))"		\
>  	image_files="$(call ptx/escape,$($(1)_FILES))"		\
> -	image_image="$(call ptx/escape,$($(1)_IMAGE))"
> +	image_image="$(call ptx/escape,$($(1)_IMAGE))"		\
> +	image_label="$(call ptx/escape,$($(1)_LABEL))"
>  
>  world/image/env = \
>  	$(call world/image/env/impl,$(strip $(1)))
> diff --git a/scripts/lib/ptxd_make_image_archive.sh b/scripts/lib/ptxd_make_image_archive.sh
> index 650679a..bb43fa2 100644
> --- a/scripts/lib/ptxd_make_image_archive.sh
> +++ b/scripts/lib/ptxd_make_image_archive.sh
> @@ -16,8 +16,8 @@ ptxd_make_image_archive_impl() {
>      ptxd_get_ipkg_files ${image_pkgs} &&
>      ptxd_make_image_extract_xpkg_files "${pkg_dir}" &&
>      cd "${pkg_dir}" &&
> -    echo -e "\nCreating $(ptxd_print_path "${image_image}") ...\n" &&
> -    tar -zcf "${image_image}" . &&
> +    echo -e "\nCreating $(ptxd_print_path "${image_image}") $([ -n "${image_label}" ] && echo "with label \"${image_label}\" ")...\n" &&

just use multiple echos with '-n' and a normal 'if ...'

> +    tar ${image_label_args} -zcf "${image_image}" . &&
>      rm -r "${pkg_dir}"
>  }
>  export -f ptxd_make_image_archive_impl
> diff --git a/scripts/lib/ptxd_make_image_common.sh b/scripts/lib/ptxd_make_image_common.sh
> index 402ff53..4fc8c50 100644
> --- a/scripts/lib/ptxd_make_image_common.sh
> +++ b/scripts/lib/ptxd_make_image_common.sh
> @@ -66,6 +66,8 @@ ptxd_make_image_init() {
>  	image_ipkg_repo_dirs=( "${image_repo_dist_dir}" )
>      fi
>  
> +    [ -n "${image_label}" ] && image_label_args="--label \"${image_label}\""

if [ -n "${image_label}" ]; then
...

and always set the variable to something.

Michael

> +
>      exec 2>&${PTXDIST_FD_LOGERR}
>  }
>  export -f ptxd_make_image_init
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      parent reply	other threads:[~2018-07-10  7:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-07  7:22 jon
2018-07-07  7:22 ` [ptxdist] [PATCH v2] initramfs-tools: Restore package jon
2018-07-10  7:48   ` Michael Olbrich
2018-07-11  4:58     ` Jon Ringle
2018-07-11  7:55       ` Michael Olbrich
2018-07-10  7:29 ` Michael Olbrich [this message]

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=20180710072950.joa2yju3thachsrx@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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