lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e358027d-a996-404f-b043-62b9c1b4d06c@pengutronix.de>
Date: Tue, 25 Nov 2025 13:07:20 +0100
From: Ahmad Fatoum <a.fatoum@...gutronix.de>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: Nathan Chancellor <nathan@...nel.org>,
 Nicolas Schier <nicolas.schier@...ux.dev>, Simon Glass <sjg@...omium.org>,
 kernel@...gutronix.de, linux-kernel@...r.kernel.org,
 linux-kbuild@...r.kernel.org, Sascha Hauer <s.hauer@...gutronix.de>
Subject: Re: [PATCH] kbuild: add target to build a cpio containing modules

Hello Thomas,

On 11/20/25 8:32 AM, Thomas Weißschuh wrote:
>> diff --git a/scripts/Makefile.package b/scripts/Makefile.package
>> index 74bcb9e7f7a4516473481468a0fcf700c3bead33..20eec9e2dec4dda3fa0ef64a15b80dccdcb55f90 100644
>> --- a/scripts/Makefile.package
>> +++ b/scripts/Makefile.package
>> @@ -189,6 +189,22 @@ tar-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar
>>  tar%-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar.% FORCE
>>  	@:
> 
> The other package targets have a separator and documentation comment.

Ack.

>> +modules-install: FORCE
>> +	$(Q)$(MAKE) -f $(srctree)/Makefile
>> +	$(Q)rm -rf $@
> 
> We have the filename prefix ".tmp_" for temporary files and directories.
> These will be automatically ignored by git and cleaned up by "make clean".

The commit originally followed what the tar target did, but it seems
doing it like perf is the better template. Will adapt.

>> +quiet_cmd_cpio = CPIO    $@
>> +      cmd_cpio = $(srctree)/usr/gen_initramfs.sh $< > $@
> 
> Use $(CONFIG_SHELL).

Can do. Is this to allow users to override CONFIG_SHELL from outside?
If so, why not go one step further and remove shebangs from scripts
altogether to enforce that they are called with a $(VARIABLE) that can
be overridden?

> Using '-o' instead of redirecting stdout to the output file should enable the
> usage of the recent copy_file_range() optimizations in gen_init_cpio.

Will give it a try, thanks.

>> +modules-$(KERNELRELEASE)-$(ARCH).cpio: modules-install
>> +	$(Q)$(MAKE) -f $(srctree)/Makefile $(build)=usr cpio-data= usr/gen_init_cpio
> 
> Drop the explicit '-f'; $(build) overwrites it.

Indeed, will drop.

> Is the cpio-data= intended to make sure the line 'hostprogs := gen_init_cpio'
> is executed? I don't think this works as usr/Makefile will overwrite 'cpio-data'
> in any case. But it should be fine to make hostprogs definition unconditional.

Will add a commit making hostprogs := gen_init_cpio unconditional.
The current approach worked though, because specifying the variable on
the command line overrides cpio-data := assignments even if there are
multiple.

Thanks,
Ahmad

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