diff options
author | Jeff Johnson <jbj@redhat.com> | 1998-07-01 17:51:21 +0000 |
---|---|---|
committer | Jeff Johnson <jbj@redhat.com> | 1998-07-01 17:51:21 +0000 |
commit | 10ec29b739fe7f47d722ca2ecce1ba2bb2e6fb7f (patch) | |
tree | 7c257389251afc704f4c13e896fcbaf884c7ddfe /rc.d | |
parent | 73426918dfb0d34cb118573cb8cac145ad4dcb5d (diff) | |
download | initscripts-10ec29b739fe7f47d722ca2ecce1ba2bb2e6fb7f.tar initscripts-10ec29b739fe7f47d722ca2ecce1ba2bb2e6fb7f.tar.gz initscripts-10ec29b739fe7f47d722ca2ecce1ba2bb2e6fb7f.tar.bz2 initscripts-10ec29b739fe7f47d722ca2ecce1ba2bb2e6fb7f.tar.xz initscripts-10ec29b739fe7f47d722ca2ecce1ba2bb2e6fb7f.zip |
Use rhkmvtag to attach modules directory to running kernel.
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/rc.sysinit | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 2457bd4b..f7fcfc86 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -111,42 +111,15 @@ else USEMODULES= fi -# Get the modules ready to go -- we use awk here as cut is in /usr/bin +# Set up /lib/modules/preferred and /boot/System.map symlinks. rm -f /lib/modules/preferred if [ -n $USEMODULES ]; then - set `cat /proc/cmdline` - while [ $# -gt 0 ]; do - if echo $1 | grep '^BOOT_IMAGE=' > /dev/null ; then - image=`echo $1 | awk -F= '{ print $2 }'` - kernelfile=`/sbin/lilo -I $image` - firstkernelfile=`/sbin/lilo -I $image` - kernelfile="$firstkernelfile" - # Traverse symbolic links - while [ -L "$kernelfile" ]; do - newkernelfile="`ls -l $kernelfile | awk '-F-> ' '{print $2}'`" - if [ "${newkernelfile#/}" != "$newkernelfile" ]; then - # newkernelfile is an absolut path - kernelfile=$newkernelfile - else - kernelfile="${kernelfile%$(basename $kernelfile)}$newkernelfile" - fi - # Check if we're looping - [ "$kernelfile" = "$firstkernelfile" ] && break - done - elif echo $1 | grep '^bootfile=' > /dev/null ; then - kernelfile=`echo $1 | awk -F= '{ print $2 }'` - fi - shift - done - - if [ -n "$kernelfile" ]; then - kernelname=`echo $kernelfile | awk -F- '{ print $1 }'` - versioninfo=`echo $kernelfile | sed "s|${kernelname}-||"` - if [ "$kernelname" = "/boot/vmlinuz" -a \ - -d /lib/modules/$versioninfo -a \ - $versioninfo != `uname -r` ]; then - ln -sf $versioninfo /lib/modules/preferred - fi + ktag="`cat /proc/version`" + mtag=`grep -l "$ktag" /lib/modules/2.0.*/.rhkmvtag` + if [ -n "$mtag" ]; then + mver=`echo $mtag | sed -e 's,/lib/modules/,,' -e 's,/.rhkmvtag,,'` + echo ln -sf /lib/modules/$mver /lib/modules/preferred + echo ln -sf /boot/System.map-$mver /boot/System.map fi fi |