[Toybox] [PATCH] cpio: fixes for Android kernel build.

Rob Landley rob at landley.net
Wed Aug 19 16:08:17 PDT 2020



On 8/19/20 4:51 PM, enh via Toybox wrote:
> Allow -pd to work by changing -p from an option that takes an
> argument to an option that implies there will be an argument (that
> is, `-pd x` is `-p -d x` with x being the directory for -p, rather
> than `-p d x` with d being the directory, as we previously interpreted
> it).
> 
> Fix -d (aka --make-directories) to not be a no-op. Previously we
> acted as if this was always on.
> 
> Accept --quiet and effectively just ignore it, since toybox cpio
> doesn't seem to produce any output that --quiet would suppress.

$ echo yank | cpio out -pd
cpio: You must specify one of -oipt options.
Try `cpio --help' or `cpio --usage' for more information.

It's not position independent, it uses Unix System 6 parsing logic like
"tar cvfC file dir" does. Your fix doesn't make the semantics match, it works
around a specific bug.

Where's this bug? It's not in the vanilla linux as of yesterday?

$ find . -name 'Makefile*' | xargs grep -w cpio | grep -v cpio- | grep -v '[.]cpio'
./usr/Makefile:# For other cases, generate the initramfs cpio archive based on
the contents
$ grep -rw cpio scripts
scripts/package/mkdebian:Build-Depends: bc, rsync, kmod, cpio, bison, flex |
flex:native $extra_build_depends

Rob


More information about the Toybox mailing list