summaryrefslogtreecommitdiff
blob: e87e29380ee978b73a5f7d51cf10b633cbf34fac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# store persistent-rules that got created while booting
# when / was still read-only
store_persistent_rules() {
	local file dest

	for file in /dev/.udev/tmp-rules--*; do
		dest=${file##*tmp-rules--}
		[ "$dest" = '*' ] && break
		type=${dest##70-persistent-}
		type=${type%%.rules}
		einfo "Saving udev persistent ${type} rules to /etc/udev/rules.d"
		cat "$file" >> /etc/udev/rules.d/"$dest"
		rm -f "$file"
	done
}

store_persistent_rules

# vim:ts=4