File: postinst

package info (click to toggle)
modutils 2.3.11-13.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,156 kB
  • ctags: 1,038
  • sloc: ansic: 10,567; sh: 2,120; lex: 484; makefile: 479; yacc: 362
file content (94 lines) | stat: -rw-r--r-- 2,500 bytes parent folder | download
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
#!/bin/sh -e
# post install script for the Debian GNU/Linux modutils package

set -e

pkg=modutils
CFGFILE="/etc/modules.conf"
HEADER="### This file is automatically generated by update-modules"

if [ ! "$1" = "configure" ]; then
	exit 0
fi

# Do the FHS-documentation-symlink-trick
if [ -d /usr/doc -a ! -e /usr/doc/$pkg -a -d /usr/share/doc/$pkg ] ; then
	ln -s ../share/doc/$pkg /usr/doc/$pkg
fi

# Remove obsolete /lib/modules/current link
if [ -L /lib/modules/current ]
then
	echo -n "Removing obsolete /lib/modules/current softlink.."
	rm -f /lib/modules/current
	echo
fi

# Reset KDOPT setting in /etc/init.d/kerneld.
if [ -f /var/run/kerneld.OPT ]
then
	echo "Restoring original KDOPT setting to /etc/init.d/kerneld.."
	OPTLINE="`cat /var/run/kerneld.OPT`"
	cp /etc/init.d/kerneld /etc/init.d/kerneld.TMP
	sed -e "s/^KDOPT="".*/$OPTLINE/" < /etc/init.d/kerneld.TMP > /etc/init.d/kerneld
	if [ -s /etc/init.d/kerneld ]
	then
		rm -f /etc/init.d/kerneld.TMP
	fi
	rm -f /var/run/kerneld.OPT
fi

update-rc.d kerneld defaults 12 >/dev/null

if [ -f /etc/modules ]; then
	if ! grep -q '^[[:space:]]*noauto[[:space:]]*$' /etc/modules ; then
		/etc/init.d/kerneld start
	fi
fi

# If $CFGFILE exists and is not generated print a big fat
# warning and inform people about the new system
if [ -f $CFGFILE ] && ! head -1 $CFGFILE | grep -q "^$HEADER" ; then
	cat <<EOF

WARNING: you already have an $CFGFILE file which has not
been generated by update-modules. Debian now uses a new system which
uses multiple files in the /etc/modutils directory. See the manpage
for update-modules for more information on this setup.

Please check all changes you made in $CFGFILE and either
apply them to the provided files in /etc/modutils or add your own
files there. Then run update-modules.

EOF
	echo -n "Press [ENTER] to continue"
	read HITME
else
	update-modules
fi

if [ -f /etc/cron.d/modutils ]; then
	cat <<EOF

You still have a /etc/cron.d/modutils file. This was used to
remove automatically loaded modules every 20 minutes. However
this is no longer present to prevent problems with kernel versions
2.0 and older and prevent machines from awakening. Removing this
file is strongly encouraged.

EOF
	echo -n "Enter \"no\" if you do not want me to remove this file: "
	read ANSWER
	echo ""
	if [ "$ANSWER" != "no" ]; then
		echo "Removing file."
		rm -f /etc/cron.d/modutils
	else
		echo "Okay, I will not remove this file. Be warned you might"
		echo "experience some problems."
		echo ""
	fi
fi

exit 0