File: preinst

package info (click to toggle)
modutils 2.1.85-11
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,020 kB
  • ctags: 1,024
  • sloc: ansic: 9,324; sh: 2,180; lex: 484; yacc: 362; makefile: 309
file content (63 lines) | stat: -rw-r--r-- 1,701 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
#!/bin/sh
# pre install script for the Debian GNU/Linux modutils package

# 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`"
	if [ "$OPTLINE" != 'KDOPT=""' ]; then
		echo "$OPTLINE" > /var/run/kerneld.OPT
	fi
fi

# If /etc/modutils doesn't exist we are upgrading from an older system.
# Move conf.modules to the new location.
if [ -f /etc/conf.modules -a ! -L /etc/conf.modules ]; then
	echo "You still have /etc/conf.modules, moving it to /etc/modutils"
	MODEL=`dpkg --print-installation-architecture`
	CONF="/etc/modutils/conf.${MODEL}"
	if [ $MODEL = "m68k" ]; then
		if [ -f /proc/hardware ]; then
			case `awk '$1 == "Model:" { print $2 }' /proc/hardware` in
				Atari)
					CONF="${CONF}.atari"
					;;
				Amiga)
					CONF="${CONF}.amiga"
					;;
				Macintosh)
					CONF="${CONF}.mac"
					;;
				Motorola)
					CONF="${CONF}.MVME"
					;;
			esac
		else
			echo "/proc not mounted, assuming generic m68k machine"
		fi
	fi

	if [ ! -d /etc/modutils ]; then
		echo "You have no /etc/modutils directory, creating it"
		mkdir /etc/modutils
		chmod 755 /etc/modutils
	fi

	echo "Moving /etc/conf.modules to $CONF"
	mv /etc/conf.modules $CONF
fi

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