You are not logged in.

#1 2007-09-19 16:25:31

rasat
Forum Fellow
From: Finland
Registered: 2002-12-27
Posts: 2,296
Website

How to edit initrd.img in Arch cd

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)


Markku

Offline

#2 2007-09-20 09:16:52

gradgrind
Member
From: Germany
Registered: 2005-10-06
Posts: 921

Re: How to edit initrd.img in Arch cd

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

Offline

#3 2007-09-20 10:00:12

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: How to edit initrd.img in Arch cd

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!

Offline

#4 2007-09-20 14:41:53

rasat
Forum Fellow
From: Finland
Registered: 2002-12-27
Posts: 2,296
Website

Re: How to edit initrd.img in Arch cd

Thanks gradgrind, it did the work. For any user who wants to edit the initrd.img, here is how I did.

1. Rename:
initrd.img to initrd.img.gz
2, Uncompress:
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
6. Compress:
gzip -c initrd.img > initrd.img.gz
7. Rename:
initrd.img.gz to initrd.img

More information
http://bbs.archlinux.org/viewtopic.php?id=34429


Markku

Offline

Board footer

Powered by FluxBB