Skip to content

[20.03] nixos/initrd-network: always run postCommands#81744

Merged
Ma27 merged 2 commits intoNixOS:release-20.03from
Ma27:backport-remaining-initrd-fix
Mar 11, 2020
Merged

[20.03] nixos/initrd-network: always run postCommands#81744
Ma27 merged 2 commits intoNixOS:release-20.03from
Ma27:backport-remaining-initrd-fix

Conversation

@Ma27
Copy link
Member

@Ma27 Ma27 commented Mar 4, 2020

Motivation for this change

Please note that fffd09d was needed to fix the initrd-network-ssh-test on release-20.03 which is why I filed a PR.


The backport of this patch has been requested in #79532[1]. The diff is
slightly off the original commit since some changes from
ea7d024 were needed, however this
commit shouldn't be backported as it potentially breaks existing setups.

[1] #79532 (comment)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

fpletz and others added 2 commits March 4, 2020 18:31
As outlined in NixOS#71447, postCommands should always be run if networking
in initrd is enabled. regardless if the configuration actually
succeeded.

(cherry picked from commit 5897899)

The backport of this patch has been requested in NixOS#79532[1]. The diff is
slightly off the original commit since some changes from
ea7d024 were needed, however this
commit shouldn't be backported as it potentially breaks existing setups.

[1] NixOS#79532 (comment)
It seems as it takes a moment until the initrd-network is loaded. Please
note that this is currently only reproducible on release-20.03.
@Ma27 Ma27 added this to the 20.03 milestone Mar 4, 2020
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Mar 4, 2020
@mweinelt
Copy link
Member

mweinelt commented Mar 4, 2020

One could write code to boot.initrd.preLVMCommands and it will always be executed after networks is up or failed.

That would not really be intuitive, as you would now have to know the order in which things are executed in the initrd. 😐

@Ma27
Copy link
Member Author

Ma27 commented Mar 11, 2020

Doesn't it make postCommands useless because it starts duplicating boot.initrd.preLVMCommands

I generally agree with you, but this is a backport PR with a bugfix and I don't think we should delay this backport (of already reviewed code) because of that.

It's IMHO better to fix this on master first :)

@Ma27 Ma27 merged commit 1937173 into NixOS:release-20.03 Mar 11, 2020
@Ma27 Ma27 deleted the backport-remaining-initrd-fix branch March 11, 2020 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants