facetimehd: Only unload module if it is loaded
The pre-sleep service exits if any command fails. Unloading facetimehd without it being loaded blocks subsequent commands from running. Note: `modprobe -r` works a bit better when unloading unused modules, and is preferrable to `rmmod`. However, the facetimehd module does not support suspending. In this case, it seems preferable to forcefully unload the module. `modprobe` does not support a `--force` flag when removing, so we are left with `rmmod`. See: - https://github.com/NixOS/nixpkgs/pull/14883 - https://github.com/patjak/bcwc_pcie/wiki#known-issues
This commit is contained in:
parent
a1b39b9990
commit
788122c3c5
@ -31,7 +31,7 @@ in
|
||||
|
||||
# unload module during suspend/hibernate as it crashes the whole system
|
||||
powerManagement.powerDownCommands = ''
|
||||
${pkgs.kmod}/bin/rmmod -f facetimehd
|
||||
${pkgs.kmod}/bin/lsmod | ${pkgs.gnugrep}/bin/grep -q "^facetimehd" && ${pkgs.kmod}/bin/rmmod -f -v facetimehd
|
||||
'';
|
||||
|
||||
# and load it back on resume
|
||||
|
Loading…
Reference in New Issue
Block a user