How to create ASCII cpio archive (SVR4 with no CRC)?

8,151

You can do this with GNU cpio:

$ find . | cpio -o -H newc > /tmp/file
40 blocks
$ file /tmp/file
/tmp/file: ASCII cpio archive (SVR4 with no CRC)
Share:
8,151

Related videos on Youtube

dotslash
Author by

dotslash

Updated on September 18, 2022

Comments

  • dotslash
    dotslash almost 2 years

    I have a file in /boot/initramfs.gz

    extract it using tar -xzvf initramfs.gz -C ./ I got a file initramfs.

    └──╼ $ file initramfs initramfs: ASCII cpio archive (SVR4 with no CRC)

    It can be open using ark. But I want to change some files in this file initramfs.

    enter image description here

    I extracted it using ark and got a folder initramfs. Now I want to save it as before.

    enter image description here

    How do I create an ASCII cpio archive (SVR4 with no CRC) like the original?

  • schily
    schily almost 8 years
    cpio -o -H newc cpio: Invalid header "newc" specified USAGE: cpio -i[bcdfkmrstuv@BSV6] [-C size] [-E file] [-H hdr] [-I file [-M msg]] [-R id] [patterns] cpio -o[acv@ABLV] [-C size] [-H hdr] [-O file [-M msg]] cpio -p[adlmuv@LV] [-R id] directory Better use cpio -o -c.