Unverified Commit f8e05c10 authored by Nicolas Schier's avatar Nicolas Schier Committed by Nathan Chancellor
Browse files

kbuild: Add top-level target for building gen_init_cpio



Add a top-level target for building gen_init_cpio to prevent re-entering
kbuild for 'modules-cpio-pkg'.

The recently introduced target 'modules-cpio-pkg' depends on
gen_init_cpio but there is no simple way to add this dependency as a
prerequisite that can be built in parallel to other recipes.

Introducing the top-level target, enables fixing this and also prepares
a possible move of gen_init_cpio from usr/ to scripts/.

Signed-off-by: default avatarNicolas Schier <nsc@kernel.org>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20251128-kbuild-add-top-level-target-for-building-gen_init_cpio-v1-1-84c63a8fc8d4@kernel.org


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
parent 18e2d526
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1417,6 +1417,10 @@ 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_unifdef
scripts_unifdef: scripts_basic
	$(Q)$(MAKE) $(build)=scripts scripts/unifdef
@@ -1669,6 +1673,8 @@ distclean: mrproper
# Packaging of the kernel to various formats
# ---------------------------------------------------------------------------

modules-cpio-pkg: usr_gen_init_cpio

%src-pkg: FORCE
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
%pkg: include/config/kernel.release FORCE
+0 −1
Original line number Diff line number Diff line
@@ -201,7 +201,6 @@ quiet_cmd_cpio = CPIO $@
      cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $<

modules-$(KERNELRELEASE)-$(ARCH).cpio: .tmp_modules_cpio
	$(Q)$(MAKE) $(build)=usr usr/gen_init_cpio
	$(call cmd,cpio)

PHONY += modules-cpio-pkg