nixos/initrd-network: add udhcpc.extraArgs option (#36305)
This can be used to fix issues where udhcpc times out before acquiring a lease. For example of these issues, see: https://bugs.alpinelinux.org/issues/3105#note-8 Signed-off-by: Dino A. Dai Zovi <ddz@theta44.org>
This commit is contained in:
parent
18055971cb
commit
ddf13e6646
1 changed files with 13 additions and 1 deletions
|
@ -23,6 +23,8 @@ let
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
udhcpcArgs = toString cfg.udhcpc.extraArgs;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -47,6 +49,16 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.initrd.network.udhcpc.extraArgs = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = ''
|
||||||
|
Additional command-line arguments passed verbatim to udhcpc if
|
||||||
|
<option>boot.initrd.network.enable</option> and <option>networking.useDHCP</option>
|
||||||
|
are enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
boot.initrd.network.postCommands = mkOption {
|
boot.initrd.network.postCommands = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
@ -91,7 +103,7 @@ in
|
||||||
|
|
||||||
# Acquire a DHCP lease.
|
# Acquire a DHCP lease.
|
||||||
echo "acquiring IP address via DHCP..."
|
echo "acquiring IP address via DHCP..."
|
||||||
udhcpc --quit --now --script ${udhcpcScript} && hasNetwork=1
|
udhcpc --quit --now --script ${udhcpcScript} ${udhcpcArgs} && hasNetwork=1
|
||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue