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:
Jean Delvare committed 2004-07-09 18:45:42 +00:00
1 parent ec48efad1c
commit 746d4adbee
1 file changed
+11 -5
+11 -5
View File
@@ -11,13 +11,19 @@ OGROUP=root
# The mode of the devices
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;
while [ $i -lt $NUMBER ] ; do
echo /dev/i2c-$i
mknod -m 000 /dev/i2c-$i c 89 $i
chown "$OUSER:$OGROUP" /dev/i2c-$i
chmod $MODE /dev/i2c-$i
i=$[$i + 1]
echo /dev/i2c-$i
mknod -m $MODE /dev/i2c-$i c 89 $i || exit
chown "$OUSER:$OGROUP" /dev/i2c-$i || exit
i=$[$i + 1]
done