File: preinst

package info (click to toggle)
modutils 2.4.26-1.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,724 kB
  • ctags: 1,708
  • sloc: ansic: 16,932; sh: 2,998; makefile: 549; lex: 490; yacc: 375
file content (26 lines) | stat: -rw-r--r-- 647 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# pre install script for the Debian modutils package

set -e

# Check if we are upgrading while running a 2.0 kernel. If so abort
# immediately since we don't support those kernels anymore.
if [ "$1" = "upgrade" ] && dpkg --compare-versions "`uname -r`" lt 2.2.0 ; then
	cat <<EOF
ERROR: you are running a pre-2.2.0 kernel on this machine. Recent
versions of modutils no longer support those kernels.
EOF
	
	if [ ! -f /proc/modules ] ; then
		cat <<EOF
However, your kernel does not seem to use modules, so I will upgrade
anyway.
EOF
	else
		echo To prevent breaking this system the modutils upgrade will abort.
		exit 1
	fi
fi

exit 0