All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [RFC PATCH v3 0/2] Add sensors config tool
Date: Wed, 14 Apr 2010 07:27:05 +0000	[thread overview]
Message-ID: <4BC56E49.9040709@redhat.com> (raw)
In-Reply-To: <20100331200353.GA2002@andre-laptop>

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

      parent reply	other threads:[~2010-04-14  7:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
2010-04-13 19:32 ` Andre Prendel
2010-04-14  7:27 ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC56E49.9040709@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.