aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox-initscripts/busybox-initscripts.post-install
blob: c393627437f2e5387a21ce8975d0b9658199ab12 (plain)
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
#!/bin/sh

# this is for upgraders
addgroup -S -g 23 input 2>/dev/null

# this is for upgraders
if [ -L /etc/runlevels/boot/mdev ] && ! [ -L /etc/runlevels/sysinit/mdev ]; then
	mkdir -p /etc/runlevels/sysinit
	mv /etc/runlevels/boot/mdev /etc/runlevels/sysinit/ 2>/dev/null
fi

rename_service() {
	oldname="$1"
	newname="$2"

	ret=1
	for link in /run/openrc/*/${oldname} /etc/runlevels/*/${oldname}; do
		newlink="${link%/*}/${newname}"
		if [ -L "$link" ] && ! [ -L "$newlink" ]; then
			target="$(readlink $link)"
			ln -s "${target%/*}/$newname" "$newlink"
			rm "$link"
			ret=0
			continue
		fi
		if [ -d "$link" ] && ! [ -d "$newlink" ]; then
			mv "$link" "$newlink"
			ret=0
		fi
	done

	return $ret
}

# cron was renamed to crond
rename_service cron crond

# keymaps was renamed to loadkmap
rename_service keymaps loadkmap && cat 1>&2 <<-EOF
*
* The OpenRC keymaps service was renamed to loadkmap. You might want
* to rename your previous configuration file /etc/conf.d/keymaps to
* /etc/conf.d/loadkmap. Also make sure that /etc/init.d/keymaps was
* removed and remove it manually if it wasn't.
*
EOF

exit 0