Merge pull request #262740 from ElvishJerricco/systemd-stage-1-improve-udhcpc-assertion

systemd-stage-1: Improve udhcpc assertion
This commit is contained in:
Will Fancher 2023-10-22 13:46:38 -04:00 committed by GitHub
commit 13f325005c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ in
};
boot.initrd.network.udhcpc.enable = mkOption {
default = config.networking.useDHCP;
default = config.networking.useDHCP && !config.boot.initrd.systemd.enable;
defaultText = "networking.useDHCP";
type = types.bool;
description = lib.mdDoc ''

View File

@ -2985,10 +2985,10 @@ in
stage2Config
(mkIf config.boot.initrd.systemd.enable {
assertions = [{
assertion = config.boot.initrd.network.udhcpc.extraArgs == [];
assertion = !config.boot.initrd.network.udhcpc.enable && config.boot.initrd.network.udhcpc.extraArgs == [];
message = ''
boot.initrd.network.udhcpc.extraArgs is not supported when
boot.initrd.systemd.enable is enabled
systemd stage 1 networking does not support 'boot.initrd.network.udhcpc'. Configure
DHCP with 'networking.*' options or with 'boot.initrd.systemd.network' options.
'';
}];