User Tools

Site Tools


tips:mkdev-for-sensors-detect

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tips:mkdev-for-sensors-detect [28.08.2011 22:59] (current)
vergo created
Line 1: Line 1:
 +====== mkdev for sensors-detect ======
  
 +After installing the //lm-sensors// package it's usually good to probe available sensors unless those supported by the motherboard are already known. However, in Dapper (8.04) the user will get the following error
 +
 +<code>
 +$ sensors-detect 
 +No i2c device files found. Use prog/mkdev/mkdev.sh to create them.
 +</code>
 +
 +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'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 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 "$OUSER:$OGROUP" /dev/i2c-$i || exit
 + i=$[$i + 1]
 +done
 +#end of file
 +</code>
 +
 +Copypaste that to your favorite editor, save as mki2cdev.sh, give it execution bits
 +
 +<code>
 +chmod a+x mki2cdev.sh
 +</code>
 +
 +and run it once as root
 +
 +<code>
 +sudo ./mki2cdev.sh
 +</code>
 +
 +and continue with //sensors-detect//. That error should finally be gone and sensors detected as wanted. 
tips/mkdev-for-sensors-detect.txt ยท Last modified: 28.08.2011 22:59 by vergo