dracut-functions: install udev rules

Install the udev rules to /lib, if the original rule is found there.
master
Harald Hoyer 2011-03-25 13:05:05 +01:00
parent 94f4923039
commit c97e1a76f3
1 changed files with 13 additions and 3 deletions

View File

@ -403,9 +403,19 @@ inst_rules() {
inst_dir "/lib/udev/rules.d"
inst_dir "$target"
for rule in "$@"; do
found=$(find_rule "$rule") && \
inst_simple "$found" "$target/${found##*/}" \
|| dinfo "Skipping udev rule: $rule"
for r in /lib/udev/rules.d /etc/udev/rules.d; do
if [[ -f $r/$rule ]]; then
found="$r/$rule"
inst_simple "$found"
fi
done
for r in '' ./ $dracutbasedir/rules.d/; do
if [[ -f ${r}$rule ]]; then
found="${r}$rule"
inst_simple "$found" "$target/${found##*/}"
fi
done
[[ $found ]] || dinfo "Skipping udev rule: $rule"
done
}