Re: [PATCH v3 2/2] kbuild: Move gen_init_cpio and gen_initramfs.sh to scripts/
From: sashiko-bot
Date: Fri Sep 25 2026 - 15:39:06 EST
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] selftests/liveupdate: vmtest.sh mkinitrd fails due to missing gen_init_cpio
- [Low] kbuild: stale comment in gen_initramfs.sh assumes old usr/ location
--
commit 97c7fb8e47f1b247f157846cfecd29ff5f239ed1
Author: Nicolas Schier <nsc@xxxxxxxxxx>
kbuild: Move gen_init_cpio and gen_initramfs.sh to scripts/
gen_init_cpio and gen_initramfs.sh are part of kbuild and required for
all kernel builds w/ CONFIG_BLK_DEV_INITRD. Move both to scripts/ to be
more clear about their importance.
Link: https://lore.kernel.org/all/aSdrCFkUQup3qb-q@xxxxxxxxxxxxxxxx/
> diff --git a/tools/testing/selftests/kho/vmtest.sh b/tools/testing/selftests/kho/vmtest.sh
> index 0014bd76e88de..1e86ffcc3a79e 100755
> --- a/tools/testing/selftests/kho/vmtest.sh
> +++ b/tools/testing/selftests/kho/vmtest.sh
> @@ -100,7 +100,7 @@ file /init $tmp_dir/init 0755 0 0
> file /kernel $kernel 0644 0 0
> EOF
>
> - "$build_dir/usr/gen_init_cpio" "$tmp_dir/cpio_list" > "$initrd"
> + "$build_dir/scripts/gen_init_cpio" "$tmp_dir/cpio_list" > "$initrd"
> }
[Severity: Medium]
The path for the kho selftest was updated, but it looks like
tools/testing/selftests/liveupdate/vmtest.sh also still calls the old path.
For example, in its mkinitrd():
# Generate inner_initrd.cpio
"$build_dir/usr/gen_init_cpio" "$workspace_dir/cpio_list_inner" > "$workspace_dir/inner_initrd.cpio"
and again later in the same function:
# Generate the final initrd
"$build_dir/usr/gen_init_cpio" "$workspace_dir/cpio_list" > "$initrd"
Since this patch ensures the old artifact is removed via
scripts/remove-stale-files, will the liveupdate selftest unconditionally
fail because it cannot find gen_init_cpio?
Should liveupdate/vmtest.sh be updated to use scripts/gen_init_cpio as well?
> diff --git a/usr/gen_initramfs.sh b/scripts/gen_initramfs.sh
> similarity index 99%
> rename from usr/gen_initramfs.sh
> rename to scripts/gen_initramfs.sh
> index 7eba2fddf0ef2..27ac1fd48001a 100755
> --- a/usr/gen_initramfs.sh
> +++ b/scripts/gen_initramfs.sh
> @@ -247,4 +247,4 @@ done
>
> # If output_file is set we will generate cpio archive
> # we are careful to delete tmp files
> -usr/gen_init_cpio $output $timestamp $cpio_list
> +scripts/gen_init_cpio $output $timestamp $cpio_list
[Severity: Low]
Is the script header comment now out of date?
At the top of the renamed scripts/gen_initramfs.sh it still states:
# Generate a cpio packed initramfs. It uses gen_init_cpio to generate
# the cpio archive.
# This script assumes that gen_init_cpio is located in usr/ directory
Should this comment be updated to reflect the new scripts/ location?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260925-move-gen_init_cpio-to-scripts-v3-1-99c493f76722@xxxxxxxxxx?part=2