-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/boot: Make sure interfaces are renamed in stage-1 #68953
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: https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055/4 |
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 |
@@ -209,6 +216,8 @@ let | |||
cp -v ${udev}/lib/udev/rules.d/60-cdrom_id.rules $out/ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be 80-net-setup-link.rules
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055/5 |
@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: https://discourse.nixos.org/t/predictable-network-interface-names-in-initrd/4055/9 |
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: https://discourse.nixos.org/t/disk-encryption-on-nixos-servers-how-when-to-unlock/5030/8 |
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
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @