mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/udev: switch networking.usePredicatableInterfaceNames
to a kernel param
The udev rules we are shipping no longer work with systemd v242 and were remove upstream some time ago. It seems like the entire renaming is now done in C and not in the udev rules.
This commit is contained in:
parent
8c7e588362
commit
1f03f6fc43
2 changed files with 2 additions and 17 deletions
|
@ -1,13 +0,0 @@
|
||||||
# Copied from systemd 203.
|
|
||||||
ACTION=="remove", GOTO="net_name_slot_end"
|
|
||||||
SUBSYSTEM!="net", GOTO="net_name_slot_end"
|
|
||||||
NAME!="", GOTO="net_name_slot_end"
|
|
||||||
|
|
||||||
IMPORT{cmdline}="net.ifnames"
|
|
||||||
ENV{net.ifnames}=="0", GOTO="net_name_slot_end"
|
|
||||||
|
|
||||||
NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
|
|
||||||
NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
|
|
||||||
NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
|
|
||||||
|
|
||||||
LABEL="net_name_slot_end"
|
|
|
@ -116,10 +116,6 @@ let
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${optionalString config.networking.usePredictableInterfaceNames ''
|
|
||||||
cp ${./80-net-setup-link.rules} $out/80-net-setup-link.rules
|
|
||||||
''}
|
|
||||||
|
|
||||||
# If auto-configuration is disabled, then remove
|
# If auto-configuration is disabled, then remove
|
||||||
# udev's 80-drivers.rules file, which contains rules for
|
# udev's 80-drivers.rules file, which contains rules for
|
||||||
# automatically calling modprobe.
|
# automatically calling modprobe.
|
||||||
|
@ -282,6 +278,8 @@ in
|
||||||
|
|
||||||
services.udev.path = [ pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.utillinux udev ];
|
services.udev.path = [ pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.utillinux udev ];
|
||||||
|
|
||||||
|
boot.kernelParams = mkIf (!config.networking.usePredictableInterfaceNames) [ "net.ifnames=0" ];
|
||||||
|
|
||||||
environment.etc =
|
environment.etc =
|
||||||
[ { source = udevRules;
|
[ { source = udevRules;
|
||||||
target = "udev/rules.d";
|
target = "udev/rules.d";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue