请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

nbfc-linux/nbfc-linux: NoteBook FanControl ported to Linux

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

nbfc-linux/nbfc-linux

开源软件地址(OpenSource Url):

https://github.com/nbfc-linux/nbfc-linux

开源编程语言(OpenSource Language):

C 76.4%

开源软件介绍(OpenSource Introduction):

NoteBook FanControl

This is a C port of Stefan Hirschmann's NoteBook FanControl.

It provides the same utilities with the same interfaces as the original NBFC, although the implementation differs.

Comparison of NBFC C# and NBFC Linux

What NBFC Mono NBFC Linux
Portability Crossplatform Linux
Configuration files XML (956KB) JSON (840KB)
Runtime Mono Native
Memory consumption (ps_mem) ~50MB ~350KB
Package size (pkg.tar.gz) 448K 100K
Service control rights Any user Only root
IPC Concept TCP/IP Files
IPC Protocol Binary JSON

The service and the probing tool are written in C. The client is written in Python. Another client has also been written in C.

Installation

  • Arch Linux:

    • Either via AUR (yaourt -S nbfc-linux)
    • Or by using the PKGBUILD nbfc-linux-git
  • With Nix:

    • With legacy nix (nix-env -if .)
    • With nix flakes (nix profile install)
  • In general:

    • make && sudo make install

Getting started

When running NBFC for the first time, you need to give it a configuration file for your laptop model.

If you are lucky, sudo nbfc config --set auto will find a matching one and set it.

sudo nbfc config --recommend (requires dmidecode) will give a list of configuration files that may match your laptop.

With sudo nbfc config --set <MODEL> a configuration is selected.

sudo nbfc start will start the service.

It can be queried by sudo nbfc status -a.

If you wish nbfc_service to get started on boot, use sudo systemctl enable nbfc_service.

Differences in detail

Files NBFC Mono NBFC Linux
Systemd service file nbfc.service nbfc_service.service
EC Probing tool ec-probe ec_probe
Notebook configuration files /opt/nbfc/Configs/*.xml /usr/share/nbfc/configs/*.json
Service binary /opt/nbfc/nbfcservice.sh /bin/nbfc_service
PID File /run/nbfc.pid /run/nbfc_service.pid
State file - /run/nbfc_service.state.json
Config file ? /etc/nbfc/nbfc.json
  • The original NBFC service is queried and controlled by the client using TCP/IP. - NBFC Linux does not implement any "real" IPC. Information about the service can be queried by reading its state file. The client controls the service by simply rewriting its configuration file and reloading it.

  • The original NBFC service adjusts the fan speeds in intervals of EcPollIntervall according to TemperatureThresholds. - NBFC Linux directly sets the fan speed (also according to TemperatureThresholds).

  • The original NBFC service selects a TemperatureThreshold and applies its FanSpeed when the temperature exceeds its UpThreshold. In contrast, NBFC Linux will select the next TemperatureThreshold and apply its FanSpeed when the temperature exceeds the current UpThreshold. The provided config files have been reconfigured to account for this change, so that they provide the same behaviour as the original NBFC service. If you have a custom config file that works well with the original service, you can port it to NBFC Linux using the provided tool (requires python3-lxml).

  • NBFC Linux dropped the Autostart option, since it relies on the systemd service file only.

Troubleshooting

The preferred way of running nbfc is using the ECSysLinux implementation, which depends on the ec_sys kernel module. There is also an alternative implementation which uses /dev/port, called ec_linux. It can be specified on the commandline using --embedded-controller=ec_linux and permanently set in /etc/nbfc/nbfc.json with "EmbeddedControllerType": "ec_linux".

Many Linux distributions do not provide the ec_sys module, and the module should be compiled manually. Alternatively, the acpi_ec module can be used. The acpi_ec module comes with a DKMS config script, which automatically rebuilds the acpi_ec module when a new kernel is installed and supports running NBFC with Secure Boot and Lockdown Kernel. To compile with the acpi_ec module, use the command:

make EMBEDDED_CONTROLLER=acpi_ec

Shell autocompletion

NBFC-Linux comes with shell completion scripts for bash, fish and zsh.

~ $ nbfc_service <TAB>
--config-file          -c  -- Use alternative config file (default /etc/nbfc/nbfc.json)
--debug                -d  -- Enable tracing of reads and writes of the embedded controller
--embedded-controller  -e  -- Specify embedded controller to use
--fork                 -f  -- Switch process to background after sucessfully started
--help                 -h  -- show this help message and exit
--readonly             -r  -- Start in read-only mode
--state-file           -s  -- Write state to an alternative file (default /var/run/nbfc_service.state.json)

~ $ nbfc <TAB>
config   -- List or apply configs
help     -- Show help
restart  -- Restart the service
set      -- Control fan speed
start    -- Start the service
status   -- Show the service status
stop     -- Stop the service

See also the documentation about the nbfc configuration.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

热门推荐
阅读排行榜
  • ** REJECT ** DO NOT USE THIS CANDIDATE NUMBER. ConsultIDs: none. Reason: This ca

    阅读:450|2022-09-23
  • Simple Task Scheduling System v1.0 was discovered to contain a SQL injection vul

    阅读:302|2022-09-18
  • Simple Task Scheduling System v1.0 was discovered to contain a SQL injection vul

    阅读:318|2022-09-18
  • Novel-Plus v3.6.2 was discovered to contain a hard-coded JWT key located in the

    阅读:316|2022-09-18
  • Novel-Plus v3.6.2 was discovered to contain an arbitrary file download vulnerabi

    阅读:316|2022-09-18
  • Simple Task Scheduling System v1.0 was discovered to contain a SQL injection vul

    阅读:241|2022-09-18
  • An issue was discovered in the Arm Mali GPU Kernel Driver. A non-privileged user

    阅读:355|2022-09-18
  • HashiCorp Boundary up to 0.10.1 did not properly perform data integrity checks t

    阅读:259|2022-09-18
  • In D-Link DIR-816 A2_v1.10CNB04.img a command injection vulnerability occurs in

    阅读:308|2022-09-18
  • D-Link DIR-816 A2_v1.10CNB04.img is vulnerable to Command Injection via /goform/

    阅读:268|2022-09-18

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap