diff options
Diffstat (limited to 'sys-apps/sysvinit')
-rw-r--r-- | sys-apps/sysvinit/Manifest | 3 | ||||
-rw-r--r-- | sys-apps/sysvinit/metadata.xml | 3 | ||||
-rw-r--r-- | sys-apps/sysvinit/sysvinit-2.99-r1.ebuild | 149 |
3 files changed, 154 insertions, 1 deletions
diff --git a/sys-apps/sysvinit/Manifest b/sys-apps/sysvinit/Manifest index bd46056..6cd678c 100644 --- a/sys-apps/sysvinit/Manifest +++ b/sys-apps/sysvinit/Manifest @@ -6,5 +6,6 @@ AUX sysvinit-2.94_beta-shutdown-single.patch 1261 BLAKE2B 571b7cf40ccdbb27e65b31 AUX sysvinit-2.99-force-poweroff.patch 470 BLAKE2B 9d7ec8d81641b57a3ffac35a8fe53491028dd6b71866cf43593e5d9a9f270af31c5fa959aded213e3bd38a5c5bb0e055015545c35aa627f4d9a427cff627e174 SHA512 d28654a122055169b4bc51f4081d5f770885e6ae13d9467308f26721cb9774a37623d7e1f4e8da993944f35328a82cd157d6f5bedcbb5d4baf172da752b84d72 AUX sysvinit-2.99-shutdown-h.patch 2684 BLAKE2B 57c27b8646a0b47f66eb103450e645fa45220a1bf79da86207ffa1393c311cb4c4a2ad9b8b7bf81cc4ae2ccb2acb19b66fd575935d8a0b0a2a9b3899c0088c9f SHA512 ef33da0d5673180275c8120c6904a4214cf1308827a626d8d6a2aab67d7d25b5407f9efcaf6a7a4a09a8c409899242943f6a95881cc8c8898b780224f991f2f7 DIST sysvinit-2.99.tar.xz 126908 BLAKE2B b82c745d5b695f918d4a163e7b9eaceccc07a46f73c3782c7771cc29a8600be13de4ff30891086df5773d60f37fa3b0f58566ccaf72cd70af68083b51152a38b SHA512 34f328d7d2e6ceddcddfebab49eb9c34e90dc96decf2caeb89dffd2ade54322fa4a3cb9fa1e1a4bc687e07fcb0a13e5aebe6186582a9f5c9153e1513baa87ddd +EBUILD sysvinit-2.99-r1.ebuild 4148 BLAKE2B 199a03887551884ca4b1452c205943c45616c8101aeb7ecb5f1ffb094bb5200394deef2df158c9f357d57eeec25ba8d714f6db297e9a071bdb96d72e8625698e SHA512 bc7a6e7e287c61ddd3dc25bc83eedb4084d75b4da32a2244992a8edfa5fdb12e2fb4b5d0a2bc2fd6b9a0914825a4a8cce6b3dea9c7673c520b7e4ac21e61621d EBUILD sysvinit-2.99.ebuild 4089 BLAKE2B a9893ec8278e5f53528e15dab927b4f14e083861ef6017302ea6c5023bf108544c457c4d1a75c83801db10f3784694150828432e8986bdaf114aeb4d85ea876e SHA512 c53a1713ca68fccab0ad9e5483ecc0281546a14f7b04f59cb2bb949ad42a4b645ba2c31b4fc1a1a75b0431110bd22fb6e6dcb9ed5e8a12cd876f8c4e1db134f7 -MISC metadata.xml 358 BLAKE2B c1093363e2c2f9cbce13e3a7025cf2f767b526e90bcdbe32714aba5aef411483e013facfc014c89ac591feae0fa733902be185ac8a0c673e56799b8168ad77ed SHA512 37306b4ebf69803889059875a22ceccde18725cc21e5a598496c30a377e6cb1d3d9ca88123121b2a70c2436b3a77530415169b53165de93ea8510cc41fbb589f +MISC metadata.xml 451 BLAKE2B fef956bfea362642015d5f53f4d988967545ac34f38bc0d307940cc7d990c7bb640869b2613a878b2911322f2dd511ac03b4794807da246961d38662bdc894e3 SHA512 afa37929bb1610e47bb83adfac61df5d3fe25f6e5f23e8e81ef19729abf51ae97168a1b81d877dfe2a682d7889e14e8e8cc419cca7e5950e516d93853cbd6616 diff --git a/sys-apps/sysvinit/metadata.xml b/sys-apps/sysvinit/metadata.xml index 53e0495..f289a88 100644 --- a/sys-apps/sysvinit/metadata.xml +++ b/sys-apps/sysvinit/metadata.xml @@ -9,4 +9,7 @@ <email>base-system@gentoo.org</email> <name>Gentoo Base System</name> </maintainer> + <use> + <flag name="force-poweroff">Force poweroff when called as reboot</flag> + </use> </pkgmetadata> diff --git a/sys-apps/sysvinit/sysvinit-2.99-r1.ebuild b/sys-apps/sysvinit/sysvinit-2.99-r1.ebuild new file mode 100644 index 0000000..5636532 --- /dev/null +++ b/sys-apps/sysvinit/sysvinit-2.99-r1.ebuild @@ -0,0 +1,149 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs flag-o-matic + +DESCRIPTION="/sbin/init - parent of all processes" +HOMEPAGE="https://savannah.nongnu.org/projects/sysvinit" +SRC_URI="mirror://nongnu/${PN}/${P/_/-}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +[[ "${PV}" == *beta* ]] || \ +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" +IUSE="selinux ibm static kernel_FreeBSD +force-poweroff" + +CDEPEND=" + selinux? ( + >=sys-libs/libselinux-1.28 + )" +DEPEND="${CDEPEND} + virtual/os-headers" +RDEPEND="${CDEPEND} + selinux? ( sec-policy/selinux-shutdown ) + !<sys-apps/openrc-0.13 +" + +S="${WORKDIR}/${P/_*}" + +PATCHES=( + "${FILESDIR}/${PN}-2.86-kexec.patch" #80220 + "${FILESDIR}/${PN}-2.94_beta-shutdown-single.patch" #158615 + "${FILESDIR}/${PN}-2.99-shutdown-h.patch" #449354 +) + +src_prepare() { + default + + if use force-poweroff ; then + eapply "${FILESDIR}/${PN}-2.99-force-poweroff.patch" + fi + + sed -i \ + -e '/^CPPFLAGS =$/d' \ + -e '/^override CFLAGS +=/s/ -fstack-protector-strong//' \ + src/Makefile || die + + # last/lastb/mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux + sed -i -r \ + -e '/^(USR)?S?BIN/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \ + -e '/^MAN[18]/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \ + src/Makefile || die + + # pidof has moved to >=procps-3.3.9 + sed -i -r \ + -e '/\/bin\/pidof/d' \ + -e '/^MAN8/s:\<pidof.8\>::g' \ + src/Makefile || die + + # logsave is already in e2fsprogs + sed -i -r \ + -e '/^(USR)?S?BIN/s:\<logsave\>::g' \ + -e '/^MAN8/s:\<logsave.8\>::g' \ + src/Makefile || die + + # Mung inittab for specific architectures + cd "${WORKDIR}" || die + cp "${FILESDIR}"/inittab-2.98-r1 inittab || die "cp inittab" + local insert=() + use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' ) + use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' ) + use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' ) + use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' ) + use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' ) + use riscv && insert=( 'sif0:12345:respawn:/sbin/agetty -L 115200 ttySIF0 vt100' ) + if use ibm ; then + insert+=( + '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0' + '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0' + ) + fi + (use arm || use mips || use sparc) && sed -i '/ttyS0/s:#::' inittab + if use kernel_FreeBSD ; then + sed -i \ + -e 's/linux/cons25/g' \ + -e 's/ttyS0/cuaa0/g' \ + -e 's/ttyS1/cuaa1/g' \ + inittab #121786 + fi + if use x86 || use amd64 ; then + sed -i \ + -e '/ttyS[01]/s:9600:115200:' \ + inittab + fi + if [[ ${#insert[@]} -gt 0 ]] ; then + printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab + fi +} + +src_compile() { + tc-export CC + append-lfs-flags + export DISTRO= #381311 + export VERSION="${PV}" + use static && append-ldflags -static + emake -C src $(usex selinux 'WITH_SELINUX=yes' '') +} + +src_install() { + emake -C src install ROOT="${D}" + dodoc README doc/* + + insinto /etc + doins "${WORKDIR}"/inittab + + newinitd "${FILESDIR}"/bootlogd.initd bootlogd + into / + dosbin "${FILESDIR}"/halt.sh + + keepdir /etc/inittab.d + + # dead symlink + find "${ED}" -xtype l -delete || die + + find "${ED}" -type d -empty -delete || die +} + +pkg_postinst() { + # Reload init to fix unmounting problems of / on next reboot. + # This is really needed, as without the new version of init cause init + # not to quit properly on reboot, and causes a fsck of / on next reboot. + if [[ -z ${ROOT} ]] ; then + if [[ -e /dev/initctl ]] && [[ ! -e /run/initctl ]] ; then + ln -s /dev/initctl /run/initctl \ + || ewarn "Failed to set /run/initctl symlink!" + fi + # Do not return an error if this fails + /sbin/telinit U &>/dev/null + fi + + elog "The last/lastb/mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to" + elog "sys-apps/util-linux. The pidof tool has been moved to sys-process/procps." + + # Required for new bootlogd service + if [[ ! -e "${EROOT}/var/log/boot" ]] ; then + touch "${EROOT}/var/log/boot" + fi +} |