I have a Debian rootfs as a tar file. I would like to specify it as the initramfs source in Kconfig (using PetaLinux), but the source must be a cpio archive.

How can I convert the .tar to .cpio, maintaining its structure, permissions, etc.?


Try using bsd tar (not GNU tar) -- the magic is to put an @ before your tarball filename:

bsdtar --format=cpio -cf - @root.tar.gz > root.cpio
| improve this answer | |

Since there is no program that offers this kind of conversion, you need to unpack the tar archive using:

tar xpf archive.tar

as root and later to create a cpio archive from that extracted directory tree.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.