summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorThomas Huth <huth@users.noreply.github.com>2018-01-08 10:49:15 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-01-08 10:49:15 +0100
commitd35d6249d5a7ed3228b94fc0e36a36bc3fe84482 (patch)
tree60953b150847d6f98e31cadd1afe1a092cc91170 /rules
parent2df46112052ee9752ce2d2920ad6184b304c77ed (diff)
downloadsystemd-d35d6249d5a7ed3228b94fc0e36a36bc3fe84482.tar.gz
rules: Mark the kvm device as static_node (for s390x and ppc64) (#7795)
On s390x and ppc64, the permissions of the /dev/kvm device are currently not right as long as the kvm kernel module has not been loaded yet. The kernel module is using MODULE_ALIAS("devname:kvm") there, so the module will be loaded on the first access to /dev/kvm. In that case, udev needs to apply the permission to the static node already (which was created via devtmpfs), i.e. we have to specify the option "static_node=kvm" in the udev rule. Note that on x86, the kvm kernel modules are loaded early instead (via the MODULE_DEVICE_TABLE(x86cpu, ...) feature checking), so that the right module is loaded for the Intel or AMD hypervisor extensions right from the start. Thus the "static_node=kvm" is not required on x86 - but it also should not hurt here (and using it here even might be more future proof in case the module loading is also done delayed there one day), so we just add the new option to the rule here unconditionally.
Diffstat (limited to 'rules')
-rw-r--r--rules/50-udev-default.rules.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/rules/50-udev-default.rules.in b/rules/50-udev-default.rules.in
index 71e716913c..191f56f42e 100644
--- a/rules/50-udev-default.rules.in
+++ b/rules/50-udev-default.rules.in
@@ -78,7 +78,8 @@ KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
-KERNEL=="kvm", GROUP="kvm", MODE="@DEV_KVM_MODE@"
+# The static_node is required on s390x and ppc (they are using MODULE_ALIAS)
+KERNEL=="kvm", GROUP="kvm", MODE="@DEV_KVM_MODE@", OPTIONS+="static_node=kvm"
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm"