Wednesday, November 26, 2008

looking at the linux boot process


This is just a temporary record that I will pull together with some other stuff for figuring out wubi

Working primarily on Windows:
Extract files from the iso C:\7z.exe x F10-live-cd.iso

Then use Fedora to open up the ram disk:
lu@localhost$ gunzip < initrd0.img | cpio -i --make-directories
I copied it back to the windows computer to read the init boot script(s) and maybe edit them - then the whole lot (the stuff extracted from initrd.img) can be repacked
on Fedora using something like
lu@localhost$ find ./ -H newc -o > initrd.cpio
lu@localhost$ gzip initrd.cpio
lu@localhost$ mv initrd.cpio.gz initrd0.img

Note: this is a bit unweildy; maybe there is an easier way - but I cannot find anything that runs in Windows to take extract the files from a .img file but seeing it is really a gzipped cpio archive that might be possible (to do: rename the .img file to .cpio.gz and see if common windows extractors will understand it)

GNUwin32 does have gzip.exe, gunzip.exe and cpio.exe and they have no problem extracting the directory structure from initrd.img (so long as i name in .cpio.gz so that makes things a bit less unweildy - haven't tried torepack them yet but that is a detail for later - back to stepping through the wubi python stuff.

(That image - probably should say picture here - might be too small to read but...) the directory that is open in the image is the extracted initrd.img file and in the subdirectory sbin where the real-init boot script lives (after making any changes the whole iso will need to be zipped up again)

1 comment:

Chris said...

Lou -- That find command doesn't look right. ??

Usually with cpio you'd do something like:

find .|cpio -o|gzip >/tmp/initrd.img