mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: Nathan Chancellor <nathan@kernel.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Askar Safin <safinaskar@gmail.com>
Subject: Re: [PATCH 2/2] kbuild: Move gen_init_cpio and gen_initramfs.sh to scripts/
Date: Tue, 10 Mar 2026 08:14:36 +0100	[thread overview]
Message-ID: <aa_E3J-iRjUO4ToP@derry.ads.avm.de> (raw)
In-Reply-To: <20260309142528-9ad96828-4f07-4cc4-81d6-5aa9b4e9d599@linutronix.de>

On Mon, Mar 09, 2026 at 02:41:53PM +0100, Thomas Weißschuh wrote:
> On Mon, Mar 09, 2026 at 08:56:30AM +0100, Nicolas Schier wrote:
> > get_init_cpio and gen_initramfs.sh are part of kbuild and required for
> 
> "gen_init_cpio"

thanks!

> > all kernel builds.  Move it to scripts/ to be more clear about their
> > importance.
> 
> As far as I can see, gen_init_cpio is currently only built and used if
> CONFIG_BLK_DEV_INITRD is enabled. So "required for all kernel builds"
> sounds wrong.
> 
> This on-demand build can probably be preserved like this:
> 
> hostprogs += gen_init_cpio
> always-$(CONFIG_BLK_DEV_INITRD) += gen_init_cpio

Ack, thanks!  I'll take your suggestion.

...
> > diff --git a/Makefile b/Makefile
> > index 0e788ce45457..7798863002ac 100644
> > --- a/Makefile
> > +++ b/Makefile
...
> > @@ -1437,9 +1437,9 @@ ifdef CONFIG_HEADERS_INSTALL
> >  prepare: headers
> >  endif
> >  
> > -PHONY += usr_gen_init_cpio
> > -usr_gen_init_cpio: scripts_basic
> > -	$(Q)$(MAKE) $(build)=usr usr/gen_init_cpio
> > +PHONY += scripts/gen_init_cpio
> > +scripts/gen_init_cpio: scripts_basic
> > +	$(Q)$(MAKE) $(build)=scripts scripts/gen_init_cpio
> 
> The other proxy targets for scripts/ use the 'scripts_' prefix.
> Why is this one different?

Good question; I was ambiguous about that, but I chose 'scripts/' in
favor of 'scripts_' as

1. The $(obj)/initramfs_data.cpio target in usr/Makefile has to depend
   on 'scripts/gen_init_cpio' regardless of how the top-level target is
   called, as the sub-make cannot depend on a phony top-level rule.
   If possible, I like to have the same name for dependencies as for the
   rule that generates them.

2. I cannot see the reason for the 'scripts_' prefix currently used in
   top-level Makefile for real targets building a single output file.
   It seems to me that commit bdd7714b6f4c ("kbuild: build all
   prerequisites of headers_install simultaneously") introduced the
   'scripts_' prefix due to the historic origin 'scripts_basic'; which
   itself came with commit 952a0ae394f4 ("[PATCH] Fix early parallel
   make failures", v2.6.5) [1].  I _guess_ the 'scripts_' prefix was
   meant to clearly make a difference from the previous 'scripts'
   target, and the name makes clear that it is a phony target building
   several things.

Masahiro, if you are around I'd appreciate a comment from you.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=952a0ae394f4

Thomas, does the reasoning make sense to you?  Or do you expect troubles
due to the 'scripts/' prefix?


Thanks for the feedback!

Kind regards,
Nicolas

  reply	other threads:[~2026-03-10  7:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09  7:56 [PATCH 0/2] Move tool for generating initramfs cpio " Nicolas Schier
2026-03-09  7:56 ` [PATCH 1/2] kbuild: Mark usr_gen_init_cpio as no-dot-config-target Nicolas Schier
2026-03-09  7:56 ` [PATCH 2/2] kbuild: Move gen_init_cpio and gen_initramfs.sh to scripts/ Nicolas Schier
2026-03-09 13:41   ` Thomas Weißschuh
2026-03-10  7:14     ` Nicolas Schier [this message]
2026-03-10  9:13       ` Thomas Weißschuh
2026-03-12 13:59         ` Nicolas Schier
2026-03-10  1:49   ` Askar Safin
2026-03-10  6:24     ` Nicolas Schier
2026-03-22 12:50       ` Askar Safin
2026-03-10  1:54 ` [PATCH 0/2] Move tool for generating initramfs cpio " Askar Safin
2026-03-10  4:30   ` H. Peter Anvin

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=aa_E3J-iRjUO4ToP@derry.ads.avm.de \
    --to=nsc@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=safinaskar@gmail.com \
    --cc=thomas.weissschuh@linutronix.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

all inboxes | Powered by JetHome®