From: David Disseldorp <ddiss@suse.de>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, David Disseldorp <ddiss@suse.de>
Subject: [RFC PATCH 5/5] gen_initramfs.sh: use gen_init_cpio -o parameter
Date: Mon, 4 Aug 2025 07:11:19 +1000 [thread overview]
Message-ID: <20250803212457.2286-6-ddiss@suse.de> (raw)
In-Reply-To: <20250803212457.2286-1-ddiss@suse.de>
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>
---
usr/gen_initramfs.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/usr/gen_initramfs.sh b/usr/gen_initramfs.sh
index 14b5782f961a8..7eba2fddf0ef2 100755
--- a/usr/gen_initramfs.sh
+++ b/usr/gen_initramfs.sh
@@ -193,7 +193,8 @@ root_gid=0
dep_list=
timestamp=
cpio_list=$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)
-output="/dev/stdout"
+# gen_init_cpio writes to stdout by default
+output=""
trap "rm -f $cpio_list" EXIT
@@ -207,7 +208,7 @@ while [ $# -gt 0 ]; do
shift
;;
"-o") # generate cpio image named $1
- output="$1"
+ output="-o $1"
shift
;;
"-u") # map $1 to uid=0 (root)
@@ -246,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 $timestamp $cpio_list > $output
+usr/gen_init_cpio $output $timestamp $cpio_list
--
2.43.0
prev parent reply other threads:[~2025-08-03 21:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-03 21:11 [RFC PATCH 0/5] gen_init_cpio: add copy_file_range support David Disseldorp
2025-08-03 21:11 ` [RFC PATCH 1/5] gen_init_cpio: write to fd instead of stdout stream David Disseldorp
2025-08-03 21:11 ` [RFC PATCH 2/5] gen_init_cpio: support -o <output_path> parameter David Disseldorp
2025-08-03 21:11 ` [RFC PATCH 3/5] gen_init_cpio: attempt copy_file_range for file data David Disseldorp
2025-08-03 21:11 ` [RFC PATCH 4/5] gen_init_cpio: avoid duplicate strlen calls David Disseldorp
2025-08-03 21:11 ` David Disseldorp [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250803212457.2286-6-ddiss@suse.de \
--to=ddiss@suse.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=masahiroy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).