nixos/boot: Make sure interfaces are renamed in stage-1#68953
nixos/boot: Make sure interfaces are renamed in stage-1#68953arianvp wants to merge 2 commits intoNixOS:masterfrom
Conversation
Otherwise we run into issues that udev cannot rename the interface in stage-2 because the device is busy. See : * NixOS#39329 * https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055 * NixOS@1f03f6f
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
renaming this will respect the kernel parameter that disables predictible naming I think, so I think the nixos Option for disabling predictible naming should still work
|
This needs a thorough review and testing. But I think we should try to get this into 19.09 as now the network setup stuff is a bit flakey |
|
Also not sure if this is the right approach. I'm still very confused how all this So I think we should also copy this file over to the But that begs the question, in the current scenario, why is Edit: I think |
| cp -v ${udev}/lib/udev/rules.d/60-persistent-storage.rules $out/ | ||
| cp -v ${udev}/lib/udev/rules.d/80-drivers.rules $out/ | ||
| # Make sure interface is renamed in stage-1 | ||
| cp -v ${udev}/lib/udev/rules.d/80-net-link-setup-link.rules $out/ |
There was a problem hiding this comment.
should be 80-net-setup-link.rules
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
@arianvp With this PR, even after fixing the typo mentioned by @emilazy I was experiencing the problems you mentioned in the NixOS Discourse thread, namely:
However, after I applied the changes in the following commit on top of your PR, everything seems to be finally fixed for me on NixOS 19.09: I don't even want to pretend to understand how udev works -- the idea about adding Note that I have only done limited testing on 2 machines: one using a static network config with networking enabled in the initrd and another one using NetworkManager (with networking disabled in the initrd). AFAIK I'm not using |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
It looks like even with my changes, one of my machines still failed to rename the network interface, even in stage 2. I don't know what's different about this machine that causes this to fail... |
|
@fpletz ping? Would love to see this fixed for 20.03. |
|
@arianvp this seems somewhat redundant to #47664. @erikarvstedt, can we close the other one, or should more be moved into here? |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
For |
|
This PR is unfinished and probably not correct. I and @fpletz briefly hacked on this during All-systems-go conf and our work is in this branch https://github.com/NixOS/nixpkgs/tree/fix-predictable-ifnames-in-initrd |
|
@ju1m This works perfectly for me, thank you! I'd love to see this cleaned up and merged upstream -- presumably some part of NixOS's existing udev setup is incorrect? |
|
Can this be closed in favor of #79532? |
Otherwise we run into issues that udev cannot rename the interface in
stage-2 because the device is busy.
See :
Motivation for this change
Things done
sandboxinnix.confon non-NixOS)nix-shell -p nix-review --run "nix-review wip"./result/bin/)nix path-info -Sbefore and after)Notify maintainers
cc @