teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0091-Copy-40-redhat.rules-from-RHEL-8.patch

ac3a84
From 6b5b5fefcb68cb53427747be4984531bdeddcf7e Mon Sep 17 00:00:00 2001
4295f9
From: David Tardon <dtardon@redhat.com>
4295f9
Date: Fri, 2 Jul 2021 13:25:51 +0200
4295f9
Subject: [PATCH] Copy 40-redhat.rules from RHEL-8
4295f9
4295f9
RHEL-only
4295f9
ac3a84
Related: #2138081
4295f9
---
4295f9
 rules.d/40-redhat.rules | 46 +++++++++++++++++++++++++++++++++++++++++
ac3a84
 rules.d/meson.build     |  3 ++-
ac3a84
 2 files changed, 48 insertions(+), 1 deletion(-)
4295f9
 create mode 100644 rules.d/40-redhat.rules
4295f9
4295f9
diff --git a/rules.d/40-redhat.rules b/rules.d/40-redhat.rules
4295f9
new file mode 100644
4295f9
index 0000000000..3c95cd2df0
4295f9
--- /dev/null
4295f9
+++ b/rules.d/40-redhat.rules
4295f9
@@ -0,0 +1,46 @@
4295f9
+# do not edit this file, it will be overwritten on update
4295f9
+
4295f9
+# CPU hotadd request
4295f9
+SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"
4295f9
+
4295f9
+# Memory hotadd request
4295f9
+SUBSYSTEM!="memory", GOTO="memory_hotplug_end"
4295f9
+ACTION!="add", GOTO="memory_hotplug_end"
4295f9
+CONST{arch}=="s390*", GOTO="memory_hotplug_end"
4295f9
+CONST{arch}=="ppc64*", GOTO="memory_hotplug_end"
4295f9
+
4295f9
+ENV{.state}="online"
4295f9
+CONST{virt}=="none", ENV{.state}="online_movable"
4295f9
+ATTR{state}=="offline", ATTR{state}="$env{.state}"
4295f9
+
4295f9
+LABEL="memory_hotplug_end"
4295f9
+
4295f9
+# reload sysctl.conf / sysctl.conf.d settings when the bridge module is loaded
4295f9
+ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/bridge"
4295f9
+
4295f9
+# load SCSI generic (sg) driver
4295f9
+SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg"
4295f9
+SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_target", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg"
4295f9
+
4295f9
+# Rule for prandom character device node permissions
4295f9
+KERNEL=="prandom", MODE="0644"
4295f9
+
4295f9
+# Rules for creating the ID_PATH for SCSI devices based on the CCW bus
4295f9
+# using the form: ccw-<BUS_ID>-zfcp-<WWPN>:<LUN>
4295f9
+#
4295f9
+ACTION=="remove", GOTO="zfcp_scsi_device_end"
4295f9
+
4295f9
+#
4295f9
+# Set environment variable "ID_ZFCP_BUS" to "1" if the devices
4295f9
+# (both disk and partition) are SCSI devices based on FCP devices
4295f9
+#
4295f9
+KERNEL=="sd*", SUBSYSTEMS=="ccw", DRIVERS=="zfcp", ENV{.ID_ZFCP_BUS}="1"
4295f9
+
4295f9
+# For SCSI disks
4295f9
+KERNEL=="sd*[!0-9]", SUBSYSTEMS=="scsi", ENV{.ID_ZFCP_BUS}=="1", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-path/ccw-$attr{hba_id}-zfcp-$attr{wwpn}:$attr{fcp_lun}"
4295f9
+
4295f9
+
4295f9
+# For partitions on a SCSI disk
4295f9
+KERNEL=="sd*[0-9]", SUBSYSTEMS=="scsi", ENV{.ID_ZFCP_BUS}=="1", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-path/ccw-$attr{hba_id}-zfcp-$attr{wwpn}:$attr{fcp_lun}-part%n"
4295f9
+
4295f9
+LABEL="zfcp_scsi_device_end"
4295f9
diff --git a/rules.d/meson.build b/rules.d/meson.build
ac3a84
index 8d2878a36d..70f48e877b 100644
4295f9
--- a/rules.d/meson.build
4295f9
+++ b/rules.d/meson.build
ac3a84
@@ -5,7 +5,8 @@ install_data(
4295f9
         install_dir : udevrulesdir)
4295f9
 
ac3a84
 rules = [
ac3a84
-        [files('60-autosuspend.rules',
ac3a84
+        [files('40-redhat.rules',
ac3a84
+               '60-autosuspend.rules',
ac3a84
                '60-block.rules',
ac3a84
                '60-cdrom_id.rules',
ac3a84
                '60-drm.rules',