On Wed, Apr 10, 2019 at 5:09 PM Olof Johansson olof@lixom.net wrote:
As far as format goes; there's clear precedent on cpio being used and supported; we already have build time requirements on the userspace tools with some options. Using tar would actually be a new dependency even if it is a common tool to have installed. With a self-populating FS, there's no new tool requirements on the runtime side either.
The decision between tar and cpio directly follows from whether the headers are uncompressed in kernel space or in user space:
- we use cpio for initramfs because unpacking cpio in C code is fairly simple, while unpacking tar is not (see the wikipedia page on tar). If we were to unpack it from the kernel, the initramfs code could be trivially reused. - nobody sane uses cpio in user space, since tar is already present almost everywhere, while cpio is rather obscure in comparison.
Arnd