[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: RHEL5 kickstart needs to mount cdrom in postinst



Martin Steinmann wrote:
Is there a similarly elegant way to add a driver disk image?  I am
still
struggling embedding an additional RAID driver into the boot CD. I
suppose I need to update the initial initrd file (using mkinitrd)
and
then tell Anaconda to load the driver image during stage2. Can the
driver disk image be placed somewhere into the tree similar to the
updates.img?

Yes.

Look for the driverdisk option at
https://www.redhat.com/docs/manuals/enterprise/RHEL-5-
manual/Installation_Guide-en-US/s1-kickstart2-options.html

That option is in RHEL4 & 5 that I know of.

Yes, I looked at this and tried several options. The problem is that I
do not have a network during installation (no ftp, http or nfs
available) and therefore the driver disk image needs to be in the tree
on the CD. Also, the HD is empty when I start.

  are you adding a new driver or replacing an existing one?
you can place an updated driver in the initrd.img, although
not with mkinitrd because the resultant ramdisk images are
vastly different (the kickstart image is more complex, a
standard initrd.img just has drivers and not much else).
the steps are:

1) uncompress initial ramdisk image to a temporary file and
   do a loopback mount of the file:

     # gzip -dc initrd.img > /tmp/initrd.tmp
     # mount -o rw,loop /tmp/initrd.tmp /mnt

2) uncompress and unarchive the modules bundle in the initrd:

     # cd /tmp
     # gzip -dc /mnt/modules/modules.cgz | cpio -idv

   you'll end up with a directory in /tmp named after the boot
   kernel, e.g. /tmp/2.6.9-34.EL or similar.

3) drop your driver module in the module tree created above:

     # cp your_module.ko /tmp/2.6.9-34.EL/<arch>

   where <arch> is probably i686 or x86_64 based on your OS
   architecture (32- or 64-bit).

4) overwrite the existing module archive with your new modules:

     # cd /tmp
# find 2.6.9-34.EL | cpio -ov -H crc | gzip -c > /mnt/modules/modules.cgz

   (that should all be on one line, if my email client wrapped
   it across two)

5) unmount and compress the temp initrd:

     # umount /mnt
     # gzip -c /tmp/initrd.tmp > /tmp/initrd-new.img

i haven't tried adding previously nonexisting modules to the
initial ramdisk before, but it should be identical to the above
except for an added step where you edit /mnt/modules/modules.pcimap
and /mnt/modules/pcitable to put the correct entries in for the
new module in question.  if you have a driver disk hopefully you'll
also have the pci information buried somewhere in it; otherwise,
i have no idea how to generate that data.  :)  i've done this
numerous times for RHEL3 and RHEL4, and i imagine it should be
no different for RHEL5.  if you update the initrd.img you shouldn't
need to update the stage2.img image.

hope this is useful,
 chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]