Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 642858
Collapse All | Expand All

(-)a/sys-apps/sysvinit/files/inittab-2.91 (+61 lines)
Line 0 Link Here
1
#
2
# /etc/inittab:  This file describes how the INIT process should set up
3
#                the system in a certain run-level.
4
#
5
# Author:  Miquel van Smoorenburg, <miquels@cistron.nl>
6
# Modified by:  Patrick J. Volkerding, <volkerdi@ftp.cdrom.com>
7
# Modified by:  Daniel Robbins, <drobbins@gentoo.org>
8
# Modified by:  Martin Schlemmer, <azarah@gentoo.org>
9
# Modified by:  Mike Frysinger, <vapier@gentoo.org>
10
# Modified by:  Robin H. Johnson, <robbat2@gentoo.org>
11
# Modified by:  William Hubbs, <williamh@gentoo.org>
12
#
13
14
# Default runlevel.
15
id:3:initdefault:
16
17
# System initialization, mount local filesystems, etc.
18
si::sysinit:/sbin/openrc sysinit
19
20
# Further system initialization, brings up the boot runlevel.
21
rc::bootwait:/sbin/openrc boot
22
23
l0u:0:wait:/sbin/telinit u
24
l0:0:wait:/sbin/openrc shutdown 
25
l0s:0:wait:/sbin/halt -dhnp
26
l1:1:wait:/sbin/openrc single
27
l2:2:wait:/sbin/openrc nonetwork
28
l3:3:wait:/sbin/openrc default
29
l4:4:wait:/sbin/openrc default
30
l5:5:wait:/sbin/openrc default
31
l6u:6:wait:/sbin/telinit u
32
l6:6:wait:/sbin/openrc reboot
33
l6r:6:wait:/sbin/reboot -dkn
34
#z6:6:respawn:/sbin/sulogin
35
36
# new-style single-user
37
su0:S:wait:/sbin/openrc single
38
su1:S:wait:/sbin/sulogin
39
40
# TERMINALS
41
#x1:12345:respawn:/sbin/agetty 38400 console linux
42
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
43
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
44
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
45
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
46
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
47
c6:2345:respawn:/sbin/agetty 38400 tty6 linux
48
49
# SERIAL CONSOLES
50
#s0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt100
51
#s1:12345:respawn:/sbin/agetty -L 9600 ttyS1 vt100
52
53
# What to do at the "Three Finger Salute".
54
ca:12345:ctrlaltdel:/sbin/shutdown -r now
55
56
# Used by /etc/init.d/xdm to control DM startup.
57
# Read the comments in /etc/init.d/xdm for more
58
# info. Do NOT remove, as this will start nothing
59
# extra at boot if /etc/init.d/xdm is not added
60
# to the "default" runlevel.
61
x:a:once:/etc/X11/startDM.sh
(-)a/sys-apps/sysvinit/sysvinit-2.91-r1.ebuild (-1 / +117 lines)
Line 0 Link Here
0
- 
1
# Copyright 1999-2018 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=6
5
6
inherit toolchain-funcs flag-o-matic
7
8
DESCRIPTION="/sbin/init - parent of all processes"
9
HOMEPAGE="https://savannah.nongnu.org/projects/sysvinit"
10
SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
11
12
LICENSE="GPL-2"
13
SLOT="0"
14
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
15
IUSE="selinux ibm static kernel_FreeBSD"
16
17
CDEPEND="
18
	selinux? (
19
		>=sys-libs/libselinux-1.28
20
	)"
21
DEPEND="${CDEPEND}
22
	virtual/os-headers"
23
RDEPEND="${CDEPEND}
24
	selinux? ( sec-policy/selinux-shutdown )
25
	!<sys-apps/openrc-0.13
26
"
27
28
PATCHES=(
29
	"${FILESDIR}/${PN}-2.86-kexec.patch" #80220
30
	"${FILESDIR}/${PN}-2.86-shutdown-single.patch" #158615
31
	"${FILESDIR}/${PN}-2.88-shutdown-h.patch" #449354
32
)
33
34
src_prepare() {
35
	default
36
	sed -i '/^CPPFLAGS =$/d' src/Makefile || die
37
38
	# last/lastb/mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux
39
	sed -i -r \
40
		-e '/^(USR)?S?BIN/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \
41
		-e '/^MAN[18]/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \
42
		src/Makefile || die
43
44
	# pidof has moved to >=procps-3.3.9
45
	sed -i -r \
46
		-e '/\/bin\/pidof/d' \
47
		-e '/^MAN8/s:\<pidof.8\>::g' \
48
		src/Makefile || die
49
50
	# Mung inittab for specific architectures
51
	cd "${WORKDIR}" || die
52
	cp "${FILESDIR}"/inittab-2.91 inittab || die "cp inittab"
53
	local insert=()
54
	use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' )
55
	use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' )
56
	use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' )
57
	use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' )
58
	use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' )
59
	if use ibm ; then
60
		insert+=(
61
			'#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
62
			'#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0'
63
		)
64
	fi
65
	(use arm || use mips || use sh || use sparc) && sed -i '/ttyS0/s:#::' inittab
66
	if use kernel_FreeBSD ; then
67
		sed -i \
68
			-e 's/linux/cons25/g' \
69
			-e 's/ttyS0/cuaa0/g' \
70
			-e 's/ttyS1/cuaa1/g' \
71
			inittab #121786
72
	fi
73
	if use x86 || use amd64 ; then
74
		sed -i \
75
			-e '/ttyS[01]/s:9600:115200:' \
76
			inittab
77
	fi
78
	if [[ ${#insert[@]} -gt 0 ]] ; then
79
		printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
80
	fi
81
}
82
83
src_compile() {
84
	tc-export CC
85
	append-lfs-flags
86
	export DISTRO= #381311
87
	export VERSION="${PV}"
88
	use static && append-ldflags -static
89
	emake -C src $(usex selinux 'WITH_SELINUX=yes' '')
90
}
91
92
src_install() {
93
	emake -C src install ROOT="${D}"
94
	dodoc README doc/*
95
96
	insinto /etc
97
	doins "${WORKDIR}"/inittab
98
99
	# dead symlink
100
	rm "${ED%/}"/usr/bin/lastb || die
101
}
102
103
pkg_postinst() {
104
	# Reload init to fix unmounting problems of / on next reboot.
105
	# This is really needed, as without the new version of init cause init
106
	# not to quit properly on reboot, and causes a fsck of / on next reboot.
107
	if [[ ${ROOT} == / ]] ; then
108
		if [[ -e /dev/initctl && ! -e /run/initctl ]]; then
109
			ln -s /dev/initctl /run/initctl
110
		fi
111
		# Do not return an error if this fails
112
		/sbin/telinit U &>/dev/null
113
	fi
114
115
	elog "The last/lastb/mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to"
116
	elog "sys-apps/util-linux. The pidof tool has been moved to sys-process/procps."
117
}

Return to bug 642858