summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcr/openrc-core/PKGBUILD134
-rw-r--r--pcr/openrc-core/aufs-unmount.patch38
-rw-r--r--pcr/openrc-core/kmod-static-nodes18
-rw-r--r--pcr/openrc-core/openrc.install19
-rw-r--r--pcr/openrc-core/openrc.logrotate7
5 files changed, 216 insertions, 0 deletions
diff --git a/pcr/openrc-core/PKGBUILD b/pcr/openrc-core/PKGBUILD
new file mode 100644
index 000000000..1391075e5
--- /dev/null
+++ b/pcr/openrc-core/PKGBUILD
@@ -0,0 +1,134 @@
+# Maintainer : <freaj@riseup.net>
+# Maintainer (Manjaro): artoo <artoo@manjaro.org>
+# Contributor (Gentoo): williamh <williamh@gentoo.org>
+
+_pkgname="openrc"
+
+_src_uri="http://dev.gentoo.org/~williamh/dist"
+_net_uri="http://dev.gentoo.org/~robbat2/distfiles"
+
+_udev="udev-init-scripts"
+_uver=27
+
+_net="netifrc"
+_nver=0.2.4
+
+pkgname=openrc-core
+pkgdesc="Gentoo's universal init system, udev enabled."
+pkgver=0.13.11
+pkgrel=1
+pkgdesc="Gentoo's universal init system, udev enabled."
+arch=('i686' 'x86_64')
+url="http://www.gentoo.org/proj/en/base/openrc/"
+license=('GPL2')
+depends=('inetutils' 'psmisc' 'sysvinit' 'udev>=186')
+optdepends=('dhcpcd-openrc: dhcpcd initscript')
+conflicts=('openrc' 'openrc-git' 'initscripts' 'systemd-sysvcompat' 'openrc-sysvinit')
+backup=('etc/rc.conf'
+ 'etc/conf.d/consolefont'
+ 'etc/conf.d/keymaps'
+ 'etc/conf.d/hostname'
+ 'etc/conf.d/modules'
+ 'etc/conf.d/net'
+ 'etc/conf.d/hwclock'
+ 'etc/inittab')
+install=${_pkgname}.install
+source=("${_src_uri}/${_pkgname}-${pkgver}.tar.bz2"
+ "${_src_uri}/${_udev}-${_uver}.tar.bz2"
+ "${_net_uri}/${_net}-${_nver}.tar.bz2"
+ "${_pkgname}.logrotate"
+ 'kmod-static-nodes'
+ 'aufs-unmount.patch')
+
+
+_base_args=(SYSCONFDIR=/etc)
+if [ -f /etc/os-release ]; then
+ . /etc/os-release
+ _base_args+=(BRANDING="$NAME")
+else
+ _base_args+=(BRANDING='Unknown Linux')
+fi
+_base_args+=(PREFIX=/usr)
+_base_args+=(SBINDIR=/usr/bin)
+
+_rc_args=( "${_base_args[@]}" )
+_rc_args+=(LIBEXECDIR=/usr/lib/rc)
+_rc_args+=(MKSELINUX=no)
+_rc_args+=(MKPAM=pam)
+_rc_args+=(MKTERMCAP=ncurses)
+_rc_args+=(MKNET=no)
+
+_net_args=( "${_base_args[@]}" )
+_net_args+=(LIBEXECDIR=/usr/lib/${_net})
+
+prepare(){
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ local _bin='s|/sbin|/usr/bin|g'
+ sed -e "${_bin}" -i support/sysvinit/inittab
+ #sed -i 's:0444:0644:' mk/sys.mk
+
+ patch -p1 -i "$srcdir/aufs-unmount.patch"
+}
+
+build(){
+ # make openrc
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ make "${_rc_args[@]}"
+ # make netifrc
+ cd "${srcdir}/${_net}-${_nver}"
+ make "${_net_args[@]}"
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" "${_rc_args[@]}" install
+ # inittab
+ install -m644 "${srcdir}/${_pkgname}-${pkgver}/support/sysvinit/inittab" "${pkgdir}/etc/inittab"
+ # logrotate
+ install -Dm644 "${srcdir}/${_pkgname}.logrotate" "${pkgdir}/etc/logrotate.d/${_pkgname}"
+ # enable unicode & logger
+ sed -e 's/#unicode="NO"/unicode="YES"/' \
+ -e 's/#rc_logger="YES"/rc_logger="YES"/' \
+ -i "${pkgdir}/etc/rc.conf"
+
+ install -d ${pkgdir}/usr/lib/rc/cache
+
+ # udev
+ cd "${srcdir}/${_udev}-${_uver}"
+ make DESTDIR="${pkgdir}" install
+ # fix shebang & path to udevd
+ local _bin='s|/sbin/udevd|/usr/bin/udevd|g' \
+ _shebang='s|#!/sbin/runscript|#!/usr/bin/openrc-run|'
+
+ sed -e "${_shebang}" \
+ -e "${_bin}" \
+ -i "${pkgdir}/etc/init.d/udev"
+ # create runlevel
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ ln -sf "/etc/init.d/udev" "${pkgdir}/etc/runlevels/sysinit/udev"
+
+ # netifrc
+ cd "${srcdir}/${_net}-${_nver}"
+ make DESTDIR="${pkgdir}" "${_net_args[@]}" install
+ install -Dm 644 "${srcdir}/${_net}-${_nver}/doc/net.example" "${pkgdir}/etc/conf.d/net"
+
+ _shebang='s|#!/usr/bin/runscript|#!/usr/bin/openrc-run|'
+ sed -e "${_shebang}" \
+ -i "${pkgdir}/etc/init.d/net.lo"
+
+ # create runlevel
+ ln -sf "/etc/init.d/net.lo" "${pkgdir}/etc/runlevels/boot/net.lo"
+
+ # kmod-static-nodes
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ install -Dm755 "${srcdir}/kmod-static-nodes" "${pkgdir}/etc/init.d/kmod-static-nodes"
+
+ # create runlevel
+ ln -sf "/etc/init.d/kmod-static-nodes" "${pkgdir}/etc/runlevels/sysinit/kmod-static-nodes"
+}
+sha256sums=('30edffa8b39d5e68129ddd9e8cd8dfde8ca8cfafc8b470124d7323a32a4a443c'
+ '1a091c361e9845861c138b505881edcb7b68fcf91708db526dff0b320243c936'
+ '9b53eb3c8e6e80cd4073a34f911a28055c28b9f7a9f119a397002b0de7ac0691'
+ '0b44210db9770588bd491cd6c0ac9412d99124c6be4c9d3f7d31ec8746072f5c'
+ 'fc90e8d480de39aff90e41477f79720a98bee2a2359c53c209d0ca7bb75fb6ba'
+ '5a22d53f3bda7365d12270845a62ef651f98725c84032ae8c9bdd6512b464ec9')
diff --git a/pcr/openrc-core/aufs-unmount.patch b/pcr/openrc-core/aufs-unmount.patch
new file mode 100644
index 000000000..76fa5b250
--- /dev/null
+++ b/pcr/openrc-core/aufs-unmount.patch
@@ -0,0 +1,38 @@
+--- ../init.d/localmount.in.orig 2015-02-18 19:56:50.000000000 +0100
++++ ../init.d/localmount.in 2015-02-20 01:04:45.783058606 +0100
+@@ -72,19 +72,22 @@
+
+ local aufs_branch aufs_mount_dir aufs_mount_point aufs_si_dir aufs_si_id
+ for aufs_si_dir in /sys/fs/aufs/*; do
+- aufs_mount_dir=${aufs_si_dir#/sys/fs/aufs/}
+- aufs_si_id="$(printf "%s" $aufs_mount_dir | sed 's/_/=/g')"
+- aufs_mount_point="$(mountinfo -o ${aufs_si_id})"
+- for x in $aufs_si_dir/br[0-9][0-9][0-9]; do
+- aufs_branch=$(sed 's/=.*//g' $x)
+- eindent
+- if ! mount -o "remount,del:$aufs_branch" "$aufs_mount_point" > /dev/null 2>&1; then
+- ewarn "Failed to remove branch $aufs_branch from aufs \
+- $aufs_mount_point"
+- fi
+- eoutdent
+- sync
+- done
++ if [[ -d ${aufs_si_dir} ]];then
++ aufs_mount_dir=${aufs_si_dir#/sys/fs/aufs/}
++ aufs_si_id="$(printf "%s" $aufs_mount_dir | sed 's/_/=/g')"
++ aufs_mount_point="$(mountinfo -o ${aufs_si_id})"
++
++ for x in $aufs_si_dir/br[0-9][0-9][0-9]; do
++ aufs_branch=$(sed 's/=.*//g' $x)
++ eindent
++ if ! mount -o "remount,del:$aufs_branch" "$aufs_mount_point" > /dev/null 2>&1; then
++ ewarn "Failed to remove branch $aufs_branch from aufs \
++ $aufs_mount_point"
++ fi
++ eoutdent
++ sync
++ done
++ fi
+ done
+ fi
+
diff --git a/pcr/openrc-core/kmod-static-nodes b/pcr/openrc-core/kmod-static-nodes
new file mode 100644
index 000000000..71bcf9c45
--- /dev/null
+++ b/pcr/openrc-core/kmod-static-nodes
@@ -0,0 +1,18 @@
+#!/usr/bin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/files/Attic/kmod-static-nodes,v 1.2 2014/09/21 10:59:57 ssuominen dead $
+
+description="Create list of required static device nodes for the current kernel"
+
+depend() {
+ after dev-mount
+ before tmpfiles.dev dev
+}
+
+start() {
+ ebegin "Creating list of required static device nodes for the current kernel"
+ checkpath -q -d /run/tmpfiles.d
+ kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
+ eend $?
+}
diff --git a/pcr/openrc-core/openrc.install b/pcr/openrc-core/openrc.install
new file mode 100644
index 000000000..f789630f7
--- /dev/null
+++ b/pcr/openrc-core/openrc.install
@@ -0,0 +1,19 @@
+pre_install() {
+ echo " ==> You can boot up systemd any time."
+ echo " ==> Add 'init=/usr/lib/systemd/systemd' to kernel command line."
+}
+
+post_install() {
+ echo " ==> Set up your network interface before you reboot."
+ local _url="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4"
+ echo " ==> Visit ${_url}"
+ #rc-update -u
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ echo " ==> Make sure you install systemd-sysvcompat before you reboot!"
+} \ No newline at end of file
diff --git a/pcr/openrc-core/openrc.logrotate b/pcr/openrc-core/openrc.logrotate
new file mode 100644
index 000000000..a168f2361
--- /dev/null
+++ b/pcr/openrc-core/openrc.logrotate
@@ -0,0 +1,7 @@
+/var/log/rc.log {
+ compress
+ rotate 4
+ weekly
+ missingok
+ notifempty
+}