Frcc kvm #9
@@ -295,6 +295,7 @@ rec {
|
|||||||
+ lib.optionalString useIdmap ":idmap"
|
+ lib.optionalString useIdmap ":idmap"
|
||||||
) allBindMounts;
|
) allBindMounts;
|
||||||
bindMountHostPaths = map (bm: bm.hostPath) (lib.attrValues allBindMounts);
|
bindMountHostPaths = map (bm: bm.hostPath) (lib.attrValues allBindMounts);
|
||||||
|
deviceFlags = map (d: "--bind=${d}") devices;
|
||||||
inherit (deriveIdentity ifPrefix.nspawn name)
|
inherit (deriveIdentity ifPrefix.nspawn name)
|
||||||
iface
|
iface
|
||||||
mac
|
mac
|
||||||
@@ -381,7 +382,7 @@ rec {
|
|||||||
nixosContainer = {
|
nixosContainer = {
|
||||||
inherit autoStart privateUsers;
|
inherit autoStart privateUsers;
|
||||||
bindMounts = { };
|
bindMounts = { };
|
||||||
extraFlags = bindMountExtraFlags;
|
extraFlags = bindMountExtraFlags ++ deviceFlags;
|
||||||
privateNetwork = true;
|
privateNetwork = true;
|
||||||
extraVeths = linkVeths;
|
extraVeths = linkVeths;
|
||||||
config =
|
config =
|
||||||
|
|||||||
@@ -333,6 +333,7 @@ with subtest("(functional): published ports follow the container's lifetime"):
|
|||||||
with subtest("(functional): declared devices are usable in-container"):
|
with subtest("(functional): declared devices are usable in-container"):
|
||||||
for name, devices in DEVICES.items():
|
for name, devices in DEVICES.items():
|
||||||
for dev in devices:
|
for dev in devices:
|
||||||
|
# opened, not stat'd: without DeviceAllow= the node is still visible
|
||||||
server.succeed(ct_cmd(name, f"exec 3<> {dev}"))
|
server.succeed(ct_cmd(name, f"exec 3<> {dev}"))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user