1 |
commit: e844db03b763517f1fcf187ea74d2211f26d5d1c |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 18 08:34:10 2019 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 18 08:38:24 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e844db03 |
7 |
|
8 |
sys-apps/sysvinit: Bump to version 2.94_beta |
9 |
|
10 |
Package-Manager: Portage-2.3.61, Repoman-2.3.12 |
11 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
12 |
|
13 |
sys-apps/sysvinit/Manifest | 1 + |
14 |
.../files/sysvinit-2.94_beta-shutdown-single.patch | 39 +++++++ |
15 |
sys-apps/sysvinit/sysvinit-2.94_beta.ebuild | 128 +++++++++++++++++++++ |
16 |
3 files changed, 168 insertions(+) |
17 |
|
18 |
diff --git a/sys-apps/sysvinit/Manifest b/sys-apps/sysvinit/Manifest |
19 |
index 7b91e7557d4..93b32e5f002 100644 |
20 |
--- a/sys-apps/sysvinit/Manifest |
21 |
+++ b/sys-apps/sysvinit/Manifest |
22 |
@@ -1,2 +1,3 @@ |
23 |
DIST sysvinit-2.91.tar.xz 114412 BLAKE2B 5e044f589f5001c2b5a30eda76bf5c24bb2a7e0d308b7027d54031848407e6b7667b59096044eb186a7f6a862521d4a670c05a17dcc929d07da6515058949606 SHA512 8dcf6de79b03567c300ef5f2b7dd211895745e231510d730092085a15f61f06f28cee7c504b0b022bdcb4b4e903f44946537d4fbb2b5069fb5d29bb099fd45f5 |
24 |
DIST sysvinit-2.93.tar.xz 117580 BLAKE2B 2e771b00dbdc73e76df9e78659aaa5e5fcbfda36290a1b5aa20a5a6fe3540c4616f2a235a668de30d33c620e2d2516da303537eda47b83b29b0844ad7aa77df4 SHA512 c80d07a674253d15ec6382cfaf792f47486e2e84ab9c913d3c9e03b590cf211177a3a14e168f4d1c9c2e97737221f7ac70a75633d90502837a6d29bdc4c48d72 |
25 |
+DIST sysvinit-2.94-beta.tar.xz 120584 BLAKE2B 7fe9bdfcdbccd13cb34a0a48da45314f1d960c49380255f99df151717c9228b6f0cdd8362795d5e6145eb483845cfbb5966937853ff826f60f0db57cd121d06c SHA512 f403e352572247d3a9c30f591d0119950b0332c51dd3c5d33f5140f7effb1832b314322dc79bb4f2958ac370c461808651e1f712d67a877ef7f9e21d463abcb1 |
26 |
|
27 |
diff --git a/sys-apps/sysvinit/files/sysvinit-2.94_beta-shutdown-single.patch b/sys-apps/sysvinit/files/sysvinit-2.94_beta-shutdown-single.patch |
28 |
new file mode 100644 |
29 |
index 00000000000..9aa85229eee |
30 |
--- /dev/null |
31 |
+++ b/sys-apps/sysvinit/files/sysvinit-2.94_beta-shutdown-single.patch |
32 |
@@ -0,0 +1,39 @@ |
33 |
+This patch makes shutdown use the Single User runlevel by default so |
34 |
+the gettys are shutdown too. |
35 |
+ |
36 |
+Roy Marples <uberlord@g.o> |
37 |
+ |
38 |
+Forward-ported from v2.86 to v2.94_beta |
39 |
+Lars Wendler <polynomial-c@g.o> |
40 |
+ |
41 |
+--- sysvinit-2.94/man/shutdown.8 |
42 |
++++ sysvinit-2.94/man/shutdown.8 |
43 |
+@@ -44,7 +44,7 @@ |
44 |
+ \fBshutdown\fP does its job by signalling the \fBinit\fP process, |
45 |
+ asking it to change the runlevel. |
46 |
+ Runlevel \fB0\fP is used to halt the system, runlevel \fB6\fP is used |
47 |
+-to reboot the system, and runlevel \fB1\fP is used to put to system into |
48 |
++to reboot the system, and runlevel \fBS\fP is used to put to system into |
49 |
+ a state where administrative tasks can be performed; this is the default |
50 |
+ if neither the \fI-h\fP or \fI-r\fP flag is given to \fBshutdown\fP. |
51 |
+ To see which actions are taken on halt or reboot see the appropriate |
52 |
+--- sysvinit-2.94/src/shutdown.c |
53 |
++++ sysvinit-2.94/src/shutdown.c |
54 |
+@@ -547,7 +547,7 @@ |
55 |
+ usage(); |
56 |
+ exit(1); |
57 |
+ } |
58 |
+- strcpy(down_level, "1"); |
59 |
++ strcpy(down_level, "S"); |
60 |
+ halttype = NULL; |
61 |
+ memset(when, '\0', WHEN_SIZE); |
62 |
+ |
63 |
+@@ -734,6 +734,8 @@ |
64 |
+ strncpy(newstate, "for reboot", STATELEN); |
65 |
+ break; |
66 |
+ case '1': |
67 |
++ case 'S': |
68 |
++ case 's': |
69 |
+ strncpy(newstate, "to maintenance mode", STATELEN); |
70 |
+ break; |
71 |
+ default: |
72 |
|
73 |
diff --git a/sys-apps/sysvinit/sysvinit-2.94_beta.ebuild b/sys-apps/sysvinit/sysvinit-2.94_beta.ebuild |
74 |
new file mode 100644 |
75 |
index 00000000000..c79dc75f1d4 |
76 |
--- /dev/null |
77 |
+++ b/sys-apps/sysvinit/sysvinit-2.94_beta.ebuild |
78 |
@@ -0,0 +1,128 @@ |
79 |
+# Copyright 1999-2019 Gentoo Authors |
80 |
+# Distributed under the terms of the GNU General Public License v2 |
81 |
+ |
82 |
+EAPI=6 |
83 |
+ |
84 |
+inherit toolchain-funcs flag-o-matic |
85 |
+ |
86 |
+DESCRIPTION="/sbin/init - parent of all processes" |
87 |
+HOMEPAGE="https://savannah.nongnu.org/projects/sysvinit" |
88 |
+SRC_URI="mirror://nongnu/${PN}/${P/_/-}.tar.xz" |
89 |
+ |
90 |
+LICENSE="GPL-2" |
91 |
+SLOT="0" |
92 |
+[[ "${PV}" == *beta* ]] || \ |
93 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
94 |
+IUSE="selinux ibm static kernel_FreeBSD" |
95 |
+ |
96 |
+CDEPEND=" |
97 |
+ selinux? ( |
98 |
+ >=sys-libs/libselinux-1.28 |
99 |
+ )" |
100 |
+DEPEND="${CDEPEND} |
101 |
+ virtual/os-headers" |
102 |
+RDEPEND="${CDEPEND} |
103 |
+ selinux? ( sec-policy/selinux-shutdown ) |
104 |
+ !<sys-apps/openrc-0.13 |
105 |
+" |
106 |
+ |
107 |
+S="${WORKDIR}/${P/_*}" |
108 |
+ |
109 |
+PATCHES=( |
110 |
+ "${FILESDIR}/${PN}-2.86-kexec.patch" #80220 |
111 |
+ "${FILESDIR}/${PN}-2.94_beta-shutdown-single.patch" #158615 |
112 |
+ "${FILESDIR}/${PN}-2.92_beta-shutdown-h.patch" #449354 |
113 |
+) |
114 |
+ |
115 |
+src_prepare() { |
116 |
+ default |
117 |
+ sed -i '/^CPPFLAGS =$/d' src/Makefile || die |
118 |
+ |
119 |
+ # last/lastb/mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux |
120 |
+ # logsave is already in e2fsprogs |
121 |
+ sed -i -r \ |
122 |
+ -e '/^(USR)?S?BIN/s:\<(last|lastb|logsave|mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \ |
123 |
+ -e '/^MAN[18]/s:\<(last|lastb|logsave|mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \ |
124 |
+ src/Makefile || die |
125 |
+ |
126 |
+ # pidof has moved to >=procps-3.3.9 |
127 |
+ sed -i -r \ |
128 |
+ -e '/\/bin\/pidof/d' \ |
129 |
+ -e '/^MAN8/s:\<pidof.8\>::g' \ |
130 |
+ src/Makefile || die |
131 |
+ |
132 |
+ # Mung inittab for specific architectures |
133 |
+ cd "${WORKDIR}" || die |
134 |
+ cp "${FILESDIR}"/inittab-2.91 inittab || die "cp inittab" |
135 |
+ local insert=() |
136 |
+ use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' ) |
137 |
+ use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' ) |
138 |
+ use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' ) |
139 |
+ use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' ) |
140 |
+ use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' ) |
141 |
+ if use ibm ; then |
142 |
+ insert+=( |
143 |
+ '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0' |
144 |
+ '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0' |
145 |
+ ) |
146 |
+ fi |
147 |
+ (use arm || use mips || use sh || use sparc) && sed -i '/ttyS0/s:#::' inittab |
148 |
+ if use kernel_FreeBSD ; then |
149 |
+ sed -i \ |
150 |
+ -e 's/linux/cons25/g' \ |
151 |
+ -e 's/ttyS0/cuaa0/g' \ |
152 |
+ -e 's/ttyS1/cuaa1/g' \ |
153 |
+ inittab #121786 |
154 |
+ fi |
155 |
+ if use x86 || use amd64 ; then |
156 |
+ sed -i \ |
157 |
+ -e '/ttyS[01]/s:9600:115200:' \ |
158 |
+ inittab |
159 |
+ fi |
160 |
+ if [[ ${#insert[@]} -gt 0 ]] ; then |
161 |
+ printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab |
162 |
+ fi |
163 |
+} |
164 |
+ |
165 |
+src_compile() { |
166 |
+ tc-export CC |
167 |
+ append-lfs-flags |
168 |
+ export DISTRO= #381311 |
169 |
+ export VERSION="${PV}" |
170 |
+ use static && append-ldflags -static |
171 |
+ emake -C src $(usex selinux 'WITH_SELINUX=yes' '') |
172 |
+} |
173 |
+ |
174 |
+src_install() { |
175 |
+ emake -C src install ROOT="${D}" |
176 |
+ dodoc README doc/* |
177 |
+ |
178 |
+ insinto /etc |
179 |
+ doins "${WORKDIR}"/inittab |
180 |
+ |
181 |
+ # dead symlink |
182 |
+ rm "${ED%/}"/usr/bin/lastb || die |
183 |
+ |
184 |
+ newinitd "${FILESDIR}"/bootlogd.initd bootlogd |
185 |
+} |
186 |
+ |
187 |
+pkg_postinst() { |
188 |
+ # Reload init to fix unmounting problems of / on next reboot. |
189 |
+ # This is really needed, as without the new version of init cause init |
190 |
+ # not to quit properly on reboot, and causes a fsck of / on next reboot. |
191 |
+ if [[ ${ROOT} == / ]] ; then |
192 |
+ if [[ -e /dev/initctl && ! -e /run/initctl ]]; then |
193 |
+ ln -s /dev/initctl /run/initctl |
194 |
+ fi |
195 |
+ # Do not return an error if this fails |
196 |
+ /sbin/telinit U &>/dev/null |
197 |
+ fi |
198 |
+ |
199 |
+ elog "The last/lastb/mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to" |
200 |
+ elog "sys-apps/util-linux. The pidof tool has been moved to sys-process/procps." |
201 |
+ |
202 |
+ # Required for new bootlogd service |
203 |
+ if [[ ! -e "${EROOT%/}/var/log/boot" ]] ; then |
204 |
+ touch "${EROOT%/}/var/log/boot" |
205 |
+ fi |
206 |
+} |