aboutsummaryrefslogtreecommitdiffstats
path: root/main/udev/udev-postmount.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-09-22 15:48:35 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-09-22 15:48:35 +0000
commit59ea1c2b42e66c216243a22e9d4d22ed6a3b93f4 (patch)
treead8003da007454f818a6faab68f9dede8ef82ce8 /main/udev/udev-postmount.initd
parent967ed15c5aa5cc735536e24b5b5cc6eb1b16e808 (diff)
downloadaports-59ea1c2b42e66c216243a22e9d4d22ed6a3b93f4.tar.bz2
aports-59ea1c2b42e66c216243a22e9d4d22ed6a3b93f4.tar.xz
main/udev: fix warning about udevadm trigger --type=failed is deprecated
Diffstat (limited to 'main/udev/udev-postmount.initd')
-rw-r--r--main/udev/udev-postmount.initd32
1 files changed, 22 insertions, 10 deletions
diff --git a/main/udev/udev-postmount.initd b/main/udev/udev-postmount.initd
index 33a412ff87..9f71c18f30 100644
--- a/main/udev/udev-postmount.initd
+++ b/main/udev/udev-postmount.initd
@@ -1,33 +1,45 @@
#!/sbin/runscript
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/files/161/udev-postmount.initd,v 1.1 2010/08/24 18:41:29 zzam Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/files/164/udev-postmount.initd,v 1.1 2010/10/30 13:53:54 zzam Exp $
depend() {
need localmount
- after dbus # for trigger failed
}
dir_writeable()
{
- printf "" 2>/dev/null >"$1"/.test.$$ && rm "$1"/.test.$$
+ 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() {
+ # only continue if rules-directory is writable
+ dir_writeable /etc/udev/rules.d || return 0
+
+ local file dest
+ for file in /dev/.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 /dev/.udev/ ] || return 0
einfo "Doing udev cleanups"
- # Run the events that failed at first udev trigger
- udevadm trigger --type=failed -v
-
- # only continue if rules-directory is writable
- dir_writeable /etc/udev/rules.d || return 0
-
# store persistent-rules that got created while booting
# when / was still read-only
- /lib/udev/move_tmp_persistent_rules.sh
+ store_persistent_rules
}
stop() {