richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
152484
From 24f033a2a5c03848ae518278c8025e13130146af 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
4295f9
Resolves: #1978639
4295f9
---
4295f9
 rules.d/40-redhat.rules | 46 +++++++++++++++++++++++++++++++++++++++++
4295f9
 rules.d/meson.build     |  1 +
4295f9
 2 files changed, 47 insertions(+)
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
152484
index 5cecddb34f..c5c3590b29 100644
4295f9
--- a/rules.d/meson.build
4295f9
+++ b/rules.d/meson.build
4295f9
@@ -5,6 +5,7 @@ install_data(
4295f9
         install_dir : udevrulesdir)
4295f9
 
4295f9
 rules = files('''
4295f9
+        40-redhat.rules
4295f9
         60-autosuspend.rules
4295f9
         60-block.rules
4295f9
         60-cdrom_id.rules