11
0

- Introduce %udevadm_reload_and_trigger() for packages that need to trigger

event in theirs scriplets. The new macro automatically triggers a reload of
  the udev rule files as this step is often overlooked by packages
  (bsc#1237143).

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=105
This commit is contained in:
2025-07-07 16:05:30 +00:00
committed by Git OBS Bridge
parent 6035ade6d2
commit c29caf25aa
3 changed files with 27 additions and 1 deletions

View File

@@ -215,6 +215,24 @@ fi \
: \
%{nil}
#
# This should be used when a package needs to execute the shipped udev rules
# during its installation. It automatically triggers a reload of the rule files,
# as this step is often overlooked by packages.
#
# Note1: The version of this macro shipped with SLE < 16 only supports a limited
# subset of options, due to the older RPM versions (< 4.17), which lacks support
# for disabling option processing.
#
# Note2: This is suboptimal when multiple events need to be triggered, as it
# results in multiple reloads of the rule files.
#
%udevadm_reload_and_trigger(-) \
if [ -e /run/udev/control ]; then \
/usr/bin/udevadm control --reload && /usr/bin/udevadm trigger %{?*} || : \
fi \
%{nil}
# The 2 following macros have also been converted into NOPs since we moved to
# file triggers. Some packages might have assumed that their effects were
# effective as soon as the macros return. However such assumption on tmpfiles

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jul 7 15:56:08 UTC 2025 - Franck Bui <fbui@suse.com>
- Introduce %udevadm_reload_and_trigger() for packages that need to trigger
event in theirs scriplets. The new macro automatically triggers a reload of
the udev rule files as this step is often overlooked by packages
(bsc#1237143).
-------------------------------------------------------------------
Sat Jun 24 08:41:48 UTC 2023 - Franck Bui <fbui@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package systemd-rpm-macros
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed