Re: [RFC PATCH] initramfs: correctly handle space in path on cpio list generation
From: David Disseldorp
Date: Tue Feb 10 2026 - 21:40:51 EST
On Wed, 11 Feb 2026 01:58:27 +0100, Christian Marangi wrote:
> > What happens when someone wants support for filenames containing spaces
> > and quotes?
> >
>
> I mean... it's a less common case where filename start to have almost invalid
> char but yes it's a valid point.
>
> > > I'm open to both solution. Lets just agree on one of the 2.
> >
> > I don't think any of the options will be particularly simple, but
> > nul-byte delimited field support might be the most straightforward.
> >
>
> Yes that was the initial idea but was quickly scrapped as major work is needed
> in the .c tool to handle NULL separated entry.
>
> Can you by chance point to me how the GNU tool work with --null ?
>
>
> They also create a cpio_list file with entry NULL separated?
E.g. dracut uses the GNU cpio --null alongside find -print0:
cd "$initdir"
find . -print0 | sort -z \
| cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null ${cpio_owner:+-R "$cpio_owner"} -H newc -o --quiet \
| $compress >> "${DRACUT_TMPDIR}/initramfs.img"