Gentoo Archives: gentoo-commits

From: "Thilo Bangert (bangert)" <bangert@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/lm_sensors/files: lm_sensors-3.1.1-sensors-detect-gentoo.patch
Date: Tue, 27 Oct 2009 08:26:28
Message-Id: E1N2hNp-0001lI-SE@stork.gentoo.org
1 bangert 09/10/27 08:26:25
2
3 Added: lm_sensors-3.1.1-sensors-detect-gentoo.patch
4 Log:
5 version bump (bug #244598)
6 (Portage version: 2.2_rc46/cvs/Linux i686)
7
8 Revision Changes Path
9 1.1 sys-apps/lm_sensors/files/lm_sensors-3.1.1-sensors-detect-gentoo.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/lm_sensors/files/lm_sensors-3.1.1-sensors-detect-gentoo.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/lm_sensors/files/lm_sensors-3.1.1-sensors-detect-gentoo.patch?rev=1.1&content-type=text/plain
13
14 Index: lm_sensors-3.1.1-sensors-detect-gentoo.patch
15 ===================================================================
16 --- lm_sensors-3.1.1.orig/prog/detect/sensors-detect 2009-03-04 15:18:39.000000000 +0100
17 +++ lm_sensors-3.1.1/prog/detect/sensors-detect 2009-03-04 15:21:26.000000000 +0100
18 @@ -20,6 +20,9 @@
19 # MA 02110-1301 USA.
20 #
21
22 +# Gentoo specific modifications based on a patch from Rudo Thomas
23 +# <thomr9am@××××××××××××××××××.cz>
24 +
25 require 5.004;
26
27 use strict;
28 @@ -5274,26 +5277,33 @@
29 print MODPROBE_D $configfile;
30 close(MODPROBE_D);
31 } else {
32 + print "\nIf you want to load the modules at startup, generate a config file\n",
33 + "below and make sure lm_sensors gets started at boot time; e.g\n",
34 + "\$ rc-update add lm_sensors default\n";
35 print "To make the sensors modules behave correctly, add these lines to\n".
36 - "/etc/modprobe.conf:\n\n";
37 + "/etc/modules.d/lm_sensors and run modules-update:\n\n";
38 print "#----cut here----\n".
39 $configfile.
40 "#----cut here----\n\n";
41 }
42 }
43
44 - my $have_sysconfig = -d '/etc/sysconfig';
45 - printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
46 - (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
47 - ($have_sysconfig ? 'YES/no' : 'yes/NO');
48 - $_ = <STDIN>;
49 - if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
50 - unless ($have_sysconfig) {
51 - mkdir('/etc/sysconfig', 0777)
52 - or die "Sorry, can't create /etc/sysconfig ($!)";
53 + my $have_config = -f '/etc/conf.d/lm_sensors';
54 + print "\nDo you want to ".($have_config?"overwrite":"generate").
55 + " /etc/conf.d/lm_sensors? Enter s to specify other file name?\n",
56 + " (".($have_config?"yes/NO":"YES/no")."/s): ";
57 + my $reply = <STDIN>;
58 +
59 + if (($have_config and $reply =~ /^\s*[Yy]/) or
60 + (not $have_config and not $reply =~ /^\s*[Nn]/) or
61 + $reply =~ /^\s*[Ss]/) {
62 + my $filename = "/etc/conf.d/lm_sensors";
63 + if ($reply =~ /^\s*[Ss]/) {
64 + print "Specify the file to store the configuration to: ";
65 + $filename = <STDIN>;
66 }
67 - open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
68 - or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
69 + open(SYSCONFIG, ">".$filename)
70 + or die "Sorry, can't create $filename ($!).";
71 print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
72 print SYSCONFIG <<'EOT';
73 # This file is sourced by /etc/init.d/lm_sensors and defines the modules to
74 @@ -5304,6 +5314,11 @@
75 # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
76
77 EOT
78 + print SYSCONFIG
79 + "# Load modules at startup\n".
80 + "LOADMODULES=yes\n\n".
81 + "# Initialize sensors at startup\n".
82 + "INITSENSORS=yes\n\n";
83 print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n"
84 if @{$bus_modules};
85 print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n";
86 @@ -5312,6 +5327,10 @@
87
88 # For compatibility reasons, modules are also listed individually as variables
89 # MODULE_0, MODULE_1, MODULE_2, etc.
90 +# Please note that the numbers in MODULE_X must start at 0 and increase in
91 +# steps of 1. Any number that is missing will make the init script skip the
92 +# rest of the modules. Use MODULE_X_ARGS for arguments.
93 +#
94 # You should use BUS_MODULES and HWMON_MODULES instead if possible.
95
96 EOT
97 @@ -5321,10 +5340,7 @@
98 $i++;
99 }
100 close(SYSCONFIG);
101 -
102 - print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n".
103 - "for initialization at boot time.\n"
104 - unless -f "/etc/init.d/lm_sensors";
105 + print "Done.\n";
106
107 if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") {
108 system("/sbin/insserv", "/etc/init.d/lm_sensors");
109 @@ -5338,20 +5354,6 @@
110 "kernel modules.\n\n";
111 }
112 } else {
113 - print "To load everything that is needed, add this to one of the system\n".
114 - "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n";
115 - print "#----cut here----\n";
116 - if (@{$bus_modules}) {
117 - print "# Adapter drivers\n";
118 - print "modprobe $_\n" foreach (@{$bus_modules});
119 - }
120 - print "# Chip drivers\n";
121 - print "modprobe $_\n" foreach (@{$hwmon_modules});
122 - print((-e '/usr/bin/sensors' ?
123 - "/usr/bin/sensors -s\n" :
124 - "/usr/local/bin/sensors -s\n").
125 - "#----cut here----\n\n");
126 -
127 print "If you have some drivers built into your kernel, the list above will\n".
128 "contain too many modules. Skip the appropriate ones! You really\n".
129 "should try these commands right now to make sure everything is\n".