diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-09-13 17:56:30 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-09-13 17:56:30 +0100 |
commit | 948d557b4a61dc14722668b6b11a4cf3cee07b01 (patch) | |
tree | b28b6cb077ae6b2457e30d49028fc978d8e2b59b /sys-apps/lm_sensors/files | |
parent | e3cf2c86fca1750343c1885311f857f185ee4f2d (diff) |
gentoo resync : 13.09.2019
Diffstat (limited to 'sys-apps/lm_sensors/files')
-rw-r--r-- | sys-apps/lm_sensors/files/fancontrol.confd | 16 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/fancontrol.initd | 21 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/fancontrol.service-r1 | 9 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/lm_sensors-3.4.0-sensors-detect-gentoo.patch | 342 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/lm_sensors-3.5.0-sensors-detect-gentoo.patch | 347 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/lm_sensors.confd | 4 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/lm_sensors.initd | 21 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/sensord.confd | 19 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/sensord.initd | 19 | ||||
-rw-r--r-- | sys-apps/lm_sensors/files/sensord.service-r1 | 9 |
10 files changed, 0 insertions, 807 deletions
diff --git a/sys-apps/lm_sensors/files/fancontrol.confd b/sys-apps/lm_sensors/files/fancontrol.confd deleted file mode 100644 index a7169583173e..000000000000 --- a/sys-apps/lm_sensors/files/fancontrol.confd +++ /dev/null @@ -1,16 +0,0 @@ -# /etc/conf.d/fancontrol - -# Configuration file -#FANCONTROL_CONFIGFILE="/etc/fancontrol" - -# You can use this configuration option to pass additional options to the -# start-stop-daemon, see start-stop-daemon(8) for more details. -# Per default we forces fancontrol into background and wait 1000ms after we -# have started the service to ensure that the daemon is really up and -# running. -#FANCONTROL_SSDARGS="--background --wait 1000" - -# The termination timeout (start-stop-daemon parameter "retry") ensures -# that the service will be terminated within a given time (60 + 5 seconds -# per default) when you are stopping the service. -#FANCONTROL_TERMTIMEOUT="TERM/60/KILL/5" diff --git a/sys-apps/lm_sensors/files/fancontrol.initd b/sys-apps/lm_sensors/files/fancontrol.initd deleted file mode 100644 index 0734668a4c0a..000000000000 --- a/sys-apps/lm_sensors/files/fancontrol.initd +++ /dev/null @@ -1,21 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -FANCONTROL_CONFIGFILE=${FANCONTROL_CONFIGFILE:-"/etc/fancontrol"} -FANCONTROL_SSDARGS=${FANCONTROL_SSDARGS:-"--background --wait 1000"} -FANCONTROL_TERMTIMEOUT=${FANCONTROL_TERMTIMEOUT:-"TERM/60/KILL/5"} - - -command="/usr/sbin/fancontrol" -command_args="${FANCONTROL_CONFIGFILE}" -start_stop_daemon_args="${FANCONTROL_SSDARGS}" -pidfile="/run/fancontrol.pid" -retry="${FANCONTROL_TERMTIMEOUT}" - -required_files="${FANCONTROL_CONFIGFILE}" - -depend() { - need localmount - use lm_sensors -} diff --git a/sys-apps/lm_sensors/files/fancontrol.service-r1 b/sys-apps/lm_sensors/files/fancontrol.service-r1 deleted file mode 100644 index 7d4342c30171..000000000000 --- a/sys-apps/lm_sensors/files/fancontrol.service-r1 +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Fan control daemon - -[Service] -PIDFile=/run/fancontrol.pid -ExecStart=/usr/sbin/fancontrol - -[Install] -WantedBy=multi-user.target diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.4.0-sensors-detect-gentoo.patch b/sys-apps/lm_sensors/files/lm_sensors-3.4.0-sensors-detect-gentoo.patch deleted file mode 100644 index dd77d66c0855..000000000000 --- a/sys-apps/lm_sensors/files/lm_sensors-3.4.0-sensors-detect-gentoo.patch +++ /dev/null @@ -1,342 +0,0 @@ -From d8603c540cfccda5e011060083108de8f1b820ab Mon Sep 17 00:00:00 2001 -From: Thomas Deutschmann <whissi@gentoo.org> -Date: Tue, 9 Aug 2016 01:19:16 +0200 -Subject: [PATCH 1/3] sensors-detect: Add sd_boot detection - -We need to know in write_config function wether the system is using systemd -or not. ---- - prog/detect/sensors-detect | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect -index 057cd96..e29ab4c 100755 ---- a/prog/detect/sensors-detect -+++ b/prog/detect/sensors-detect -@@ -2746,7 +2746,7 @@ sub isa_read_i5d6 - # AUTODETECTION # - ################# - --use vars qw($dev_i2c $sysfs_root $systemd_systemctl $systemd_system_dir); -+use vars qw($dev_i2c $sysfs_root $systemd_is_booted $systemd_systemctl $systemd_system_dir); - - sub initialize_conf - { -@@ -2820,6 +2820,10 @@ sub initialize_conf - } elsif (-d "/lib/systemd/system") { - $systemd_system_dir = "/lib/systemd/system"; - } -+ -+ # Check whether the system was booted using systemd. -+ # See: man sd_booted -+ $systemd_is_booted = -d '/run/systemd/system'; - } - - # [0] -> VERSION --- -2.9.3 - - -From 14376e837c4a666fe2088bc7b7fbb90a4520f387 Mon Sep 17 00:00:00 2001 -From: Thomas Deutschmann <whissi@gentoo.org> -Date: Tue, 9 Aug 2016 01:25:52 +0200 -Subject: [PATCH 2/3] sensors-detect: write_config function adjusted for Gentoo - environment - -Bug: https://bugs.gentoo.org/480018 ---- - prog/detect/sensors-detect | 133 +++++++++++++++++++++------------------------ - 1 file changed, 62 insertions(+), 71 deletions(-) - -diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect -index e29ab4c..bb5ae0f 100755 ---- a/prog/detect/sensors-detect -+++ b/prog/detect/sensors-detect -@@ -7079,6 +7079,9 @@ sub write_config - { - my ($configfile, $bus_modules, $hwmon_modules) = @_; - -+ my $have_conffiles_created = 0; -+ -+ # /etc/modprobe.d handling - if (defined $configfile) { - my $have_modprobe_d = -d '/etc/modprobe.d'; - printf "Do you want to \%s /etc/modprobe.d/lm_sensors.conf? (\%s): ", -@@ -7087,96 +7090,84 @@ sub write_config - $_ = read_answer(); - if (($have_modprobe_d and not m/^\s*n/i) or m/^\s*y/i) { - unless ($have_modprobe_d) { -- mkdir('/etc/modprobe.d', 0777) -+ mkdir('/etc/modprobe.d', 0755) - or die "Sorry, can't create /etc/modprobe.d ($!)"; - } -- open(local *MODPROBE_D, ">/etc/modprobe.d/lm_sensors.conf") -+ open(local *MODPROBE_D, ">", $have_modprobe_d . '/lm_sensors.conf') - or die "Sorry, can't create /etc/modprobe.d/lm_sensors.conf ($!)"; - print MODPROBE_D "# Generated by sensors-detect on " . scalar localtime() . "\n"; - print MODPROBE_D $configfile; - close(MODPROBE_D); -+ $have_conffiles_created++; - } else { - print "To make the sensors modules behave correctly, add these lines to\n". -- "/etc/modprobe.conf:\n\n"; -+ "/etc/modprobe.d/lm_sensors.conf:\n\n"; - print "#----cut here----\n". - $configfile. - "#----cut here----\n\n"; - } - } - -- 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'); -- $_ = 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 ($!)"; -- 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" -- if @{$bus_modules}; -- print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n"; -- close(SYSCONFIG); -- -- if ($systemd_systemctl && $systemd_system_dir) { -- if (-f "$systemd_system_dir/lm_sensors.service") { -- system($systemd_systemctl, "enable", "lm_sensors.service"); -- system($systemd_systemctl, "start", "lm_sensors.service"); -- # All done, don't check for /etc/init.d/lm_sensors -- } else { -- print "Copy prog/init/lm_sensors.service to $systemd_system_dir\n". -- "and run 'systemctl enable lm_sensors.service'\n". -- "for initialization at boot time.\n"; -- } -- return; -+ # /etc/modules-load.d handling -+ my $modulesload_filedir = '/etc/modules-load.d'; -+ my $modulesload_file = $modulesload_filedir . '/lm_sensors.conf'; -+ my $modulesload_cfg = "# Generated by sensors-detect on " . scalar localtime() . "\n" -+ . join("\n", (@{$bus_modules}, @{$hwmon_modules})) . "\n"; -+ -+ my $have_modulesload_file = -f $modulesload_file; -+ printf "Do you want to \%s '$modulesload_file'? (\%s): ", -+ ($have_modulesload_file ? 'overwrite' : 'generate'), -+ ($have_modulesload_file ? 'yes/NO' : 'YES/no'); -+ -+ my $input = read_answer(); -+ chomp($input); -+ if ($input eq '' && $have_modulesload_file) { -+ $input = 'no'; -+ } -+ elsif ($input eq '' && !$have_modulesload_file) { -+ $input = 'yes'; -+ } -+ -+ if ($input =~ m/^\s*y/i) { -+ unless (-d $modulesload_filedir) { -+ mkdir($modulesload_filedir, 0755) -+ or die "Sorry, can't create '$modulesload_filedir' ($!)"; - } - -- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n". -- "for initialization at boot time.\n" -- unless -f "/etc/init.d/lm_sensors"; -+ open(my $fh, '>', $modulesload_file) -+ or die "Sorry, can't open '$modulesload_file' for writing! ($!)"; - -- if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") { -- system("/sbin/insserv", "/etc/init.d/lm_sensors"); -- } elsif (-x "/sbin/chkconfig" && -f "/etc/init.d/lm_sensors") { -- system("/sbin/chkconfig", "lm_sensors", "on"); -- if (-x "/sbin/service") { -- system("/sbin/service", "lm_sensors", "start"); -- } -+ print $fh $modulesload_cfg; -+ close($fh); -+ -+ $have_conffiles_created++; -+ } -+ else { -+ print "\nPlease create '$modulesload_file' with the following content\n" -+ . "to allow modules-load service to autoload modules on boot:\n\n"; -+ print "#----cut here----\n" -+ . "# Generated by sensors-detect on " . scalar localtime() . "\n" -+ . join("\n", (@{$bus_modules}, @{$hwmon_modules})) . "\n" -+ . "#----cut here----\n\n"; -+ } -+ -+ if ($have_conffiles_created) { -+ printf "\nNote: You only have created the required configuration to autoload the\n" -+ . "required modules to use your sensors on boot. If you want to start using\n" -+ . "your sensors right now you have to either load them now once manually, to\n" -+ . "reboot this system or to execute the following command(s):\n\n"; -+ -+ if ($systemd_is_booted) { -+ print " # systemctl restart systemd-modules-load\n\n" - } else { -- print "You should now start the lm_sensors service to load the required\n". -- "kernel modules.\n\n"; -- } -- } else { -- print "To load everything that is needed, add this to one of the system\n". -- "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n"; -- print "#----cut here----\n"; -- if (@{$bus_modules}) { -- print "# Adapter drivers\n"; -- print "modprobe $_\n" foreach (@{$bus_modules}); -+ print " # /etc/init.d/modules-load restart\n\n" - } -- print "# Chip drivers\n"; -- print "modprobe $_\n" foreach (@{$hwmon_modules}); -- print((-e '/usr/bin/sensors' ? -- "/usr/bin/sensors -s\n" : -- "/usr/local/bin/sensors -s\n"). -- "#----cut here----\n\n"); -- -- print "You really should try these commands right now to make sure everything\n". -- "is working properly. Monitoring programs won't work until the needed\n". -- "modules are loaded.\n\n"; -+ } -+ else { -+ print "\nNote: Please make sure the following modules are loaded when you\n" -+ . "want to make use of your sensors:\n\n"; -+ -+ print " " . join(" ", (@{$bus_modules}, @{$hwmon_modules})) . "\n\n"; - } - } - --- -2.9.3 - - -From 59680d1fd41402efb547ca75ad8397089df2e059 Mon Sep 17 00:00:00 2001 -From: Thomas Deutschmann <whissi@gentoo.org> -Date: Mon, 29 Aug 2016 12:47:50 +0200 -Subject: [PATCH 3/3] sensors-detect: Add Gentoo config file protection - -Per default we don't modify live config file. Instead we create -"._cfg0000_<filename>" files known from emerge when using CONFIG PROTECT. - -See CONFIGURATION FILES section of emerge(1) man page for details. - -Can be disabled using the "--no-gentoo-config-protect" parameter. ---- - prog/detect/sensors-detect | 51 +++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 48 insertions(+), 3 deletions(-) - -diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect -index bb5ae0f..2cc8f88 100755 ---- a/prog/detect/sensors-detect -+++ b/prog/detect/sensors-detect -@@ -7093,7 +7093,7 @@ sub write_config - mkdir('/etc/modprobe.d', 0755) - or die "Sorry, can't create /etc/modprobe.d ($!)"; - } -- open(local *MODPROBE_D, ">", $have_modprobe_d . '/lm_sensors.conf') -+ open(local *MODPROBE_D, ">", gentoo_get_protected_file($have_modprobe_d . '/lm_sensors.conf')) - or die "Sorry, can't create /etc/modprobe.d/lm_sensors.conf ($!)"; - print MODPROBE_D "# Generated by sensors-detect on " . scalar localtime() . "\n"; - print MODPROBE_D $configfile; -@@ -7134,7 +7134,7 @@ sub write_config - or die "Sorry, can't create '$modulesload_filedir' ($!)"; - } - -- open(my $fh, '>', $modulesload_file) -+ open(my $fh, '>', gentoo_get_protected_file($modulesload_file)) - or die "Sorry, can't open '$modulesload_file' for writing! ($!)"; - - print $fh $modulesload_cfg; -@@ -7152,10 +7152,17 @@ sub write_config - } - - if ($have_conffiles_created) { -+ if (!$opt{no_gentoo_config_protect}) { -+ print "\n * IMPORTANT: At least $have_conffiles_created config file(s) in '/etc' need updating.\n" -+ . " * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS\n" -+ . " * sections of the emerge man page to learn how to update config files.\n"; -+ } -+ - printf "\nNote: You only have created the required configuration to autoload the\n" - . "required modules to use your sensors on boot. If you want to start using\n" - . "your sensors right now you have to either load them now once manually, to\n" -- . "reboot this system or to execute the following command(s):\n\n"; -+ . "reboot this system or to execute the following command(s)\%s:\n\n", -+ ($opt{no_gentoo_config_protect} ? "" : " _AFTER_\nyou have updated your config files"); - - if ($systemd_is_booted) { - print " # systemctl restart systemd-modules-load\n\n" -@@ -7171,6 +7178,32 @@ sub write_config - } - } - -+sub gentoo_get_protected_file -+{ -+ my ($file) = @_; -+ -+ if ($opt{no_gentoo_config_protect}) { -+ return $file; -+ } -+ -+ my $basename = basename($file); -+ my $dirname = dirname($file); -+ -+ my $protected_file; -+ for (my $prot_num = 0; $prot_num <= 9999; $prot_num++) { -+ $protected_file = sprintf('%s/._cfg%s_%s', -+ $dirname, -+ sprintf("%0*d", 4, $prot_num), -+ $basename); -+ -+ if (! -f $protected_file) { -+ return $protected_file; -+ } -+ } -+ -+ die "Running out of files -- cannot create protected file '$file'" -+} -+ - sub main - { - my ($input, $superio_features); -@@ -7181,6 +7214,8 @@ sub main - $opt{stat} = 1; - } elsif ($ARGV[0] eq "--auto") { - $opt{auto} = 1; -+ } elsif ($ARGV[0] eq "--no-gentoo-config-protect") { -+ $opt{no_gentoo_config_protect} = 1; - } else { - print STDERR "Error: unknown option $ARGV[0]\n"; - exit 1; -@@ -7234,6 +7269,16 @@ sub main - "unless you know what you're doing.\n\n"; - } - -+ if (!$opt{no_gentoo_config_protect}) { -+ print "Gentoo config file protection is active. Every file this program will\n", -+ "modify must be merged before the change will become active using\n", -+ "default Gentoo tools such as dispatch-conf, cfg-update, and etc-update.\n\n"; -+ } -+ else { -+ print "Gentoo config file protection is _disabled_. This program will modify\n", -+ "your active configuration without backups.\n\n"; -+ } -+ - print "Some south bridges, CPUs or memory controllers contain embedded sensors.\n". - "Do you want to scan for them? This is totally safe. (YES/no): "; - $input = read_answer(); --- -2.9.3 - diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.5.0-sensors-detect-gentoo.patch b/sys-apps/lm_sensors/files/lm_sensors-3.5.0-sensors-detect-gentoo.patch deleted file mode 100644 index 3fcd19c05c4f..000000000000 --- a/sys-apps/lm_sensors/files/lm_sensors-3.5.0-sensors-detect-gentoo.patch +++ /dev/null @@ -1,347 +0,0 @@ -From eed538e59a63eaacae67d7bfdd95a19e18dad1a5 Mon Sep 17 00:00:00 2001 -From: Thomas Deutschmann <whissi@gentoo.org> -Date: Tue, 9 Aug 2016 01:19:16 +0200 -Subject: [PATCH 1/3] sensors-detect: Add sd_boot detection - -We need to know in write_config function wether the system is using systemd -or not. - -Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> ---- - prog/detect/sensors-detect | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect -index 5c771485..ea1c0d53 100755 ---- a/prog/detect/sensors-detect -+++ b/prog/detect/sensors-detect -@@ -2976,7 +2976,7 @@ sub isa_read_i5d6 - # AUTODETECTION # - ################# - --use vars qw($dev_i2c $sysfs_root $systemd_systemctl $systemd_system_dir); -+use vars qw($dev_i2c $sysfs_root $systemd_is_booted $systemd_systemctl $systemd_system_dir); - - sub initialize_conf - { -@@ -3050,6 +3050,10 @@ sub initialize_conf - } elsif (-d "/lib/systemd/system") { - $systemd_system_dir = "/lib/systemd/system"; - } -+ -+ # Check whether the system was booted using systemd. -+ # See: man sd_booted -+ $systemd_is_booted = -d '/run/systemd/system'; - } - - # [0] -> VERSION --- -2.21.0 - - -From bad0d73c98c9167ec4ade01c6b75159643d237f1 Mon Sep 17 00:00:00 2001 -From: Thomas Deutschmann <whissi@gentoo.org> -Date: Tue, 9 Aug 2016 01:25:52 +0200 -Subject: [PATCH 2/3] sensors-detect: write_config function adjusted for Gentoo - environment - -Bug: https://bugs.gentoo.org/480018 -Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> ---- - prog/detect/sensors-detect | 133 +++++++++++++++++-------------------- - 1 file changed, 62 insertions(+), 71 deletions(-) - -diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect -index ea1c0d53..1e8ac00d 100755 ---- a/prog/detect/sensors-detect -+++ b/prog/detect/sensors-detect -@@ -7338,6 +7338,9 @@ sub write_config - { - my ($configfile, $bus_modules, $hwmon_modules) = @_; - -+ my $have_conffiles_created = 0; -+ -+ # /etc/modprobe.d handling - if (defined $configfile) { - my $have_modprobe_d = -d '/etc/modprobe.d'; - printf "Do you want to \%s /etc/modprobe.d/lm_sensors.conf? (\%s): ", -@@ -7346,96 +7349,84 @@ sub write_config - $_ = read_answer(); - if (($have_modprobe_d and not m/^\s*n/i) or m/^\s*y/i) { - unless ($have_modprobe_d) { -- mkdir('/etc/modprobe.d', 0777) -+ mkdir('/etc/modprobe.d', 0755) - or die "Sorry, can't create /etc/modprobe.d ($!)"; - } -- open(local *MODPROBE_D, ">/etc/modprobe.d/lm_sensors.conf") -+ open(local *MODPROBE_D, ">", $have_modprobe_d . '/lm_sensors.conf') - or die "Sorry, can't create /etc/modprobe.d/lm_sensors.conf ($!)"; - print MODPROBE_D "# Generated by sensors-detect on " . scalar localtime() . "\n"; - print MODPROBE_D $configfile; - close(MODPROBE_D); -+ $have_conffiles_created++; - } else { - print "To make the sensors modules behave correctly, add these lines to\n". -- "/etc/modprobe.conf:\n\n"; -+ "/etc/modprobe.d/lm_sensors.conf:\n\n"; - print "#----cut here----\n". - $configfile. - "#----cut here----\n\n"; - } - } - -- 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'); -- $_ = 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 ($!)"; -- 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" -- if @{$bus_modules}; -- print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n"; -- close(SYSCONFIG); -- -- if ($systemd_systemctl && $systemd_system_dir) { -- if (-f "$systemd_system_dir/lm_sensors.service") { -- system($systemd_systemctl, "enable", "lm_sensors.service"); -- system($systemd_systemctl, "start", "lm_sensors.service"); -- # All done, don't check for /etc/init.d/lm_sensors -- } else { -- print "Copy prog/init/lm_sensors.service to $systemd_system_dir\n". -- "and run 'systemctl enable lm_sensors.service'\n". -- "for initialization at boot time.\n"; -- } -- return; -+ # /etc/modules-load.d handling -+ my $modulesload_filedir = '/etc/modules-load.d'; -+ my $modulesload_file = $modulesload_filedir . '/lm_sensors.conf'; -+ my $modulesload_cfg = "# Generated by sensors-detect on " . scalar localtime() . "\n" -+ . join("\n", (@{$bus_modules}, @{$hwmon_modules})) . "\n"; -+ -+ my $have_modulesload_file = -f $modulesload_file; -+ printf "Do you want to \%s '$modulesload_file'? (\%s): ", -+ ($have_modulesload_file ? 'overwrite' : 'generate'), -+ ($have_modulesload_file ? 'yes/NO' : 'YES/no'); -+ -+ my $input = read_answer(); -+ chomp($input); -+ if ($input eq '' && $have_modulesload_file) { -+ $input = 'no'; -+ } -+ elsif ($input eq '' && !$have_modulesload_file) { -+ $input = 'yes'; -+ } -+ -+ if ($input =~ m/^\s*y/i) { -+ unless (-d $modulesload_filedir) { -+ mkdir($modulesload_filedir, 0755) -+ or die "Sorry, can't create '$modulesload_filedir' ($!)"; - } - -- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n". -- "for initialization at boot time.\n" -- unless -f "/etc/init.d/lm_sensors"; -+ open(my $fh, '>', $modulesload_file) -+ or die "Sorry, can't open '$modulesload_file' for writing! ($!)"; - -- if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") { -- system("/sbin/insserv", "/etc/init.d/lm_sensors"); -- } elsif (-x "/sbin/chkconfig" && -f "/etc/init.d/lm_sensors") { -- system("/sbin/chkconfig", "lm_sensors", "on"); -- if (-x "/sbin/service") { -- system("/sbin/service", "lm_sensors", "start"); -- } -+ print $fh $modulesload_cfg; -+ close($fh); -+ -+ $have_conffiles_created++; -+ } -+ else { -+ print "\nPlease create '$modulesload_file' with the following content\n" -+ . "to allow modules-load service to autoload modules on boot:\n\n"; -+ print "#----cut here----\n" -+ . "# Generated by sensors-detect on " . scalar localtime() . "\n" -+ . join("\n", (@{$bus_modules}, @{$hwmon_modules})) . "\n" -+ . "#----cut here----\n\n"; -+ } -+ -+ if ($have_conffiles_created) { -+ printf "\nNote: You only have created the required configuration to autoload the\n" -+ . "required modules to use your sensors on boot. If you want to start using\n" -+ . "your sensors right now you have to either load them now once manually, to\n" -+ . "reboot this system or to execute the following command(s):\n\n"; -+ -+ if ($systemd_is_booted) { -+ print " # systemctl restart systemd-modules-load\n\n" - } else { -- print "You should now start the lm_sensors service to load the required\n". -- "kernel modules.\n\n"; -- } -- } else { -- print "To load everything that is needed, add this to one of the system\n". -- "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n"; -- print "#----cut here----\n"; -- if (@{$bus_modules}) { -- print "# Adapter drivers\n"; -- print "modprobe $_\n" foreach (@{$bus_modules}); -+ print " # /etc/init.d/modules restart\n\n" - } -- print "# Chip drivers\n"; -- print "modprobe $_\n" foreach (@{$hwmon_modules}); -- print((-e '/usr/bin/sensors' ? -- "/usr/bin/sensors -s\n" : -- "/usr/local/bin/sensors -s\n"). -- "#----cut here----\n\n"); -- -- print "You really should try these commands right now to make sure everything\n". -- "is working properly. Monitoring programs won't work until the needed\n". -- "modules are loaded.\n\n"; -+ } -+ else { -+ print "\nNote: Please make sure the following modules are loaded when you\n" -+ . "want to make use of your sensors:\n\n"; -+ -+ print " " . join(" ", (@{$bus_modules}, @{$hwmon_modules})) . "\n\n"; - } - } - --- -2.21.0 - - -From c1d471a8be4840a38fe82464e0756a243e158a30 Mon Sep 17 00:00:00 2001 -From: Thomas Deutschmann <whissi@gentoo.org> -Date: Mon, 29 Aug 2016 12:47:50 +0200 -Subject: [PATCH 3/3] sensors-detect: Add Gentoo config file protection - -Per default we don't modify live config file. Instead we create -"._cfg0000_<filename>" files known from emerge when using CONFIG PROTECT. - -See CONFIGURATION FILES section of emerge(1) man page for details. - -Can be disabled using the "--no-gentoo-config-protect" parameter. - -Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> ---- - prog/detect/sensors-detect | 51 +++++++++++++++++++++++++++++++++++--- - 1 file changed, 48 insertions(+), 3 deletions(-) - -diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect -index 1e8ac00d..e548bfaf 100755 ---- a/prog/detect/sensors-detect -+++ b/prog/detect/sensors-detect -@@ -7352,7 +7352,7 @@ sub write_config - mkdir('/etc/modprobe.d', 0755) - or die "Sorry, can't create /etc/modprobe.d ($!)"; - } -- open(local *MODPROBE_D, ">", $have_modprobe_d . '/lm_sensors.conf') -+ open(local *MODPROBE_D, ">", gentoo_get_protected_file($have_modprobe_d . '/lm_sensors.conf')) - or die "Sorry, can't create /etc/modprobe.d/lm_sensors.conf ($!)"; - print MODPROBE_D "# Generated by sensors-detect on " . scalar localtime() . "\n"; - print MODPROBE_D $configfile; -@@ -7393,7 +7393,7 @@ sub write_config - or die "Sorry, can't create '$modulesload_filedir' ($!)"; - } - -- open(my $fh, '>', $modulesload_file) -+ open(my $fh, '>', gentoo_get_protected_file($modulesload_file)) - or die "Sorry, can't open '$modulesload_file' for writing! ($!)"; - - print $fh $modulesload_cfg; -@@ -7411,10 +7411,17 @@ sub write_config - } - - if ($have_conffiles_created) { -+ if (!$opt{no_gentoo_config_protect}) { -+ print "\n * IMPORTANT: At least $have_conffiles_created config file(s) in '/etc' need updating.\n" -+ . " * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS\n" -+ . " * sections of the emerge man page to learn how to update config files.\n"; -+ } -+ - printf "\nNote: You only have created the required configuration to autoload the\n" - . "required modules to use your sensors on boot. If you want to start using\n" - . "your sensors right now you have to either load them now once manually, to\n" -- . "reboot this system or to execute the following command(s):\n\n"; -+ . "reboot this system or to execute the following command(s)\%s:\n\n", -+ ($opt{no_gentoo_config_protect} ? "" : " _AFTER_\nyou have updated your config files"); - - if ($systemd_is_booted) { - print " # systemctl restart systemd-modules-load\n\n" -@@ -7430,6 +7437,32 @@ sub write_config - } - } - -+sub gentoo_get_protected_file -+{ -+ my ($file) = @_; -+ -+ if ($opt{no_gentoo_config_protect}) { -+ return $file; -+ } -+ -+ my $basename = basename($file); -+ my $dirname = dirname($file); -+ -+ my $protected_file; -+ for (my $prot_num = 0; $prot_num <= 9999; $prot_num++) { -+ $protected_file = sprintf('%s/._cfg%s_%s', -+ $dirname, -+ sprintf("%0*d", 4, $prot_num), -+ $basename); -+ -+ if (! -f $protected_file) { -+ return $protected_file; -+ } -+ } -+ -+ die "Running out of files -- cannot create protected file '$file'" -+} -+ - sub main - { - my ($input, $superio_features); -@@ -7440,6 +7473,8 @@ sub main - $opt{stat} = 1; - } elsif ($ARGV[0] eq "--auto") { - $opt{auto} = 1; -+ } elsif ($ARGV[0] eq "--no-gentoo-config-protect") { -+ $opt{no_gentoo_config_protect} = 1; - } else { - print STDERR "Error: unknown option $ARGV[0]\n"; - exit 1; -@@ -7493,6 +7528,16 @@ sub main - "unless you know what you're doing.\n\n"; - } - -+ if (!$opt{no_gentoo_config_protect}) { -+ print "Gentoo config file protection is active. Every file this program will\n", -+ "modify must be merged before the change will become active using\n", -+ "default Gentoo tools such as dispatch-conf, cfg-update, and etc-update.\n\n"; -+ } -+ else { -+ print "Gentoo config file protection is _disabled_. This program will modify\n", -+ "your active configuration without backups.\n\n"; -+ } -+ - print "Some south bridges, CPUs or memory controllers contain embedded sensors.\n". - "Do you want to scan for them? This is totally safe. (YES/no): "; - $input = read_answer(); --- -2.21.0 - diff --git a/sys-apps/lm_sensors/files/lm_sensors.confd b/sys-apps/lm_sensors/files/lm_sensors.confd deleted file mode 100644 index bae2ea0bbbec..000000000000 --- a/sys-apps/lm_sensors/files/lm_sensors.confd +++ /dev/null @@ -1,4 +0,0 @@ -# /etc/conf.d/lm_sensors - -# NOTE: -# For module loading please use /etc/modules-load.d/lm_sensors.conf diff --git a/sys-apps/lm_sensors/files/lm_sensors.initd b/sys-apps/lm_sensors/files/lm_sensors.initd deleted file mode 100644 index 4efc6c964040..000000000000 --- a/sys-apps/lm_sensors/files/lm_sensors.initd +++ /dev/null @@ -1,21 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -command="/usr/bin/sensors" - -depend() { - need localmount - after modules-load -} - -start() { - ebegin "Initializing sensors" - ${command} --set >/dev/null 2>&1 - eend $? -} - -stop() { - # Nothing to stop - return 0; -} diff --git a/sys-apps/lm_sensors/files/sensord.confd b/sys-apps/lm_sensors/files/sensord.confd deleted file mode 100644 index a6f2f265c11f..000000000000 --- a/sys-apps/lm_sensors/files/sensord.confd +++ /dev/null @@ -1,19 +0,0 @@ -# /etc/conf.d/sensord - -# PID file -#SENSORD_PIDFILE="/run/sensord.pid" - -# You can use this configuration option to pass additional options to the -# start-stop-daemon, see start-stop-daemon(8) for more details. -# Per default we wait 1000ms after we have started the service to ensure -# that the daemon is really up and running. -#SENSORD_SSDARGS="--wait 1000" - -# The termination timeout (start-stop-daemon parameter "retry") ensures -# that the service will be terminated within a given time (60 + 5 seconds -# per default) when you are stopping the service. -#SENSORD_TERMTIMEOUT="TERM/60/KILL/5" - -# Extra options to pass to the sensord daemon, -# see sensord(8) for more information -#SENSORD_OPTS="" diff --git a/sys-apps/lm_sensors/files/sensord.initd b/sys-apps/lm_sensors/files/sensord.initd deleted file mode 100644 index fa958dbf4389..000000000000 --- a/sys-apps/lm_sensors/files/sensord.initd +++ /dev/null @@ -1,19 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -SENSORD_PIDFILE=${SENSORD_PIDFILE:-"/run/sensord.pid"} -SENSORD_SSDARGS=${SENSORD_SSDARGS:-"--wait 1000"} -SENSORD_TERMTIMEOUT=${SENSORD_TERMTIMEOUT:-"TERM/60/KILL/5"} -SENSORD_OPTS=${SENSORD_OPTS:-""} - -command="/usr/sbin/sensord" -command_args="${SENSORD_OPTS} --pid-file ${SENSORD_PIDFILE}" -start_stop_daemon_args="${SENSORD_SSDARGS}" -pidfile="${SENSORD_PIDFILE}" -retry="${SENSORD_TERMTIMEOUT}" - -depend() { - need localmount - use logger lm_sensors -} diff --git a/sys-apps/lm_sensors/files/sensord.service-r1 b/sys-apps/lm_sensors/files/sensord.service-r1 deleted file mode 100644 index b7a1e1bc3bd0..000000000000 --- a/sys-apps/lm_sensors/files/sensord.service-r1 +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Sensor information logging daemon - -[Service] -PIDFile=/run/sensord.pid -ExecStart=/usr/sbin/sensord - -[Install] -WantedBy=multi-user.target |