Open n-hass opened 9 months ago
Hi, I have the same problem, and your workaround works for me. However, I found that when adopting your workaround, the ModemManager does start but doesn't load the fccUnlockScript correctly.
I have configured the "networking.networkmanager.fccUnlockScripts" setting accordingly. When I stop the service and manually run ModemManager
after login into the system, I can see the fccUnlock is performed correctly.
(Perhaps there is something wrong with the service config?)
My current config in /etc/nixos/configuration.nix
:
# Enable networking
networking.networkmanager.enable = true;
networking.networkmanager.fccUnlockScripts = [
{
id = "105b:e0ab";
path = "${pkgs.modemmanager}/share/ModemManager/fcc-unlock.available.d/105b:e0ab";
}
];
systemd.services.ModemManager = {
enable = lib.mkForce true;
wantedBy = [ "multi-user.target" "network.target" ];
};
[root@nixos:/etc/nixos]# nix-shell -p nix-info --run "nix-info -m"
- system: "x86_64-linux"
- host os: Linux 6.1.69, NixOS, 23.11 (Tapir), 23.11.20231225.d02d818
- multi-user?: yes
- sandbox: yes
- version: nix-env (Nix) 2.18.1
- channels(root): "home-manager, nixos-23.11"
- nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
I found that in my case, the ModemManager
fails to execute the fcc-unlock-script because the unlock script of 105b:e0ab
device uses qmi interfaces and require PATH of libqmi to be added to the service.
The following service config works in my setup:
systemd.services.ModemManager = {
enable = lib.mkForce true;
path = [ pkgs.libqmi ]; # required by fcc-unlock-script of 105b:e0ab
wantedBy = [ "multi-user.target" "network.target" ];
};
I have a similar issue with the unlock script not being run. If I run ModemManager manually it works. I tried the above work around to set the path, but it does not help.
My unlock script, which I found somewhere, has the following at the top:
#!/run/current-system/sw/bin/bash
# SPDX-License-Identifier: CC0-1.0
# 2023 Thilo-Alexander Ginkel <thilo@ginkel.com>
#
# Lenovo-shipped Fibocom FM350-GL (14c3:4d75) FCC unlock
if [[ "$FCC_UNLOCK_DEBUG_LOG" == '1' ]]; then
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>>/var/log/mm-fm350-fcc.log 2>&1
fi
To debug this I had to enable logging, which meant setting FCC_UNLOCK_DEBUG_LOG
.
I am not sure the proper way to set this, so I just modified the script with:
FCC_UNLOCK_DEBUG_LOG=1
Think I worked out it, my unlock script required some more paths:
path = [pkgs.libqmi pkgs.gawk pkgs.xxd];
Suspect mine doesn't require libqmi actually, but can't hurt.
Describe the bug
Given the following configuration, ModemManager.service fails to start on boot.
However, a potential workaround exists by specifying ModemManager as being wantedBy
network.target
, as well as its defaultmulti-user.target
:Steps To Reproduce
Steps to reproduce the behavior:
systemd.services.ModemManager.enable = true
orlib.mkForce true
Expected behavior
ModemManager.service should start automatically if its specified as a system package.
Notify maintainers
(Had to look through git log, sorry if you are not an active maintainers)
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Priorities
Add a :+1: reaction to issues you find important.