From: Jon Ringle <jon@ringle.org>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH v2] initramfs-tools: Restore package
Date: Wed, 11 Jul 2018 00:58:44 -0400 [thread overview]
Message-ID: <CAMwGMjz=y_L15O4r5ikyHqjLz2Y25EVwy1YPVbwUfrWx_H7mEw@mail.gmail.com> (raw)
In-Reply-To: <20180710074829.65emkwxylubggjct@pengutronix.de>
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
next prev parent reply other threads:[~2018-07-11 4:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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='CAMwGMjz=y_L15O4r5ikyHqjLz2Y25EVwy1YPVbwUfrWx_H7mEw@mail.gmail.com' \
--to=jon@ringle.org \
--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