File: util-linux.postinst

package info (click to toggle)
util-linux 2.29.2-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 40,944 kB
  • sloc: ansic: 115,419; sh: 13,753; makefile: 375; xml: 316; python: 316; csh: 37; sed: 16; perl: 15
file content (39 lines) | stat: -rw-r--r-- 1,511 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
#!/bin/sh
set -e

update-alternatives --install /usr/bin/pager pager /bin/more 50 \
	--slave /usr/share/man/man1/pager.1.gz pager.1.gz \
	/usr/share/man/man1/more.1.gz
update-alternatives --install /usr/bin/pager pager /usr/bin/pg 10 \
	--slave /usr/share/man/man1/pager.1.gz pager.1.gz \
	/usr/share/man/man1/pg.1.gz

# hwclock works on all Linux architectures, except s390 (and s390x, of course).
if [ "$(uname -s)" = "Linux" ]; then
	model=$(uname -m)
	if [ ${model%x} != "s390" ]; then
		# work around that initscripts package might still be
		# in "unpacked" (not yet configured) state and insserv
		# will fail on hwclock.sh if Required scripts are not
		# processed yet. See http://bugs.debian.org/823665
		# (We can't add initscripts dependency to util-linux because
		# that would introduce a dependency cycle via
		# sysvinit-utils<->initscripts<->util-linux
		# because of Depends/Breaks relations. Ideally the hwclock.sh
		# scripts should just be moved over to initscripts pkg, but
		# moving conffiles between packages is problematic.)
		if dpkg-query -W --showformat '${Status}\n' initscripts | grep -q unpacked ; then
			if [ -x /etc/init.d/mountkernfs.sh ]; then
				update-rc.d mountkernfs.sh         defaults >/dev/null || exit $?
			fi
			if [ -x /etc/init.d/mountdevsubfs.sh ]; then
				update-rc.d mountdevsubfs.sh       defaults >/dev/null || exit $?
			fi
		fi

		update-rc.d -f hwclock.sh remove >/dev/null 2>&1 || true
		update-rc.d hwclock.sh defaults > /dev/null
	fi
fi

#DEBHELPER#