mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-28 20:58:22 +00:00
Detect devfs and refuse to run.
Use mknod's mode instead of chmod. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2638 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
ec48efad1c
commit
746d4adbee
1 file changed
+11
-5
+11
-5
@@ -11,13 +11,19 @@ OGROUP=root
|
|||||||
# The mode of the devices
|
# The mode of the devices
|
||||||
MODE=600
|
MODE=600
|
||||||
|
|
||||||
|
# This script doesn't need to be run if devfs is used
|
||||||
|
if [ -r /proc/mounts ] ; then
|
||||||
|
if grep -q "/dev devfs" /proc/mounts ; then
|
||||||
|
echo "You do not need to run this script as your system uses devfs."
|
||||||
|
exit;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
|
|
||||||
while [ $i -lt $NUMBER ] ; do
|
while [ $i -lt $NUMBER ] ; do
|
||||||
echo /dev/i2c-$i
|
echo /dev/i2c-$i
|
||||||
mknod -m 000 /dev/i2c-$i c 89 $i
|
mknod -m $MODE /dev/i2c-$i c 89 $i || exit
|
||||||
chown "$OUSER:$OGROUP" /dev/i2c-$i
|
chown "$OUSER:$OGROUP" /dev/i2c-$i || exit
|
||||||
chmod $MODE /dev/i2c-$i
|
i=$[$i + 1]
|
||||||
i=$[$i + 1]
|
|
||||||
done
|
done
|
||||||
Reference in new issue
Block a user