PROGNAME="Linux kernel $VERSION modules"
DESC="\
kernel-modules (Linux kernel modules)                                  \n\
                                                                       \n\
A kernel module is a piece of object code that can be dynamically      \n\
loaded into the Linux kernel to provide new kernel functions.  Most of \n\
these modules provide support for devices such as CD-ROM drives, tape  \n\
drives, and ethernet cards.  You can choose which modules to load by   \n\
editing /etc/rc.d/rc.modules."

SUBPKGNAME=kernel-modules-$VERSION-s390-$BUILD
TAG=ADD

subinstall() {
   cd $TMP/kernel-modules
   mkdir -p /package-kernel-modules/etc/rc.d/
   cp -p $CWD/rc.modules.s390 /package-kernel-modules/etc/rc.d/rc.modules-2.6.7.new
   mv * /package-kernel-modules/

   ( cd /package-kernel-modules/lib/modules/$VERSION
     rm -rf build ; ln -s /usr/src/linux-$VERSION build
   )
}

subspecial() {
   cd $SUBPKG
   mv package-kernel-modules/* ./
   rmdir package-kernel-modules

   cd $SUBCTL
   cat $CWD/../../../source/a/kernel-modules/slack-desc > slack-desc

   sed -e 's%package-kernel-modules/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new

   cat $CWD/config.sh >> doinst.sh
   echo config etc/rc.d/rc.modules-2.6.7.new >> doinst.sh

cat << EOF >> doinst.sh
# If rc.modules is a real file, back it up:
if [ -r etc/rc.d/rc.modules -a ! -L etc/rc.d/rc.modules ]; then
  cp -a etc/rc.d/rc.modules etc/rc.d/rc.modules.bak
fi
# Make rc.modules a symlink if it's not already, but do not replace
# an existing symlink.  You'll have to decide to point at a new version
# of this script on your own...
if [ ! -L etc/rc.d/rc.modules ]; then
  ( cd etc/rc.d ; rm -rf rc.modules )
  ( cd etc/rc.d ; ln -sf rc.modules-${VERSION} rc.modules )
fi

# A good idea whenever kernel modules are added or changed:
if [ -x sbin/depmod ]; then
  chroot . /sbin/depmod -a 1> /dev/null 2> /dev/null
fi
EOF
}

