Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/sysvinit/, sys-apps/sysvinit/files/
Date: Wed, 31 Oct 2018 14:10:51
Message-Id: 1540995003.d91617e997cdde5eb4c1fba797fdcb221dcbbd8a.williamh@gentoo
1 commit: d91617e997cdde5eb4c1fba797fdcb221dcbbd8a
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 28 19:12:43 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 31 14:10:03 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d91617e9
7
8 sys-apps/sysvinit: call telinit u when halting or rebooting
9
10 Closes: https://bugs.gentoo.org/642858
11 Package-Manager: Portage-2.3.51_p2, Repoman-2.3.11_p27
12 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
13 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
14
15 sys-apps/sysvinit/files/inittab-2.91 | 61 ++++++++++++++++
16 sys-apps/sysvinit/sysvinit-2.91-r1.ebuild | 117 ++++++++++++++++++++++++++++++
17 2 files changed, 178 insertions(+)
18
19 diff --git a/sys-apps/sysvinit/files/inittab-2.91 b/sys-apps/sysvinit/files/inittab-2.91
20 new file mode 100644
21 index 00000000000..f9ed8d1126a
22 --- /dev/null
23 +++ b/sys-apps/sysvinit/files/inittab-2.91
24 @@ -0,0 +1,61 @@
25 +#
26 +# /etc/inittab: This file describes how the INIT process should set up
27 +# the system in a certain run-level.
28 +#
29 +# Author: Miquel van Smoorenburg, <miquels@×××××××.nl>
30 +# Modified by: Patrick J. Volkerding, <volkerdi@×××××××××.com>
31 +# Modified by: Daniel Robbins, <drobbins@g.o>
32 +# Modified by: Martin Schlemmer, <azarah@g.o>
33 +# Modified by: Mike Frysinger, <vapier@g.o>
34 +# Modified by: Robin H. Johnson, <robbat2@g.o>
35 +# Modified by: William Hubbs, <williamh@g.o>
36 +#
37 +
38 +# Default runlevel.
39 +id:3:initdefault:
40 +
41 +# System initialization, mount local filesystems, etc.
42 +si::sysinit:/sbin/openrc sysinit
43 +
44 +# Further system initialization, brings up the boot runlevel.
45 +rc::bootwait:/sbin/openrc boot
46 +
47 +l0u:0:wait:/sbin/telinit u
48 +l0:0:wait:/sbin/openrc shutdown
49 +l0s:0:wait:/sbin/halt -dhnp
50 +l1:1:wait:/sbin/openrc single
51 +l2:2:wait:/sbin/openrc nonetwork
52 +l3:3:wait:/sbin/openrc default
53 +l4:4:wait:/sbin/openrc default
54 +l5:5:wait:/sbin/openrc default
55 +l6u:6:wait:/sbin/telinit u
56 +l6:6:wait:/sbin/openrc reboot
57 +l6r:6:wait:/sbin/reboot -dkn
58 +#z6:6:respawn:/sbin/sulogin
59 +
60 +# new-style single-user
61 +su0:S:wait:/sbin/openrc single
62 +su1:S:wait:/sbin/sulogin
63 +
64 +# TERMINALS
65 +#x1:12345:respawn:/sbin/agetty 38400 console linux
66 +c1:12345:respawn:/sbin/agetty 38400 tty1 linux
67 +c2:2345:respawn:/sbin/agetty 38400 tty2 linux
68 +c3:2345:respawn:/sbin/agetty 38400 tty3 linux
69 +c4:2345:respawn:/sbin/agetty 38400 tty4 linux
70 +c5:2345:respawn:/sbin/agetty 38400 tty5 linux
71 +c6:2345:respawn:/sbin/agetty 38400 tty6 linux
72 +
73 +# SERIAL CONSOLES
74 +#s0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt100
75 +#s1:12345:respawn:/sbin/agetty -L 9600 ttyS1 vt100
76 +
77 +# What to do at the "Three Finger Salute".
78 +ca:12345:ctrlaltdel:/sbin/shutdown -r now
79 +
80 +# Used by /etc/init.d/xdm to control DM startup.
81 +# Read the comments in /etc/init.d/xdm for more
82 +# info. Do NOT remove, as this will start nothing
83 +# extra at boot if /etc/init.d/xdm is not added
84 +# to the "default" runlevel.
85 +x:a:once:/etc/X11/startDM.sh
86
87 diff --git a/sys-apps/sysvinit/sysvinit-2.91-r1.ebuild b/sys-apps/sysvinit/sysvinit-2.91-r1.ebuild
88 new file mode 100644
89 index 00000000000..da9b190c71d
90 --- /dev/null
91 +++ b/sys-apps/sysvinit/sysvinit-2.91-r1.ebuild
92 @@ -0,0 +1,117 @@
93 +# Copyright 1999-2018 Gentoo Authors
94 +# Distributed under the terms of the GNU General Public License v2
95 +
96 +EAPI=6
97 +
98 +inherit toolchain-funcs flag-o-matic
99 +
100 +DESCRIPTION="/sbin/init - parent of all processes"
101 +HOMEPAGE="https://savannah.nongnu.org/projects/sysvinit"
102 +SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
103 +
104 +LICENSE="GPL-2"
105 +SLOT="0"
106 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
107 +IUSE="selinux ibm static kernel_FreeBSD"
108 +
109 +CDEPEND="
110 + selinux? (
111 + >=sys-libs/libselinux-1.28
112 + )"
113 +DEPEND="${CDEPEND}
114 + virtual/os-headers"
115 +RDEPEND="${CDEPEND}
116 + selinux? ( sec-policy/selinux-shutdown )
117 + !<sys-apps/openrc-0.13
118 +"
119 +
120 +PATCHES=(
121 + "${FILESDIR}/${PN}-2.86-kexec.patch" #80220
122 + "${FILESDIR}/${PN}-2.86-shutdown-single.patch" #158615
123 + "${FILESDIR}/${PN}-2.88-shutdown-h.patch" #449354
124 +)
125 +
126 +src_prepare() {
127 + default
128 + sed -i '/^CPPFLAGS =$/d' src/Makefile || die
129 +
130 + # last/lastb/mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux
131 + sed -i -r \
132 + -e '/^(USR)?S?BIN/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \
133 + -e '/^MAN[18]/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \
134 + src/Makefile || die
135 +
136 + # pidof has moved to >=procps-3.3.9
137 + sed -i -r \
138 + -e '/\/bin\/pidof/d' \
139 + -e '/^MAN8/s:\<pidof.8\>::g' \
140 + src/Makefile || die
141 +
142 + # Mung inittab for specific architectures
143 + cd "${WORKDIR}" || die
144 + cp "${FILESDIR}"/inittab-2.91 inittab || die "cp inittab"
145 + local insert=()
146 + use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' )
147 + use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' )
148 + use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' )
149 + use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' )
150 + use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' )
151 + if use ibm ; then
152 + insert+=(
153 + '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
154 + '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0'
155 + )
156 + fi
157 + (use arm || use mips || use sh || use sparc) && sed -i '/ttyS0/s:#::' inittab
158 + if use kernel_FreeBSD ; then
159 + sed -i \
160 + -e 's/linux/cons25/g' \
161 + -e 's/ttyS0/cuaa0/g' \
162 + -e 's/ttyS1/cuaa1/g' \
163 + inittab #121786
164 + fi
165 + if use x86 || use amd64 ; then
166 + sed -i \
167 + -e '/ttyS[01]/s:9600:115200:' \
168 + inittab
169 + fi
170 + if [[ ${#insert[@]} -gt 0 ]] ; then
171 + printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
172 + fi
173 +}
174 +
175 +src_compile() {
176 + tc-export CC
177 + append-lfs-flags
178 + export DISTRO= #381311
179 + export VERSION="${PV}"
180 + use static && append-ldflags -static
181 + emake -C src $(usex selinux 'WITH_SELINUX=yes' '')
182 +}
183 +
184 +src_install() {
185 + emake -C src install ROOT="${D}"
186 + dodoc README doc/*
187 +
188 + insinto /etc
189 + doins "${WORKDIR}"/inittab
190 +
191 + # dead symlink
192 + rm "${ED%/}"/usr/bin/lastb || die
193 +}
194 +
195 +pkg_postinst() {
196 + # Reload init to fix unmounting problems of / on next reboot.
197 + # This is really needed, as without the new version of init cause init
198 + # not to quit properly on reboot, and causes a fsck of / on next reboot.
199 + if [[ ${ROOT} == / ]] ; then
200 + if [[ -e /dev/initctl && ! -e /run/initctl ]]; then
201 + ln -s /dev/initctl /run/initctl
202 + fi
203 + # Do not return an error if this fails
204 + /sbin/telinit U &>/dev/null
205 + fi
206 +
207 + elog "The last/lastb/mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to"
208 + elog "sys-apps/util-linux. The pidof tool has been moved to sys-process/procps."
209 +}