How to install NBFC on GNU Linux - satorym/nbfc GitHub Wiki

1. Download source code

Debian-based (Ubuntu):

sudo apt install git
git clone --depth 1 https://github.com/hirschmann/nbfc.git ~/Downloads/nbfc

Fedora:

sudo dnf install git
git clone --depth 1 https://github.com/hirschmann/nbfc.git ~/Downloads/nbfc

--depth 1 - a shallow clone with a history truncated to the specified number of commits

2. Install mono

Install mono-complete package: https://www.mono-project.com/download/stable/

For Arch-based distros(for example Manjaro):

sudo pacman -S mono

3. Build code

Expected result: "Build succeeded", no errors, some warnings occured due to missing stuff that are needed for build on Windows.

3.1

~/Downloads/nbfc/build.sh

3.2 With docker

Install docker: https://docs.docker.com/engine/install/

docker run -it -v ~/Downloads/nbfc:/nbfc mono:latest bash
/nbfc/build.sh
exit

4. Copy built files to /opt/nbfc/

sudo mkdir /opt/nbfc/
sudo cp -r ~/Downloads/nbfc/Linux/bin/Release /opt/nbfc/

5. Copy NBFC services to /etc/systemd/system/

sudo cp ~/Downloads/nbfc/Linux/{nbfc.service,nbfc-sleep.service} /etc/systemd/system/

6. Enable a service to be started on bootup and also start immediately

sudo systemctl enable nbfc --now

7. Apply a config

Config files location: /opt/nbfc/Configs

cd /opt/nbfc
mono nbfc.exe config --recommend # (Optional) List configs which may work for your device
mono nbfc.exe config --list      # (Optional) List all available configs
mono nbfc.exe config --apply 'name of a config file without extension'

8. (Optional) Check status

mono /opt/nbfc/nbfc.exe status

9. (Optional) Make alias

printf "alias nbfc=\'mono /opt/nbfc/nbfc.exe\'\n" | tee -a ~/.bashrc
source ~/.bashrc

Now you can check status in this way

nbfc status

Notes

  • The NBFC service will start automatically. You can use the NBFC CLI (nbfc.exe) to control it.
  • If you want to completely disable the service, this article will be a good read: systemd: Using units.

For Secure Boot users

NBFC normally uses /dev/port, which is not available with Secure Boot enabled. The current solutions to workaround this are:

  • Disabling Secure Boot.
    You can do this at boot, by switching a parameter in the BIOS, depending on your computer.

  • Enabling ec_sys. You can enable a kernel module which NBFC can use, by running these commands:

sudo sh -c "echo ec_sys >> /etc/modules-load.d/ec_sys.conf"
sudo sh -c "echo 'options ec_sys write_support=1' >> /etc/modprobe.d/ec_sys-write-support.conf"
sudo systemctl restart systemd-modules-load.service