2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00

Search for the udev db file/directory location in

/etc/udev/udev.conf. Should be more efficient that regularly adding
new possible names. Too bad distributions didn't agree on one name.
Hopefully the Linux Standard Base will address the issue soon.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2939 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2005-03-20 21:10:24 +00:00
parent a20ea3611f
commit a7fe97cf1d

View File

@@ -1955,10 +1955,25 @@ sub initialize_conf
close INPUTFILE;
my $use_udev = 0;
if (-e '/dev/.udev.tdb' || -f '/dev/.udev' || -d '/dev/.udevdb') {
$use_udev = 1;
$dev_i2c = '/dev/i2c-';
}
if (open(*INPUTFILE, '/etc/udev/udev.conf')) {
while (<INPUTFILE>) {
if (m/^\s*udev_db\s*=\s*\"([^"]*)\"/ || m/^\s*udev_db\s*=\s*(\S+)/) {
if (-e $1) {
$use_udev = 1;
$dev_i2c = '/dev/i2c-';
}
last;
}
}
close INPUTFILE;
} else {
# Try some known default udev db locations, just in case
if (-e '/dev/.udev.tdb' || -e '/dev/.udev'
|| -e '/dev/.udevdb' || -e '/dev/.udevdb') {
$use_udev = 1;
$dev_i2c = '/dev/i2c-';
}
}
if (-f '/etc/modules.conf') {
$modules_conf = '/etc/modules.conf';