* [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option @ 2018-07-07 7:22 jon 2018-07-07 7:22 ` [ptxdist] [PATCH v2] initramfs-tools: Restore package jon 2018-07-10 7:29 ` [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option Michael Olbrich 0 siblings, 2 replies; 6+ messages in thread From: jon @ 2018-07-07 7:22 UTC (permalink / raw) To: ptxdist; +Cc: Jon Ringle From: Jon Ringle <jringle@gridpoint.com> Signed-off-by: Jon Ringle <jringle@gridpoint.com> --- 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 +config IMAGE_ROOT_TGZ_LABEL + string + prompt "label" + default "${PTXCONF_PROJECT_VENDOR}-${PTXCONF_PROJECT}${PTXCONF_PROJECT_VERSION}" + help + This string gets expanded to form the label. An empty string produces no label. + +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" && + 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}\"" + exec 2>&${PTXDIST_FD_LOGERR} } export -f ptxd_make_image_init -- 1.9.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* [ptxdist] [PATCH v2] initramfs-tools: Restore package 2018-07-07 7:22 [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option jon @ 2018-07-07 7:22 ` jon 2018-07-10 7:48 ` Michael Olbrich 2018-07-10 7:29 ` [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option Michael Olbrich 1 sibling, 1 reply; 6+ messages in thread From: jon @ 2018-07-07 7:22 UTC (permalink / raw) To: ptxdist; +Cc: Jon Ringle From: Jon Ringle <jringle@gridpoint.com> This was removed in 4e8ea1703cad595f3136f0d48ae93de73a180c40 However, initramfs-tools is still being used to install scripts provided by this package. Signed-off-by: Jon Ringle <jringle@gridpoint.com> --- rules/initmethod.in | 5 +++ rules/initramfs-tools.in | 30 ++++++++++++++ rules/initramfs-tools.make | 97 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 rules/initramfs-tools.in create mode 100644 rules/initramfs-tools.make diff --git a/rules/initmethod.in b/rules/initmethod.in index c1ef054..b8c0b9f 100644 --- a/rules/initmethod.in +++ b/rules/initmethod.in @@ -26,6 +26,11 @@ choice select SYSTEMD prompt "systemd " + config INITMETHOD_INITRAMFS + bool + select INITRAMFS_TOOLS + prompt "initramfs init " + endchoice source "generated/initmethod.in" diff --git a/rules/initramfs-tools.in b/rules/initramfs-tools.in new file mode 100644 index 0000000..010b876 --- /dev/null +++ b/rules/initramfs-tools.in @@ -0,0 +1,30 @@ +## SECTION=initmethod + +if INITMETHOD_INITRAMFS || ALLYES + +menuconfig INITRAMFS_TOOLS + bool + prompt "initramfs-tools " + help + Install initramfs skeleton framework + +if INITRAMFS_TOOLS + +config INITRAMFS_TOOLS_SCRIPTS_INIT + bool "install /scripts/init " + help + FIXME + +config INITRAMFS_TOOLS_SCRIPTS_LOCAL + bool "install /scripts/local " + help + FIXME + +config INITRAMFS_TOOLS_SCRIPTS_NFS + bool "install /scripts/nfs " + help + FIXME + +endif + +endif diff --git a/rules/initramfs-tools.make b/rules/initramfs-tools.make new file mode 100644 index 0000000..987333e --- /dev/null +++ b/rules/initramfs-tools.make @@ -0,0 +1,97 @@ +# -*-makefile-*- +# +# Copyright (C) 2009 by Jon Ringle <jon@ringle.org> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_INITRAMFS_TOOLS) += initramfs-tools + +# +# Paths and names +# +INITRAMFS_TOOLS_VERSION := 0.130 +INITRAMFS_TOOLS_MD5 := f219c0277766104005419ee35151c5d4 +INITRAMFS_TOOLS_SUFFIX := tar.gz +INITRAMFS_TOOLS := initramfs-tools-v$(INITRAMFS_TOOLS_VERSION) +INITRAMFS_TOOLS_TARBALL := $(INITRAMFS_TOOLS).$(INITRAMFS_TOOLS_SUFFIX) +INITRAMFS_TOOLS_URL := https://salsa.debian.org/kernel-team/initramfs-tools/-/archive/v$(INITRAMFS_TOOLS_VERSION)/$(INITRAMFS_TOOLS_TARBALL) +INITRAMFS_TOOLS_SOURCE := $(SRCDIR)/$(INITRAMFS_TOOLS_TARBALL) +INITRAMFS_TOOLS_DIR := $(BUILDDIR)/$(INITRAMFS_TOOLS) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +$(STATEDIR)/initramfs-tools.prepare: + @$(call targetinfo) + @echo "DPKG_ARCH=$(PTXCONF_ARCH_STRING)" > $(INITRAMFS_TOOLS_DIR)/conf/arch.conf + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/initramfs-tools.compile: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/initramfs-tools.install: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/initramfs-tools.targetinstall: + @$(call targetinfo) + + @$(call install_init, initramfs-tools) + @$(call install_fixup, initramfs-tools,PRIORITY,optional) + @$(call install_fixup, initramfs-tools,SECTION,base) + @$(call install_fixup, initramfs-tools,AUTHOR,"Jon Ringle <jon@ringle.org>") + @$(call install_fixup, initramfs-tools,DESCRIPTION,missing) + + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /init) + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /conf/initramfs.conf) + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /conf/arch.conf) + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/functions) + +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_INIT + @cd $(INITRAMFS_TOOLS_DIR) && \ + find scripts/init-* -type d | while read dir; do \ + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ + done +endif + +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_LOCAL + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/local) + @cd $(INITRAMFS_TOOLS_DIR) && \ + find scripts/local-* -type d | while read dir; do \ + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ + done +endif + +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_NFS + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/nfs) + @cd $(INITRAMFS_TOOLS_DIR) && \ + find scripts/nfs-* -type d | while read dir; do \ + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ + done +endif + + @$(call install_finish, initramfs-tools) + @$(call touch) + +# vim: syntax=make -- 1.9.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH v2] initramfs-tools: Restore package 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 0 siblings, 1 reply; 6+ messages in thread From: Michael Olbrich @ 2018-07-10 7:48 UTC (permalink / raw) To: ptxdist On Sat, Jul 07, 2018 at 03:22:37AM -0400, jon@ringle.org wrote: > From: Jon Ringle <jringle@gridpoint.com> > > This was removed in 4e8ea1703cad595f3136f0d48ae93de73a180c40 > However, initramfs-tools is still being used to install scripts provided by > this package. > > Signed-off-by: Jon Ringle <jringle@gridpoint.com> > --- > rules/initmethod.in | 5 +++ > rules/initramfs-tools.in | 30 ++++++++++++++ > rules/initramfs-tools.make | 97 ++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 132 insertions(+) > create mode 100644 rules/initramfs-tools.in > create mode 100644 rules/initramfs-tools.make > > diff --git a/rules/initmethod.in b/rules/initmethod.in > index c1ef054..b8c0b9f 100644 > --- a/rules/initmethod.in > +++ b/rules/initmethod.in > @@ -26,6 +26,11 @@ choice > select SYSTEMD > prompt "systemd " > > + config INITMETHOD_INITRAMFS > + bool > + select INITRAMFS_TOOLS > + prompt "initramfs init " > + > endchoice > > source "generated/initmethod.in" > diff --git a/rules/initramfs-tools.in b/rules/initramfs-tools.in > new file mode 100644 > index 0000000..010b876 > --- /dev/null > +++ b/rules/initramfs-tools.in > @@ -0,0 +1,30 @@ > +## SECTION=initmethod > + > +if INITMETHOD_INITRAMFS || ALLYES > + > +menuconfig INITRAMFS_TOOLS > + bool > + prompt "initramfs-tools " > + help > + Install initramfs skeleton framework > + > +if INITRAMFS_TOOLS > + > +config INITRAMFS_TOOLS_SCRIPTS_INIT > + bool "install /scripts/init " > + help > + FIXME > + > +config INITRAMFS_TOOLS_SCRIPTS_LOCAL > + bool "install /scripts/local " > + help > + FIXME > + > +config INITRAMFS_TOOLS_SCRIPTS_NFS > + bool "install /scripts/nfs " > + help > + FIXME > + > +endif > + > +endif > diff --git a/rules/initramfs-tools.make b/rules/initramfs-tools.make > new file mode 100644 > index 0000000..987333e > --- /dev/null > +++ b/rules/initramfs-tools.make > @@ -0,0 +1,97 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2009 by Jon Ringle <jon@ringle.org> > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_INITRAMFS_TOOLS) += initramfs-tools > + > +# > +# Paths and names > +# > +INITRAMFS_TOOLS_VERSION := 0.130 > +INITRAMFS_TOOLS_MD5 := f219c0277766104005419ee35151c5d4 > +INITRAMFS_TOOLS_SUFFIX := tar.gz > +INITRAMFS_TOOLS := initramfs-tools-v$(INITRAMFS_TOOLS_VERSION) > +INITRAMFS_TOOLS_TARBALL := $(INITRAMFS_TOOLS).$(INITRAMFS_TOOLS_SUFFIX) > +INITRAMFS_TOOLS_URL := https://salsa.debian.org/kernel-team/initramfs-tools/-/archive/v$(INITRAMFS_TOOLS_VERSION)/$(INITRAMFS_TOOLS_TARBALL) > +INITRAMFS_TOOLS_SOURCE := $(SRCDIR)/$(INITRAMFS_TOOLS_TARBALL) > +INITRAMFS_TOOLS_DIR := $(BUILDDIR)/$(INITRAMFS_TOOLS) > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/initramfs-tools.prepare: > + @$(call targetinfo) > + @echo "DPKG_ARCH=$(PTXCONF_ARCH_STRING)" > $(INITRAMFS_TOOLS_DIR)/conf/arch.conf PTXCONF_ARCH_STRING contains quotes. Either use remove_quotes or don't add the extra quotes. > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Compile > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/initramfs-tools.compile: > + @$(call targetinfo) > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/initramfs-tools.install: > + @$(call targetinfo) > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/initramfs-tools.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, initramfs-tools) > + @$(call install_fixup, initramfs-tools,PRIORITY,optional) > + @$(call install_fixup, initramfs-tools,SECTION,base) > + @$(call install_fixup, initramfs-tools,AUTHOR,"Jon Ringle <jon@ringle.org>") > + @$(call install_fixup, initramfs-tools,DESCRIPTION,missing) > + > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /init) > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /conf/initramfs.conf) > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /conf/arch.conf) > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/functions) > + > +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_INIT > + @cd $(INITRAMFS_TOOLS_DIR) && \ > + find scripts/init-* -type d | while read dir; do \ > + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ > + done > +endif > + > +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_LOCAL > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/local) > + @cd $(INITRAMFS_TOOLS_DIR) && \ > + find scripts/local-* -type d | while read dir; do \ > + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ > + done > +endif > + > +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_NFS > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/nfs) > + @cd $(INITRAMFS_TOOLS_DIR) && \ > + find scripts/nfs-* -type d | while read dir; do \ > + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ > + done > +endif So, I looked a bit more at what happens here. I don't like those find loops. The archive only contains init-top and local-premount so loops don't make sense unless you patch the package. And in that case *alternative* makes no sense. Maybe a options for each of those that contains the subsections and defaults to those that exist in the upstream packacke? "top" for 'init', "premount" for 'local' and "" for nfs? And then: @$(foreach section in $(call remove_quotes,$(PTXCONF_INITRAMFS_TOOLS_SCRIPTS_INIT_SECTIONS)), $(call install_alternative_tree, ... or something like that. This way you can add more subdirectories as needed in the BSP. Or do you add those with extra packages? In that case just explicitly call install_alternative_tree for init-top and local-premount. Michael > + > + @$(call install_finish, initramfs-tools) > + @$(call touch) > + > +# vim: syntax=make > -- > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH v2] initramfs-tools: Restore package 2018-07-10 7:48 ` Michael Olbrich @ 2018-07-11 4:58 ` Jon Ringle 2018-07-11 7:55 ` Michael Olbrich 0 siblings, 1 reply; 6+ messages in thread From: Jon Ringle @ 2018-07-11 4:58 UTC (permalink / raw) To: ptxdist On Tue, Jul 10, 2018 at 3:48 AM Michael Olbrich <m.olbrich@pengutronix.de> wrote: > > On Sat, Jul 07, 2018 at 03:22:37AM -0400, jon@ringle.org wrote: > > +$(STATEDIR)/initramfs-tools.prepare: > > + @$(call targetinfo) > > + @echo "DPKG_ARCH=$(PTXCONF_ARCH_STRING)" > $(INITRAMFS_TOOLS_DIR)/conf/arch.conf > > PTXCONF_ARCH_STRING contains quotes. Either use remove_quotes or don't add > the extra quotes. > Ok. > > +$(STATEDIR)/initramfs-tools.targetinstall: > > + @$(call targetinfo) > > + > > + @$(call install_init, initramfs-tools) > > + @$(call install_fixup, initramfs-tools,PRIORITY,optional) > > + @$(call install_fixup, initramfs-tools,SECTION,base) > > + @$(call install_fixup, initramfs-tools,AUTHOR,"Jon Ringle <jon@ringle.org>") > > + @$(call install_fixup, initramfs-tools,DESCRIPTION,missing) > > + > > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /init) > > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /conf/initramfs.conf) > > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /conf/arch.conf) > > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/functions) > > + > > +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_INIT > > + @cd $(INITRAMFS_TOOLS_DIR) && \ > > + find scripts/init-* -type d | while read dir; do \ > > + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ > > + done > > +endif > > + > > +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_LOCAL > > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/local) > > + @cd $(INITRAMFS_TOOLS_DIR) && \ > > + find scripts/local-* -type d | while read dir; do \ > > + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ > > + done > > +endif > > + > > +ifdef PTXCONF_INITRAMFS_TOOLS_SCRIPTS_NFS > > + @$(call install_alternative, initramfs-tools, 0, 0, 0755, /scripts/nfs) > > + @cd $(INITRAMFS_TOOLS_DIR) && \ > > + find scripts/nfs-* -type d | while read dir; do \ > > + $(call install_alternative_tree, initramfs-tools, 0, 0, /$${dir}$(ptx/nl)); \ > > + done > > +endif > > So, I looked a bit more at what happens here. > > I don't like those find loops. The archive only contains init-top and > local-premount so loops don't make sense unless you patch the package. And > in that case *alternative* makes no sense. > > Maybe a options for each of those that contains the subsections and > defaults to those that exist in the upstream packacke? "top" for 'init', > "premount" for 'local' and "" for nfs? And then: > > @$(foreach section in $(call remove_quotes,$(PTXCONF_INITRAMFS_TOOLS_SCRIPTS_INIT_SECTIONS)), > $(call install_alternative_tree, ... > > or something like that. This way you can add more subdirectories as needed > in the BSP. Or do you add those with extra packages? In that case just > explicitly call install_alternative_tree for init-top and local-premount. If you look into the `init` script and the `scripts/local` and `scripts/nfs` scripts, you'll see that there are predefined hooks where it call `run_scripts ...` with some predetermined directory names. The package only provides some scripts in `scripts/init-top`, and `scripts/local-premount`, but the hooks in the scripts allow for the user to provide scripts in any of these directories: init script calls: run_scripts /scripts/init-top run_scripts /scripts/init-premount mount_top (depending on ${BOOT} value which should be either "local" or "nfs", will call the function of that name in `local` or `nfs` scripts, which will call either: `run_scripts /scripts/local-top` or `run_scripts /scripts/nfs-top`) mount_premount (same logic as mount_top... resolving to either `run_scripts /scripts/local-premount` or `run_scripts /scripts/nfs-premount`) mount_bottom (ditto) mountroot (defined in /scripts/local or /scripts/nfs) In all the following are the possible trees of user defined scripts that could be installed: /scripts/init-top /scripts/init-premount /scripts/init-bottom /scripts/local-top /scripts/local-block /scripts/local-premount /scripts/local-bottom /scripts/nfs-top /scripts/nfs-premount /scripts/nfs-bottom I could just do an $(install_alternative_tree ...) for each of the above? Regards, -Jon _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH v2] initramfs-tools: Restore package 2018-07-11 4:58 ` Jon Ringle @ 2018-07-11 7:55 ` Michael Olbrich 0 siblings, 0 replies; 6+ messages in thread From: Michael Olbrich @ 2018-07-11 7:55 UTC (permalink / raw) To: ptxdist On Wed, Jul 11, 2018 at 12:58:44AM -0400, Jon Ringle wrote: > On Tue, Jul 10, 2018 at 3:48 AM Michael Olbrich > <m.olbrich@pengutronix.de> wrote: > If you look into the `init` script and the `scripts/local` and > `scripts/nfs` scripts, you'll see that there are predefined hooks > where it call `run_scripts ...` with some predetermined directory > names. The package only provides some scripts in `scripts/init-top`, > and `scripts/local-premount`, but the hooks in the scripts allow for > the user to provide scripts in any of these directories: > init script calls: > run_scripts /scripts/init-top > run_scripts /scripts/init-premount > mount_top (depending on ${BOOT} value which should be either "local" > or "nfs", will call the function of that name in `local` or `nfs` > scripts, which will call either: `run_scripts /scripts/local-top` or > `run_scripts /scripts/nfs-top`) > mount_premount (same logic as mount_top... resolving to either > `run_scripts /scripts/local-premount` or `run_scripts > /scripts/nfs-premount`) > mount_bottom (ditto) > mountroot (defined in /scripts/local or /scripts/nfs) > > In all the following are the possible trees of user defined scripts > that could be installed: > /scripts/init-top > /scripts/init-premount > /scripts/init-bottom > /scripts/local-top > /scripts/local-block > /scripts/local-premount > /scripts/local-bottom > /scripts/nfs-top > /scripts/nfs-premount > /scripts/nfs-bottom > > I could just do an $(install_alternative_tree ...) for each of the above? That sounds good. Note, that install_alternative_tree will fail if no source directory is found. So you either need to make them optional or create empty directories. Michael -- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option 2018-07-07 7:22 [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option jon 2018-07-07 7:22 ` [ptxdist] [PATCH v2] initramfs-tools: Restore package jon @ 2018-07-10 7:29 ` Michael Olbrich 1 sibling, 0 replies; 6+ messages in thread From: Michael Olbrich @ 2018-07-10 7:29 UTC (permalink / raw) To: ptxdist 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-07-11 7:55 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-07-07 7:22 [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option 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 ` [ptxdist] [PATCH] image-root-tgz: Add IMAGE_ROOT_TGZ_LABEL option Michael Olbrich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox