aboutsummaryrefslogtreecommitdiffstats
path: root/main/eudev
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-07-17 12:53:31 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-07-17 12:53:31 +0000
commitb96bd6ed76c007ff0975e954d1bf20d1213eaf90 (patch)
treea332ee4ff5f3482fc9bf77e00fd849bbffd3f056 /main/eudev
parent8c4b85ef230ac621b88f4d7e64e09d1c5d5e84e7 (diff)
downloadaports-b96bd6ed76c007ff0975e954d1bf20d1213eaf90.tar.bz2
aports-b96bd6ed76c007ff0975e954d1bf20d1213eaf90.tar.xz
main/eudev: add udev-postmount script
Diffstat (limited to 'main/eudev')
-rw-r--r--main/eudev/APKBUILD25
-rw-r--r--main/eudev/udev-postmount.initd55
2 files changed, 75 insertions, 5 deletions
diff --git a/main/eudev/APKBUILD b/main/eudev/APKBUILD
index 00b3747879..f2361d89be 100644
--- a/main/eudev/APKBUILD
+++ b/main/eudev/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=eudev
pkgver=3.1.2
-pkgrel=2
+pkgrel=3
pkgdesc="OpenRC compatible fork of systemd-udev"
url="https://wiki.gentoo.org/wiki/Project:Eudev"
arch="all"
@@ -13,7 +13,10 @@ makedepends="$depends_dev gperf glib-dev linux-headers kmod-dev
gobject-introspection-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-libgudev $pkgname-libs"
-source="http://dev.gentoo.org/~blueness/eudev/eudev-$pkgver.tar.gz"
+source="http://dev.gentoo.org/~blueness/eudev/eudev-$pkgver.tar.gz
+ udev-postmount.initd
+ "
+
_builddir="$srcdir"/eudev-$pkgver
prepare() {
@@ -55,6 +58,15 @@ package() {
make DESTDIR="$pkgdir" sharepkgconfigdir=/usr/lib/pkgconfig \
install || return 1
rm -f "$pkgdir"/usr/lib/*.la
+
+ for i in $source; do
+ case $i in
+ *.initd)
+ install -Dm755 "$srcdir"/$i \
+ "$pkgdir"/etc/init.d/${i%.initd} || return 1
+ ;;
+ esac
+ done
}
dev() {
@@ -84,6 +96,9 @@ libgudev() {
}
-md5sums="07ab33fe310d250f06fc28f010e3fde2 eudev-3.1.2.tar.gz"
-sha256sums="4393b69e93dd8117defde6519b199d479f9d051f52061157a1a7a41b8fe10273 eudev-3.1.2.tar.gz"
-sha512sums="d9aeb37a163ce4a0c116f75a927b4b99f8445d06624fbb3c28ade18f3effd8c54af5a4a52477c31a0452822a3dc0901468263195256e9dbf79d2ef08cf46f2b6 eudev-3.1.2.tar.gz"
+md5sums="07ab33fe310d250f06fc28f010e3fde2 eudev-3.1.2.tar.gz
+17ca36a764f5e8a89454344cde828740 udev-postmount.initd"
+sha256sums="4393b69e93dd8117defde6519b199d479f9d051f52061157a1a7a41b8fe10273 eudev-3.1.2.tar.gz
+b0327069dbb57b39600079b87df80915dabb77c2fa298d6ae109ca04f8ba08b5 udev-postmount.initd"
+sha512sums="d9aeb37a163ce4a0c116f75a927b4b99f8445d06624fbb3c28ade18f3effd8c54af5a4a52477c31a0452822a3dc0901468263195256e9dbf79d2ef08cf46f2b6 eudev-3.1.2.tar.gz
+8ef1b911843ab13acb1c1b9b7a0a5cd76659f395c3db9e579429556f23eacebb414507dc0231e2455e7589bc70054fa1e6b6dd93dd833f7101c0da0597aabf88 udev-postmount.initd"
diff --git a/main/eudev/udev-postmount.initd b/main/eudev/udev-postmount.initd
new file mode 100644
index 0000000000..f1f94f4890
--- /dev/null
+++ b/main/eudev/udev-postmount.initd
@@ -0,0 +1,55 @@
+#!/sbin/openrc-run
+# 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