[CentOS] How to create initrd.img
linuxsemi at gmail.com
Wed Nov 14 21:56:49 UTC 2007
On Nov 13, 2007 5:49 AM, David Hrbáč <hrbac.conf at seznam.cz> wrote:
> Alain Spineux napsal(a):
> > On Oct 15, 2007 2:09 PM, David Hrbáč <hrbac.conf at seznam.cz> wrote:
> >> Hi,
> >> anyone to point me URL on initrd.img creating? I have custom kernel and
> >> want to create initrd.img for install media.
> >> mkinitrd /tmp/initrd.img 2.6.18-8.1.14.el5.hrb -v -f create unusable
> >> file for install media.
> > Maybe you could extract original initrd image, replace its components
> > with yours and then rebuild the initrd !
> > gzip, mount -o are your friend
> Not anymore, use buildinstall.
David is right... Through a series of commands: cpio, mount, g(un)zip,
zcat, loopack devices, dd, mkfs.*, etc. I was able to mount, extract
and otherwise rebuild the the initrd. Sadly, after almost two months
of toying with it, I got to a point where I had my newly built kernel
booting, my newly minted initrd loading and a plethora of new drivers
loaded and ready for use. BUT, after the kernel finished booting, the
hand-off to init (which is symlinked to loader/anaconda) would never
happen. Although I was never able to figure-out why, I sent some
messages to the Fedora Release Engineering group. Jesse Keating over
there pointed me back up the chain to buildinstall as well. Although
cooking an _entier_ distro was overkill, using the resulting
diskboot.img and stage2.img worked great. Seemingly, you can't
shortcut this route either - mk-images/.i386 really does the work I
need but taking it out of context is _way_ more trouble then it's
worth. In any case, mystery solved!
Thanks for the help guys!
P.S.> It appears that the manual initrd rebuild used to work in FC2,
don't know about FC3, and won't work for FC4+... but this is just
speculation from my readings.
More information about the CentOS