Skip to content

Commit

Permalink
Only add the new udev rule for x86 targets.
Browse files Browse the repository at this point in the history
The fundamental issue is that there is not a hardware.definitions
defined for the non-x86 targets yet. so there is nothing in the config
to evaluate and iterate the pcidevices.

This is a tmp fix.

Signed-off-by: Brian McGillion <[email protected]>
  • Loading branch information
brianmcgillion committed Aug 26, 2024
1 parent 1e93bd8 commit ec9377d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/microvm/virtualization/microvm/netvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ let

services.openssh = config.ghaf.security.sshKeys.sshAuthorizedKeysCommand;

# WORKAROUND: Create a rule to temporary hardcode device name for Wi-Fi adapter
services.udev.extraRules = ''
# WORKAROUND: Create a rule to temporary hardcode device name for Wi-Fi adapter on x86
# TODO this is a dirty hack to guard against adding this to Nvidia/vm targets which
# dont have that definition structure yet defined. FIXME.
# TODO the hardware.definition should not even be exposed in targets that do not consume it
services.udev.extraRules = lib.mkIf (config.ghaf.hardware.definition.network.pciDevices != [ ]) ''
SUBSYSTEM=="net", ACTION=="add", ATTRS{vendor}=="0x${(lib.head config.ghaf.hardware.definition.network.pciDevices).vendorId}", ATTRS{device}=="0x${(lib.head config.ghaf.hardware.definition.network.pciDevices).productId}", NAME="${(lib.head config.ghaf.hardware.definition.network.pciDevices).name}"
'';

Expand Down

0 comments on commit ec9377d

Please sign in to comment.