Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lm-sensors: Read system configuration files from /etc directory #117168

Merged
merged 1 commit into from Mar 31, 2021

Conversation

pmeiyu
Copy link
Member

@pmeiyu pmeiyu commented Mar 22, 2021

Motivation for this change

Let sensors read system configuration files from /etc directory.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@r-rmcgibbo
Copy link

r-rmcgibbo commented Mar 22, 2021

Result of nixpkgs-review pr 117168 at 9a7a2257 run on aarch64-linux 1

6 packages marked as broken and skipped:
  • libsForQt512.kdeplasma-addons
  • libsForQt512.ksysguard
  • libsForQt512.plasma-desktop
  • libsForQt514.kdeplasma-addons
  • libsForQt514.ksysguard
  • libsForQt514.plasma-desktop
18 packages built successfully:
  • collectd
  • collectd-data
  • libsForQt5.kdeplasma-addons (libsForQt515.kdeplasma-addons ,plasma5Packages.kdeplasma-addons)
  • libsForQt5.ksysguard (libsForQt515.ksysguard ,plasma5Packages.ksysguard)
  • libsForQt5.plasma-desktop (libsForQt515.plasma-desktop ,plasma5Packages.plasma-desktop)
  • lm_sensors
  • lxqt.lxqt-panel
  • mate.mate-sensors-applet
  • monitoring-plugins
  • netdata
  • psensor
  • python38Packages.py3status
  • python38Packages.pysensors
  • python39Packages.py3status
  • python39Packages.pysensors
  • xfce.xfce4-hardware-monitor-plugin (xfce.xfce4_hardware_monitor_plugin)
  • xfce.xfce4-sensors-plugin (xfce.xfce4_sensors_plugin)
  • xsensors
