Re: [PATCH v2 5/7] gen_initramfs.sh: use gen_init_cpio -o parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 14, 2025 at 03:18:03PM +1000, David Disseldorp wrote:
> 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@xxxxxxx>
> ---
>  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

I think it would have been sufficient to replace '> $output' by
'-o $output'.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux