From a588fe86f723edbb0cf84cfb735ac7a259309fef Mon Sep 17 00:00:00 2001 From: gordonb3 Date: Mon, 10 Jul 2023 18:47:58 +0200 Subject: [PATCH] revert Gentoo disabling of sysvinit (initctl) compatibility with systemd --- systemd/etc/portage/bashrc | 18 ++++++++ systemd/etc/portage/env/sys-apps/systemd | 7 ++++ .../restore-sysvinit-compatibility.patch | 42 +++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 systemd/etc/portage/bashrc create mode 100644 systemd/etc/portage/env/sys-apps/systemd create mode 100644 systemd/etc/portage/patches/sys-apps/systemd/restore-sysvinit-compatibility.patch diff --git a/systemd/etc/portage/bashrc b/systemd/etc/portage/bashrc new file mode 100644 index 0000000..7359f8d --- /dev/null +++ b/systemd/etc/portage/bashrc @@ -0,0 +1,18 @@ +case ${CATEGORY}/${PN} in + sys-devel/distcc | sys-devel/gcc | sys-devel/gcc-config) + # Hey man, how come that CONFIG PROTECT don't work? + if [ "${EBUILD_PHASE}" == "postinst" ] || [ "${EBUILD_PHASE}" == "postrm" ]; + then + /usr/share/distcc/distcc-fix & + fi + ;; +esac + + +if [ "${EBUILD_PHASE_FUNC}" == "pkg_preinst" ]; +then + # prevent spamming the log with non matching servive names in /etc/init.d + rm -v ${ED}/etc/init.d/* + rmdir -v ${ED}/etc/init.d +fi + diff --git a/systemd/etc/portage/env/sys-apps/systemd b/systemd/etc/portage/env/sys-apps/systemd new file mode 100644 index 0000000..8b415d6 --- /dev/null +++ b/systemd/etc/portage/env/sys-apps/systemd @@ -0,0 +1,7 @@ +post_src_install() +{ + rm -f "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} + rm -f "${ED}"/usr/share/man/man1/init.1 + rm -f "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 +} + diff --git a/systemd/etc/portage/patches/sys-apps/systemd/restore-sysvinit-compatibility.patch b/systemd/etc/portage/patches/sys-apps/systemd/restore-sysvinit-compatibility.patch new file mode 100644 index 0000000..2a8be46 --- /dev/null +++ b/systemd/etc/portage/patches/sys-apps/systemd/restore-sysvinit-compatibility.patch @@ -0,0 +1,42 @@ +From: Gordon Bos +Date: Wed, 10 Jul 2023 16:08:12 +0200 +Subject: unwelcome forced disabling of sysvinit compatibility + +In all their wisdom Gentoo devs have forcibly disabled sysvinit +compatibility, however on the B3 we require this compatibility +for correct handling of the power button. This patch circumvents +the raised issue by ignoring the configure options that are +being passed by the ebuild + + +diff -ru a/meson.build b/meson.build +--- a/meson.build ++++ b/meson.build +@@ -108,8 +108,8 @@ + + have_standalone_binaries = get_option('standalone-binaries') + +-sysvinit_path = get_option('sysvinit-path') +-sysvrcnd_path = get_option('sysvrcnd-path') ++sysvinit_path = get_option('b3-sysvinit-path') ++sysvrcnd_path = get_option('b3-sysvrcnd-path') + conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '', + description : 'SysV init scripts and rcN.d links are supported') + conf.set10('CREATE_LOG_DIRS', get_option('create-log-dirs')) +diff -ru a/meson_options.txt b/meson_options.txt +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -43,8 +43,12 @@ + + option('sysvinit-path', type : 'string', value : '/etc/init.d', + description : 'the directory where the SysV init scripts are located') ++option('b3-sysvinit-path', type : 'string', value : '/etc/init.d', ++ description : 'the directory where the SysV init scripts are located') + option('sysvrcnd-path', type : 'string', value : '/etc/rc.d', + description : 'the base directory for SysV rcN.d directories') ++option('b3-sysvrcnd-path', type : 'string', value : '/etc/rc.d', ++ description : 'the base directory for SysV rcN.d directories') + option('telinit-path', type : 'string', value : '/lib/sysvinit/telinit', + description : 'path to telinit') + option('rc-local', type : 'string', +