On Tue, Jul 10, 2018 at 3:48 AM Michael Olbrich <[email protected]> wrote: > > On Sat, Jul 07, 2018 at 03:22:37AM -0400, [email protected] 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 > > <[email protected]>") > > + @$(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 [email protected]
