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

kernel modules postinst script



Hi,

while I just build some kernel module packages for our clients and
installing them, I think I found a bug applying to almost all kernel module
packages.

Most packages have a file like postinst.modules.in with something like

#!/bin/sh
set -e

if [ "`uname -r`" = "_KVERS_" ] ; then
   depmod -a &
fi

Now imagine you are installing the package on a fileserver in a chroot and
the file servers kernel version is different from _KVERS_. Furthermore, all
clients mount their root directory read-only from the server.
So /lib/modules/modules.dep will never be updated.

Why is not something like this used?

#!/bin/sh
set -e

SYSTEMMAP=/boot/System.map-_KVERS_

if [ -f $SYSTEMMAP ] ; then
        depmod -ae -F $SYSTEMMAP _KVERS_
elif [ "`uname -r`" = "_KVERS_" ] ; then
        depmod -a &
fi

Thanks,
        Bernd



Reply to: