This shows you the differences between two versions of the page.
| — |
tips:mkdev-for-sensors-detect [28.08.2011 22:59] (current) vergo created |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== mkdev for sensors-detect ====== | ||
| + | After installing the // | ||
| + | |||
| + | < | ||
| + | $ sensors-detect | ||
| + | No i2c device files found. Use prog/ | ||
| + | </ | ||
| + | |||
| + | and that mkdev.sh or similar is nowhere to be found. Here's a script that will do what needs to be done: | ||
| + | |||
| + | <code bash> | ||
| + | #!/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 | ||
| + | |||
| + | # This script doesn' | ||
| + | if [ -r / | ||
| + | if grep -q "/dev devfs" / | ||
| + | echo "You do not need to run this script as devfs is used." | ||
| + | exit; | ||
| + | fi | ||
| + | fi | ||
| + | |||
| + | i=0; | ||
| + | |||
| + | while [ $i -lt $NUMBER ] ; do | ||
| + | echo /dev/i2c-$i | ||
| + | mknod -m $MODE /dev/i2c-$i c 89 $i || exit | ||
| + | chown " | ||
| + | | ||
| + | done | ||
| + | #end of file | ||
| + | </ | ||
| + | |||
| + | Copypaste that to your favorite editor, save as mki2cdev.sh, | ||
| + | |||
| + | < | ||
| + | chmod a+x mki2cdev.sh | ||
| + | </ | ||
| + | |||
| + | and run it once as root | ||
| + | |||
| + | < | ||
| + | sudo ./ | ||
| + | </ | ||
| + | |||
| + | and continue with // | ||