[PATCH 2/3] prog/init/detect_new_dmi_info: Allows automatic detection new motherboard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch creates a file in prog/init/ which can be used to detect if a new
motherboard is used. When this is the case, sensors-detect -a will be
called.
I have not intergrated this script to any existing scripts; I'll leave that
to you (as in: people that know more about how to do it :)).

Ivo Manca
---
diff -ubrN lm-sensors-3.0.0/prog/init/detect_new_dmi_info
lm-sensors.new/prog/init/detect_new_dmi_info
--- lm-sensors-3.0.0/prog/init/detect_new_dmi_info 1970-01-01
01:00:00.000000000 +0100
+++ lm-sensors.new/prog/init/detect_new_dmi_info 2007-05-30
13:18:58.000000000 +0200
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+OLDDMIFILE=/etc/dmistrings
+
+# don't use -t system, since you also get logging info
+NEWDMI=`dmidecode -s system-manufacturer 2> /dev/null`
+NEWDMI="$NEWDMI`dmidecode -s system-product-name 2> /dev/null`"
+NEWDMI="$NEWDMI`dmidecode -s system-version 2> /dev/null`"
+NEWDMI="$NEWDMI`dmidecode -s baseboard-manufacturer 2> /dev/null`"
+NEWDMI="$NEWDMI`dmidecode -s baseboard-product-name 2> /dev/null`"
+NEWDMI="$NEWDMI`dmidecode -s baseboard-version 2> /dev/null`"
+
+if [ ! -r "$OLDDMIFILE" ]
+then
+  sensors-detect -a > /dev/null 2> /dev/null
+else
+  # read $OLDDMIFILE
+  OLDDMI=`cat $OLDDMIFILE`
+  if [ "$NEWDMI" != "$OLDDMI" ]
+  then
+    sensors-detect -a > /dev/null 2> /dev/null
+  fi
+fi
+
+exit 0
\ No newline at end of file





[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux