summaryrefslogtreecommitdiff
path: root/user/lm_sensors/use-module-load.d-dir.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-12-01 19:13:16 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-12-01 19:13:16 +0000
commit5e97d538cf91d9ac6e95ed869e0baa4fb5a7ed4b (patch)
treefafdc4f961e295bdc313b6da688a732746d95941 /user/lm_sensors/use-module-load.d-dir.patch
parent2912f5f90d52242c1b992164973c604a5d216777 (diff)
downloadpackages-5e97d538cf91d9ac6e95ed869e0baa4fb5a7ed4b.tar.gz
packages-5e97d538cf91d9ac6e95ed869e0baa4fb5a7ed4b.tar.bz2
packages-5e97d538cf91d9ac6e95ed869e0baa4fb5a7ed4b.tar.xz
packages-5e97d538cf91d9ac6e95ed869e0baa4fb5a7ed4b.zip
user/lm_sensors: bump to 3.5.0
Diffstat (limited to 'user/lm_sensors/use-module-load.d-dir.patch')
-rw-r--r--user/lm_sensors/use-module-load.d-dir.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/user/lm_sensors/use-module-load.d-dir.patch b/user/lm_sensors/use-module-load.d-dir.patch
new file mode 100644
index 000000000..319fcec06
--- /dev/null
+++ b/user/lm_sensors/use-module-load.d-dir.patch
@@ -0,0 +1,47 @@
+diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
+index 08721f0..6e83e97 100755
+--- a/prog/detect/sensors-detect
++++ b/prog/detect/sensors-detect
+@@ -7059,31 +7059,20 @@ sub write_config
+ }
+ }
+
+- my $have_sysconfig = -d '/etc/sysconfig';
+- printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
+- (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
+- ($have_sysconfig ? 'YES/no' : 'yes/NO');
++ my $config = '/etc/modules-load.d/lm_sensors.conf';
++ my $have_config = -f $config;
++ printf "Do you want to \%s \%s? (\%s): ",
++ (-e $config ? 'overwrite' : 'generate'),
++ $config,
++ ($have_config ? 'YES/no' : 'yes/NO');
+ $_ = read_answer();
+- if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
+- unless ($have_sysconfig) {
+- mkdir('/etc/sysconfig', 0777)
+- or die "Sorry, can't create /etc/sysconfig ($!)";
+- }
+- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
+- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
++ if (($have_config and not m/^\s*n/i) or m/^\s*y/i) {
++ open(local *SYSCONFIG, ">$config")
++ or die "Sorry, can't create $config ($!)";
+ print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
+- print SYSCONFIG <<'EOT';
+-# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
+-# be loaded/unloaded.
+-#
+-# 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).
+-
+-EOT
+- print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n"
++ print SYSCONFIG join("\n", @{$bus_modules}), "\n"
+ if @{$bus_modules};
+- print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n";
++ print SYSCONFIG join("\n", @{$hwmon_modules}), "\n";
+ close(SYSCONFIG);
+
+ if (-x "/bin/systemctl" && -d "/lib/systemd/system" &&