diff options
-rw-r--r-- | nonsystemd/openrc-desktop/PKGBUILD | 140 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/acpid.confd | 6 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/acpid.initd | 19 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/autoipd-openrc.sh | 32 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/avahi-daemon.initd | 29 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/avahi-dnsconfd.initd | 28 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/bluetoothd.initd | 12 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/displaymanager.install | 3 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/startDM.sh | 25 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/xdm-setup.initd | 13 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/xdm.confd | 10 | ||||
-rw-r--r-- | nonsystemd/openrc-desktop/xdm.initd | 132 |
12 files changed, 449 insertions, 0 deletions
diff --git a/nonsystemd/openrc-desktop/PKGBUILD b/nonsystemd/openrc-desktop/PKGBUILD new file mode 100644 index 000000000..7a96f35f2 --- /dev/null +++ b/nonsystemd/openrc-desktop/PKGBUILD @@ -0,0 +1,140 @@ +# Maintainer (Artix): artoo <artoo@cromnix.org> +# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe> +# Maintainer: David P <megver83@parabola.nu> + +pkgver=20200112 +_commit=bfce6ac47f7b46a3d89a73b9a24c196713914d83 +_url="https://raw.githubusercontent.com/gentoo/gentoo/${_commit}" + +pkgbase=openrc-desktop +pkgname=('acpid-openrc' + 'alsa-utils-openrc' + 'avahi-openrc' + 'bluez-openrc' + 'displaymanager-openrc' + 'gpm-openrc' + 'wpa_supplicant-openrc') +pkgrel=1 +pkgdesc="OpenRC init scripts" +arch=('any') +url="https://github.com/gentoo/gentoo" +license=('GPL2') +groups=('openrc-desktop') +source=('acpid.confd' + 'acpid.initd' + "alsasound.confd::${_url}/media-sound/alsa-utils/files/alsasound.confd-r4" + "alsasound.initd::${_url}/media-sound/alsa-utils/files/alsasound.initd-r6" + 'avahi-daemon.initd' + 'avahi-dnsconfd.initd' + 'autoipd-openrc.sh' + 'bluetoothd.initd' + 'xdm.confd' + 'xdm.initd' + 'xdm-setup.initd' + 'startDM.sh' + "gpm.confd::${_url}/sys-libs/gpm/files/gpm.conf.d" + "gpm.initd::${_url}/sys-libs/gpm/files/gpm.rc6-2" + "wpa_supplicant.confd::${_url}/net-wireless/wpa_supplicant/files/wpa_supplicant-conf.d" + "wpa_supplicant.initd::${_url}/net-wireless/wpa_supplicant/files/wpa_supplicant-init.d" + "${_url}/net-wireless/wpa_supplicant/files/wpa_cli.sh") +sha256sums=('3755d4eb8bb64a1304e5defedb949305ac550565da36fe4f94d5f31beee821ba' + '5dcf5721a129b3782c13fc453853c390c34e2ad4ee00706388ce014454b063ee' + 'd1c55400b701a72dcb8bb85e016b5013fa3eb6a2766ffc20dae278d0ee4c1a43' + 'cf67ba1c4bd13cc6fafdebab40b3e84d09f5b6ec768ed2dcf0ec53d9be296ba4' + '876788303553fe773e64917f76f0208f5e8adf7b91d4af24aa9d6a68a147d646' + 'e128576d72981e402ff106bb481108ab6d5ba941ab1b0f5f53e96a7831fc1d15' + '064a4cedc00f67e93a6f2ef99489e2614305a673a75a2135010283e99da6d6bf' + 'b80a38737be3a1112bc52d2474e8ece3adb405a92623cfb36c3df5aed99ebf51' + '24dc07139087bd2261eb2de268ae5228a37a4db4fc695a7d9e647d95c36044df' + 'a65d8c3a0210e4ec336f6b19900122d3a27c097893773aaf5c7de91d96399b36' + 'cb49240e32b5bb22d7764890e765c94276ec66b597caeacd5121618f614c3bec' + '28dbefc67b332712273047ff0a5776b379217368f9a572665b43c2f486591058' + '73e7483fdc4b12ab4225a4cb13bbe7da71b07b9e69b17e3a6a4c63cb5e2287c8' + 'b48fd8ef0c4e64ca3f3ada72e8e2148a276f86bf3cbb1a165504058bd15385c1' + '27833f60a091464612e74e6171cc98c3e3f994e2fde0ccc4535dd0d84ed041fa' + '98985142371d39ea6294d757e85a3d3fc9fc21718063afbf81869e1d2ca648a7' + 'f3aa34b99a90213c53496f8ea014c487266338791f3526043a7fd97adc651fc6') + +_inst_initd(){ + install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1 + + local _sed_args=() + sed -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \ + -e 's|/var/run|/run|g' \ + -e 's|/sbin|/usr/bin|g' \ + -i ${pkgdir}/etc/init.d/$1 +} + +_inst_confd(){ + install -Dm755 ${srcdir}/$1.confd ${pkgdir}/etc/conf.d/$1 +} + +package_acpid-openrc() { + pkgdesc="OpenRC acpid init script" + depends=('openrc' 'acpid') + backup=('etc/conf.d/acpid') + + _inst_confd 'acpid' + _inst_initd 'acpid' +} + +package_alsa-utils-openrc() { + pkgdesc="OpenRC alsa-utils init script" + depends=('openrc' 'alsa-utils') + backup=('etc/conf.d/alsasound') + + _inst_confd 'alsasound' + _inst_initd 'alsasound' +} + +package_avahi-openrc() { + pkgdesc="OpenRC avahi init script" + depends=('avahi' 'dbus-openrc') + + _inst_initd 'avahi-daemon' + _inst_initd 'avahi-dnsconfd' + + install -Dm755 autoipd-openrc.sh ${pkgdir}/usr/lib/netifrc/net/autoipd.sh +} + +package_bluez-openrc() { + pkgdesc="OpenRC bluez init script" + depends=('bluez' 'openrc') + + _inst_initd 'bluetoothd' +} + +package_displaymanager-openrc() { + pkgdesc="OpenRC display manager init script" + depends=('xorg-server' 'xorg-xinit' 'openrc') + backup=('etc/conf.d/xdm') + install=displaymanager.install + + _inst_confd 'xdm' + _inst_initd 'xdm' + _inst_initd 'xdm-setup' + + install -Dm755 "${srcdir}/startDM.sh" "${pkgdir}/etc/X11/startDM.sh" +} + +package_gpm-openrc() { + pkgdesc="OpenRC gpm init script" + depends=('openrc' 'gpm') + backup=('etc/conf.d/gpm') + + _inst_confd 'gpm' + _inst_initd 'gpm' +} + +package_wpa_supplicant-openrc() { + pkgdesc="OpenRC wpa_supplicant init script" + depends=('openrc' 'wpa_supplicant') + backup=('etc/conf.d/wpa_supplicant') + + _inst_confd 'wpa_supplicant' + _inst_initd 'wpa_supplicant' + + install -Dm755 "${srcdir}/wpa_cli.sh" "${pkgdir}/etc/wpa_supplicant/wpa_cli.sh" + + sed -e "s|gentoo-release|parabola-release|" -i "${pkgdir}/etc/wpa_supplicant/wpa_cli.sh" +} diff --git a/nonsystemd/openrc-desktop/acpid.confd b/nonsystemd/openrc-desktop/acpid.confd new file mode 100644 index 000000000..9aadb4cd8 --- /dev/null +++ b/nonsystemd/openrc-desktop/acpid.confd @@ -0,0 +1,6 @@ +# /etc/conf.d/acpid: config file for /etc/init.d/acpid + +# Options to pass to the acpid daemon. +# See the acpid(8) man page for more info. + +ACPID_ARGS="" diff --git a/nonsystemd/openrc-desktop/acpid.initd b/nonsystemd/openrc-desktop/acpid.initd new file mode 100644 index 000000000..f8076d43b --- /dev/null +++ b/nonsystemd/openrc-desktop/acpid.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" +command="/usr/sbin/acpid" +command_args="${ACPID_ARGS}" +description="Daemon for Advanced Configuration and Power Interface" + +depend() { + need localmount + use logger +} + +reload() { + ebegin "Reloading acpid configuration" + start-stop-daemon --exec $command --signal HUP + eend $? +} diff --git a/nonsystemd/openrc-desktop/autoipd-openrc.sh b/nonsystemd/openrc-desktop/autoipd-openrc.sh new file mode 100644 index 000000000..749085228 --- /dev/null +++ b/nonsystemd/openrc-desktop/autoipd-openrc.sh @@ -0,0 +1,32 @@ +# Copyright (C) 2004-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# Contributed by Sven Wegener (swegener@gentoo.org) + +_config_vars="$_config_vars autoipd" + +autoipd_depend() { + program /usr/bin/avahi-autoipd + after interface +} + +autoipd_start() { + _exists true || return 1 + + eval args=\$autoipd_${IFVAR} + + ebegin "Starting avahi-autoipd" + /usr/bin/avahi-autoipd --daemonize --syslog --wait ${args} "${IFACE}" + eend "${?}" || return 1 + + _show_address + + return 0 +} + +autoipd_stop() { + /usr/bin/avahi-autoipd --check --syslog "${IFACE}" || return 0 + + ebegin "Stopping avahi-autoipd" + /usr/bin/avahi-autoipd --kill --syslog "${IFACE}" + eend "${?}" +} diff --git a/nonsystemd/openrc-desktop/avahi-daemon.initd b/nonsystemd/openrc-desktop/avahi-daemon.initd new file mode 100644 index 000000000..3db552903 --- /dev/null +++ b/nonsystemd/openrc-desktop/avahi-daemon.initd @@ -0,0 +1,29 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +depend() { + before netmount nfsmount + use net + need dbus +} + +start() { + ebegin "Starting avahi-daemon" + /usr/bin/avahi-daemon -D + eend $? +} + +stop() { + ebegin "Stopping avahi-daemon" + /usr/bin/avahi-daemon -k + eend $? +} + +reload() { + ebegin "Reloading avahi-daemon" + /usr/bin/avahi-daemon -r + eend $? +} diff --git a/nonsystemd/openrc-desktop/avahi-dnsconfd.initd b/nonsystemd/openrc-desktop/avahi-dnsconfd.initd new file mode 100644 index 000000000..1389a2889 --- /dev/null +++ b/nonsystemd/openrc-desktop/avahi-dnsconfd.initd @@ -0,0 +1,28 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +depend() { + need avahi-daemon + use net +} + +start() { + ebegin "Starting avahi-dnsconfd" + /usr/bin/avahi-dnsconfd -D + eend $? +} + +stop() { + ebegin "Stopping avahi-dnsconfd" + /usr/bin/avahi-dnsconfd -k + eend $? +} + +reload() { + ebegin "Reloading avahi-dnsconfd" + /usr/bin/avahi-dnsconfd -r + eend $? +} diff --git a/nonsystemd/openrc-desktop/bluetoothd.initd b/nonsystemd/openrc-desktop/bluetoothd.initd new file mode 100644 index 000000000..a3d02e55c --- /dev/null +++ b/nonsystemd/openrc-desktop/bluetoothd.initd @@ -0,0 +1,12 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +pidfile="/run/bluetoothd.pid" +command="/usr/lib/bluetooth/bluetoothd" +command_background=1 + +depend() { + after coldplug + need dbus localmount hostname +} diff --git a/nonsystemd/openrc-desktop/displaymanager.install b/nonsystemd/openrc-desktop/displaymanager.install new file mode 100644 index 000000000..dfd82b365 --- /dev/null +++ b/nonsystemd/openrc-desktop/displaymanager.install @@ -0,0 +1,3 @@ +post_install() { + echo " ==> Edit /etc/conf.d/xdm to set DM." +} diff --git a/nonsystemd/openrc-desktop/startDM.sh b/nonsystemd/openrc-desktop/startDM.sh new file mode 100644 index 000000000..489a73930 --- /dev/null +++ b/nonsystemd/openrc-desktop/startDM.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 + +# We need to source /etc/profile for stuff like $LANG to work +# bug #10190. +. /etc/profile + +. /etc/init.d/functions.sh + +# Great new Gnome2 feature, AA +# We enable this by default +export GDK_USE_XFT=1 + +export SVCNAME=xdm +EXEC="$(get_options service)" +NAME="$(get_options name)" +PIDFILE="$(get_options pidfile)" +START_STOP_ARGS="$(get_options start_stop_args)" + +start-stop-daemon --start --exec ${EXEC} \ +${NAME:+--name} ${NAME} ${PIDFILE:+--pidfile} ${PIDFILE} ${START_STOP_ARGS} || \ +eerror "ERROR: could not start the Display Manager" + +# vim:ts=4 diff --git a/nonsystemd/openrc-desktop/xdm-setup.initd b/nonsystemd/openrc-desktop/xdm-setup.initd new file mode 100644 index 000000000..05f41a90a --- /dev/null +++ b/nonsystemd/openrc-desktop/xdm-setup.initd @@ -0,0 +1,13 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need localmount +} + +start() { + if get_bootparam "nox" ; then + touch /etc/.noxdm + fi +} diff --git a/nonsystemd/openrc-desktop/xdm.confd b/nonsystemd/openrc-desktop/xdm.confd new file mode 100644 index 000000000..f6ebd0b8e --- /dev/null +++ b/nonsystemd/openrc-desktop/xdm.confd @@ -0,0 +1,10 @@ +# We always try and start X on a static VT. The various DMs normally default +# to using VT7. If you wish to use the xdm init script, then you should ensure +# that the VT checked is the same VT your DM wants to use. We do this check to +# ensure that you haven't accidentally configured something to run on the VT +# in your /etc/inittab file so that you don't get a dead keyboard. +CHECKVT=7 + +# What display manager do you use ? [ xdm | gdm | sddm | gpe | entrance | lightdm | lxdm ] +# NOTE: If this is set in /etc/rc.conf, that setting will override this one. +DISPLAYMANAGER="xdm" diff --git a/nonsystemd/openrc-desktop/xdm.initd b/nonsystemd/openrc-desktop/xdm.initd new file mode 100644 index 000000000..545aea188 --- /dev/null +++ b/nonsystemd/openrc-desktop/xdm.initd @@ -0,0 +1,132 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 + +depend() { + need localmount xdm-setup + + # this should start as early as possible + after bootmisc consolefont modules netmount + after readahead-list ypbind autofs openvpn gpm lircmd + after quota keymaps + before alsasound + + # Start before X + use elogind dbus xfs +} + +setup_dm() { + local MY_XDM + + MY_XDM=$(echo "${DISPLAYMANAGER}" | tr '[:upper:]' '[:lower:]') + + NAME= + case "${MY_XDM}" in + entrance*) + EXE=/usr/bin/entrance + PIDFILE=/run/entrance.pid + ;; + gdm|gnome) + EXE=/usr/bin/gdm + PIDFILE=/run/gdm/gdm.pid + START_STOP_ARGS="--background" + AUTOCLEAN_CGROUP="yes" + ;; + wdm) + EXE=/usr/bin/wdm + PIDFILE= + ;; + gpe) + EXE=/usr/bin/gpe-dm + PIDFILE=/run/gpe-dm.pid + ;; + lxdm) + EXE=/usr/bin/lxdm-binary + PIDFILE=/run/lxdm.pid + START_STOP_ARGS="--background" + ;; + lightdm) + EXE=/usr/bin/lightdm + PIDFILE=/run/lightdm.pid + START_STOP_ARGS="--background" + ;; + sddm) + EXE="/usr/bin/sddm" + START_STOP_ARGS="-m --background" + PIDFILE=/run/sddm.pid + ;; + *) + # first find out if there is such executable + EXE="$(command -v ${MY_XDM} 2>/dev/null)" + PIDFILE="/run/${MY_XDM}.pid" + + # warn user that he is doing sick things if the exe was not found + if [ -z "${EXE}" ]; then + echo "ERROR: Your XDM value is invalid." + echo " No ${MY_XDM} executable could be found on your system." + fi + ;; + esac + + if ! [ -x "${EXE}" ]; then + EXE=/usr/bin/xdm + PIDFILE=/run/xdm.pid + if ! [ -x "/usr/bin/xdm" ]; then + echo "ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm," + echo " or install x11-apps/xdm package" + eend 255 + fi + fi +} + +start() { + local EXE NAME PIDFILE AUTOCLEAN_CGROUP + setup_dm + + if [ -f /etc/.noxdm ]; then + einfo "Skipping ${EXE##*/}, /etc/.noxdm found or \"nox\" bootparam passed." + rm /etc/.noxdm + return 0 + fi + + ebegin "Setting up ${EXE##*/}" + + # save the prefered DM + save_options "service" "${EXE}" + save_options "name" "${NAME}" + save_options "pidfile" "${PIDFILE}" + save_options "start_stop_args" "${START_STOP_ARGS}" + save_options "autoclean_cgroup" "${AUTOCLEAN_CGROUP:-no}" + + /etc/X11/startDM.sh + eend 0 +} + +stop() { + local retval + + retval=0 + + local myexe myname mypidfile myservice + myexe=$(get_options "service") + myname=$(get_options "name") + mypidfile=$(get_options "pidfile") + myservice=${myexe##*/} + yesno "${rc_cgroup_cleanup:-no}" || rc_cgroup_cleanup=$(get_options "autoclean_cgroup") + + [ -z "${myexe}" ] && return 0 + + ebegin "Stopping ${myservice}" + + if start-stop-daemon --quiet --test --stop --exec "${myexe}"; then + start-stop-daemon --stop --exec "${myexe}" --retry TERM/5/TERM/5 \ + ${mypidfile:+--pidfile} ${mypidfile} \ + ${myname:+--name} ${myname} + retval=${?} + fi + + eend ${retval} "Error stopping ${myservice}" + return ${retval} +} + +# vim: set ts=4 : |