Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: modules-cpio-pkg: Respect INSTALL_MOD_PATH

The modules-cpio-pkg target added in commit 2a9c8c0b59d3 ("kbuild: add
target to build a cpio containing modules") is incompatible with
initramfs with merged /lib and /usr/lib directories [1]. "/lib" cannot
be a link and directory at the same time.
Respect a non-empty INSTALL_MOD_PATH in the modules-cpio-pkg target so
that `make INSTALL_MOD_PATH=/usr modules-cpio-pkg` results in the same
module install location as `make INSTALL_MOD_PATH=/usr modules_install`.

Tested with Fedora distribution initramfs produced by dracut.

Link: https://systemd.io/THE_CASE_FOR_THE_USR_MERGE/ [1]
Fixes: 2a9c8c0b59d3 ("kbuild: add target to build a cpio containing modules")
Cc: stable@vger.kernel.org
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Tested-by: Nicolas Schier <nsc@kernel.org>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://patch.msgid.link/20260327-kbuild-modules-cpio-pkg-usr-merge-v3-1-ef507dfa006c@jannau.net
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

authored by

Janne Grunau and committed by
Nathan Chancellor
742de64b 7aaa8047

+2 -1
+2 -1
scripts/Makefile.package
··· 195 195 .tmp_modules_cpio: FORCE 196 196 $(Q)$(MAKE) -f $(srctree)/Makefile 197 197 $(Q)rm -rf $@ 198 - $(Q)$(MAKE) -f $(srctree)/Makefile INSTALL_MOD_PATH=$@ modules_install 198 + $(Q)$(MAKE) -f $(srctree)/Makefile INSTALL_MOD_PATH=$@/$(INSTALL_MOD_PATH) modules_install 199 199 200 200 quiet_cmd_cpio = CPIO $@ 201 201 cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $< ··· 264 264 @echo ' tarxz-pkg - Build the kernel as a xz compressed tarball' 265 265 @echo ' tarzst-pkg - Build the kernel as a zstd compressed tarball' 266 266 @echo ' modules-cpio-pkg - Build the kernel modules as cpio archive' 267 + @echo ' (uses INSTALL_MOD_PATH inside the archive)' 267 268 @echo ' perf-tar-src-pkg - Build the perf source tarball with no compression' 268 269 @echo ' perf-targz-src-pkg - Build the perf source tarball with gzip compression' 269 270 @echo ' perf-tarbz2-src-pkg - Build the perf source tarball with bz2 compression'