mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #7456 from giuseppe/modprobe-fuse
spec: modprobe fuse with --device .*/fuse
This commit is contained in:
@ -215,6 +215,10 @@ Note: if the user only has access rights via a group, accessing the device
|
|||||||
from inside a rootless container will fail. The **crun**(1) runtime offers a
|
from inside a rootless container will fail. The **crun**(1) runtime offers a
|
||||||
workaround for this by adding the option **--annotation run.oci.keep_original_groups=1**.
|
workaround for this by adding the option **--annotation run.oci.keep_original_groups=1**.
|
||||||
|
|
||||||
|
Podman may load kernel modules required for using the specified
|
||||||
|
device. The devices that podman will load modules when necessary are:
|
||||||
|
/dev/fuse.
|
||||||
|
|
||||||
**--device-cgroup-rule**="type major:minor mode"
|
**--device-cgroup-rule**="type major:minor mode"
|
||||||
|
|
||||||
Add a rule to the cgroup allowed devices list. The rule is expected to be in the format specified in the Linux kernel documentation (Documentation/cgroup-v1/devices.txt):
|
Add a rule to the cgroup allowed devices list. The rule is expected to be in the format specified in the Linux kernel documentation (Documentation/cgroup-v1/devices.txt):
|
||||||
|
@ -231,6 +231,10 @@ Note: if the user only has access rights via a group, accessing the device
|
|||||||
from inside a rootless container will fail. The **crun**(1) runtime offers a
|
from inside a rootless container will fail. The **crun**(1) runtime offers a
|
||||||
workaround for this by adding the option **--annotation run.oci.keep_original_groups=1**.
|
workaround for this by adding the option **--annotation run.oci.keep_original_groups=1**.
|
||||||
|
|
||||||
|
Podman may load kernel modules required for using the specified
|
||||||
|
device. The devices that podman will load modules when necessary are:
|
||||||
|
/dev/fuse.
|
||||||
|
|
||||||
**--device-cgroup-rule**=rule
|
**--device-cgroup-rule**=rule
|
||||||
|
|
||||||
Add a rule to the cgroup allowed devices list
|
Add a rule to the cgroup allowed devices list
|
||||||
|
@ -248,6 +248,13 @@ func addDevice(g *generate.Generator, device string) error {
|
|||||||
}
|
}
|
||||||
g.Config.Mounts = append(g.Config.Mounts, devMnt)
|
g.Config.Mounts = append(g.Config.Mounts, devMnt)
|
||||||
return nil
|
return nil
|
||||||
|
} else if src == "/dev/fuse" {
|
||||||
|
// if the user is asking for fuse inside the container
|
||||||
|
// make sure the module is loaded.
|
||||||
|
f, err := unix.Open(src, unix.O_RDONLY|unix.O_NONBLOCK, 0)
|
||||||
|
if err == nil {
|
||||||
|
unix.Close(f)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dev.Path = dst
|
dev.Path = dst
|
||||||
g.AddDevice(*dev)
|
g.AddDevice(*dev)
|
||||||
|
Reference in New Issue
Block a user