Re: [PATCH v3] kbuild: modules-cpio-pkg: Respect INSTALL_MOD_PATH

From: Nicolas Schier

Date: Fri Mar 27 2026 - 15:13:37 EST


On Fri, Mar 27, 2026 at 09:30:29AM +0100, Janne Grunau wrote:
> 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@xxxxxxxxxxxxxxx
> Reviewed-by: Simon Glass <sjg@xxxxxxxxxxxx>
> Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> Reviewed-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
> Signed-off-by: Janne Grunau <j@xxxxxxxxxx>
> ---
> Hej,
>
> this patch allows to produce modules-cpio initramfs which are compatible
> with initramfs with merged /lib and /usr/lib (/lib as symlink to
> /usr/lib). I expect initramfs of distributions with merged /usr to have
> a merged /usr as well. This is at least true for Fedora initramfs built
> with dracut.
>
> Janne
> ---
> Changes in v3:
> - Drop comment added in v2, change is straight forward after dropping
> the repeated slash prevention
> - collect Thomas' and Nathan's Rb:
> - Link to v2: https://lore.kernel.org/r/20260325-kbuild-modules-cpio-pkg-usr-merge-v2-1-339ac87d82ea@xxxxxxxxxx
>

Thanks!

Reviewed-by: Nicolas Schier <nsc@xxxxxxxxxx>
Tested-by: Nicolas Schier <nsc@xxxxxxxxxx>

--
Nicolas