diff --git a/dtb-aarch64.changes b/dtb-aarch64.changes index 2f790094..59ec6220 100644 --- a/dtb-aarch64.changes +++ b/dtb-aarch64.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/dtb-aarch64.spec b/dtb-aarch64.spec index 67fcf51e..d420e53e 100644 --- a/dtb-aarch64.spec +++ b/dtb-aarch64.spec @@ -31,7 +31,7 @@ Name: dtb-aarch64 Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -50,10 +50,6 @@ BuildRequires: xz Requires: kernel = %version Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches diff --git a/dtb-armv6l.changes b/dtb-armv6l.changes index 2f790094..59ec6220 100644 --- a/dtb-armv6l.changes +++ b/dtb-armv6l.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/dtb-armv6l.spec b/dtb-armv6l.spec index 2ad3c020..cfbd39d8 100644 --- a/dtb-armv6l.spec +++ b/dtb-armv6l.spec @@ -31,7 +31,7 @@ Name: dtb-armv6l Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -50,10 +50,6 @@ BuildRequires: xz Requires: kernel = %version Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches diff --git a/dtb-armv7l.changes b/dtb-armv7l.changes index 2f790094..59ec6220 100644 --- a/dtb-armv7l.changes +++ b/dtb-armv7l.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/dtb-armv7l.spec b/dtb-armv7l.spec index a559cd5b..554c26da 100644 --- a/dtb-armv7l.spec +++ b/dtb-armv7l.spec @@ -31,7 +31,7 @@ Name: dtb-armv7l Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -50,10 +50,6 @@ BuildRequires: xz Requires: kernel = %version Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches diff --git a/dtb-riscv64.changes b/dtb-riscv64.changes index 2f790094..59ec6220 100644 --- a/dtb-riscv64.changes +++ b/dtb-riscv64.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/dtb-riscv64.spec b/dtb-riscv64.spec index 6fe92f32..b45c7eee 100644 --- a/dtb-riscv64.spec +++ b/dtb-riscv64.spec @@ -31,7 +31,7 @@ Name: dtb-riscv64 Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -50,10 +50,6 @@ BuildRequires: xz Requires: kernel = %version Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches diff --git a/kernel-64kb.changes b/kernel-64kb.changes index 2f790094..59ec6220 100644 --- a/kernel-64kb.changes +++ b/kernel-64kb.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-64kb.spec b/kernel-64kb.spec index 487ffdae..8718dd8f 100644 --- a/kernel-64kb.spec +++ b/kernel-64kb.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,17 +243,13 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -335,10 +331,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -797,54 +789,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1213,14 +1157,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1254,13 +1225,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1298,10 +1292,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1440,29 +1459,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1481,29 +1506,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1522,29 +1553,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1578,29 +1615,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1620,29 +1663,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1661,29 +1710,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/kernel-binary.spec.in b/kernel-binary.spec.in index 234ceb88..b94bbeb3 100644 --- a/kernel-binary.spec.in +++ b/kernel-binary.spec.in @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -658,54 +658,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1074,14 +1026,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1113,13 +1092,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1155,10 +1157,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1297,29 +1324,35 @@ Requires(post): suse-module-tools >= 12.4 %description -n @KMP_NAME@-%build_flavor @KMP_DESCRIPTION@ -%post -n @KMP_NAME@-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=@KMP_NAME@-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n @KMP_NAME@-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "@KMP_NAME@-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n @KMP_NAME@-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n @KMP_NAME@-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "@KMP_NAME@-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n @KMP_NAME@-%build_flavor -nvr=@KMP_NAME@-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "@KMP_NAME@-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n @KMP_NAME@-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=@KMP_NAME@-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "@KMP_NAME@-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n @KMP_NAME@-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "@KMP_NAME@-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n @KMP_NAME@-%build_flavor -f @KMP_NAME@.files %defattr(-, root, root) diff --git a/kernel-cert-subpackage b/kernel-cert-subpackage index edc62ebb..a0e61cbd 100644 --- a/kernel-cert-subpackage +++ b/kernel-cert-subpackage @@ -1,55 +1,26 @@ %package -n %{-n*}-ueficert Summary: UEFI Secure Boot Certificate For Package %{-n*}-kmp Group: System/Kernel +Requires(post): suse-kernel-rpm-scriptlets +Requires(pre): suse-kernel-rpm-scriptlets %description -n %{-n*}-ueficert This package contains the UEFI Secure Boot certificate used to sign modules in the %{-n*}-kmp packages. -# The scriptlets are reused in kernel-binary.spec.in by a sed script that -# stops at the next line that starts with a percent sign +%pre -n %{-n*}-ueficert +/usr/lib/module-init-tools/kernel-scriptlets/cert-pre --certs "@CERTS@" "$@" + %post -n %{-n*}-ueficert -if ! command -v mokutil >/dev/null; then - exit 0 -fi -# Only apply CA check on the kernel package certs (bsc#1173115) -if [ %{defined _suse_kernel_module_subpackage} = 0 ] && mokutil -h | grep -q "ca-check"; then - MOK_ARG="--ca-check" -else - MOK_ARG="" -fi -# XXX: Only call mokutil if UEFI and shim are used -for cert in @CERTS@; do - cert="/etc/uefi/certs/${cert}.crt" - if ! mokutil --import "$cert" --root-pw ${MOK_ARG}; then - echo "Failed to import $cert" - fi -done -exit 0 +/usr/lib/module-init-tools/kernel-scriptlets/cert-post --certs "@CERTS@" "$@" %preun -n %{-n*}-ueficert -if ! command -v mokutil >/dev/null; then - exit 0 -fi -for cert in @CERTS@; do - cert="/etc/uefi/certs/${cert}.crt" - ln "$cert" "$cert.delete" -done -exit 0 +/usr/lib/module-init-tools/kernel-scriptlets/cert-preun --certs "@CERTS@" "$@" %postun -n %{-n*}-ueficert -if ! command -v mokutil >/dev/null; then - exit 0 -fi -for cert in @CERTS@; do - cert="/etc/uefi/certs/${cert}.crt" - if ! test -e "$cert"; then - if ! mokutil --delete "$cert.delete" --root-pw; then - echo "Failed to delete $cert" - fi - fi - rm "$cert.delete" -done -exit 0 +/usr/lib/module-init-tools/kernel-scriptlets/cert-postun --certs "@CERTS@" "$@" + +%posttrans -n %{-n*}-ueficert +/usr/lib/module-init-tools/kernel-scriptlets/cert-posttrans --certs "@CERTS@" "$@" %files -n %{-n*}-ueficert %defattr(-, root, root) diff --git a/kernel-debug.changes b/kernel-debug.changes index 2f790094..59ec6220 100644 --- a/kernel-debug.changes +++ b/kernel-debug.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-debug.spec b/kernel-debug.spec index ce0b8b45..1e4df059 100644 --- a/kernel-debug.spec +++ b/kernel-debug.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,10 +243,10 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %ifarch ppc64 Provides: kernel-kdump = 2.6.28 Obsoletes: kernel-kdump <= 2.6.28 @@ -258,10 +258,6 @@ Obsoletes: kernel-kdump-base <= 2.6.28 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -343,10 +339,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -803,54 +795,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1219,14 +1163,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1262,13 +1233,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1308,10 +1302,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1454,29 +1473,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1495,29 +1520,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1536,29 +1567,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1592,29 +1629,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1634,29 +1677,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1675,29 +1724,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/kernel-default.changes b/kernel-default.changes index 2f790094..59ec6220 100644 --- a/kernel-default.changes +++ b/kernel-default.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-default.spec b/kernel-default.spec index d0059eed..7baf6c41 100644 --- a/kernel-default.spec +++ b/kernel-default.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,10 +243,10 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %ifarch %ix86 Provides: kernel-smp = 2.6.17 Obsoletes: kernel-smp <= 2.6.17 @@ -302,10 +302,6 @@ Obsoletes: kernel-ec2-base <= 4.4 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -387,10 +383,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -846,54 +838,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1262,14 +1206,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1324,13 +1295,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1389,10 +1383,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1555,29 +1574,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1596,29 +1621,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1637,29 +1668,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1693,29 +1730,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1735,29 +1778,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1776,29 +1825,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/kernel-docs.changes b/kernel-docs.changes index 2f790094..59ec6220 100644 --- a/kernel-docs.changes +++ b/kernel-docs.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-docs.spec b/kernel-docs.spec index 93f5ecd1..d90b19ab 100644 --- a/kernel-docs.spec +++ b/kernel-docs.spec @@ -33,7 +33,7 @@ License: GPL-2.0-only Group: Documentation/Man Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -64,15 +64,11 @@ BuildRequires: texlive-zapfding %endif Url: http://www.kernel.org/ Provides: %name = %version-%source_rel -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -140,10 +136,6 @@ Source121: sysctl.tar.bz2 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 diff --git a/kernel-kvmsmall.changes b/kernel-kvmsmall.changes index 2f790094..59ec6220 100644 --- a/kernel-kvmsmall.changes +++ b/kernel-kvmsmall.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-kvmsmall.spec b/kernel-kvmsmall.spec index 8f76e5e5..e780df0e 100644 --- a/kernel-kvmsmall.spec +++ b/kernel-kvmsmall.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,17 +243,13 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -335,10 +331,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -801,54 +793,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1217,14 +1161,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1262,13 +1233,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1310,10 +1304,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1452,29 +1471,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1493,29 +1518,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1534,29 +1565,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1590,29 +1627,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1632,29 +1675,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1673,29 +1722,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/kernel-lpae.changes b/kernel-lpae.changes index 2f790094..59ec6220 100644 --- a/kernel-lpae.changes +++ b/kernel-lpae.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-lpae.spec b/kernel-lpae.spec index e0ffc57f..9b2199b4 100644 --- a/kernel-lpae.spec +++ b/kernel-lpae.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,17 +243,13 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -335,10 +331,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -795,54 +787,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1211,14 +1155,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1250,13 +1221,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1292,10 +1286,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1434,29 +1453,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1475,29 +1500,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1516,29 +1547,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1572,29 +1609,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1614,29 +1657,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1655,29 +1704,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/kernel-module-subpackage b/kernel-module-subpackage index 61442ac6..6ba181ee 100644 --- a/kernel-module-subpackage +++ b/kernel-module-subpackage @@ -69,29 +69,26 @@ in_desc { print; good = 1 } END { exit(! good) } ' $spec ) +%pre -n %{-n*}-kmp-%1 +%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-pre --name "%{-n*}-kmp-%1" \ + --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ + --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %post -n %{-n*}-kmp-%1 -nvr=%{-n*}-kmp-%1-%_this_kmp_version-%{-r*} -wm2=/usr/lib/module-init-tools/weak-modules2 -if [ -x $wm2 ]; then - %{-b:KMP_NEEDS_MKINITRD=1} INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} $wm2 --add-kmp $nvr -fi -%posttrans -n %{-n*}-kmp-%1 -%{?regenerate_initrd_posttrans} +%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-post --name "%{-n*}-kmp-%1" \ + --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ + --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %preun -n %{-n*}-kmp-%1 -nvr=%{-n*}-kmp-%1-%_this_kmp_version-%{-r*} -rpm -ql $nvr | sed -n '/\.ko\(\.xz\|\.gz\|\.zst\)\?$/p' > /var/run/rpm-$nvr-modules +%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-preun --name "%{-n*}-kmp-%1" \ + --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ + --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %postun -n %{-n*}-kmp-%1 -nvr=%{-n*}-kmp-%1-%_this_kmp_version-%{-r*} -modules=( $(cat /var/run/rpm-$nvr-modules) ) -rm -f /var/run/rpm-$nvr-modules -if [ ${#modules[*]} = 0 ]; then - echo "WARNING: $nvr does not contain any kernel modules" >&2 - exit 0 -fi -wm2=/usr/lib/module-init-tools/weak-modules2 -if [ -x $wm2 ]; then - printf '%s\n' "${modules[@]}" | /bin/bash -${-/e/} $wm2 --remove-kmp $nvr -fi +%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-postun --name "%{-n*}-kmp-%1" \ + --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ + --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" +%posttrans -n %{-n*}-kmp-%1 +%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-posttrans --name "%{-n*}-kmp-%1" \ + --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ + --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %files -n %{-n*}-kmp-%1 %{-f:%{expand:%(cd %_sourcedir; cat %{-f*})}} %{!-f:%defattr (-,root,root)} diff --git a/kernel-obs-build.changes b/kernel-obs-build.changes index 2f790094..59ec6220 100644 --- a/kernel-obs-build.changes +++ b/kernel-obs-build.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-obs-build.spec b/kernel-obs-build.spec index af36f074..30976480 100644 --- a/kernel-obs-build.spec +++ b/kernel-obs-build.spec @@ -45,7 +45,7 @@ BuildRequires: util-linux %endif %endif %endif -BuildRequires: kernel%kernel_flavor-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +BuildRequires: kernel%kernel_flavor-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %if 0%{?rhel_version} BuildRequires: kernel @@ -66,7 +66,7 @@ License: GPL-2.0-only Group: SLES Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif diff --git a/kernel-obs-qa.changes b/kernel-obs-qa.changes index 2f790094..59ec6220 100644 --- a/kernel-obs-qa.changes +++ b/kernel-obs-qa.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-obs-qa.spec b/kernel-obs-qa.spec index 0566cbd7..b54340b2 100644 --- a/kernel-obs-qa.spec +++ b/kernel-obs-qa.spec @@ -38,7 +38,7 @@ License: GPL-2.0-only Group: SLES Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif diff --git a/kernel-pae.changes b/kernel-pae.changes index 2f790094..59ec6220 100644 --- a/kernel-pae.changes +++ b/kernel-pae.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-pae.spec b/kernel-pae.spec index fdaf7866..28f43ad5 100644 --- a/kernel-pae.spec +++ b/kernel-pae.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,10 +243,10 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %ifarch %ix86 Provides: kernel-bigsmp = 2.6.17 Obsoletes: kernel-bigsmp <= 2.6.17 @@ -272,10 +272,6 @@ Obsoletes: kernel-ec2-base <= 4.4 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -357,10 +353,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -823,54 +815,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1239,14 +1183,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1294,13 +1265,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1352,10 +1346,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1504,29 +1523,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1545,29 +1570,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1586,29 +1617,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1642,29 +1679,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1684,29 +1727,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1725,29 +1774,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/kernel-source.changes b/kernel-source.changes index 2f790094..59ec6220 100644 --- a/kernel-source.changes +++ b/kernel-source.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-source.spec b/kernel-source.spec index c7d72ba0..035b3729 100644 --- a/kernel-source.spec +++ b/kernel-source.spec @@ -32,7 +32,7 @@ License: GPL-2.0-only Group: Development/Sources Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -43,15 +43,11 @@ BuildRequires: fdupes BuildRequires: sed Requires(post): coreutils sed Provides: %name = %version-%source_rel -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 Provides: linux Provides: multiversion(kernel) Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches diff --git a/kernel-source.spec.in b/kernel-source.spec.in index 358892b0..8b57554e 100644 --- a/kernel-source.spec.in +++ b/kernel-source.spec.in @@ -48,10 +48,6 @@ Provides: linux Provides: multiversion(kernel) Source0: @TARBALL_URL@linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches diff --git a/kernel-subpackage-build b/kernel-subpackage-build index 93c2d696..bec9ee06 100644 --- a/kernel-subpackage-build +++ b/kernel-subpackage-build @@ -15,9 +15,10 @@ echo Ghost files: cat kernel-ghost.flist rpm -q --qf '%{PREIN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > prein.sh -rpm -q --qf '%{PREUN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > preun.sh rpm -q --qf '%{POSTIN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > postin.sh +rpm -q --qf '%{PREUN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > preun.sh rpm -q --qf '%{POSTUN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > postun.sh +rpm -q --qf '%{POSTTRANS}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > posttrans.sh [ -z "$(rpm -q --triggers $kernel_package_name)" ] # not handled diff --git a/kernel-subpackage-spec b/kernel-subpackage-spec index 3d277c32..78575090 100644 --- a/kernel-subpackage-spec +++ b/kernel-subpackage-spec @@ -83,14 +83,16 @@ There is no reason to install this package. echo "%{?modules}" | tr ', ' '\n\n' > request-modules %scriptdir/kernel-subpackage-build %kernel_package_name %rpm_kver-%rpm_krel %package_name-%version-%release -%preun -f preun.sh - -%postun -f postun.sh - %pre -f prein.sh %post -f postin.sh +%preun -f preun.sh + +%postun -f postun.sh + +%posttrans -f posttrans.sh + %files -f subpackage.flist %changelog diff --git a/kernel-syms.changes b/kernel-syms.changes index 2f790094..59ec6220 100644 --- a/kernel-syms.changes +++ b/kernel-syms.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-syms.spec b/kernel-syms.spec index 1f9c9043..e6a49f1c 100644 --- a/kernel-syms.spec +++ b/kernel-syms.spec @@ -27,7 +27,7 @@ Group: Development/Sources Version: 5.14.3 %if %using_buildservice %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -52,7 +52,7 @@ Requires: kernel-pae-devel = %version-%source_rel %endif Requires: pesign-obs-integration Provides: %name = %version-%source_rel -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 Provides: multiversion(kernel) Source: README.KSYMS Requires: kernel-devel%variant = %version-%source_rel diff --git a/kernel-vanilla.changes b/kernel-vanilla.changes index 2f790094..59ec6220 100644 --- a/kernel-vanilla.changes +++ b/kernel-vanilla.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-vanilla.spec b/kernel-vanilla.spec index 21fce560..a4798da7 100644 --- a/kernel-vanilla.spec +++ b/kernel-vanilla.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,17 +243,13 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -335,10 +331,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -794,54 +786,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1210,14 +1154,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1248,13 +1219,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1289,10 +1283,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1431,29 +1450,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1472,29 +1497,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1513,29 +1544,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1569,29 +1606,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1611,29 +1654,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1652,29 +1701,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/kernel-zfcpdump.changes b/kernel-zfcpdump.changes index 2f790094..59ec6220 100644 --- a/kernel-zfcpdump.changes +++ b/kernel-zfcpdump.changes @@ -87,6 +87,24 @@ Fri Sep 10 22:51:08 CEST 2021 - msuchanek@suse.de Fixes: d9a1357edd73 ("rpm: Define $certs as rpm macro (bsc#1189841).") - commit 8684de8 +------------------------------------------------------------------- +Fri Sep 10 17:03:10 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec.in Stop templating the scriptlets for subpackages + (bsc#1190358). + The script part for base package case is completely separate from the + part for subpackages. Remove the part for subpackages from the base + package script and use the KMP scripts for subpackages instead. +- commit 5d1f677 + +------------------------------------------------------------------- +Fri Sep 10 16:45:27 CEST 2021 - msuchanek@suse.de + +- kernel-binary.spec: Do not fail silently when KMP is empty + (bsc#1190358). + Copy the code from kernel-module-subpackage that deals with empty KMPs. +- commit d7d2e6e + ------------------------------------------------------------------- Fri Sep 10 12:17:08 CEST 2021 - ohering@suse.de @@ -347,6 +365,15 @@ Tue Aug 31 23:50:52 CEST 2021 - lduncan@suse.com No longer needed, since it's upstream now. - commit b1aeba4 +------------------------------------------------------------------- +Tue Aug 31 12:56:46 CEST 2021 - msuchanek@suse.de + +- rpm: Abolish scritplet templating (bsc#1189841). + Outsource kernel-binary and KMP scriptlets to suse-module-tools. + This allows fixing bugs in the scriptlets as well as defining initrd + regeneration policy independent of the kernel packages. +- commit e98096d + ------------------------------------------------------------------- Tue Aug 31 12:12:22 CEST 2021 - mbrugger@suse.com diff --git a/kernel-zfcpdump.spec b/kernel-zfcpdump.spec index 9fa48648..3d26b2fc 100644 --- a/kernel-zfcpdump.spec +++ b/kernel-zfcpdump.spec @@ -108,10 +108,8 @@ done ) %if 0%{?usrmerged} %define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor -%define systemmap %{modules_dir}/System.map %else %define modules_dir /lib/modules/%kernelrelease-%build_flavor -%define systemmap /boot/System.map-%kernelrelease-%build_flavor %endif @@ -121,7 +119,7 @@ License: GPL-2.0-only Group: System/Kernel Version: 5.14.3 %if 0%{?is_kotd} -Release: .g6b9975e +Release: .g6941a10 %else Release: 0 %endif @@ -175,6 +173,8 @@ Recommends: kernel-firmware %endif # The following is copied to the -base subpackage as well # BEGIN COMMON DEPS +Requires(pre): suse-kernel-rpm-scriptlets +Requires(post): suse-kernel-rpm-scriptlets Requires(pre): coreutils awk # For /usr/lib/module-init-tools/weak-modules2 Requires(post): suse-module-tools @@ -243,17 +243,13 @@ Conflicts: hyper-v < 4 Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 -Provides: kernel-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: kernel-%build_flavor-base-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 +Provides: kernel-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 # END COMMON DEPS -Provides: %name-srchash-6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +Provides: %name-srchash-6941a100dcdd77e74c130c223ff58cb543f86448 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source3: kernel-source.rpmlintrc -Source10: preun.sh -Source11: postun.sh -Source12: pre.sh -Source13: post.sh Source14: series.conf Source16: guards Source17: apply-patches @@ -335,10 +331,6 @@ BuildArch: i686 # These files are found in the kernel-source package: NoSource: 0 NoSource: 3 -NoSource: 10 -NoSource: 11 -NoSource: 12 -NoSource: 13 NoSource: 14 NoSource: 16 NoSource: 17 @@ -797,54 +789,6 @@ if test %CONFIG_MODULE_SIG = "y"; then done fi -for sub in '' '-extra' \ -%if %split_extra && %split_optional - '-optional' \ -%endif -; do - case "$sub" in - '') base_package=1 ;; - *) base_package=0 ;; - esac - for script in preun postun pre post; do - if test %build_flavor = "zfcpdump"; then - : >%my_builddir/$script$sub.sh - continue - fi - sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \ - -e "s:@IMAGE@:%image:g" \ - -e "s:@FLAVOR""@:%build_flavor:g" \ - -e "s:@SUBPACKAGE@:%name$sub:g" \ - -e "s:@BASE_PACKAGE@:$base_package:g" \ - -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \ - -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \ - -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \ - -e "s:@SRCVARIANT@:%variant:g" \ - -e "s:@MODULESDIR@:%modules_dir:g" \ - -e "s:@SYSTEMMAP@:%systemmap:g" \ -%if 0%{?usrmerged} - -e "s:^@USRMERGE@::" \ -%else - -e "/^@USRMERGE@/d" \ -%endif - %_sourcedir/$script.sh > %my_builddir/$script$sub.sh - if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then - case "$script" in - preun | postun | post) - # Copy the respective scriptlet from kernel-cert-subpackage - sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \ - %_sourcedir/kernel-cert-subpackage \ - >>"%my_builddir/$script$sub.sh" - esac - fi - # Do an exit 0 at the end of each scriptlet. If the last real command - # in the scriptlet (e.g. update-bootloader call, see bnc#809617) - # returns an error, we do not want to amplify the damage by leaving - # the system in an inconsistent state. - echo "exit 0" >>"%my_builddir/$script$sub.sh" - done -done - cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do @@ -1213,14 +1157,41 @@ fi # /usr/src/linux-obj intentionally, to not accidentally break timestamps there %fdupes %buildroot%modules_dir -%preun -f preun.sh - -%postun -f postun.sh - -%pre -f pre.sh - -%post -f post.sh - +%pre +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-pre --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%post +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-post --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%preun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-preun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%postun +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-postun --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif +%posttrans +%if "%build_flavor" != "zfcpdump" +/usr/lib/module-init-tools/kernel-scriptlets/rpm-posttrans --name "%name" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" +%endif %files -f kernel-main.files %defattr(-, root, root) @@ -1254,13 +1225,36 @@ This package contains additional modules not supported by SUSE. %source_timestamp -%preun extra -f preun-extra.sh -%postun extra -f postun-extra.sh +%pre extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%pre extra -f pre-extra.sh +%post extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%post extra -f post-extra.sh +%preun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans extra +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-extra" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %if %split_extra @@ -1298,10 +1292,35 @@ This package contains optional modules only for openSUSE Leap. %source_timestamp -%preun optional -f preun-optional.sh -%postun optional -f postun-optional.sh -%pre optional -f pre-optional.sh -%post optional -f post-optional.sh +%pre optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%post optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%preun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%postun optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans optional +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "%name-optional" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files optional -f kernel-optional.files %defattr(-, root, root) @@ -1440,29 +1459,35 @@ Clustering support for MD devices. This enables locking and synchronization across multiple systems on the cluster, so all nodes in the cluster can access the MD devices simultaneously. -%post -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n cluster-md-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n cluster-md-kmp-%build_flavor -nvr=cluster-md-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n cluster-md-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=cluster-md-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n cluster-md-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "cluster-md-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n cluster-md-kmp-%build_flavor -f cluster-md-kmp.files %defattr(-, root, root) @@ -1481,29 +1506,35 @@ Requires(post): suse-module-tools >= 12.4 DLM stands for Distributed Lock Manager, a means to synchronize access to shared resources over the cluster. -%post -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n dlm-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n dlm-kmp-%build_flavor -nvr=dlm-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n dlm-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=dlm-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n dlm-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "dlm-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n dlm-kmp-%build_flavor -f dlm-kmp.files %defattr(-, root, root) @@ -1522,29 +1553,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release %description -n gfs2-kmp-%build_flavor GFS2 is Global Filesystem, a shared device filesystem. -%post -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n gfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n gfs2-kmp-%build_flavor -nvr=gfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n gfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=gfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n gfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "gfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n gfs2-kmp-%build_flavor -f gfs2-kmp.files %defattr(-, root, root) @@ -1578,29 +1615,35 @@ reproduced, verified and corrected. Selftest drivers are intended to be supported only in testing and QA environments, they are not intended to be run on production systems. -%post -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n kselftests-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n kselftests-kmp-%build_flavor -nvr=kselftests-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n kselftests-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=kselftests-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n kselftests-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "kselftests-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n kselftests-kmp-%build_flavor -f kselftests-kmp.files %defattr(-, root, root) @@ -1620,29 +1663,35 @@ Requires: dlm-kmp-%build_flavor = %version-%release OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices accessible simultaneously from multiple nodes of a cluster. -%post -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n ocfs2-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n ocfs2-kmp-%build_flavor -nvr=ocfs2-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n ocfs2-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=ocfs2-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n ocfs2-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "ocfs2-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n ocfs2-kmp-%build_flavor -f ocfs2-kmp.files %defattr(-, root, root) @@ -1661,29 +1710,35 @@ Requires(post): suse-module-tools >= 12.4 The reiserfs file system is no longer supported in SLE15. This package provides the reiserfs module for the installation system. -%post -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - rpm -ql "$nvr" | INITRD_IN_POSTTRANS=1 /bin/bash -${-/e/} "$wm2" \ - --add-kernel-modules %kernelrelease-%build_flavor -fi +%pre -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-pre --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" -%posttrans -n reiserfs-kmp-%build_flavor -%{?regenerate_initrd_posttrans} +%post -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-post --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %preun -n reiserfs-kmp-%build_flavor -nvr=reiserfs-kmp-%build_flavor-%version-%release -rpm -ql "$nvr" | grep '\.ko\(\.xz\|\.gz\|\.zst\)\?$' > "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-preun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %postun -n reiserfs-kmp-%build_flavor -wm2=/usr/lib/module-init-tools/weak-modules2 -nvr=reiserfs-kmp-%build_flavor-%version-%release -if test -x "$wm2"; then - /bin/bash -${-/e/} "$wm2" < "/var/run/rpm-$nvr-modules" \ - --remove-kernel-modules %kernelrelease-%build_flavor -fi -rm -f "/var/run/rpm-$nvr-modules" +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-postun --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" + +%posttrans -n reiserfs-kmp-%build_flavor +/usr/lib/module-init-tools/kernel-scriptlets/inkmp-posttrans --name "reiserfs-kmp-%build_flavor" \ + --version "%version" --release "%release" --kernelrelease "%kernelrelease" \ + --image "%image" --flavor "%build_flavor" --variant "%variant" \ + --usrmerged "0%{?usrmerged}" --certs "%certs" "$@" %files -n reiserfs-kmp-%build_flavor -f reiserfs-kmp.files %defattr(-, root, root) diff --git a/source-timestamp b/source-timestamp index 07e21b99..432843b2 100644 --- a/source-timestamp +++ b/source-timestamp @@ -1,3 +1,3 @@ -2021-09-13 10:44:25 +0000 -GIT Revision: 6b9975ed199835e6b9c21a0a33ed5f88f5f7a543 +2021-09-14 20:21:52 +0000 +GIT Revision: 6941a100dcdd77e74c130c223ff58cb543f86448 GIT Branch: stable