mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-03 13:38:25 +00:00
unhide_ICH_SMBus: New features!
* check that the user is root * check if the SMBus is already there * only load i2c-i801 if needed * show the SMBus device line on success git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4285 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
6c8dde0740
commit
13541ab5c4
2 files changed
+24
-3
No files matched your search
@@ -25,7 +25,7 @@ SVN HEAD
|
||||
Program eepromer: Fix loads of warnings
|
||||
Program i2cdetect: Make the output clearer
|
||||
Program py-smbus: New! Python i2c-dev bindings (prog/py-smbus)
|
||||
Program unhide_ICH_SMBus: New! Unhides the ICH SMBus even for 2.6 kernels
|
||||
Program unhide_ICH_SMBus: New! Unhides the ICH SMBus for 2.6 kernels
|
||||
without need of recompilation.
|
||||
Programs dump/*: More robust handling of user inputs
|
||||
Programs pwmconfig, fancontrol: Handle write errors for bash 3.1
|
||||
|
||||
@@ -11,6 +11,18 @@
|
||||
pcibus="/sys/bus/pci/slots/"
|
||||
device="00:1f"
|
||||
|
||||
if [ "$UID" -ne 0 ] ; then
|
||||
echo "You need to be root to run this script!"
|
||||
exit 252
|
||||
fi
|
||||
|
||||
smbus=`lspci -n -s $device.3 | grep -i '0c05: *8086'`
|
||||
if [ -n "$smbus" ] ; then
|
||||
echo "ICH SMBus is already there!"
|
||||
lspci -s $device.3
|
||||
exit
|
||||
fi
|
||||
|
||||
intel=`lspci -n -s $device.0 | grep 8086`
|
||||
|
||||
if [ -z "$intel" ] ; then
|
||||
@@ -35,5 +47,14 @@ if [ ! -d "$pcibus/0000:$device.3" ] ; then
|
||||
echo "Failed to enable the SMBUS"
|
||||
exit 253;
|
||||
fi
|
||||
echo "Done, loading i2c-i801 ..."
|
||||
modprobe i2c-i801 &> /dev/null
|
||||
|
||||
if [ ! -d "/sys/bus/pci/drivers/i801_smbus" ] ; then
|
||||
echo "Loading i2c-i801 ..."
|
||||
modprobe i2c-i801
|
||||
if [ $? -ne 0 ] ; then
|
||||
exit 251
|
||||
fi
|
||||
fi
|
||||
|
||||
lspci -s $device.3
|
||||
echo "Done!"
|
||||
Reference in new issue
Block a user