solution: custom bootnet.img with additional net drivers

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

 



hello,

since there are couple of threads on the mailinglist with the same problem
i decided to write a new thread about the solution. well maybe first take
a look on the linke below, even if you dont have a intel e1000 and want
just to add a ie. via-rhine driver because the problem is the same:

http://www.redhat.com/mailing-lists/kickstart-list/msg01758.html

to make it short: REAL ADMINISTRATORS DONT CUT+PASTE!!!!!

huh, what? here a cut+paste ;PPPPPP from the posting above:

"I carefully copied and pasted the definitions from modinfo on the NIC
driver disk to module-info on the bootnet.img disk (yeah, i dunno why the
driver disk's module info file is called 'modinfo' while the other is
'module-info') and did the same for the pcitab file."

guess what you do when you cut+paste: YOU REPLACE TABS WITH SPACES!!!!

this makes the new entries in the pcitable file worthless. you get the
nice "end result" like on the posting you read.

if you cut+paste (what as i said real administrators dont do and can
because the only work without mouse ;ppppppppp) the entries then make sure
that the columns you paste are seperated by tabs like all other entries in
this file. then everything should work fine and the "end result" is
solved.

copying the module in /tmp on the initrd.img may also work (havent tried
it because its well not a solution its a workaround) but its not needed if
you build the pcitable file how it should be.

here a little howto (only tested with redhat 7.3):

NOTE: i am using here drvnet.img to get the modules. you can use also the
files in the kernel-2.?.??-?BOOT*.rpm package (the modules can be found in
/lib/modules/kernel-2.?.??-?BOOT/kernel/drivers/net) but you dont have a
nice pcitable file in the drvnet.img.

cd /tmp

# get images from a redhat mirror and mount them
wget ftp://ftp.unixag-zw.fh-kl.de/pub/mirrors/redhat/linux/7.3/en/os/i386/images/bootnet.img
wget ftp://ftp.unixag-zw.fh-kl.de/pub/mirrors/redhat/linux/7.3/en/os/i386/images/drvnet.img
mkdir /mnt/bootnet
mkdir /mnt/drvnet
mount -o loop /tmp/bootnet.img /mnt/bootnet
mount -o loop /tmp/drvnet.img /mnt/drvnet

# make the dirs where we extract the modules later
mkdir /tmp/bootnet-initrd-modules
mkdir /tmp/drvnet-modules

# drvnet.img/* = modinfo  modules.cgz  modules.dep  pcitable  rhdd-6.1
cp -a /mnt/drvnet/* /tmp/drvnet-modules

# unmount drvnet.img because we dont need it anymore
umount /mnt/drvnet
rmdir /mnt/drvnet

# unpack the gzip + cpio packed modules.cgz
cd drvnet-modules
zcat modules.cgz | cpio -ivd
cd ..

# cp the initrd.img to the tmp dir and unpack it
cp -a /mnt/bootnet/initrd.img /tmp
mv initrd.img initrd.gz
gunzip initrd.gz

# now we mount the unpacked initrd image ;ppppp
mkdir /mnt/bootnet-initrd
mount -o loop initrd /mnt/bootnet-initrd
cp -a /mnt/bootnet-initrd/modules/* bootnet-initrd-modules

# unpack the gzip + cpio packed modules.cgz
cd boonet-initrd-modules
zcat modules.cgz | cpio -ivd

# so now its up to you do make the modfications
# more info: http://ldp.unixag-zw.fh-kl.de/HOWTO/PLIP-Install-HOWTO-16.html
#
# delete useless modules (*.o files in the 2.?.??-?BOOT dir). if you dont
# know what the .o files are exactly you should check pcitable searching
# for the module entry without .o suffix
#
# edit modinfo, check /tmp/drvnet-modules/modinfo to see how redhat did it
# dont forget about the TABS, not that they would matter here but well :p
#
# edit modules.dep, check /tmp/drvnet-modules/modules.dep to see how
# redhat did it (here you can cut+paste because its only seperated by 1
# space)

# ok now we modify the pcitable file to make sure the kernel finds the
# apropriate driver when searching for the pciid entry. you can do this
# all by hand *BUT* dont cut+paste when you dont replace later the spaces
# by tabs. down below are some nice and easy commands to avoid this
# problem.
# of course you can use also a another module like via-rhine instead of e1000
grep "e1000" /tmp/drvnet-modules/pcitable > pcitable.add

# check the pcitable.add to see if everything is like it should be
# now we merge the default pcitable with the new entries and sort it
cat pcitable.add >> pcitable
rm -f pcitable.add
sort pcitable > pcitable.tmp
rm -f pcitable
mv pcitable.tmp pcitable

# ok we are done with the modification. now rebuild everything again.
cd /tmp/bootnet-initrd-modules
rm -f modules.cgz

# pack the modules in cpio + gzipped modules.cgz
find 2.* | cpio -ov -H crc | gzip -9 > modules.cgz

# copy the files back to the mounted initrd image
rm -f /mnt/bootnet-initrd/modules/*
cp -a [a-z] /mnt/bootnet-initrd/modules

# to complicated to explain here ;P but its not to hard to guess
touch /mnt/bootnet-initrd/zerofile
cat /dev/zero > /mnt/bootnet-initrd/zerofile
sync
rm -f /mnt/bootnet-initrd/zerofile

# unmount the initrd image
umount /mnt/bootnet-initrd
rmdir /mnt/initrd

# pack the initrd image again
cd /tmp
gzip -9 initrd

# copy it back at the bootnet image
rm -f /mnt/bootnet/initrd.img
cp -a initrd.gz /mnt/bootnet/initrd.img

# same as above
touch /mnt/bootnet/zerofile
cat /dev/zero > /mnt/bootnet/zerofile
sync
rm -f /mnt/bootnet/zerofile


# unmount the bootnet image
umount /mnt/bootnet
rmdir /mnt/bootnet

# do some cleanup
#rm -rf bootnet-initrd-modules
#rm -rf drvnet-modules

# THE END ;P
# i hope i havent forgot anything. i am to lazy now to check it now again.


# btw: never use a  DOS editor to edit any files on a bootnet.img
# btw2: hey jeffrey from intel ;) if you read this send me a
#       p4-2.5ghz/ram/board as suprise ;>>>
# btw3: ive tested this all only with a via-rhine because i dont have a
#       e1000. jeffrey its up to you to change this ;>>>

oj





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux