mkdumprd: fix udev rules in modules-setup.sh

This commit is contained in:
Amerigo Wang 2011-08-02 00:33:14 +08:00
parent 1ec4f7b1b4
commit 7a4f7d02be
3 changed files with 28 additions and 4 deletions

View File

@ -67,10 +67,22 @@ to_udev_name()
echo ${dev#/dev/}
}
udevmatch() {
case "$1" in
UUID=????????-????-????-????-????????????|LABEL=*)
printf 'ENV{ID_FS_%s}=="%s"' "${1%%=*}" "${1#*=}"
;;
UUID=*)
printf 'ENV{ID_FS_UUID}=="%s*"' "${1#*=}"
;;
/dev/?*) printf 'KERNEL=="%s"' "${1#/dev/}" ;;
esac
printf ', SYMLINK+="'$(to_udev_name $1)'"\n'
}
add_udev_rules()
{
udevmatch $1 >> $moddir/99-localfs.rules
printf ", SYMLINK+=$(to_udev_name $1)" >> $moddir/99-localfs.rules
}
depends() {
@ -80,7 +92,6 @@ depends() {
case "$config_opt" in
ext[234]|xfs|btrfs|minix|raw)
_deps="$_deps `pull_dracut_modules "$config_val"`"
add_udev_rules $config_val
;;
esac
done < /etc/kdump.conf
@ -89,6 +100,16 @@ depends() {
}
install() {
echo -n "" > "$moddir/99-localfs.rules"
while read config_opt config_val;
do
case "$config_opt" in
ext[234]|xfs|btrfs|minix|raw)
add_udev_rules $config_val
;;
esac
done < /etc/kdump.conf
inst "/bin/date" "/bin/date"
inst "/bin/sync" "/bin/sync"
inst "/sbin/makedumpfile" "/sbin/makedumpfile"

View File

@ -1,6 +1,6 @@
Name: kexec-tools
Version: 2.0.2
Release: 20%{?dist}
Release: 21%{?dist}
License: GPLv2
Group: Applications/System
Summary: The kexec/kdump userspace component.
@ -280,6 +280,9 @@ done
%changelog
* Tue Aug 2 2011 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-21
- Fix udev rules in module-setup.sh
* Mon Aug 1 2011 Cong Wang <xiyou.wangcong@gmail.com> - 2.0.2-20
- Generate udev rules in module-setup.sh

View File

@ -2,4 +2,4 @@ d9f2ecd3c3307905f24130a25816e6cc kexec-tools-2.0.0.tar.bz2
3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz
e3a813bd6d7dace903a05c1296e20d57 makedumpfile-1.3.5.tar.gz
8e359dd03731b93a2082bd37cc2a4a4c kexec-tools-2.0.2.tar.bz2
8f9fb6eedea9f0006e4561301faab570 dracut-files.tbz2
e781db40f39c3f27c6003d9c5794b862 dracut-files.tbz2