From c674bdbb3eea6819c047e79581054af4c174e9a0 Mon Sep 17 00:00:00 2001 From: wangkaiqiang Date: Wed, 19 Nov 2025 14:34:52 +0800 Subject: [PATCH] rules: automatically modprobe sg drive --- ...les-automatically-modprobe-sg-driver.patch | 25 +++++++++++++++++++ systemd.spec | 8 ++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 1003-rules-automatically-modprobe-sg-driver.patch diff --git a/1003-rules-automatically-modprobe-sg-driver.patch b/1003-rules-automatically-modprobe-sg-driver.patch new file mode 100644 index 0000000..1394d67 --- /dev/null +++ b/1003-rules-automatically-modprobe-sg-driver.patch @@ -0,0 +1,25 @@ +From 131c08ba71e290795ea9b3e5e9228c6419db5e8b Mon Sep 17 00:00:00 2001 +From: wangkaiqiang +Date: Wed, 19 Nov 2025 15:00:50 +0800 +Subject: [PATCH] rules: automatically modprobe sg drive + +--- + rules.d/99-systemd.rules.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/rules.d/99-systemd.rules.in b/rules.d/99-systemd.rules.in +index 455a236..da97c89 100644 +--- a/rules.d/99-systemd.rules.in ++++ b/rules.d/99-systemd.rules.in +@@ -85,4 +85,8 @@ SUBSYSTEM=="misc", KERNEL=="rfkill", TAG+="systemd", ENV{SYSTEMD_WANTS}+="system + SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount" + SUBSYSTEM=="module", KERNEL=="configfs", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount" + ++# 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" ++ + LABEL="systemd_end" +-- +2.39.3 + diff --git a/systemd.spec b/systemd.spec index aee0945..409e065 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1,4 +1,4 @@ -%define anolis_release 10 +%define anolis_release 11 %global __requires_exclude pkg-config %global pkgdir %{_prefix}/lib/systemd @@ -70,6 +70,7 @@ Patch0497: 0497-print-backtrack-log-to-var-log-messages.patch Patch1001: Systemd-Add-sw64-architecture.patch Patch1002: 1002-bugfix-for-CVE-2023-50387.patch +Patch1003: 1003-rules-automatically-modprobe-sg-driver.patch BuildRequires: gcc gcc-c++ clang coreutils BuildRequires: libcap-devel libmount-devel libfdisk-devel libpwquality-devel @@ -314,7 +315,7 @@ and is meant for use in non-systemd systems. %package standalone-shutdown Summary: Standalone sysusers binary for use in non-systemd systems -Provides: systemd-shutdown= %{EVR} +Provides: systemd-shutdown = %{EVR} Obsoletes: systemd-shutdown < %{EVR} RemovePathPostfixes: .standalone @@ -2179,6 +2180,9 @@ fi %doc docs/DISTRO_PORTING.md docs/HACKING.md %changelog +* Wed Nov 19 2025 Kaiqiang Wang - 255-11 +- rules: automatically modprobe sg drive + * Fri Oct 24 2025 tomcruiseqi - 255-10 - Fix CVE-2023-50387 -- Gitee