summaryrefslogtreecommitdiff
path: root/pcr/openrc-base
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/openrc-base')
-rw-r--r--pcr/openrc-base/1.0.6-dmcrypt.confd98
-rw-r--r--pcr/openrc-base/1.5.1-dmcrypt.rc353
-rw-r--r--pcr/openrc-base/PKGBUILD269
-rw-r--r--pcr/openrc-base/anacron-1.0-initd18
-rw-r--r--pcr/openrc-base/cronie-1.3-initd14
-rw-r--r--pcr/openrc-base/cronie.install16
-rw-r--r--pcr/openrc-base/cryptsetup.install16
-rw-r--r--pcr/openrc-base/dbus.initd50
-rw-r--r--pcr/openrc-base/dbus.install16
-rw-r--r--pcr/openrc-base/device-mapper.conf-1.02.22-r31
-rw-r--r--pcr/openrc-base/device-mapper.install20
-rw-r--r--pcr/openrc-base/device-mapper.rc-2.02.105-r2147
-rw-r--r--pcr/openrc-base/dhcpcd.initd17
-rw-r--r--pcr/openrc-base/dhcpcd.install16
-rw-r--r--pcr/openrc-base/dmeventd.initd-2.02.67-r126
-rw-r--r--pcr/openrc-base/eudev.install14
-rw-r--r--pcr/openrc-base/glibc.install16
-rw-r--r--pcr/openrc-base/inetutils.confd8
-rw-r--r--pcr/openrc-base/inetutils.initd27
-rw-r--r--pcr/openrc-base/inetutils.install16
-rw-r--r--pcr/openrc-base/lvm-monitoring.initd-2.02.105-r239
-rw-r--r--pcr/openrc-base/lvm.confd-2.02.28-r25
-rw-r--r--pcr/openrc-base/lvm.rc-2.02.105-r297
-rw-r--r--pcr/openrc-base/lvm2.install24
-rw-r--r--pcr/openrc-base/lvmetad.initd-2.02.105-r213
-rw-r--r--pcr/openrc-base/mdadm.confd7
-rw-r--r--pcr/openrc-base/mdadm.install16
-rw-r--r--pcr/openrc-base/mdadm.rc26
-rw-r--r--pcr/openrc-base/mdraid.confd5
-rw-r--r--pcr/openrc-base/mdraid.rc40
-rw-r--r--pcr/openrc-base/nscd64
-rw-r--r--pcr/openrc-base/udev-postmount55
32 files changed, 1549 insertions, 0 deletions
diff --git a/pcr/openrc-base/1.0.6-dmcrypt.confd b/pcr/openrc-base/1.0.6-dmcrypt.confd
new file mode 100644
index 000000000..9747dff11
--- /dev/null
+++ b/pcr/openrc-base/1.0.6-dmcrypt.confd
@@ -0,0 +1,98 @@
+# /etc/conf.d/dmcrypt
+
+# For people who run dmcrypt on top of some other layer (like raid),
+# use rc_need to specify that requirement. See the runscript(8) man
+# page for more information.
+
+#--------------------
+# Instructions
+#--------------------
+
+# Note regarding the syntax of this file. This file is *almost* bash,
+# but each line is evaluated separately. Separate swaps/targets can be
+# specified. The init-script which reads this file assumes that a
+# swap= or target= line starts a new section, similar to lilo or grub
+# configuration.
+
+# Note when using gpg keys and /usr on a separate partition, you will
+# have to copy /usr/bin/gpg to /bin/gpg so that it will work properly
+# and ensure that gpg has been compiled statically.
+# See http://bugs.gentoo.org/90482 for more information.
+
+# Note that the init-script which reads this file detects whether your
+# partition is LUKS or not. No mkfs is run unless you specify a makefs
+# option.
+
+# Global options:
+#----------------
+
+# Max number of checks to perform (1 per second)
+#dmcrypt_max_timeout=120
+
+# Arguments:
+#-----------
+# target=<name> == Mapping name for partition.
+# swap=<name> == Mapping name for swap partition.
+# source='<dev>' == Real device for partition.
+# key='</path/to/keyfile>[:<mode>]' == Fullpath from / or from inside removable media.
+# remdev='<dev>' == Device that will be assigned to removable media.
+# gpg_options='<opts>' == Default are --quiet --decrypt
+# options='<opts>' == cryptsetup, for LUKS you can only use --readonly
+# loop_file='<file>' == Loopback file.
+# pre_mount='cmds' == commands to execute before mounting partition.
+# post_mount='cmds' == commands to execute after mounting partition.
+#-----------
+# Supported Modes
+# gpg == decrypt and pipe key into cryptsetup.
+# Note: new-line character must not be part of key.
+# Command to erase \n char: 'cat key | tr -d '\n' > cleanKey'
+
+#--------------------
+# dm-crypt examples
+#--------------------
+
+## swap
+# Swap partitions. These should come first so that no keys make their
+# way into unencrypted swap.
+# If no options are given, they will default to: -c aes -h sha1 -d /dev/urandom
+# If no makefs is given then mkswap will be assumed
+#swap=crypt-swap
+#source='/dev/hda2'
+
+## /home with passphrase
+#target=crypt-home
+#source='/dev/hda5'
+
+## /home with regular keyfile
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey'
+
+## /home with gpg protected key
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey:gpg'
+
+## /home with regular keyfile on removable media(such as usb-stick)
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey'
+#remdev='/dev/sda1'
+
+##/home with gpg protected key on removable media(such as usb-stick)
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey:gpg'
+#remdev='/dev/sda1'
+
+##/tmp with regular keyfile
+#target=crypt-tmp
+#source='/dev/hda6'
+#key='/full/path/to/tmpkey'
+#pre_mount='/sbin/mkreiserfs -f -f ${dev}'
+#post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}'
+
+## Loopback file example
+#target='crypt-loop-home'
+#source='/dev/loop0'
+#loop_file='/mnt/crypt/home'
diff --git a/pcr/openrc-base/1.5.1-dmcrypt.rc b/pcr/openrc-base/1.5.1-dmcrypt.rc
new file mode 100644
index 000000000..9415a0bce
--- /dev/null
+++ b/pcr/openrc-base/1.5.1-dmcrypt.rc
@@ -0,0 +1,353 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc,v 1.2 2014/10/19 04:37:19 vapier Exp $
+
+depend() {
+ before checkfs fsck
+}
+
+# We support multiple dmcrypt instances based on $SVCNAME
+execute_hook="dm_crypt_execute_dmcrypt"
+# XXX: Should we drop this ?
+# execute_hook="dm_crypt_execute_localmount"
+conf_file="/etc/conf.d/${SVCNAME}"
+
+# Get splash helpers if available.
+if [ -e /sbin/splash-functions.sh ] ; then
+ . /sbin/splash-functions.sh
+fi
+
+# Setup mappings for an individual target/swap
+# Note: This relies on variables localized in the main body below.
+dm_crypt_execute_dmcrypt() {
+ local dev ret mode foo
+
+ if [ -n "${target}" ] ; then
+ # let user set options, otherwise leave empty
+ : ${options:=' '}
+ elif [ -n "${swap}" ] ; then
+ if cryptsetup isLuks ${source} 2>/dev/null ; then
+ ewarn "The swap you have defined is a LUKS partition. Aborting crypt-swap setup."
+ return
+ fi
+ target=${swap}
+ # swap contents do not need to be preserved between boots, luks not required.
+ # suspend2 users should have initramfs's init handling their swap partition either way.
+ : ${options:='-c aes -h sha1 -d /dev/urandom'}
+ : ${pre_mount:='mkswap ${dev}'}
+ else
+ return
+ fi
+ if [ "x${source#UUID}" != "x${source}" ]; then
+ source=${source#UUID=}
+ source="$(blkid -U ${source})"
+ fi
+ if [ -z "${source}" ] && [ ! -e "${source}" ] ; then
+ ewarn "source \"${source}\" for ${target} missing, skipping..."
+ return
+ fi
+
+ if [ -n "${loop_file}" ] ; then
+ dev="/dev/mapper/${target}"
+ ebegin " Setting up loop device ${source}"
+ losetup ${source} ${loop_file}
+ fi
+
+ # cryptsetup:
+ # open <device> <name> # <device> is $source
+ # create <name> <device> # <name> is $target
+ local arg1="create" arg2="${target}" arg3="${source}"
+ if cryptsetup isLuks ${source} 2>/dev/null ; then
+ arg1="open"
+ arg2="${source}"
+ arg3="${target}"
+ fi
+
+ # Older versions reported:
+ # ${target} is active:
+ # Newer versions report:
+ # ${target} is active[ and is in use.]
+ if cryptsetup status ${target} | egrep -q ' is active' ; then
+ einfo "dm-crypt mapping ${target} is already configured"
+ return
+ fi
+ splash svc_input_begin ${SVCNAME} >/dev/null 2>&1
+
+ # Handle keys
+ if [ -n "${key}" ] ; then
+ read_abort() {
+ # some colors
+ local ans savetty resettty
+ [ -z "${NORMAL}" ] && eval $(eval_ecolors)
+ einfon " $1? (${WARN}yes${NORMAL}/${GOOD}No${NORMAL}) "
+ shift
+ # This is ugly as s**t. But POSIX doesn't provide `read -t`, so
+ # we end up having to implement our own crap with stty/etc...
+ savetty=$(stty -g)
+ resettty='stty ${savetty}; trap - EXIT HUP INT TERM'
+ trap 'eval "${resettty}"' EXIT HUP INT TERM
+ stty -icanon
+ [ "${1}" = -t ] && stty min 0 time "$(( $2 * 10 ))"
+ ans=$(dd count=1 bs=1 2>/dev/null) || ans=''
+ eval "${resettty}"
+ if [ -z "${ans}" ] ; then
+ printf '\r'
+ else
+ echo
+ fi
+ case ${ans} in
+ [yY]) return 0;;
+ *) return 1;;
+ esac
+ }
+
+ # Notes: sed not used to avoid case where /usr partition is encrypted.
+ mode=${key/*:/} && ( [ "${mode}" = "${key}" ] || [ -z "${mode}" ] ) && mode=reg
+ key=${key/:*/}
+ case "${mode}" in
+ gpg|reg)
+ # handle key on removable device
+ if [ -n "${remdev}" ] ; then
+ # temp directory to mount removable device
+ local mntrem="${RC_SVCDIR}/dm-crypt-remdev.$$"
+ if [ ! -d "${mntrem}" ] ; then
+ if ! mkdir -p "${mntrem}" ; then
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: Unable to create temporary mount point '${mntrem}'"
+ return
+ fi
+ fi
+ i=0
+ einfo "Please insert removable device for ${target}"
+ while [ ${i} -lt ${dmcrypt_max_timeout:-120} ] ; do
+ foo=""
+ if mount -n -o ro "${remdev}" "${mntrem}" 2>/dev/null >/dev/null ; then
+ # keyfile exists?
+ if [ ! -e "${mntrem}${key}" ] ; then
+ umount -n "${mntrem}"
+ rmdir "${mntrem}"
+ einfo "Cannot find ${key} on removable media."
+ read_abort "Abort" ${read_timeout:--t 1} && return
+ else
+ key="${mntrem}${key}"
+ break
+ fi
+ else
+ [ -e "${remdev}" ] \
+ && foo="mount failed" \
+ || foo="mount source not found"
+ fi
+ : $((i += 1))
+ read_abort "Stop waiting after $i attempts (${foo})" -t 1 && return
+ done
+ else # keyfile ! on removable device
+ if [ ! -e "${key}" ] ; then
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: keyfile ${key} does not exist."
+ return
+ fi
+ fi
+ ;;
+ *)
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: mode ${mode} is invalid."
+ return
+ ;;
+ esac
+ else
+ mode=none
+ fi
+ ebegin " ${target} using: ${options} ${arg1} ${arg2} ${arg3}"
+ if [ "${mode}" = "gpg" ] ; then
+ : ${gpg_options:='-q -d'}
+ # gpg available ?
+ if type -p gpg >/dev/null ; then
+ for i in 0 1 2 ; do
+ # paranoid, don't store key in a variable, pipe it so it stays very little in ram unprotected.
+ # save stdin stdout stderr "values"
+ gpg ${gpg_options} ${key} 2>/dev/null | cryptsetup ${options} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ [ ${ret} -eq 0 ] && break
+ done
+ eend ${ret} "failure running cryptsetup"
+ else
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: cannot find gpg application."
+ einfo "You have to install app-crypt/gnupg first."
+ einfo "If you have /usr on its own partition, try copying gpg to /bin ."
+ fi
+ else
+ if [ "${mode}" = "reg" ] ; then
+ cryptsetup ${options} -d ${key} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ eend ${ret} "failure running cryptsetup"
+ else
+ cryptsetup ${options} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ eend ${ret} "failure running cryptsetup"
+ fi
+ fi
+ if [ -d "${mntrem}" ] ; then
+ umount -n ${mntrem} 2>/dev/null >/dev/null
+ rmdir ${mntrem} 2>/dev/null >/dev/null
+ fi
+ splash svc_input_end ${SVCNAME} >/dev/null 2>&1
+
+ if [ ${ret} -ne 0 ] ; then
+ cryptfs_status=1
+ else
+ if [ -n "${pre_mount}" ] ; then
+ dev="/dev/mapper/${target}"
+ ebegin " pre_mount: ${pre_mount}"
+ eval "${pre_mount}" > /dev/null
+ ewend $? || cryptfs_status=1
+ fi
+ fi
+}
+
+# Run any post_mount commands for an individual mount
+#
+# Note: This relies on variables localized in the main body below.
+dm_crypt_execute_localmount() {
+ local mount_point
+
+ [ -z "${target}" ] && [ -z "${post_mount}" ] && return
+
+ if ! cryptsetup status ${target} | egrep -q '\<active:' ; then
+ ewarn "Skipping unmapped target ${target}"
+ cryptfs_status=1
+ return
+ fi
+
+ mount_point=$(grep "/dev/mapper/${target}" /proc/mounts | cut -d' ' -f2)
+ if [ -z "${mount_point}" ] ; then
+ ewarn "Failed to find mount point for ${target}, skipping"
+ cryptfs_status=1
+ fi
+
+ if [ -n "${post_mount}" ] ; then
+ ebegin "Running post_mount commands for target ${target}"
+ eval "${post_mount}" >/dev/null
+ eend $? || cryptfs_status=1
+ fi
+}
+
+# Lookup optional bootparams
+get_bootparam_val() {
+ # We're given something like:
+ # foo=bar=cow
+ # Return the "bar=cow" part.
+ case $1 in
+ *\=*)
+ local key=$(echo "$1" | cut -f1 -d=)
+ echo "$1" | cut -c $(( ${#key} + 2 ))
+ ;;
+ esac
+}
+
+start() {
+ local header=true cryptfs_status=0
+ local gpg_options key loop_file target targetline options pre_mount post_mount source swap remdev
+
+ local x
+ for x in $(cat /proc/cmdline) ; do
+ case "${x}" in
+ key_timeout\=*)
+ local KEY_TIMEOUT=$(get_bootparam_val "${x}")
+ if [ ${KEY_TIMEOUT} -gt 0 ] ; then
+ read_timeout="-t ${KEY_TIMEOUT}"
+ fi
+ ;;
+ esac
+ done
+
+ while read -u 3 targetline ; do
+ case ${targetline} in
+ # skip comments and blank lines
+ ""|"#"*) continue ;;
+ # skip service-specific openrc configs #377927
+ rc_*) continue ;;
+ esac
+
+ ${header} && ebegin "Setting up dm-crypt mappings"
+ header=false
+
+ # check for the start of a new target/swap
+ case ${targetline} in
+ target=*|swap=*)
+ # If we have a target queued up, then execute it
+ ${execute_hook}
+
+ # Prepare for the next target/swap by resetting variables
+ unset gpg_options key loop_file target options pre_mount post_mount source swap remdev
+ ;;
+
+ gpg_options=*|remdev=*|key=*|loop_file=*|options=*|pre_mount=*|post_mount=*|source=*)
+ if [ -z "${target}${swap}" ] ; then
+ ewarn "Ignoring setting outside target/swap section: ${targetline}"
+ continue
+ fi
+ ;;
+
+ dmcrypt_max_timeout=*)
+ # ignore global options
+ continue
+ ;;
+
+ *)
+ ewarn "Skipping invalid line in ${conf_file}: ${targetline}"
+ ;;
+ esac
+
+ # Queue this setting for the next call to dm_crypt_execute_xxx
+ eval "${targetline}"
+ done 3< ${conf_file}
+
+ # If we have a target queued up, then execute it
+ ${execute_hook}
+
+ ewend ${cryptfs_status} "Failed to setup dm-crypt devices"
+}
+
+stop() {
+ local line header
+
+ # Break down all mappings
+ header=true
+ egrep "^(target|swap)=" ${conf_file} | \
+ while read line ; do
+ ${header} && einfo "Removing dm-crypt mappings"
+ header=false
+
+ target= swap=
+ eval ${line}
+
+ [ -n "${swap}" ] && target=${swap}
+ if [ -z "${target}" ] ; then
+ ewarn "invalid line in ${conf_file}: ${line}"
+ continue
+ fi
+
+ ebegin " ${target}"
+ cryptsetup remove ${target}
+ eend $?
+ done
+
+ # Break down loop devices
+ header=true
+ grep '^source=./dev/loop' ${conf_file} | \
+ while read line ; do
+ ${header} && einfo "Detaching dm-crypt loop devices"
+ header=false
+
+ source=
+ eval ${line}
+
+ ebegin " ${source}"
+ losetup -d "${source}"
+ eend $?
+ done
+
+ return 0
+}
diff --git a/pcr/openrc-base/PKGBUILD b/pcr/openrc-base/PKGBUILD
new file mode 100644
index 000000000..9519fb572
--- /dev/null
+++ b/pcr/openrc-base/PKGBUILD
@@ -0,0 +1,269 @@
+# Maintainer : freaj <freaj@riseup.net>
+# Maintainer (Manjaro): artoo <artoo@manjaro.org>
+
+_Icron1=cronie-1.3-initd
+_Icron2=anacron-1.0-initd
+_Ccrypt=1.0.6-dmcrypt.confd
+_Icrypt=1.5.1-dmcrypt.rc
+_Idbus=dbus.initd
+_Inscd=nscd
+_Cdm=device-mapper.conf-1.02.22-r3
+_Idm1=device-mapper.rc-2.02.105-r2
+_Idm2=dmeventd.initd-2.02.67-r1
+_Clvm=lvm.confd-2.02.28-r2
+_Ilvm1=lvm.rc-2.02.105-r2
+_Ilvm2=lvm-monitoring.initd-2.02.105-r2
+_Ilvm3=lvmetad.initd-2.02.105-r2
+_Cmdadm=mdadm.confd
+_Imdadm=mdadm.rc
+_Idhcpcd=dhcpcd.initd
+_Cmdraid=mdraid.confd
+_Imdraid=mdraid.rc
+_Ieudev=udev-postmount
+
+_gentoo_uri="http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86"
+
+
+# set false if you want building without eudev(leaving systemd)
+_is_eudev=true
+
+pkgbase=openrc-base
+_pkgname=('cronie-openrc'
+ 'cryptsetup-openrc'
+ 'dbus-openrc'
+ 'dhcpcd-openrc'
+ 'device-mapper-openrc'
+ 'glibc-openrc'
+ 'inetutils-openrc'
+ 'lvm2-openrc'
+ 'mdadm-openrc')
+if ${_is_eudev};then
+ pkgname=( ${_pkgname[@]} 'eudev-openrc')
+else
+ pkgname=( ${_pkgname[@]} )
+fi
+pkgver=20150215
+pkgrel=1
+pkgdesc="OpenRC init scripts"
+arch=('any')
+url="https://github.com/manjaro/packages-openrc"
+license=('GPL2')
+groups=('openrc' 'openrc-base')
+conflicts=('initscripts'
+ 'systemd-sysvcompat'
+ 'openrc'
+ 'openrc-git'
+ 'openrc-sysvinit')
+source=("${_gentoo_uri}/sys-process/cronie/files/${_Icron1}"
+ "${_gentoo_uri}/sys-process/cronie/files/${_Icron2}"
+ "${_gentoo_uri}/sys-fs/cryptsetup/files/${_Ccrypt}"
+ "${_gentoo_uri}/sys-fs/cryptsetup/files/${_Icrypt}"
+ "${_gentoo_uri}/sys-apps/dbus/files/${_Idbus}"
+ "${_gentoo_uri}/sys-libs/glibc/files/${_Inscd}"
+ "${_gentoo_uri}/sys-fs/lvm2/files/${_Cdm}"
+ "${_gentoo_uri}/sys-fs/lvm2/files/${_Idm1}"
+ "${_gentoo_uri}/sys-fs/lvm2/files/${_Idm2}"
+ "${_gentoo_uri}/sys-fs/lvm2/files/${_Clvm}"
+ "${_gentoo_uri}/sys-fs/lvm2/files/${_Ilvm1}"
+ "${_gentoo_uri}/sys-fs/lvm2/files/${_Ilvm2}"
+ "${_gentoo_uri}/sys-fs/lvm2/files/${_Ilvm3}"
+ "${_gentoo_uri}/sys-fs/mdadm/files/${_Cmdadm}"
+ "${_gentoo_uri}/sys-fs/mdadm/files/${_Imdadm}"
+ "${_gentoo_uri}/sys-fs/mdadm/files/${_Cmdraid}"
+ "${_gentoo_uri}/sys-fs/mdadm/files/${_Imdraid}"
+ "${_gentoo_uri}/net-misc/dhcpcd/files/${_Idhcpcd}"
+ "${_gentoo_uri}/sys-fs/eudev/files/${_Ieudev}"
+ 'inetutils.confd'
+ 'inetutils.initd')
+
+_shebang='s|#!/sbin/runscript|#!/usr/bin/openrc-run|'
+_runpath='s|/var/run|/run|g'
+_binpath=('s|/usr/sbin|/usr/bin|g' 's|/sbin|/usr/bin|g')
+
+pkgver() {
+ date +%Y%m%d
+}
+
+package_cronie-openrc() {
+ pkgdesc="OpenRC cronie init script"
+ groups=('openrc' 'openrc-base' 'openrc-desktop')
+ depends=('openrc-core' 'cronie')
+ provides=('openrc-cron')
+ conflicts=('fcron'
+ 'fcron-openrc'
+ 'openrc'
+ 'openrc-git'
+ 'openrc-arch-services-git'
+ 'initscripts'
+ 'systemd-sysvcompat')
+ backup=('etc/init.d/cronie')
+ install=cronie.install
+
+ install -Dm755 "${srcdir}/${_Icron1}" "${pkgdir}/etc/init.d/cronie"
+ install -Dm755 "${srcdir}/${_Icron2}" "${pkgdir}/etc/init.d/anacron"
+
+ for f in ${pkgdir}/etc/init.d/*; do
+ sed -e "${_shebang}" \
+ -e "${_binpath[0]}" \
+ -e "${_runpath}" \
+ -i $f
+ done
+}
+
+package_dhcpcd-openrc() {
+ pkgdesc="OpenRC dhcpcd init script"
+ groups=('openrc' 'openrc-base' 'openrc-desktop')
+ depends=('openrc-core' 'dhcpcd')
+ install=dhcpcd.install
+
+ install -Dm755 "${srcdir}/${_Idhcpcd}" "${pkgdir}/etc/init.d/dhcpcd"
+
+ sed -e "${_shebang}" \
+ -e "${_binpath[1]}" \
+ -e "${_runpath}" \
+ -i "${pkgdir}/etc/init.d/dhcpcd"
+}
+
+package_dbus-openrc() {
+ pkgdesc="OpenRC dbus init script"
+ groups=('openrc' 'openrc-base' 'openrc-desktop')
+ depends=('openrc-core' 'dbus')
+ install=dbus.install
+
+ install -Dm755 "${srcdir}/${_Idbus}" "${pkgdir}/etc/init.d/dbus"
+
+ local _p1='s|dbus.pid|dbus/pid|g'
+ sed -e "${_shebang}" -e "${_runpath}" \
+ -e "${_p1}" \
+ -i "${pkgdir}/etc/init.d/dbus"
+}
+
+package_device-mapper-openrc() {
+ pkgdesc="OpenRC device-mapper init script"
+ depends=('openrc-core' 'device-mapper')
+ backup=('etc/conf.d/device-mapper')
+ install=device-mapper.install
+
+ install -Dm755 "${srcdir}/${_Cdm}" "${pkgdir}/etc/conf.d/device-mapper"
+ install -Dm755 "${srcdir}/${_Idm1}" "${pkgdir}/etc/init.d/device-mapper"
+ install -Dm755 "${srcdir}/${_Idm2}" "${pkgdir}/etc/init.d/dmeventd"
+
+ for f in ${pkgdir}/etc/init.d/*; do
+ sed -e "${_shebang}" \
+ -e "${_binpath[1]}" \
+ -e "${_runpath}" \
+ -i $f
+ done
+}
+
+package_cryptsetup-openrc() {
+ pkgdesc="OpenRC cryptsetup init script"
+ depends=('device-mapper-openrc' 'cryptsetup')
+ backup=('etc/conf.d/dmcrypt')
+ install=cryptsetup.install
+
+ install -Dm755 "${srcdir}/${_Ccrypt}" "${pkgdir}/etc/conf.d/dmcrypt"
+ install -Dm755 "${srcdir}/${_Icrypt}" "${pkgdir}/etc/init.d/dmcrypt"
+
+ sed -e "${_shebang}" \
+ -e "${_binpath[0]}" \
+ -e "${_runpath}" \
+ -i "${pkgdir}/etc/init.d/dmcrypt"
+}
+
+package_glibc-openrc() {
+ pkgdesc="OpenRC nscd init script"
+ depends=('openrc-core' 'glibc')
+ optdepends=('openldap-openrc'
+ 'bind-openrc')
+ install=glibc.install
+
+ install -Dm755 "${srcdir}/${_Inscd}" "${pkgdir}/etc/init.d/nscd"
+
+ sed -e "${_shebang}" \
+ -e "${_binpath[0]}" \
+ -e "${_runpath}" \
+ -i "${pkgdir}/etc/init.d/nscd"
+}
+
+package_inetutils-openrc() {
+ pkgdesc="OpenRC ftpd init script"
+ depends=('openrc-core' 'inetutils')
+ backup=('etc/conf.d/ftpd')
+ install=inetutils.install
+
+ install -Dm755 "${srcdir}/inetutils.confd" "${pkgdir}/etc/conf.d/ftpd"
+ install -Dm755 "${srcdir}/inetutils.initd" "${pkgdir}/etc/init.d/ftpd"
+}
+
+package_lvm2-openrc() {
+ pkgdesc="OpenRC lvm2 init script"
+ depends=('device-mapper-openrc' 'lvm2')
+ backup=('etc/conf.d/lvm')
+ install=lvm2.install
+
+ install -Dm755 "${srcdir}/${_Clvm}" "${pkgdir}/etc/conf.d/lvm"
+ install -Dm755 "${srcdir}/${_Ilvm1}" "${pkgdir}/etc/init.d/lvm"
+ install -Dm755 "${srcdir}/${_Ilvm2}" "${pkgdir}/etc/init.d/lvm-monitoring"
+ install -Dm755 "${srcdir}/${_Ilvm3}" "${pkgdir}/etc/init.d/lvmetad"
+
+ for f in ${pkgdir}/etc/init.d/*; do
+ sed -e "${_shebang}" \
+ -e "${_binpath[1]}" \
+ -e "${_runpath}" \
+ -i $f
+ done
+}
+
+package_mdadm-openrc() {
+ pkgdesc="OpenRC mdadm init script"
+ depends=('openrc-core' 'mdadm')
+ optdepends=('bind-openrc')
+ backup=('etc/conf.d/mdadm')
+ install=mdadm.install
+
+ install -Dm755 "${srcdir}/${_Cmdadm}" "${pkgdir}/etc/conf.d/mdadm"
+ install -Dm755 "${srcdir}/${_Imdadm}" "${pkgdir}/etc/init.d/mdadm"
+
+ install -Dm755 "${srcdir}/${_Cmdraid}" "${pkgdir}/etc/conf.d/mdraid"
+ install -Dm755 "${srcdir}/${_Imdraid}" "${pkgdir}/etc/init.d/mdraid"
+
+ sed -e "${_shebang}" \
+ -e "${_runpath}" \
+ -i "${pkgdir}/etc/init.d/mdadm"
+ sed -e "${_shebang}" \
+ -i "${pkgdir}/etc/init.d/mdraid"
+}
+
+package_eudev-openrc(){
+ pkgdesc="OpenRC eudev postmount script"
+ groups=('eudev-base')
+ depends=('openrc-core' 'eudev')
+ install=eudev.install
+
+ install -Dm755 "${srcdir}/${_Ieudev}" "${pkgdir}/etc/init.d/udev-postmount"
+
+ sed -e "${_shebang}" -i "${pkgdir}/etc/init.d/udev-postmount"
+}
+
+sha256sums=('292a7b20fe33bd027357475fea6aa1194afa7e5c1c47a85299db945b9d1c847e'
+ '7ff283ee8b492929d33831461b72e872fe9d3a98344cf39af442f575875b0132'
+ '9696d70a49296113a9ae3dff1b023b859df984bfb3572426ba199a630b628ce8'
+ '1010666cfb3cd2c662032c3e8f3c2aec35316fc376d0ce30f2c821b581ae2c6d'
+ '98e37b8b6ed25004e48c5855d74c9361eea06d3fee13cefcc0ed10ccf452aa01'
+ '6165db3a2fcb251d4f3655c0461e018ce9c92a37f7f22a8fd2b75178b5435bc8'
+ '57777904f12a35617e5a4193c964ebb32396452487fd02353e71e16e7b46bc22'
+ '036b6de05e6cbd921a667d6fc6b01d30c8f9b720e1a0d0e2453ecd62d32573fb'
+ '0c051388991ba69afbf2f6baf36ba227d7c26fc8f0d7588d8de76d9a74886d79'
+ '28370c089c39c248d7ded0960b8d8a9256bada44d44c22ce3cec87d512ef6844'
+ 'a5754ffa0a05a0c29a9f6b5acf1b21dd313581fd6156c1ef722dc620e0114676'
+ 'd7655cadd3a3a9d3683a540413365310ca9503c38fd21a9bfccec40630ca72f1'
+ '60accb4b6114753232f2db0adf3fc3f46d4459bfedf79b888801a13c55d79fa9'
+ 'ec55674955af7a31da51b8b72b599e8519809287dad796a9b16155bcba471b79'
+ '3073b14619cb7b2c99c33f2d6cfd1e59ce5557899bffebaa65fa52f3caffadc7'
+ '1b7918c4bdd024607bcb49d7cea0a77cb70502d2fbb4dbe07024bb5b5699c8e0'
+ '73303ec32b7010c7f6d4fd66dde1a5baea07e73c79d3e516dce31000abdb4089'
+ '72b42c9939fda3fb56666813513029ed36194c1708bddce06bcb3e131e547492'
+ '0220e949b1f31832a205021c0a8615e77b27b73b7c9b16ef4a61bbd2774aeecb'
+ '59fe1aa68c43f4958afc397a0d6b35da263a20fcdb457005123a0d64cb1f7477'
+ '7f46e5e9ac9f204fb1564560c506a5bb4cede8823b89e3f1844e4f8be258e9ef')
diff --git a/pcr/openrc-base/anacron-1.0-initd b/pcr/openrc-base/anacron-1.0-initd
new file mode 100644
index 000000000..6462b900e
--- /dev/null
+++ b/pcr/openrc-base/anacron-1.0-initd
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/files/anacron-1.0-initd,v 1.4 2014/03/04 00:17:58 polynomial-c Exp $
+
+# anacron forks itself when -d gets omitted. So s-s-d fails to create a valid
+# pidfile. DO NOT remove -d from command_args and let s-s-d start anacron
+# in background!
+
+command="/usr/sbin/anacron"
+command_args="-d -s -S /var/spool/anacron"
+pidfile="/var/run/anacron.pid"
+command_background="true"
+
+depend() {
+ use clock logger
+ need localmount
+}
diff --git a/pcr/openrc-base/cronie-1.3-initd b/pcr/openrc-base/cronie-1.3-initd
new file mode 100644
index 000000000..138530f5e
--- /dev/null
+++ b/pcr/openrc-base/cronie-1.3-initd
@@ -0,0 +1,14 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/files/cronie-1.3-initd,v 1.3 2014/03/04 00:17:58 polynomial-c Exp $
+
+command="/usr/sbin/crond"
+command_args="${CRONDARGS}"
+pidfile="/var/run/crond.pid"
+
+depend() {
+ use clock logger
+ need localmount
+ provide cron
+}
diff --git a/pcr/openrc-base/cronie.install b/pcr/openrc-base/cronie.install
new file mode 100644
index 000000000..aa2454c36
--- /dev/null
+++ b/pcr/openrc-base/cronie.install
@@ -0,0 +1,16 @@
+_svc="cronie"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/cryptsetup.install b/pcr/openrc-base/cryptsetup.install
new file mode 100644
index 000000000..edbb2dd26
--- /dev/null
+++ b/pcr/openrc-base/cryptsetup.install
@@ -0,0 +1,16 @@
+_svc="dmcrypt"
+_rlvl="boot"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/dbus.initd b/pcr/openrc-base/dbus.initd
new file mode 100644
index 000000000..65271f69c
--- /dev/null
+++ b/pcr/openrc-base/dbus.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/dbus/files/dbus.initd,v 1.1 2011/11/05 13:56:10 ssuominen Exp $
+
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start() {
+ ebegin "Starting D-BUS system messagebus"
+ /usr/bin/dbus-uuidgen --ensure=/etc/machine-id
+
+ # We need to test if /var/run/dbus exists, since script will fail if it does not
+ [ ! -e /var/run/dbus ] && mkdir /var/run/dbus
+
+ start-stop-daemon --start --pidfile /var/run/dbus.pid --exec /usr/bin/dbus-daemon -- --system
+ eend $?
+}
+
+stop() {
+ local retval
+
+ ebegin "Stopping D-BUS system messagebus"
+
+ start-stop-daemon --stop --pidfile /var/run/dbus.pid
+ retval=$?
+
+ eend ${retval}
+
+ [ -S /var/run/dbus/system_bus_socket ] && rm -f /var/run/dbus/system_bus_socket
+
+ return ${retval}
+}
+
+reload() {
+ local retval
+
+ ebegin "Reloading D-BUS messagebus config"
+
+ /usr/bin/dbus-send --print-reply --system --type=method_call \
+ --dest=org.freedesktop.DBus \
+ / org.freedesktop.DBus.ReloadConfig > /dev/null
+ retval=$?
+ eend ${retval}
+ return ${retval}
+}
diff --git a/pcr/openrc-base/dbus.install b/pcr/openrc-base/dbus.install
new file mode 100644
index 000000000..f93bc37ca
--- /dev/null
+++ b/pcr/openrc-base/dbus.install
@@ -0,0 +1,16 @@
+_svc="dbus"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/device-mapper.conf-1.02.22-r3 b/pcr/openrc-base/device-mapper.conf-1.02.22-r3
new file mode 100644
index 000000000..bc7a25158
--- /dev/null
+++ b/pcr/openrc-base/device-mapper.conf-1.02.22-r3
@@ -0,0 +1 @@
+RC_AFTER="lvm"
diff --git a/pcr/openrc-base/device-mapper.install b/pcr/openrc-base/device-mapper.install
new file mode 100644
index 000000000..f2429ddb9
--- /dev/null
+++ b/pcr/openrc-base/device-mapper.install
@@ -0,0 +1,20 @@
+_svc=('device-mapper' 'dmeventd')
+_rlvl="boot"
+
+post_install() {
+ _cmd="rc-update add ${_svc[0]} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+ _cmd="rc-update add ${_svc[1]} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc[0]} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+ _cmd="rc-update del ${_svc[1]} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/device-mapper.rc-2.02.105-r2 b/pcr/openrc-base/device-mapper.rc-2.02.105-r2
new file mode 100644
index 000000000..56e75037e
--- /dev/null
+++ b/pcr/openrc-base/device-mapper.rc-2.02.105-r2
@@ -0,0 +1,147 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ before dmeventd checkfs fsck
+ after modules
+}
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+# char **build_dmsetup_command(volume)
+#
+# Returns complete dmsetup command given single volume name
+build_dmsetup_command() {
+ local count dmsetup_cmd
+
+ # Number of lines mentioning volume name
+ count=$(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | grep -c ${1})
+
+ # If there's just one line:
+ if [ ${count} -eq 1 ] ; then
+ echo "echo $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk '{$1=""; print $0}') | /sbin/dmsetup create ${1}"
+
+ # For all cases with more lines:
+ elif [ ${count} -gt 1 ] ; then
+ for c in $( seq 1 ${count} ) ; do
+ if [ ${c} -eq 1 ] ; then
+ # Heavy escaping in awk-statement because we cannot use apostrophes
+ dmsetup_cmd="echo -e $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
+ else
+ # Append starting with newline
+ dmsetup_cmd="${dmsetup_cmd}\\\\n \
+ $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
+ fi
+ done
+ echo "${dmsetup_cmd} | /sbin/dmsetup create ${1}"
+ fi
+
+ return 0
+}
+
+# char **get_new_dm_volumes(void)
+#
+# Return unique volumes from /etc/dmtab
+get_new_dm_volumes() {
+ local volume
+
+ # Filter comments and blank lines
+ grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ awk '{ print $1 }' | \
+ uniq | \
+ while read volume ; do
+ # If it exists, skip it
+ dmvolume_exists "${volume%:}" && continue
+
+ echo "${volume%:}"
+ done
+
+ return 0
+}
+
+# int dmvolume_exists(volume)
+#
+# Return true if volume exists in DM table
+dmvolume_exists() {
+ local x line volume=$1
+
+ [ -z "${volume}" ] && return 1
+
+ /sbin/dmsetup ls 2>/dev/null | \
+ while read line ; do
+ for x in ${line} ; do
+ # the following conditonal return only breaks out
+ # of the while loop, as it is running in a pipe.
+ [ "${x}" = "${volume}" ] && return 1
+ # We only want to check the volume name
+ break
+ done
+ done
+
+ # if 1 was returned from the above loop, then indicate that
+ # volume exists
+ [ $? = 1 ] && return 0
+
+ # otherwise the loop exited normally and the volume does not
+ # exist
+ return 1
+}
+
+# int is_empty_dm_volume(volume)
+#
+# Return true if the volume exists in DM table, but is empty/non-valid
+is_empty_dm_volume() {
+ local table volume=$1
+
+ set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
+ [ "${volume}" = "$1" -a -z "$2" ]
+}
+
+
+start() {
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ # Ensure the dirs exist for locking and running
+ checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
+
+ local x volume
+
+ if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
+ [ -n "$(get_new_dm_volumes)" ] && \
+ einfo " Setting up device-mapper volumes:"
+
+ get_new_dm_volumes | \
+ while read x ; do
+ [ -n "${x}" ] || continue
+
+ volume="${x##* }"
+
+ ebegin " Creating volume: ${volume}"
+ if ! eval $(build_dmsetup_command ${volume}) >/dev/null 2>/dev/null ; then
+ eend 1 " Error creating volume: ${volume}"
+ # dmsetup still adds an empty volume in some cases,
+ # so lets remove it
+ is_empty_dm_volume "${volume}" && \
+ /sbin/dmsetup remove "${volume}" 2>/dev/null
+ else
+ eend 0
+ fi
+ done
+ fi
+}
+
diff --git a/pcr/openrc-base/dhcpcd.initd b/pcr/openrc-base/dhcpcd.initd
new file mode 100644
index 000000000..d88b0610d
--- /dev/null
+++ b/pcr/openrc-base/dhcpcd.initd
@@ -0,0 +1,17 @@
+#!/sbin/runscript
+# Copyright 2007-2008 Roy Marples <roy@marples.name>
+# All rights reserved. Released under the 2-clause BSD license.
+
+command=/sbin/dhcpcd
+pidfile=/var/run/dhcpcd.pid
+command_args=-q
+name="DHCP Client Daemon"
+
+depend()
+{
+ provide net
+ need localmount
+ use logger network
+ after bootmisc modules
+ before dns
+}
diff --git a/pcr/openrc-base/dhcpcd.install b/pcr/openrc-base/dhcpcd.install
new file mode 100644
index 000000000..278467b94
--- /dev/null
+++ b/pcr/openrc-base/dhcpcd.install
@@ -0,0 +1,16 @@
+_svc="dhcpcd"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/dmeventd.initd-2.02.67-r1 b/pcr/openrc-base/dmeventd.initd-2.02.67-r1
new file mode 100644
index 000000000..3c2f5f327
--- /dev/null
+++ b/pcr/openrc-base/dmeventd.initd-2.02.67-r1
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1,v 1.3 2014/02/08 21:17:46 robbat2 Exp $
+
+PIDFILE=/run/dmeventd.pid
+BIN=/sbin/dmeventd
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ after lvm device-mapper
+}
+
+start() {
+ ebegin "Starting dmeventd"
+ start-stop-daemon --start --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dmeventd"
+ start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
diff --git a/pcr/openrc-base/eudev.install b/pcr/openrc-base/eudev.install
new file mode 100644
index 000000000..0043774fa
--- /dev/null
+++ b/pcr/openrc-base/eudev.install
@@ -0,0 +1,14 @@
+_svc="udev-postmount"
+_rlvl="default"
+
+post_install() {
+ rc-update add ${_svc} ${_rlvl}
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+pre_remove() {
+ rc-update del ${_svc} ${_rlvl}
+}
diff --git a/pcr/openrc-base/glibc.install b/pcr/openrc-base/glibc.install
new file mode 100644
index 000000000..eed830c26
--- /dev/null
+++ b/pcr/openrc-base/glibc.install
@@ -0,0 +1,16 @@
+_svc="nscd"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/inetutils.confd b/pcr/openrc-base/inetutils.confd
new file mode 100644
index 000000000..df58eab46
--- /dev/null
+++ b/pcr/openrc-base/inetutils.confd
@@ -0,0 +1,8 @@
+#
+# Parameters to be passed to ftpd
+#
+FTPD_ARGS="-D"
+
+# Neeed for openrc newnet
+#current openrc4arch packages are compiled with oldnet
+#rc_need=\"!net\"
diff --git a/pcr/openrc-base/inetutils.initd b/pcr/openrc-base/inetutils.initd
new file mode 100644
index 000000000..a53184c4c
--- /dev/null
+++ b/pcr/openrc-base/inetutils.initd
@@ -0,0 +1,27 @@
+#!/usr/bin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+FTPD_BINARY="/usr/bin/ftpd"
+FTPD_PIDFILE="/run/ftpd.pid"
+
+depend() {
+ use logger dns
+ need net
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec "${FTPD_BINARY}" \
+ --pidfile "${FTPD_PIDFILE}" \
+ -- ${FTPD_ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec "${FTPD_BINARY}" \
+ --pidfile "${FTPD_PIDFILE}" --quiet
+ eend $?
+}
+
diff --git a/pcr/openrc-base/inetutils.install b/pcr/openrc-base/inetutils.install
new file mode 100644
index 000000000..85b4fad7a
--- /dev/null
+++ b/pcr/openrc-base/inetutils.install
@@ -0,0 +1,16 @@
+_svc="ftpd"
+_rlvl="default"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/lvm-monitoring.initd-2.02.105-r2 b/pcr/openrc-base/lvm-monitoring.initd-2.02.105-r2
new file mode 100644
index 000000000..c53a60465
--- /dev/null
+++ b/pcr/openrc-base/lvm-monitoring.initd-2.02.105-r2
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
+
+# This script is based on upstream file
+# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ need lvm dmeventd
+}
+
+VGCHANGE=/sbin/vgchange
+VGS=/sbin/vgs
+
+start() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+ ebegin "Starting LVM monitoring for VGs ${VGSLIST}:"
+ $VGCHANGE --monitor y --poll y ${VGSLIST}
+ ret=$?
+ eend $ret
+ return $ret
+
+}
+
+stop() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+ ebegin "Stopping LVM monitoring for VGs ${VGSLIST}:"
+ $VGCHANGE --monitor n ${VGSLIST}
+ ret=$?
+ eend $ret
+ return $ret
+}
diff --git a/pcr/openrc-base/lvm.confd-2.02.28-r2 b/pcr/openrc-base/lvm.confd-2.02.28-r2
new file mode 100644
index 000000000..2fbd8668c
--- /dev/null
+++ b/pcr/openrc-base/lvm.confd-2.02.28-r2
@@ -0,0 +1,5 @@
+# LVM should normally only be started after mdraid is available
+# this is because LVM physical volumes are very often MD devices.
+RC_AFTER="mdraid"
+
+# vim: ft=gentoo-conf-d
diff --git a/pcr/openrc-base/lvm.rc-2.02.105-r2 b/pcr/openrc-base/lvm.rc-2.02.105-r2
new file mode 100644
index 000000000..7fdf50e18
--- /dev/null
+++ b/pcr/openrc-base/lvm.rc-2.02.105-r2
@@ -0,0 +1,97 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm.rc-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
+
+depend() {
+ before checkfs fsck
+ after modules device-mapper
+ need lvmetad sysfs
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+start() {
+ # LVM support for /usr, /home, /opt ....
+ # This should be done *before* checking local
+ # volumes, or they never get checked.
+
+ # NOTE: Add needed modules for LVM or RAID, etc
+ # to /etc/modules.autoload if needed
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+ if [ -z "${CDBOOT}" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+ fi
+}
+
+stop() {
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+# Stop LVM2
+if [ -x /sbin/vgs ] && \
+ [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+then
+ einfo "Shutting down the Logical Volume Manager"
+
+
+ VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+ if [ "$VGS" ]
+ then
+ ebegin " Shutting Down LVs & VGs"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ln ${VGS}\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed (possibly some LVs still needed for /usr or root)"
+ fi
+
+ einfo "Finished shutting down the Logical Volume Manager"
+ return 0
+fi
+}
+
+# vim:ts=4
diff --git a/pcr/openrc-base/lvm2.install b/pcr/openrc-base/lvm2.install
new file mode 100644
index 000000000..8a00d2936
--- /dev/null
+++ b/pcr/openrc-base/lvm2.install
@@ -0,0 +1,24 @@
+_svc=('lvm' 'lvmetad' 'lvm-monitoring')
+_rlvl=('boot' 'default')
+
+post_install() {
+ _cmd="rc-update add ${_svc[0]} ${_rlvl[0]}"
+ echo " ==> run '${_cmd}'"
+# _cmd="rc-update add ${_svc[1]} ${_rlvl[1]}"
+# echo " ==> run '${_cmd}'"
+# _cmd="rc-update add ${_svc[2]} ${_rlvl[1]}"
+# echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc[0]} ${_rlvl[0]}"
+ echo " ==> run '${_cmd}'"
+# _cmd="rc-update del ${_svc[1]} ${_rlvl[1]}"
+# echo " ==> run '${_cmd}'"
+# _cmd="rc-update del ${_svc[2]} ${_rlvl[1]}"
+# echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/lvmetad.initd-2.02.105-r2 b/pcr/openrc-base/lvmetad.initd-2.02.105-r2
new file mode 100644
index 000000000..e16d55c46
--- /dev/null
+++ b/pcr/openrc-base/lvmetad.initd-2.02.105-r2
@@ -0,0 +1,13 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2,v 1.2 2014/02/08 21:17:46 robbat2 Exp $
+
+pidfile="/run/lvmetad.pid"
+command="/sbin/lvmetad"
+command_args="${LVMETAD_OPTS:=-p ${pidfile}}"
+start_stop_daemon_args="--pidfile ${pidfile}"
+
+depend() {
+ :
+}
diff --git a/pcr/openrc-base/mdadm.confd b/pcr/openrc-base/mdadm.confd
new file mode 100644
index 000000000..a4ead14dc
--- /dev/null
+++ b/pcr/openrc-base/mdadm.confd
@@ -0,0 +1,7 @@
+# /etc/conf.d/mdadm: config file for /etc/init.d/mdadm
+
+# Misc options to pass to mdadm in monitor mode.
+# For more info, run `mdadm --monitor --help` or see
+# the mdadm(8) manpage.
+
+MDADM_OPTS="--syslog"
diff --git a/pcr/openrc-base/mdadm.install b/pcr/openrc-base/mdadm.install
new file mode 100644
index 000000000..8bcffe5f6
--- /dev/null
+++ b/pcr/openrc-base/mdadm.install
@@ -0,0 +1,16 @@
+_svc="mdadm"
+_rlvl="boot"
+
+post_install() {
+ _cmd="rc-update add ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ _cmd="rc-update del ${_svc} ${_rlvl}"
+ echo " ==> run '${_cmd}'"
+}
diff --git a/pcr/openrc-base/mdadm.rc b/pcr/openrc-base/mdadm.rc
new file mode 100644
index 000000000..c30004d0b
--- /dev/null
+++ b/pcr/openrc-base/mdadm.rc
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/mdadm.rc,v 1.2 2006/04/25 05:41:51 vapier Exp $
+
+depend() {
+ use logger dns net
+}
+
+start() {
+ ebegin "Starting mdadm monitor"
+ mdadm --monitor --scan \
+ --daemonise \
+ --pid-file /var/run/mdadm.pid \
+ ${MDADM_OPTS}
+ eend $?
+}
+
+stop() {
+ local ret
+ ebegin "Stopping mdadm monitor"
+ start-stop-daemon --stop --pidfile /var/run/mdadm.pid
+ ret=$?
+ rm -f /var/run/mdadm.pid
+ eend ${ret}
+}
diff --git a/pcr/openrc-base/mdraid.confd b/pcr/openrc-base/mdraid.confd
new file mode 100644
index 000000000..daa17abd8
--- /dev/null
+++ b/pcr/openrc-base/mdraid.confd
@@ -0,0 +1,5 @@
+# /etc/conf.d/mdraid: config file for /etc/init.d/mdraid
+
+# For people who run raid on top of some other layer (like
+# dmcrypt), use rc_need to specify that requirement. See
+# the runscript(8) man page for more information.
diff --git a/pcr/openrc-base/mdraid.rc b/pcr/openrc-base/mdraid.rc
new file mode 100644
index 000000000..27421e26e
--- /dev/null
+++ b/pcr/openrc-base/mdraid.rc
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/mdraid.rc,v 1.6 2011/11/12 21:06:44 vapier Exp $
+
+depend() {
+ before checkfs fsck
+ after modules
+}
+
+start() {
+ local output
+
+ ebegin "Starting up RAID devices"
+ output=$(mdadm -As 2>&1)
+ eend $? "${output}"
+
+ local pat="/dev/md_d*"
+ set -- ${pat}
+ if [ "$*" != "${pat}" ] ; then
+ ebegin "Creating RAID device partitions"
+ blockdev "$@"
+ eend $?
+ # wait because vgscan runs next, and we want udev to fire
+ sleep 1
+ fi
+
+ return 0
+}
+
+stop() {
+ local output
+
+ # XXX: Maybe drop this check ?
+ [ ! -e /etc/mdadm/mdadm.conf ] && [ ! -e /etc/mdadm.conf ] && return 0
+
+ ebegin "Shutting down RAID devices (mdadm)"
+ output=$(mdadm -Ss 2>&1)
+ eend $? "${output}"
+}
diff --git a/pcr/openrc-base/nscd b/pcr/openrc-base/nscd
new file mode 100644
index 000000000..b102de070
--- /dev/null
+++ b/pcr/openrc-base/nscd
@@ -0,0 +1,64 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/nscd,v 1.7 2007/02/23 12:09:39 uberlord Exp $
+
+depend() {
+ use dns ldap net slapd
+}
+
+checkconfig() {
+ if [ ! -d /var/run/nscd ] ; then
+ mkdir -p /var/run/nscd
+ chmod 755 /var/run/nscd
+ fi
+ if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then
+ echo ""
+ ewarn "nscd run dir is not world readable, you should reset the perms:"
+ ewarn "chmod 755 /var/run/nscd"
+ ewarn "chmod a+rw /var/run/nscd/socket"
+ echo ""
+ ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
+ echo ""
+ fi
+}
+
+start() {
+ checkconfig
+
+ ebegin "Starting Name Service Cache Daemon"
+ local secure=`while read curline ; do
+ table=${curline%:*}
+ entries=${curline##$table:}
+ table=${table%%[^a-z]*}
+ case $table in
+ passwd*|group*|hosts)
+ for entry in $entries ; do
+ case $entry in
+ nisplus*)
+ /usr/sbin/nscd_nischeck $table || \
+ /echo "-S $table,yes"
+ ;;
+ esac
+ done
+ ;;
+ esac
+ done < /etc/nsswitch.conf`
+ local pidfile="$(strings /usr/sbin/nscd | grep nscd.pid)"
+ mkdir -p "$(dirname ${pidfile})"
+ save_options pidfile "${pidfile}"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/nscd --pidfile "${pidfile}" \
+ -- $secure
+ eend $?
+}
+
+stop() {
+ local pidfile="$(get_options pidfile)"
+ [ -n "${pidfile}" ] && pidfile="--pidfile ${pidfile}"
+ ebegin "Shutting down Name Service Cache Daemon"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/nscd ${pidfile}
+ eend $?
+}
+
+# vim:ts=4
diff --git a/pcr/openrc-base/udev-postmount b/pcr/openrc-base/udev-postmount
new file mode 100644
index 000000000..e433736db
--- /dev/null
+++ b/pcr/openrc-base/udev-postmount
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend()
+{
+ need localmount
+ keyword -vserver -lxc
+}
+
+dir_writeable()
+{
+ touch "$1"/.test.$$ 2>/dev/null && rm "$1"/.test.$$
+}
+
+# store persistent-rules that got created while booting
+# when / was still read-only
+store_persistent_rules()
+{
+ # create /etc/udev/rules.d if it does not exist and /etc/udev is writable
+ [ -d /etc/udev/rules.d ] || \
+ dir_writeable /etc/udev && \
+ mkdir -p /etc/udev/rules.d
+
+ # only continue if rules-directory is writable
+ dir_writeable /etc/udev/rules.d || return 0
+
+ local file dest
+ for file in /run/udev/tmp-rules--*; do
+ dest=${file##*tmp-rules--}
+ [ "$dest" = '*' ] && break
+ type=${dest##70-persistent-}
+ type=${type%%.rules}
+ ebegin "Saving udev persistent ${type} rules to /etc/udev/rules.d"
+ cat "$file" >> /etc/udev/rules.d/"$dest" && rm -f "$file"
+ eend $? "Failed moving persistent rules!"
+ done
+}
+
+start()
+{
+ # check if this system uses udev
+ [ -d /run/udev ] || return 0
+
+ # store persistent-rules that got created while booting
+ # when / was still read-only
+ store_persistent_rules
+}
+
+stop()
+{
+ return 0
+}
+
+# vim:ts=4