initrd modification on a liveCD

Hi,

I have some problems to modify initrd file from a liveCD/DVD made with susestudio.com.

I Need to make an OS which boots like a LiveCD/DVD ( unionfs between compressed image OS and tmpfs ), but on a harddrive.

First, I modify boot sequence by using grub instead of isolinux. It’s ok, works fine. Now, I need to modify linuxrc and include file into initrd, to be able to boot on hard-drive ( these scripts are configured for CDBoot only )

Here is my problem :

When I use unmodified initrd file , the system starts booting without problem ( initrd is loaded into /dev/ram0 , and kernel mount /dev/ram0 as root filesystem , it get stuck later but it is not the problem , it is the reason why i need to modify scripts ).

When I use modified initrd file, the kernel is not able to find the filesystem on /dev/ram0 ( message is : 2.06xxxx ]VFS : cannot open root device “ram0” or unknown-block(0,0) )

I supposed it comes from my modification but here it is the only thing I Do :


gunzip -S .img initrd.img
cpio --extract --file=initrd
rm initrd 
find . -print | cpio -ov > initrd
gzip -S .img initrd

I don’t modify initrd, I just extract all the files, and I make cpio-archive again.
The old archive is working fine. The new one does’nt work.

I don’t know where i am wrong. Have you any idea ?

Thanks a lot,

F. MAZUR.

On Tue, 06 Sep 2011 14:46:03 +0000, filsif wrote:

> I have some problems to modify initrd file from a liveCD/DVD made with
> susestudio.com.

What is it ultimately that you’re trying to accomplish?

What I’ve done to make changes to files like this in Studio is to modify
the initial run script to copy the files that I need into the proper
places. It’s an ugly hack, but it works for me. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

in “linuxrc” file included into initrd, there is a call to the CDMount function at line 93. This function is described into “include” file ( included into initrd too ).

This CDMount function ( at line 3048 ) tries to mount LiveCD on cdrom devices only, to find config.isoclient file ( which contains informations to make unionfs mount ) and to access to the clicfs file which contains the OS files.

I Need to modify this function to make mount on my hard drive instead of CDRom ( probably others modifications ).

This is why I need to modify files into “initrd” but all my tries failed.

It is very important to me that the OS boots like a LiveCD ( writes in RAM, FS read-only ) and it is not a standard feature on several linux distrib

I cannot use “initial run script” section because it is run after initrd/liveCD sequence, and the hard drive should be already mounted.

Maybe I should contact the author of the script ( marcus shaefer ) ?

I have some good news.

I manage to modify initrd. The reason is I need to add an addtionnal option when a rebuild cpio-archive : -H newc


gunzip -S .img initrd.img
cpio --extract --file=initrd
rm initrd 
find . -print | cpio -ov -H newc > initrd
gzip -S .img initrd

the option -H newc is needed when the archive contains more than 65535 nodes. If this option is not set, there is no error at the build, but when kernel tries to load it , it returns a kernel panic.

I don’t read enough the documentation of cpio :stuck_out_tongue:

Now I can begin to modify this initrd file, probably I will have another questions :slight_smile: