Skip to content

Commit

Permalink
rules: copy 40-redhat.rules from RHEL 9
Browse files Browse the repository at this point in the history
Also split rules into 40-redhat-hotplug.rules, 40-redhat-s390.rules and 40-redhat.rules.

rhel-only: feature

Resolves: RHEL-40360
  • Loading branch information
jamacku committed Jun 26, 2024
1 parent 517bf13 commit 36ef8f9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
23 changes: 23 additions & 0 deletions rules.d/40-redhat-hotplug.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# do not edit this file, it will be overwritten on update

# CPU hotadd request
SUBSYSTEM!="cpu", GOTO="cpu_online_end"
ACTION!="add", GOTO="cpu_online_end"
CONST{arch}=="ppc64*", GOTO="cpu_online_end"
CONST{arch}=="s390*", ATTR{configure}=="0", GOTO="cpu_online_end"

TEST=="online", ATTR{online}=="0", ATTR{online}="1"

LABEL="cpu_online_end"

# Memory hotadd request
SUBSYSTEM!="memory", GOTO="memory_hotplug_end"
ACTION!="add", GOTO="memory_hotplug_end"
CONST{arch}=="s390*", GOTO="memory_hotplug_end"
CONST{arch}=="ppc64*", GOTO="memory_hotplug_end"

ENV{.state}="online"
CONST{virt}=="none", ENV{.state}="online_movable"
ATTR{state}=="offline", ATTR{state}="$env{.state}"

LABEL="memory_hotplug_end"
24 changes: 24 additions & 0 deletions rules.d/40-redhat-s390.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# do not edit this file, it will be overwritten on update

# Rule for prandom character device node permissions
KERNEL=="prandom", MODE="0644"

# Rules for creating the ID_PATH for SCSI devices based on the CCW bus
# using the form: ccw-<BUS_ID>-zfcp-<WWPN>:<LUN>
#
ACTION=="remove", GOTO="zfcp_scsi_device_end"

#
# Set environment variable "ID_ZFCP_BUS" to "1" if the devices
# (both disk and partition) are SCSI devices based on FCP devices
#
KERNEL=="sd*", SUBSYSTEMS=="ccw", DRIVERS=="zfcp", ENV{.ID_ZFCP_BUS}="1"

# For SCSI disks
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}"


# For partitions on a SCSI disk
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"

LABEL="zfcp_scsi_device_end"
8 changes: 8 additions & 0 deletions rules.d/40-redhat.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# do not edit this file, it will be overwritten on update

# reload sysctl.conf / sysctl.conf.d settings when the bridge module is loaded
ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/bridge"

# load SCSI generic (sg) driver
SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg"
SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_target", TEST!="[module/sg]", RUN+="/sbin/modprobe -bv sg"
5 changes: 4 additions & 1 deletion rules.d/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ install_data(
install_dir : udevrulesdir)

rules = [
[files('60-autosuspend.rules',
[files('40-redhat-hotplug.rules',
'40-redhat-s390.rules',
'40-redhat.rules',
'60-autosuspend.rules',
'60-block.rules',
'60-cdrom_id.rules',
'60-dmi-id.rules',
Expand Down

0 comments on commit 36ef8f9

Please sign in to comment.