containers: Do not wait for udev for network devices
Test that adding physical devices to containers works, find that network setup then doesn't work because there is no udev in the container to tell systemd that the device is present. Fixed by not depending on the device in the container. Activate the new container test for release Bonds, bridges and other network devices need the underlying not as dependency when used inside the container. Because the device is already there. But the address configuration needs the aggregated device itself.
This commit is contained in:
@@ -310,9 +310,9 @@ in
|
||||
generate a random 32-bit ID using the following commands:
|
||||
|
||||
<literal>cksum /etc/machine-id | while read c rest; do printf "%x" $c; done</literal>
|
||||
|
||||
|
||||
(this derives it from the machine-id that systemd generates) or
|
||||
|
||||
|
||||
<literal>head -c4 /dev/urandom | od -A none -t x4</literal>
|
||||
'';
|
||||
};
|
||||
@@ -972,12 +972,17 @@ in
|
||||
'';
|
||||
};
|
||||
} // (listToAttrs (flip map interfaces (i:
|
||||
let
|
||||
deviceDependency = if config.boot.isContainer
|
||||
then []
|
||||
else [ (subsystemDevice i.name) ];
|
||||
in
|
||||
nameValuePair "network-link-${i.name}"
|
||||
{ description = "Link configuration of ${i.name}";
|
||||
wantedBy = [ "network-interfaces.target" ];
|
||||
before = [ "network-interfaces.target" ];
|
||||
bindsTo = [ (subsystemDevice i.name) ];
|
||||
after = [ (subsystemDevice i.name) "network-pre.target" ];
|
||||
bindsTo = deviceDependency;
|
||||
after = [ "network-pre.target" ] ++ deviceDependency;
|
||||
path = [ pkgs.iproute ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
|
||||
Reference in New Issue
Block a user