initrd.network: support predictable interface names #47664
Closed
erikarvstedt wants to merge 2 commits intoNixOS:masterfrom
Closed
initrd.network: support predictable interface names #47664erikarvstedt wants to merge 2 commits intoNixOS:masterfrom
erikarvstedt wants to merge 2 commits intoNixOS:masterfrom
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
Contributor
|
I did that in #39329 but there was no consensus on how to avoid breaking existing configurations, so it wasn't merged yet. |
Member
Author
|
Great, thanks for the heads-up. I think some aspects of this PR are worth copying to your proposal:
|
Mic92
reviewed
Oct 2, 2018
|
|
||
| boot.initrd.kernelModules = [ "af_packet" ]; | ||
|
|
||
| boot.initrd.extraUdevRulesCommands = mkIf config.networking.usePredictableInterfaceNames '' |
Member
There was a problem hiding this comment.
Can you write release notes for that?
Member
There was a problem hiding this comment.
This aligns more with the semantics of the option, but requires users to migrate.
Contributor
There was a problem hiding this comment.
#39329 contains some draft release notes, feel free to copy/adapt.
Contributor
Member
|
Any updates on this pull request, please? |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
10 tasks
Member
Author
|
Superseded by #68953. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copy of main commit msg:
When
initrd.network.enableandnetworking.usePredictableInterfaceNamesare enabled, apply predictable interface naming in initrd.
This also fixes a bug:
Previously, setting
initrd.network.enableeffectively 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: