-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
initrd.network: support predictable interface names #47664
initrd.network: support predictable interface names #47664
Conversation
6390654
to
881084c
Compare
5212bca
to
1d22388
Compare
When `initrd.network.enable` and `networking.usePredictableInterfaceNames` are enabled, apply predictable interface naming in initrd. This also fixes a bug: Previously, setting `initrd.network.enable` effectively disabled option `networking.usePredictableInterfaceNames`. Reason: Interfaces brought up in initrd are not renamed by udev in boot stage 2. So the unpredictable names assigned in initrd remained unchanged after booting. Implementation notes: udhcpc uses eth0 as the default interface. When predictable names are enabled, use the lexicographically first Ethernet interface (en*) instead.
1d22388
to
7612783
Compare
I did that in #39329 but there was no consensus on how to avoid breaking existing configurations, so it wasn't merged yet. |
Great, thanks for the heads-up. I think some aspects of this PR are worth copying to your proposal:
|
@@ -76,6 +76,11 @@ in | |||
|
|||
boot.initrd.kernelModules = [ "af_packet" ]; | |||
|
|||
boot.initrd.extraUdevRulesCommands = mkIf config.networking.usePredictableInterfaceNames '' |
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.
Can you write release notes for that?
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.
This aligns more with the semantics of the option, but requires users to migrate.
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.
#39329 contains some draft release notes, feel free to copy/adapt.
Any updates on this pull request, please? |
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/1 |
Superseded by #68953. |
Copy of main commit msg:
When
initrd.network.enable
andnetworking.usePredictableInterfaceNames
are enabled, apply predictable interface naming in initrd.
This also fixes a bug:
Previously, setting
initrd.network.enable
effectively disabled optionnetworking.usePredictableInterfaceNames
.Reason: Interfaces brought up in initrd are not renamed by udev in boot
stage 2. So the unpredictable names assigned in initrd remained
unchanged after booting.
Implementation notes:
udhcpc uses eth0 as the default interface.
When predictable names are enabled, use the lexicographically
first Ethernet interface (en*) instead.
Things done: