[CentOS] How to create initrd.img

Thu Nov 15 08:38:32 UTC 2007
Jim Wight <j.k.wight at ncl.ac.uk>

On Wed, 2007-11-14 at 13:56 -0800, semi linux wrote:
> 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.
> > D.
> 
> David is right...

Not necessarily. For the changes I make I find the following sufficient:

mkdir initrd; cd initrd
gunzip -c --suffix '.img' /boot/initrd-abc.img | cpio -i

and

find . -print | cpio -c -o | gzip -c9 >/boot/initrd-xyz.img

Jim