TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

script for getting modules setup correctly



Ok, I've been meaning to do this for a while and I've finally got all
the information I need and sat down and hacked this out tonight.  Only
took a few minutes once I knew where all of hte information was.  This
is a shell script that will do everything, including edit
/etc/lilo.conf and rerun lilo.  Granted this is tailored to my setup,
so YMMV.  Also I haven't actually done this yet, just tested each
command individually.  I figure I'll use it next time I recompile,
probably when I get around to installing 2.2.x.

#!/bin/sh
#run from inside /usr/src/linux
make menuconfig
make dep clean zImage modules
#somehow setup the MODPATH and make modules_install follow that
# hack alert, need to modify the makefile otherwise
kernel_version=`grep 'Linux version' vmlinux | sed 's/.*Linux version \([0-9.]\+\).*$/\1/'`
build=`grep 'Linux version' vmlinux | sed 's/.*Linux version \([0-9.]\+\).*\#\([0-9]\+\).*$/\1-\2/'`
ln -s /lib/modules/${build} /lib/modules/${kernel_version}
make modules_install
rm /lib/modules/${build}
grep 'Linux version' vmlinux > /lib/modules/${build}/.rhkmvtag
cp System.map /boot/System.map-${build}
cp arch/i386/boot/zImage /boot/zImage-${build}
cp /boot/module-info /boot/module-info-${build}
echo "image=/boot/zImage-${build}" >> /etc/lilo.conf
echo "\tlabel=${build}" >> /etc/lilo.conf
/sbin/lilo
cat /etc/lilo.conf | sed "s/^default=.*$/default=${build}/" > /etc/lilo.conf

-- 
Jon Schewe 
http://tcfreenet.org/~schewe
schewe@tcfreenet.org