Skip to content

Commit 9135564

Browse files
ddissnathanchance
authored andcommitted
gen_initramfs.sh: use gen_init_cpio -o parameter
gen_init_cpio can now write to a file directly, so use it when gen_initramfs.sh is called with -o (e.g. usr/Makefile invocation). Signed-off-by: David Disseldorp <ddiss@suse.de> Reviewed-by: Nicolas Schier <nsc@kernel.org> Link: https://lore.kernel.org/r/20250819032607.28727-6-ddiss@suse.de Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 348ff9e commit 9135564

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

usr/gen_initramfs.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ root_gid=0
193193
dep_list=
194194
timestamp=
195195
cpio_list=$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)
196-
output="/dev/stdout"
196+
# gen_init_cpio writes to stdout by default
197+
output=""
197198

198199
trap "rm -f $cpio_list" EXIT
199200

@@ -207,7 +208,7 @@ while [ $# -gt 0 ]; do
207208
shift
208209
;;
209210
"-o") # generate cpio image named $1
210-
output="$1"
211+
output="-o $1"
211212
shift
212213
;;
213214
"-u") # map $1 to uid=0 (root)
@@ -246,4 +247,4 @@ done
246247

247248
# If output_file is set we will generate cpio archive
248249
# we are careful to delete tmp files
249-
usr/gen_init_cpio $timestamp $cpio_list > $output
250+
usr/gen_init_cpio $output $timestamp $cpio_list

0 commit comments

Comments
 (0)