1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/bin/sh
# pre install script for the Debian GNU/Linux modutils package
set -e
# Remove diversions if we are upgrading from a version that still
# diverted linux/kerneld.h
if [ "$1" = "upgrade" ]; then
if dpkg --compare-versions "$2" lt 2.3.5-1 ; then
dpkg-divert --package modutils --remove \
--divert /usr/include/linux/kerneld.h.libc6 \
/usr/include/linux/kerneld.h
fi
# Don't forget to mention the config-file format changed on us again!
if grep -q '^path' /etc/conf.modules 2>/dev/null ; then
cat <<EOF
WARNING: the configuration format for modutils has changed!
Your modutils configuration contains path statements. Since version 2.3.1
of modutils the syntax for this statement has changed. The section is
no longer automatically appended to the given path. To demonstrate: if
you have a statement like this:
path[fs]=/lib/modules/`uname -r`
it should be replaced with this statement:
path[fs]=/lib/modules/`uname -r`/fs
For more documentation on the syntax please see the modules.conf manpage.
Please press [ENTER] to continue
EOF
read HITME
fi
fi
# maybe an old kerneld is still running?
if [ -f /sbin/kerneld ]; then
start-stop-daemon --stop --quiet --oknodo --exec /sbin/kerneld
fi
# Be nice and remember the configuration..
if [ -f /etc/init.d/kerneld ]; then
echo "Saving KDOPT setting from /etc/init.d/kerneld .."
OPTLINE="`grep '^KDOPT=' /etc/init.d/kerneld`" || true
if [ "$OPTLINE" != 'KDOPT=""' ]; then
echo "$OPTLINE" > /var/run/kerneld.OPT
fi
fi
# Handle namechage from conf.modules to modules.conf
if [ -f /etc/conf.modules ]; then
if [ -f /etc/modules.conf ]; then
echo "The modutils configurationfile /etc/conf.modules has been"
echo "renamed to /etc/modules.conf. I tried to rename the file,"
echo "but there is already a file called modules.conf present."
echo "You will have to resolve this situation manually."
else
mv /etc/conf.modules /etc/modules.conf
fi
fi
# Check for symlinked /etc/modules.conf and replace it by a real file
if [ -f /etc/modules.conf -a -L /etc/modules.conf ]; then
echo "Your /etc/modules.conf is a symlink. I will replace this by"
echo "a real file so update-modules can do it's work later."
cp /etc/modules.conf /etc/modules.conf.DPKG-UPGRADE
cat /etc/modules.conf.DPKG-UPGRADE > /etc/modules.conf
rm /etc/modules.conf.DPKG-UPGRADE
fi
# Remove any architecture-specifics in /etc/modutils. This is safe since
# we already copied the used file (see above).
echo -n "Removing obsoleted files: "
for i in conf.generic conf.i386 conf.m68k conf.m68k.amiga conf.m68k.atari \
conf.m68k.amiga conf.m68k.mac ; do
if [ -f /etc/modutils/$i ]; then
echo -n "$i "
rm -f /etc/modutils/$i
fi
done
echo
cat <<EOF
Dpkg might ask you if you want the new configuration files in /etc/init.d.
This is generally a good idea, unless you have really changed any of these
files. The KDOPT setting in /etc/init.d/kerneld will be saved even if you
install a new version of this file.
EOF
exit 0
|