Making a new bootable initrd.img

Brian Long brilong at cisco.com
Thu Nov 18 19:51:32 UTC 2004


Why go through all this?  Just run buildinstall that's part of
anaconda-runtime.  Point it to your kickstart image (RHEL 3 U3 extracted
ISOs or your personally-tweaked tree) and it will make the boot floppy
images (and PXE initrd) from the U3 kernel.  Manually tweaking initrd
isn't ideal in my opinion.  Just edit the scripts in anaconda-runtime as
you need to.  For example, we comment out the qlaXXX drivers in the pci
table so none of our SAN devices will get overwritten by an accidental
kickstart.  :)

/Brian/

On Thu, 2004-11-18 at 14:44, Steven Hajducko wrote:
> I'm not sure if mkinitrd will compile an initrd.img that can be used for
> PXE.  But then again, I don't have much experience using the tool, so I
> might be completely off the mark, but a test run of the command only built a
> initrd.img that looks similar to something the kernel installs already.
> 
> Here's a snapshot of the difference between our PXE initrd ( copied directly
> from the RH CD ) and a regular, 2.4.21-15 initrd
> 
> 2.4.21-15
> ./init_nonboot/lib/scsi_mod.o
> ./init_nonboot/lib/sd_mod.o
> ./init_nonboot/lib/cciss.o
> ./init_nonboot/lib/lvm-mod.o
> ./init_nonboot/lib/jbd.o
> ./init_nonboot/lib/ext3.o
> ./init_nonboot/bin/nash
> ./init_nonboot/bin/insmod
> ./init_nonboot/bin/vgwrapper
> ./init_nonboot/bin/vgscan
> ./init_nonboot/bin/vgchange
> ./init_nonboot/linuxrc
> 
> 2.4.21-4 ( specifically, this is 2.4.21-4.ELBOOT )
> ./init/modules/module-info
> ./init/modules/pcitable
> ./init/modules/modules.dep
> ./init/modules/modules.pcimap
> ./init/modules/modules.cgz
> ./init/sbin/loader
> ./init/sbin/init
> ./init/etc/terminfo/l/linux
> ./init/etc/terminfo/x/xterm
> ./init/etc/terminfo/v/vt100
> ./init/etc/terminfo/v/vt100-nav
> ./init/etc/terminfo/b/bterm
> ./init/etc/passwd
> ./init/etc/arch
> ./init/etc/keymaps.gz
> ./init/etc/screenfont.gz
> ./init/etc/lang-table
> ./init/etc/loader.tr
> ./init/etc/font.bgf.gz
> ./init/etc/pcmcia/config
> ./init/etc/ramfs.img
> ./init/.buildstamp
> ./init/.profile
> 
> So I'm guess this is the process -
> 
> Install 2.4.21-15 kernel
> Reboot the machine off this new kernel
> ( Hopefully ) make a new initrd using mkinitrd
> Put the new cciss.o that is compiled for 2.4.21-15 into this initrd.img
> Put the new initrd.img and the new 2.4.21-15 vmlinuz into our PXE boot.
> 
> If I can't do the ELBOOT via mkinitrd, how do I make an initrd.img that is
> usable for PXE?  Can I just copy over whatever I'm missing from the one we
> currently use?  
> 
> --
> sh
> 
> -----Original Message-----
> From: Peter Eisch [mailto:peter at boku.net] 
> Sent: Thursday, November 18, 2004 10:56 AM
> To: Discussion list about Kickstart
> Subject: Re: Making a new bootable initrd.img
> 
> 
> 
> I put the building of the newer initrd into the %post of the kernel's RPM:
> 
> %post smp
> [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
> [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
> if [ -x /sbin/new-kernel-pkg ] ; then
>         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}smp
> fi
> /sbin/mkinitrd --preload scsi_mod --preload sd_mod --with cciss \
>        /boot/ninitrd-%{KVERREL}smp.img %{KVERREL}smp
> /bin/mv /boot/initrd-%{KVERREL}smp.img /boot/oinitrd-%{KVERREL}smp.img
> /bin/mv /boot/ninitrd-%{KVERREL}smp.img /boot/initrd-%{KVERREL}smp.img
> 
> 
> I specifically had to do this with the DL380 G3's last spring.  Then rebuild
> the kernel and such.
> 
> Presumably you could feed in the appropriate %{KVERREL} and put this into a
> ks %post.  (Remember to do or not do the other kernels (bigmem, up, etc)
> according to your needs.)
> 
> peter
> 
> 
> On 11/18/04 12:17 PM, "Steven Hajducko" <Steven.Hajducko at DigitalInsight.com>
> wrote:
> 
> > Hi,
> > 
> > We currently are using PXE and RH3.0AS to kickstart our machines.  We
> > recently got a new version of our hardware ( HP DL360's ) that use a new
> > storage array.  When we tried to kickstart, it complained about the pcimap
> > and IRQ and IO mappings for the cciss.o ( the HP driver ) and wouldn't
> > proceed, saying it couldn't find any disks to install to.
> > 
> > Went to the HP website and found a new version of the driver that supports
> > the new array.  Unfortunately, that driver is only supported on kernel
> > versions 2.4.21-9 and 2.4.21-15.  The kernel version of the initrd.img we
> > use is 2.4.21-4.  We basically just copied the pxelinux initrd.img from
> the
> > install CDs.
> > 
> > Now, correct me if I'm wrong, but the correct procedure for updating the
> > driver in the initrd.img would be...
> > 
> > mv initrd.img initrd.img.gz
> > gzip -d initrd.img.gz
> > mount -o loop ./initrd.img /mnt/init
> > cp /mnt/init/modules/modules.cgz /tmp
> > cd /tmp
> > mv ./modules.cgz ./modules.gz
> > gzip -d ./modules.gz
> > cpio -idv < modules
> > 
> > So now I've got my exploded modules directory, 2.4.21-4.ELBOOT
> > 
> > I need to add the cciss.o driver to the 2.4.21-4.ELBOOT/i386 dir (
> replacing
> > the old one ).  Once that's done...
> > 
> > cd /tmp
> > find ./2.4.21-4.ELBOOT -print > /tmp/filelist
> > cpio -o -H crc < filelist > modules.cpio
> > gzip --best --no-name modules.cpio
> > mv modules.cpio modules.cgz
> > mv modules.cgz /mnt/init/modules
> > umount /mnt/init
> > gzip --best --no-name initrd.img
> > mv initrd.img.gz initrd.img
> > 
> > So if that process isn't wrong, I can ask my question.  How do I make a
> new
> > bootable initrd.img off of a kernel that I'm not running?  The machine
> that
> > we PXE and kickstart off is at 2.4.21-20.ELsmp and we don't want to
> > downgrade to 2.4.21-9 or 2.4.21-15.  I suppose I could install them as a
> > separate kernel and just reboot off of that when I need to.  So I guess I
> > should rephrase my question.
> > 
> > How do I make a bootable initrd.img usable by PXE?
> > 
> > Thanks.
> > 
> > sh
> > 
> > _______________________________________________
> > Kickstart-list mailing list
> > Kickstart-list at redhat.com
> > https://www.redhat.com/mailman/listinfo/kickstart-list
> > 
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
-- 
     Brian Long                      |         |           |
     IT Data Center Systems          |       .|||.       .|||.
     Cisco Linux Developer           |   ..:|||||||:...:|||||||:..
     Phone: (919) 392-7363           |   C i s c o   S y s t e m s




More information about the Kickstart-list mailing list