mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-30 13:57:41 +00:00
A small program to create /dev/i2c-* nodes
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@162 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
parent
a5f164aca5
commit
21fafe4241
23
prog/mkdev/mkdev.sh
Executable file
23
prog/mkdev/mkdev.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Here you can set several defaults.
|
||||||
|
|
||||||
|
# The number of devices to create (max: 256)
|
||||||
|
NUMBER=32
|
||||||
|
|
||||||
|
# The owner and group of the devices
|
||||||
|
OUSER=root
|
||||||
|
OGROUP=root
|
||||||
|
# The mode of the devices
|
||||||
|
MODE=600
|
||||||
|
|
||||||
|
|
||||||
|
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]
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user