This shows you the differences between two versions of the page.
adding_kernel_modules_to_a_red_hat_installer_s_kernel [2008/06/26 10:03] adam created |
adding_kernel_modules_to_a_red_hat_installer_s_kernel [2016/11/25 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== How to Add Kernel Modules to a Red Hat Installer' | ||
- | |||
- | The following was copied verbatim from http:// | ||
- | |||
- | These instructions still seem to be valid for current RHEL/ | ||
- | |||
- | |||
- | |||
- | Adding a driver to a RedHat install floppy | ||
- | |||
- | Michael D. Stenner | ||
- | last modified 27-February-2002 | ||
- | |||
- | OK... This was my experience with adding a driver to the RedHat | ||
- | bootnet disk image. | ||
- | floppy, and so couldn' | ||
- | method. | ||
- | disk contents onto the hard drive. | ||
- | |||
- | RedHat Linux 7.1 (Seth Vidal has made this work for 7.2) | ||
- | I needed to add the 3c509 driver | ||
- | |||
- | Notes: | ||
- | (these may not make sense until you actually start the stuff below) | ||
- | |||
- | 1) Don't edit files in place on the loopback device. | ||
- | thing you want to edit, then edit it. When done editing, DELETE | ||
- | the original from the loopback device. | ||
- | file back in. | ||
- | |||
- | If you don't care about WHY you should do it this way, skip to | ||
- | the next item. | ||
- | |||
- | The problem is this: you don't care about the used space on the | ||
- | | ||
- | | ||
- | |||
- | For a dramatic example, imagine the following. | ||
- | drive with a bunch of files containing random data, and delete | ||
- | those files, the hard drive is still filled with that data, it's | ||
- | just flagged as free (i.e. over-writable). | ||
- | disk image, it would still be roughly the size of the total disk | ||
- | | ||
- | |||
- | In contrast, if instead of deleting (with rm) those files, I | ||
- | | ||
- | | ||
- | |||
- | You want to make sure that your edited files take up the same | ||
- | place in your (loopback mounted) filesystem as the originals, | ||
- | | ||
- | |||
- | | ||
- | |||
- | 2) If you add more than I did, you may need to trim things down a | ||
- | | ||
- | you don't need. Be sure to edit the appropriate files to | ||
- | | ||
- | |||
- | 3) I didn't actually _try_ what I suggest in (2). You may get | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | this problem, I don't want to spout off too much about it. I | ||
- | would love to hear from people who know about these issues. | ||
- | |||
- | 4) I typed this up after figuring it all out. As a result, the | ||
- | | ||
- | may be typos. | ||
- | |||
- | Below are the commands you need to use. All of these should be ready | ||
- | for cut and paste. | ||
- | since you need to do things like swap floppies and do the happy-bit | ||
- | dance in the middle. | ||
- | |||
- | I hope that you find this useful! | ||
- | |||
- | -Michael | ||
- | mstenner@phy.duke.edu | ||
- | |||
- | ============================================================ | ||
- | ################################################### | ||
- | # First, get the drivers we need | ||
- | ################################################### | ||
- | |||
- | # download driver image to drivers.img | ||
- | # insert blank disk | ||
- | cat drivers.img > /dev/fd0 | ||
- | |||
- | mount /mnt/floppy | ||
- | mkdir drivers | ||
- | cp / | ||
- | umount /mnt/floppy | ||
- | |||
- | cd drivers | ||
- | gzip -d < modules.cgz | cpio -i --make-directories | ||
- | # now look in modules.dep to see if you're going to | ||
- | # need to get any other modules. | ||
- | # find the entries for each of the modules you need | ||
- | # in modules.dep, | ||
- | # the actual modules should be in a dir called 2.4.2-2BOOT | ||
- | # (or something similar - will vary with version) | ||
- | cd .. | ||
- | |||
- | ################################################### | ||
- | # Now, get the files from the bootnet image | ||
- | # that we must edit | ||
- | ################################################### | ||
- | |||
- | # download bootnet image to bootnet.img | ||
- | # insert blank disk | ||
- | cat bootnet.img > /dev/fd0 | ||
- | mount /mnt/floppy | ||
- | mkdir initrd-mod | ||
- | cp / | ||
- | cd initrd-mod/ | ||
- | gzip -d < initrd.img.orig.gz > initrd.img.orig | ||
- | cp initrd.img.orig initrd.img.working | ||
- | mkdir loop | ||
- | mount -t ext2 -o loop initrd.img.working loop | ||
- | cd loop/ | ||
- | mkdir ../ | ||
- | cp * ../ | ||
- | cd ../ | ||
- | |||
- | ################################################### | ||
- | # Back up these files and edit them | ||
- | ################################################### | ||
- | |||
- | for FILE in *; do cp $FILE $FILE.orig; done | ||
- | # now edit each of (module-info modules.dep pcitable) that you | ||
- | # need to, adding the entries from the corresponding files on the | ||
- | # driver disk | ||
- | gzip -d < modules.cgz | cpio -i --make-directories | ||
- | # this should make a directory called 2.4.2-2BOOT (depending on | ||
- | # version). | ||
- | # disk into this directory. | ||
- | cp ../ | ||
- | |||
- | # rebuild the modules.cgz file with | ||
- | find 2.4.2-2BOOT | cpio -o -H crc | gzip -9 > modules.cgz | ||
- | |||
- | ################################################### | ||
- | # Put our changes back into the floppy | ||
- | ################################################### | ||
- | |||
- | # copy each of the files that you changed back into | ||
- | # initrd-mod/ | ||
- | # this includes, of course, modules.cgz | ||
- | |||
- | cd .. # pwd = initrd-mod | ||
- | umount loop | ||
- | gzip -9 < initrd.img.working > initrd.img.new | ||
- | cp initrd.img.new / | ||
- | umount /mnt/floppy | ||
- | ============================================================ | ||