* Re: [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool
2010-03-31 20:03 [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool Andre Prendel
@ 2010-04-01 6:56 ` Hans de Goede
2010-04-10 21:49 ` Andre Prendel
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2010-04-01 6:56 UTC (permalink / raw)
To: lm-sensors
Hi Andre,
On 03/31/2010 10:03 PM, Andre Prendel wrote:
> Hi Hans,
>
> At last here is a new version of the sensors config tool.
>
First of all many thanks for your continued work on this, it
is looking very good, so hopefully we will be able to soon
ship an lm_sensors with working auto-configuration of
(known) motherboards.
> Now we have a shell script doing the auto installation stuff. See
> install.sh patch 2/2. Further I removed this part of the python
> script.
>
The shell script looks good, nice and simple, great!
> As discussed, the config files from lm-sensors.org are fetched to
> vendor specific directories and links are made in the root config
> directory.
Great!
>
> This looks like this:
>
> drwxr-xr-x 2 andre andre 4096 2010-03-31 21:01 Abit
> lrwxrwxrwx 1 andre andre 16 2010-03-31 21:01 Abit_AA8-DuraMAX ->Abit/AA8-DuraMAX
> lrwxrwxrwx 1 andre andre 12 2010-03-31 21:01 Abit_AI7_1.0 ->Abit/AI7-1.0
> lrwxrwxrwx 1 andre andre 8 2010-03-31 21:01 Abit_AN7 -> Abit/AN7
> drwxr-xr-x 2 andre andre 4096 2010-03-31 21:01 ASRock
> lrwxrwxrwx 1 andre andre 17 2010-03-31 21:01 ASRock_M2NF3-VSTA ->ASRock/M2NF3-VSTA
> drwxr-xr-x 2 andre andre 4096 2010-03-31 21:01 Fujitsu
> lrwxrwxrwx 1 andre andre 15 2010-03-31 21:01 Fujitsu_D23122A ->Fujitsu/D2312A1
> lrwxrwxrwx 1 andre andre 15 2010-03-31 21:01 Fujitsu_D2312A1 ->Fujitsu/D2312A1
> lrwxrwxrwx 1 andre andre 15 2010-03-31 21:01 Fujitsu_D2312C1 ->Fujitsu/D2312A1
> lrwxrwxrwx 1 andre andre 15 2010-03-31 21:01 Fujitsu_D2312C2 ->Fujitsu/D2312A1
> lrwxrwxrwx 1 andre andre 15 2010-03-31 21:01 Fujitsu_D2312D2_2.0 ->Fujitsu/D2312A1
> lrwxrwxrwx 1 andre andre 15 2010-03-31 21:01 Fujitsu_D2314A1 ->Fujitsu/D2314A1
> lrwxrwxrwx 1 andre andre 15 2010-03-31 21:01 Fujitsu_D2314A2 ->Fujitsu/D2314A1
>
Also looks good :)
> The fetching tool parses headers like:
>
> # board_vendor: Fujitsu
> # board_name: D2312A1
> # board_version: 1.0
>
> Board version is optional. The block can appear mutliple times.
>
> # board_vendor: Fujitsu
> # board_name: D2312A1
>
> # board_vendor: Fujitsu
> # board_name: D23122A
>
> # board_vendor: Fujitsu
> # board_name: D2312C1
>
> # board_vendor: Fujitsu
> # board_name: D2312C2
>
> The same rules apply to the product headers.
>
> # sys_vendor: Fujitsu
> # product_name: D2312D2
> # product_version: 2.0
>
> Next task is the module auto loading stuff but first, what about this
> here?
>
I think this all looks very good! I think the module auto loading
is the only remaining item to do before this could actually become
production ready (although we will want Jean's input on this too).
The module autoloading requires 2 questions to be answered:
1) How do we store which modules are needed into the configuration
files on the wiki
2) How / where / what will these modules get loaded ? Currently we
have lines like these in /etc/sysconfig/lm_sensors:
# The format of this file is a shell script that simply defines variables:
# HWMON_MODULES for hardware monitoring driver modules, and optionally
# BUS_MODULES for any required bus driver module (for example for I2C or SPI).
HWMON_MODULES="it87"
# For compatibility reasons, modules are also listed individually as variables
# MODULE_0, MODULE_1, MODULE_2, etc.
# You should use BUS_MODULES and HWMON_MODULES instead if possible.
MODULE_0=it87
We could add new "keys" to this file, say:
AUTOMOBO_HWMON_MODULES
AUTOMOBO_BUS_MODULES
And modify the lm_sensors initscript to recognize these too, or thinking more
about this, as we need the script which does the copying of the config file
to /etc/sensors.d/automobo.conf, to extract the modules for us anyways (to
insert them into /etc/sysconfig/lm_sensors for example). We might just as
well make that script load the modules directly.
This also solves a problem with the HWMON_MODULES="it87" syntax, namely
that it does not allow specifying module parameters.
Jean, could we have your input on this ?
Thanks & Regards,
Hans
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool
2010-03-31 20:03 [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool Andre Prendel
2010-04-01 6:56 ` Hans de Goede
@ 2010-04-10 21:49 ` Andre Prendel
2010-04-11 8:18 ` Jean Delvare
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andre Prendel @ 2010-04-10 21:49 UTC (permalink / raw)
To: lm-sensors
On Thu, Apr 01, 2010 at 08:56:31AM +0200, Hans de Goede wrote:
> Hi Andre,
>
> On 03/31/2010 10:03 PM, Andre Prendel wrote:
> >Hi Hans,
> >
> >At last here is a new version of the sensors config tool.
> >
> >
> >Next task is the module auto loading stuff but first, what about this
> >here?
> >
>
> I think this all looks very good! I think the module auto loading
> is the only remaining item to do before this could actually become
> production ready (although we will want Jean's input on this too).
>
> The module autoloading requires 2 questions to be answered:
>
> 1) How do we store which modules are needed into the configuration
> files on the wiki
>
> 2) How / where / what will these modules get loaded ? Currently we
> have lines like these in /etc/sysconfig/lm_sensors:
>
> # The format of this file is a shell script that simply defines variables:
> # HWMON_MODULES for hardware monitoring driver modules, and optionally
> # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
>
> HWMON_MODULES="it87"
>
> # For compatibility reasons, modules are also listed individually as variables
> # MODULE_0, MODULE_1, MODULE_2, etc.
> # You should use BUS_MODULES and HWMON_MODULES instead if possible.
>
> MODULE_0=it87
>
>
> We could add new "keys" to this file, say:
> AUTOMOBO_HWMON_MODULES
> AUTOMOBO_BUS_MODULES
>
> And modify the lm_sensors initscript to recognize these too, or thinking more
> about this, as we need the script which does the copying of the config file
> to /etc/sensors.d/automobo.conf, to extract the modules for us anyways (to
> insert them into /etc/sysconfig/lm_sensors for example). We might just as
> well make that script load the modules directly.
>
> This also solves a problem with the HWMON_MODULES="it87" syntax, namely
> that it does not allow specifying module parameters.
>
> Jean, could we have your input on this ?
No reply from Jean so far. So I'd like to make a proposal.
I'd suggest using the install.sh script (which installs the
automobo.conf) to load the driver. The config file gets a "modules" tag
specifying the module name. E.g.
# board_name: foo
# board_vendor: bar
# modules: tmp421
Sed gives us the module name and modprobe loads the module. I've
extended the install.sh script to do this. See the patch below
(load_driver function).
What do you think about this approach?
Thanks,
Andre
---
Index: sensors/prog/detect/install.sh
=================================--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ sensors/prog/detect/install.sh 2010-04-10 23:37:38.510513143 +0200
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+SYSFS_PATH=/sys/class/dmi/id
+CONF_PATH=/var/lib/sensors/conf
+INSTALL_FILE=/etc/sensors.d/automobo.conf
+
+BOARD_VENDOR=`cat $SYSFS_PATH/board_vendor`
+BOARD_NAME=`cat $SYSFS_PATH/board_name`
+BOARD_VERSION=`cat $SYSFS_PATH/board_version`
+SYS_VENDOR=`cat $SYSFS_PATH/sys_vendor`
+PRODUCT_NAME=`cat $SYSFS_PATH/product_name`
+PRODUCT_VERSION=`cat $SYSFS_PATH/product_version`
+
+# only for testing
+#BOARD_VENDOR=Fujitsu
+#BOARD_NAMEÒ312C1
+#BOARD_VERSION=1.0
+#SYS_VENDOR=Fujitsu
+#PRODUCT_NAMEÒ312D2
+#PRODUCT_VERSION=2.0
+
+SEARCH_BOARD_VERSION=$CONF_PATH"/"$BOARD_VENDOR"_"$BOARD_NAME"_"$BOARD_VERSION
+SEARCH_BOARD=$CONF_PATH"/"$BOARD_VENDOR"_"$BOARD_NAME
+SEARCH_SYS_VERSION=$CONF_PATH"/"$SYS_VENDOR"_"$PRODUCT_NAME"_"$PRODUCT_VERSION
+SEARCH_SYS=$CONF_PATH"/"$SYS_VENDOR"_"$PRODUCT_NAME
+
+load_driver()
+{
+ MODULES=`sed -n -e 's/^# modules: \([A-Za-z0-9= ]*\).*$/\1/p' $INSTALL_FILE`
+ echo "Loading driver: $MODULES"
+ modprobe $MODULES
+}
+
+echo "Looking for config: $SEARCH_BOARD_VERSION"
+if [ -h "$SEARCH_BOARD_VERSION" ]; then
+ echo "Found suitable config"
+ cp -f $SEARCH_BOARD_VERSION $INSTALL_FILE
+ load_driver
+ exit 0
+fi
+
+echo "Looking for config: $SEARCH_BOARD"
+if [ -h "$SEARCH_BOARD" ]; then
+ echo "Found suitable config"
+ cp -f $SEARCH_BOARD $INSTALL_FILE
+ load_driver
+ exit 0
+fi
+
+echo "Looking for config: $SEARCH_SYS_VERSION"
+if [ -h "$SEARCH_SYS_VERSION" ]; then
+ echo "Found suitable config"
+ cp -f $SEARCH_SYS_VERSION $INSTALL_FILE
+ load_driver
+ exit 0
+fi
+
+echo "Looking for config: $SEARCH_SYS"
+if [ -h "$SEARCH_SYS" ]; then
+ echo "Found suitable config"
+ cp -f $SEARCH_SYS $INSTALL_FILE
+ load_driver
+ exit 0
+fi
+
+echo "Could not find a suitable config"
+rm -f $INSTALL_FILE
+
+exit 1
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool
2010-03-31 20:03 [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool Andre Prendel
2010-04-01 6:56 ` Hans de Goede
2010-04-10 21:49 ` Andre Prendel
@ 2010-04-11 8:18 ` Jean Delvare
2010-04-12 7:25 ` Hans de Goede
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Jean Delvare @ 2010-04-11 8:18 UTC (permalink / raw)
To: lm-sensors
On Sat, 10 Apr 2010 23:49:16 +0200, Andre Prendel wrote:
> On Thu, Apr 01, 2010 at 08:56:31AM +0200, Hans de Goede wrote:
> > I think this all looks very good! I think the module auto loading
> > is the only remaining item to do before this could actually become
> > production ready (although we will want Jean's input on this too).
> >
> > The module autoloading requires 2 questions to be answered:
> >
> > 1) How do we store which modules are needed into the configuration
> > files on the wiki
> >
> > 2) How / where / what will these modules get loaded ? Currently we
> > have lines like these in /etc/sysconfig/lm_sensors:
> >
> > # The format of this file is a shell script that simply defines variables:
> > # HWMON_MODULES for hardware monitoring driver modules, and optionally
> > # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
> >
> > HWMON_MODULES="it87"
> >
> > # For compatibility reasons, modules are also listed individually as variables
> > # MODULE_0, MODULE_1, MODULE_2, etc.
> > # You should use BUS_MODULES and HWMON_MODULES instead if possible.
> >
> > MODULE_0=it87
> >
> >
> > We could add new "keys" to this file, say:
> > AUTOMOBO_HWMON_MODULES
> > AUTOMOBO_BUS_MODULES
> >
> > And modify the lm_sensors initscript to recognize these too, or thinking more
> > about this, as we need the script which does the copying of the config file
> > to /etc/sensors.d/automobo.conf, to extract the modules for us anyways (to
> > insert them into /etc/sysconfig/lm_sensors for example). We might just as
> > well make that script load the modules directly.
> >
> > This also solves a problem with the HWMON_MODULES="it87" syntax, namely
> > that it does not allow specifying module parameters.
> >
> > Jean, could we have your input on this ?
If modules need parameters, these should go
to /etc/modprobe.d/hwmon.conf or some such. /etc/sysconfig/lm_sensors
isn't the right place for them, because you want the options to be
applied even when the modules are loaded manually.
Not that this should be a big concern anyway, as module parameters
should almost never be used at this point. sensors-detect no longer
generates any for kernels >= 2.6.28.
> No reply from Jean so far. So I'd like to make a proposal.
I'm very sorry, but I simply don't have the time to look into your code
and proposals right now. Please don't let this stop you, just go ahead
with what you have, we have been in need of this feature for years, so
the sooner we have it, the better. If it needs adjustments, we can
apply them later. I have no doubt that we will discover new needs as
users start using your code anyway.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool
2010-03-31 20:03 [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool Andre Prendel
` (2 preceding siblings ...)
2010-04-11 8:18 ` Jean Delvare
@ 2010-04-12 7:25 ` Hans de Goede
2010-04-13 19:32 ` Andre Prendel
2010-04-14 7:27 ` Hans de Goede
5 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2010-04-12 7:25 UTC (permalink / raw)
To: lm-sensors
Hi,
On 04/10/2010 11:49 PM, Andre Prendel wrote:
> On Thu, Apr 01, 2010 at 08:56:31AM +0200, Hans de Goede wrote:
>> Hi Andre,
>>
>> On 03/31/2010 10:03 PM, Andre Prendel wrote:
>>> Hi Hans,
>>>
>>> At last here is a new version of the sensors config tool.
>>>
>>>
>>> Next task is the module auto loading stuff but first, what about this
>>> here?
>>>
>>
>> I think this all looks very good! I think the module auto loading
>> is the only remaining item to do before this could actually become
>> production ready (although we will want Jean's input on this too).
>>
>> The module autoloading requires 2 questions to be answered:
>>
>> 1) How do we store which modules are needed into the configuration
>> files on the wiki
>>
>> 2) How / where / what will these modules get loaded ? Currently we
>> have lines like these in /etc/sysconfig/lm_sensors:
>>
>> # The format of this file is a shell script that simply defines variables:
>> # HWMON_MODULES for hardware monitoring driver modules, and optionally
>> # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
>>
>> HWMON_MODULES="it87"
>>
>> # For compatibility reasons, modules are also listed individually as variables
>> # MODULE_0, MODULE_1, MODULE_2, etc.
>> # You should use BUS_MODULES and HWMON_MODULES instead if possible.
>>
>> MODULE_0=it87
>>
>>
>> We could add new "keys" to this file, say:
>> AUTOMOBO_HWMON_MODULES
>> AUTOMOBO_BUS_MODULES
>>
>> And modify the lm_sensors initscript to recognize these too, or thinking more
>> about this, as we need the script which does the copying of the config file
>> to /etc/sensors.d/automobo.conf, to extract the modules for us anyways (to
>> insert them into /etc/sysconfig/lm_sensors for example). We might just as
>> well make that script load the modules directly.
>>
>> This also solves a problem with the HWMON_MODULES="it87" syntax, namely
>> that it does not allow specifying module parameters.
>>
>> Jean, could we have your input on this ?
>
> No reply from Jean so far. So I'd like to make a proposal.
>
> I'd suggest using the install.sh script (which installs the
> automobo.conf) to load the driver. The config file gets a "modules" tag
> specifying the module name. E.g.
>
> # board_name: foo
> # board_vendor: bar
>
> # modules: tmp421
>
> Sed gives us the module name and modprobe loads the module. I've
> extended the install.sh script to do this. See the patch below
> (load_driver function).
>
> What do you think about this approach?
>
Sounds fine (and the proposed code looks good), but IMHO it would be better to have
a module statement rather then a module*s*, which specifies
a single module, and then allow having this statement multiple times.
This way we can (optionally) add module parameters. Unfortunately in some
rare cases this is necessary see, for example:
http://www.lm-sensors.org/wiki/Configurations/Abit/AN7
Regards,
Hans
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool
2010-03-31 20:03 [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool Andre Prendel
` (3 preceding siblings ...)
2010-04-12 7:25 ` Hans de Goede
@ 2010-04-13 19:32 ` Andre Prendel
2010-04-14 7:27 ` Hans de Goede
5 siblings, 0 replies; 7+ messages in thread
From: Andre Prendel @ 2010-04-13 19:32 UTC (permalink / raw)
To: lm-sensors
On Mon, Apr 12, 2010 at 09:25:16AM +0200, Hans de Goede wrote:
> Hi,
Hello Hans,
> Sounds fine (and the proposed code looks good), but IMHO it would be better to have
> a module statement rather then a module*s*, which specifies
> a single module, and then allow having this statement multiple times.
>
> This way we can (optionally) add module parameters. Unfortunately in some
> rare cases this is necessary see, for example:
> http://www.lm-sensors.org/wiki/Configurations/Abit/AN7
I've revised the install.sh script a bit (see patch below). Now we can
have the module statement multiple times along with parameters.
Regards,
Andre
---
Index: sensors/prog/detect/install.sh
=================================--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ sensors/prog/detect/install.sh 2010-04-13 20:59:26.931071291 +0200
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+SYSFS_PATH=/sys/class/dmi/id
+CONF_PATH=/var/lib/sensors/conf
+INSTALL_FILE=/etc/sensors.d/automobo.conf
+
+BOARD_VENDOR=`cat $SYSFS_PATH/board_vendor`
+BOARD_NAME=`cat $SYSFS_PATH/board_name`
+BOARD_VERSION=`cat $SYSFS_PATH/board_version`
+SYS_VENDOR=`cat $SYSFS_PATH/sys_vendor`
+PRODUCT_NAME=`cat $SYSFS_PATH/product_name`
+PRODUCT_VERSION=`cat $SYSFS_PATH/product_version`
+
+# only for testing
+#BOARD_VENDOR=Fujitsu
+#BOARD_NAMEÒ312C1
+#BOARD_VERSION=1.0
+#SYS_VENDOR=Fujitsu
+#PRODUCT_NAMEÒ312D2
+#PRODUCT_VERSION=2.0
+
+SEARCH_BOARD_VERSION=$CONF_PATH"/"$BOARD_VENDOR"_"$BOARD_NAME"_"$BOARD_VERSION
+SEARCH_BOARD=$CONF_PATH"/"$BOARD_VENDOR"_"$BOARD_NAME
+SEARCH_SYS_VERSION=$CONF_PATH"/"$SYS_VENDOR"_"$PRODUCT_NAME"_"$PRODUCT_VERSION
+SEARCH_SYS=$CONF_PATH"/"$SYS_VENDOR"_"$PRODUCT_NAME
+
+load_drivers()
+{
+ while read a b c; do
+ if [ "$a" = "#" ]; then
+ if [ "$b" = "module:" ]; then
+ driver=`echo $c | tr -d '\r'`
+ echo "Loading driver: $driver"
+ modprobe $driver
+ fi
+ fi
+ done < $INSTALL_FILE
+}
+
+search_config()
+{
+ echo "Looking for config: $1"
+ if [ -h "$1" ]; then
+ echo "Found suitable config"
+ cp -f $1 $INSTALL_FILE
+ load_drivers
+ exit 0
+ fi
+}
+
+for search in "$SEARCH_BOARD_VERSION" "$SEARCH_BOARD" "$SEARCH_SYS_VERSION" "$SEARCH_SYS"
+do
+ search_config "$search"
+done
+
+echo "Could not find a suitable config"
+rm -f $INSTALL_FILE
+
+exit 1
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool
2010-03-31 20:03 [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool Andre Prendel
` (4 preceding siblings ...)
2010-04-13 19:32 ` Andre Prendel
@ 2010-04-14 7:27 ` Hans de Goede
5 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2010-04-14 7:27 UTC (permalink / raw)
To: lm-sensors
Hi Andre,
On 04/13/2010 09:32 PM, Andre Prendel wrote:
> On Mon, Apr 12, 2010 at 09:25:16AM +0200, Hans de Goede wrote:
>> Hi,
>
> Hello Hans,
>
>> Sounds fine (and the proposed code looks good), but IMHO it would be better to have
>> a module statement rather then a module*s*, which specifies
>> a single module, and then allow having this statement multiple times.
>>
>> This way we can (optionally) add module parameters. Unfortunately in some
>> rare cases this is necessary see, for example:
>> http://www.lm-sensors.org/wiki/Configurations/Abit/AN7
>
> I've revised the install.sh script a bit (see patch below). Now we can
> have the module statement multiple times along with parameters.
>
Looks good!
Can you please repost the latest version of the entire set? Then I'll give it a
more thorough review (and run some tests). And then if Jean also acks it we can
commit it to svn :)
Regards,
Hans
> Regards,
> Andre
>
> ---
> Index: sensors/prog/detect/install.sh
> =================================> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ sensors/prog/detect/install.sh 2010-04-13 20:59:26.931071291 +0200
> @@ -0,0 +1,59 @@
> +#!/bin/bash
> +
> +SYSFS_PATH=/sys/class/dmi/id
> +CONF_PATH=/var/lib/sensors/conf
> +INSTALL_FILE=/etc/sensors.d/automobo.conf
> +
> +BOARD_VENDOR=`cat $SYSFS_PATH/board_vendor`
> +BOARD_NAME=`cat $SYSFS_PATH/board_name`
> +BOARD_VERSION=`cat $SYSFS_PATH/board_version`
> +SYS_VENDOR=`cat $SYSFS_PATH/sys_vendor`
> +PRODUCT_NAME=`cat $SYSFS_PATH/product_name`
> +PRODUCT_VERSION=`cat $SYSFS_PATH/product_version`
> +
> +# only for testing
> +#BOARD_VENDOR=Fujitsu
> +#BOARD_NAMEÒ312C1
> +#BOARD_VERSION=1.0
> +#SYS_VENDOR=Fujitsu
> +#PRODUCT_NAMEÒ312D2
> +#PRODUCT_VERSION=2.0
> +
> +SEARCH_BOARD_VERSION=$CONF_PATH"/"$BOARD_VENDOR"_"$BOARD_NAME"_"$BOARD_VERSION
> +SEARCH_BOARD=$CONF_PATH"/"$BOARD_VENDOR"_"$BOARD_NAME
> +SEARCH_SYS_VERSION=$CONF_PATH"/"$SYS_VENDOR"_"$PRODUCT_NAME"_"$PRODUCT_VERSION
> +SEARCH_SYS=$CONF_PATH"/"$SYS_VENDOR"_"$PRODUCT_NAME
> +
> +load_drivers()
> +{
> + while read a b c; do
> + if [ "$a" = "#" ]; then
> + if [ "$b" = "module:" ]; then
> + driver=`echo $c | tr -d '\r'`
> + echo "Loading driver: $driver"
> + modprobe $driver
> + fi
> + fi
> + done< $INSTALL_FILE
> +}
> +
> +search_config()
> +{
> + echo "Looking for config: $1"
> + if [ -h "$1" ]; then
> + echo "Found suitable config"
> + cp -f $1 $INSTALL_FILE
> + load_drivers
> + exit 0
> + fi
> +}
> +
> +for search in "$SEARCH_BOARD_VERSION" "$SEARCH_BOARD" "$SEARCH_SYS_VERSION" "$SEARCH_SYS"
> +do
> + search_config "$search"
> +done
> +
> +echo "Could not find a suitable config"
> +rm -f $INSTALL_FILE
> +
> +exit 1
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 7+ messages in thread