Skip to content

Commit 7df0b86

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: [email protected] Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Janne Grunau <[email protected]>
1 parent 1b0e698 commit 7df0b86

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/Makefile.package

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ 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+
# Prepend INSTALL_MOD_PATH inside the staging dir
199+
$(Q)$(MAKE) -f $(srctree)/Makefile INSTALL_MOD_PATH=$@/$(INSTALL_MOD_PATH) modules_install
199200

200201
quiet_cmd_cpio = CPIO $@
201202
cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $<
@@ -265,6 +266,7 @@ help:
265266
@echo ' tarxz-pkg - Build the kernel as a xz compressed tarball'
266267
@echo ' tarzst-pkg - Build the kernel as a zstd compressed tarball'
267268
@echo ' modules-cpio-pkg - Build the kernel modules as cpio archive'
269+
@echo ' (uses INSTALL_MOD_PATH inside the archive)'
268270
@echo ' perf-tar-src-pkg - Build the perf source tarball with no compression'
269271
@echo ' perf-targz-src-pkg - Build the perf source tarball with gzip compression'
270272
@echo ' perf-tarbz2-src-pkg - Build the perf source tarball with bz2 compression'

0 commit comments

Comments
 (0)