Skip to content

Commit 2df7342

Browse files
committed
kbuild: modules-cpio-pkg: Respect INSTALL_MOD_PATH
The modules-cpio-pkg target added in commit 2a9c8c0 ("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: 2a9c8c0 ("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>
1 parent 0fdfffb commit 2df7342

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/Makefile.package

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ tar%-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar.% FORCE
195195
.tmp_modules_cpio: FORCE
196196
$(Q)$(MAKE) -f $(srctree)/Makefile
197197
$(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
199199

200200
quiet_cmd_cpio = CPIO $@
201201
cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $<
@@ -265,6 +265,7 @@ help:
265265
@echo ' tarxz-pkg - Build the kernel as a xz compressed tarball'
266266
@echo ' tarzst-pkg - Build the kernel as a zstd compressed tarball'
267267
@echo ' modules-cpio-pkg - Build the kernel modules as cpio archive'
268+
@echo ' (uses INSTALL_MOD_PATH inside the archive)'
268269
@echo ' perf-tar-src-pkg - Build the perf source tarball with no compression'
269270
@echo ' perf-targz-src-pkg - Build the perf source tarball with gzip compression'
270271
@echo ' perf-tarbz2-src-pkg - Build the perf source tarball with bz2 compression'

0 commit comments

Comments
 (0)