diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2019-09-22 17:14:47 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2020-02-08 14:04:02 +0100 |
commit | 44e289f93bcf6d04c3eab231bac57dade06fc0c6 (patch) | |
tree | 64adee07c42dfd1ba9bdb0c14c263a0e1f588067 /nixos/tests/predictable-interface-names.nix | |
parent | cfd4d4557af9f26dcd760fc5ee4a982d0b7867df (diff) | |
download | nixlib-44e289f93bcf6d04c3eab231bac57dade06fc0c6.tar nixlib-44e289f93bcf6d04c3eab231bac57dade06fc0c6.tar.gz nixlib-44e289f93bcf6d04c3eab231bac57dade06fc0c6.tar.bz2 nixlib-44e289f93bcf6d04c3eab231bac57dade06fc0c6.tar.lz nixlib-44e289f93bcf6d04c3eab231bac57dade06fc0c6.tar.xz nixlib-44e289f93bcf6d04c3eab231bac57dade06fc0c6.tar.zst nixlib-44e289f93bcf6d04c3eab231bac57dade06fc0c6.zip |
nixos/stage-1: fix predictable interfaces names
This makes predictable interfaces names available as soon as possible with udev by adding the default network link units to initrd which are read by udev. Also adds some udev rules that are needed but which would normally loaded from the udev store path which is not included in the initrd.
Diffstat (limited to 'nixos/tests/predictable-interface-names.nix')
-rw-r--r-- | nixos/tests/predictable-interface-names.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/tests/predictable-interface-names.nix b/nixos/tests/predictable-interface-names.nix index 83883477a5cc..bab091d57acf 100644 --- a/nixos/tests/predictable-interface-names.nix +++ b/nixos/tests/predictable-interface-names.nix @@ -17,6 +17,12 @@ in pkgs.lib.listToAttrs (pkgs.lib.crossLists (predictable: withNetworkd: { networking.useNetworkd = withNetworkd; networking.dhcpcd.enable = !withNetworkd; networking.useDHCP = !withNetworkd; + + # Check if predictable interface names are working in stage-1 + boot.initrd.postDeviceCommands = '' + ip link + ip link show eth0 ${if predictable then "&&" else "||"} exit 1 + ''; }; testScript = '' |