1 suggestion:
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/os-specific/linux/lm-sensors/default.nix:28:3:

       |
    28 |   meta = with lib; {
       |   ^
    

Result of nixpkgs-review pr 117168 at 9a7a2257 run on x86_64-linux 1

6 packages marked as broken and skipped:
  • libsForQt512.kdeplasma-addons
  • libsForQt512.ksysguard
  • libsForQt512.plasma-desktop
  • libsForQt514.kdeplasma-addons
  • libsForQt514.ksysguard
  • libsForQt514.plasma-desktop
19 packages built successfully:
  • check-wmiplus
  • collectd
  • collectd-data
  • libsForQt5.kdeplasma-addons (libsForQt515.kdeplasma-addons ,plasma5Packages.kdeplasma-addons)
  • libsForQt5.ksysguard (libsForQt515.ksysguard ,plasma5Packages.ksysguard)
  • libsForQt5.plasma-desktop (libsForQt515.plasma-desktop ,plasma5Packages.plasma-desktop)
  • lm_sensors
  • lxqt.lxqt-panel
  • mate.mate-sensors-applet
  • monitoring-plugins
  • netdata
  • psensor
  • python38Packages.py3status
  • python38Packages.pysensors
  • python39Packages.py3status
  • python39Packages.pysensors
  • xfce.xfce4-hardware-monitor-plugin (xfce.xfce4_hardware_monitor_plugin)
  • xfce.xfce4-sensors-plugin (xfce.xfce4_sensors_plugin)
  • xsensors
1 suggestion:
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/os-specific/linux/lm-sensors/default.nix:28:3:

       |
    28 |   meta = with lib; {
       |   ^
    

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 117168 run on x86_64-linux 1

6 packages marked as broken and skipped:
  • libsForQt512.kdeplasma-addons
  • libsForQt512.ksysguard
  • libsForQt512.plasma-desktop
  • libsForQt514.kdeplasma-addons
  • libsForQt514.ksysguard
  • libsForQt514.plasma-desktop
19 packages built:
  • check-wmiplus
  • collectd
  • collectd-data
  • libsForQt5.kdeplasma-addons (libsForQt515.kdeplasma-addons ,plasma5Packages.kdeplasma-addons)
  • libsForQt5.ksysguard (libsForQt515.ksysguard ,plasma5Packages.ksysguard)
  • libsForQt5.plasma-desktop (libsForQt515.plasma-desktop ,plasma5Packages.plasma-desktop)
  • lm_sensors
  • lxqt.lxqt-panel
  • mate.mate-sensors-applet
  • monitoring-plugins
  • netdata
  • psensor
  • python38Packages.py3status
  • python38Packages.pysensors
  • python39Packages.py3status
  • python39Packages.pysensors
  • xfce.xfce4-hardware-monitor-plugin (xfce.xfce4_hardware_monitor_plugin)
  • xfce.xfce4-sensors-plugin (xfce.xfce4_sensors_plugin)
  • xsensors

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

check-wmiplus:

warning: unclear-gpl
gpl2 is a deprecated license, check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

Near pkgs/servers/monitoring/plugins/wmiplus/default.nix:74:5:

   |
74 |     license = licenses.gpl2;
   |     ^

See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/unclear-gpl.md
warning: stale-substitute
Stale substituteInPlace detected.
substituteStream(): WARNING: pattern '/usr/bin/perl' doesn't match anything in file 'check_wmi_plus_help.pl'
See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/stale-substitute.md

@SuperSandro2000
Copy link
Member

It reads my configuration file even before from /etc/.

@aanderse aanderse requested a review from jtojnar March 22, 2021 11:30
@pmeiyu
Copy link
Member Author

pmeiyu commented Mar 23, 2021

It reads my configuration file even before from /etc/.

Really? sensors command doesn't read configuration files from /etc unless --config-file is explicitly specified.

@pmeiyu
Copy link
Member Author

pmeiyu commented Mar 30, 2021

@jtojnar The DESTDIR issue has been resolved. I have removed DESTDIR from makeFlags and moved ETCDIR into installFlags. Would you mind have another look at this PR?

@pmeiyu pmeiyu requested a review from jtojnar March 30, 2021 01:27
@SuperSandro2000
Copy link
Member

Really? sensors command doesn't read configuration files from /etc unless --config-file is explicitly specified.

/nix/store/vpk48kqrmk3im0nwkab2l4ywvwdv23c3-lm-sensors-3.6.0/bin/sensors uses the config I have locally set up.

@pmeiyu
Copy link
Member Author

pmeiyu commented Mar 31, 2021

Really? sensors command doesn't read configuration files from /etc unless --config-file is explicitly specified.

/nix/store/vpk48kqrmk3im0nwkab2l4ywvwdv23c3-lm-sensors-3.6.0/bin/sensors uses the config I have locally set up.

@SuperSandro2000
I have tried sensors many times. None of /etc/sensors3.conf, /etc/sensors.conf, /etc/sensors.d/ applys to /nix/store/vpk48kqrmk3im0nwkab2l4ywvwdv23c3-lm-sensors-3.6.0/bin/sensors. That's why I made this PR. Now I have tried one more time. It still does not work.

Can you show me your /etc/sensors.conf?

Here is my /etc/sensors.conf, the chip nct6792-* is unique on my motherboard so it very likely does not apply to your computer.


chip "nct6792-*"

   # beeping appears to not work
   set beep_enable 1

   # voltages

   label   in0     "Vcore"
   compute in0     @*2, @/2
   set     in0_min 0.16
   set     in0_max 1.46
   set     in0_beep 1

   label   in2     "AVCC"
   set     in2_min 3.30 * 0.90
   set     in2_max 3.30 * 1.10

   label   in3     "+3.3V"
   set     in3_min 3.30 * 0.90
   set     in3_max 3.30 * 1.10

   label   in7     "3VSB"
   set     in7_min 3.30 * 0.90
   set     in7_max 3.30 * 1.10

   label   in8 "VBAT"
   set     in8_min 3.00 * 0.90
   set     in8_max 3.30 * 1.10

   label   in9 "+12V"
   compute in9 @*(53/8), @/(53/8)
   set     in9_min 12 * 0.90
   set     in9_max 12 * 1.10

   label   in13     "+5V"
   compute in13 @*(24/8), @/(24/8)
   set     in13_min 5 * 0.90
   set     in13_max 5 * 1.10

   # these are all zero
   ignore  in1
   ignore  in4
   ignore  in5
   ignore  in14

   # these have non-zero input, but are unknown
   ignore  in6
   ignore  in10
   ignore  in11
   ignore  in12

   # temperatures
   # not sure about temp2 and temp3 
   label   temp2 "VRM(?) temp"
   set temp2_max      55
   set temp2_max_hyst 50
   set temp2_beep 1
   label   temp3 "MB(?) temp"
   set temp3_max      55
   set temp3_max_hyst 50
   set temp3_beep 1
   label   temp7 "CPU temp"

   # temp2 has similar readings to temp3
   # other temps are zero or unreasonably high/low
   ignore  temp1
   ignore  temp4
   ignore  temp5
   ignore  temp6
   ignore  temp8
   ignore  temp9
   ignore  temp10

   # fans

   label fan1 "CHA_FAN1"
   set fan1_min 300
   set fan1_beep 1
   label fan2 "CPU_FAN1"
   set fan2_min 600
   set fan2_beep 1
   label fan3 "CHA_FAN2"
   set fan3_min 300
   set fan3_beep 1

   # these are not on the mainboard
   ignore  fan4
   ignore  fan5

   # misc

   ignore intrusion0
   ignore intrusion1

@SuperSandro2000
Copy link
Member

Apparently my board is so generic that it just uses its default and config or no config does not make any difference with the debian version or the nix version.

@SuperSandro2000 SuperSandro2000 merged commit 5f914dc into NixOS:master Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants