I am modifying Arch install cd's initrd.img for my Arch Linux Office Install CD, but not familiar with cpio archive. To create a new archive, I don't get it to work.
find | cpio -o > initrd.img
Or is there any easier way to modify the /arch/setup script in the initrd.img instead of re-archiving the whole image? I tried to edit with mc but the archive is too big.
Last edited by rasat (2007-09-20 15:00:19)
I think you need something like this:
cd basefolder # basefolder is the directory containing your /etc, /var and so on find . | cpio -o -H newc | gzip > ../test.cpio.gz
Have you read mkinitcpio?
It's a bash script... Has exactly the info you need
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Thanks gradgrind, it did the work. For any user who wants to edit the initrd.img, here is how I did.
initrd.img to initrd.img.gz
gzip -d initrd.img.gz
3. Extract: (WARNING!! without "--no-absolute-filenames" extracts in your root "/")
cpio -i --no-absolute-filenames < initrd.img
4. Do the editing
5. New archive:
find . | cpio -o -H newc > initrd.img
gzip -c initrd.img > initrd.img.gz
initrd.img.gz to initrd.img