Re: [PATCH v5 4/8] scripts/make_fit: Provide a way to add built modules
From: Simon Glass <sjg@chromium.org>
Date: 2025-11-17 18:07:05
Also in:
lkml
Hi Ahmad, On Sat, 15 Nov 2025 at 07:39, Ahmad Fatoum [off-list ref] wrote:
Hello Simon, On 14.11.25 15:27, Simon Glass wrote:quoted
Provide arguments to support building a ramdisk from a directory tree of modules. This is a convenient way to try out a kernel with its modules. This makes use of the cpio tool rather than attempting to use a python module or our own code. The list of modules is provided in a file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nicolas Schier <nsc@kernel.org> Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>Thanks for taking up the suggestion! I just Cc'd you on a patch that generates a CPIO with the modules directly as a make target. I'd prefer going down that route instead as to reuse as much existing code as possible. Maybe this even covers Thomas' use case from the other thread?
From my testing, FIT_MODULES=1 this seems to require that modules_install be done first. But my existing approach builds a FIT without needing to do the install step. Just adding the dependency, like this: image.fit: $(if $(FIT_MODULES),cpio-modules-pkg) results in: time ARCH=arm64 CROSS_COMPILE=/home/sglass/.buildman-toolchains/gcc-13.1.0-nolibc/aarch64-linux/bin/aarch64-linux- make O=/tmp/kern -j30 image.fit FIT_MODULES=1 -s fixdep: error opening file: init/.main.o.d: No such file or directory make[4]: *** [/scratch/sglass/linux/scripts/Makefile.build:287: init/main.o] Error 2 make[4]: *** Deleting file 'init/main.o' make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/scratch/sglass/linux/scripts/Makefile.build:556: init] Error 2 make[3]: *** Waiting for unfinished jobs.... /home/sglass/.buildman-toolchains/gcc-13.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ar: init/main.o: No such file or directory make[6]: *** [/scratch/sglass/linux/scripts/Makefile.build:473: init/built-in.a] Error 123 make[5]: *** [/scratch/sglass/linux/scripts/Makefile.build:556: init] Error 2 make[4]: *** [/scratch/sglass/linux/Makefile:2017: .] Error 2 make[3]: *** [/scratch/sglass/linux/scripts/Makefile.package:193: modules-install] Error 2 make[2]: *** [/scratch/sglass/linux/Makefile:1647: cpio-modules-pkg] Error 2 make[2]: *** Waiting for unfinished jobs.... Makefile has the ability to sequence things, but in this case we are effectively adding a target within the Makefile. What do you suggest? [..] Regards, Simon