2012-11-23 16:19:32 +01:00
|
|
|
#
|
|
|
|
# spec file for package suse-module-tools
|
|
|
|
#
|
2021-04-22 19:23:42 +02:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2012-11-23 16:19:32 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-10-26 16:41:41 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-11-23 16:19:32 +01:00
|
|
|
#
|
|
|
|
|
2021-07-02 11:37:20 +02:00
|
|
|
# Location for modprobe and depmod .conf files
|
|
|
|
#
|
|
|
|
# This assumes post-usr-merge (20210527) for Tumbleweed
|
|
|
|
%global modprobe_dir /usr/lib/modprobe.d
|
|
|
|
%global depmod_dir /usr/lib/depmod.d
|
2021-08-19 13:41:18 +02:00
|
|
|
%global with_kernel_sysctl 1
|
|
|
|
# boot_sysctl may be dropped on TW when we can assume that nobody keeps
|
|
|
|
# kernel packages around that store sysctl files under /boot
|
|
|
|
%bcond_without boot_sysctl
|
|
|
|
%global sysctl_dropin %{_unitdir}/systemd-sysctl.service.d/50-kernel-uname_r.conf
|
|
|
|
%global systemd_units %{?with_boot_sysctl:boot-sysctl.service} %{?with_kernel_sysctl:kernel-sysctl.service}
|
2019-06-14 18:06:06 +02:00
|
|
|
|
2019-02-13 17:58:42 +01:00
|
|
|
# List of legacy file systems to be blacklisted by default
|
2023-12-18 21:13:58 +01:00
|
|
|
%global fs_blacklist adfs affs bfs befs cramfs efs erofs exofs f2fs freevxfs hfs hfsplus hpfs jffs2 jfs kafs minix nilfs2 ntfs ntfs3 omfs orangefs pstore qnx4 qnx6 reiserfs romfs sysv ufs zonefs
|
2019-02-13 17:58:42 +01:00
|
|
|
|
2021-07-02 11:37:20 +02:00
|
|
|
# List of all files installed under modprobe.d
|
|
|
|
# Note: this list contains files installed by previous versions, like 00-system-937216.conf!
|
|
|
|
%global modprobe_conf_files 00-system 00-system-937216 10-unsupported-modules 50-blacklist 60-blacklist_fs-* 99-local
|
|
|
|
%global modprobe_conf_rpmsave %(echo "%{modprobe_conf_files}" | sed 's,\\([^ ]*\\),%{_sysconfdir}/modprobe.d/\\1.conf.rpmsave,g')
|
2020-01-15 22:13:20 +01:00
|
|
|
|
2012-11-23 16:19:32 +01:00
|
|
|
Name: suse-module-tools
|
2023-12-18 21:13:58 +01:00
|
|
|
Version: 16.0.40
|
2012-11-23 16:19:32 +01:00
|
|
|
Release: 0
|
2017-06-19 15:16:47 +02:00
|
|
|
Summary: Configuration for module loading and SUSE-specific utilities for KMPs
|
2018-10-26 16:41:41 +02:00
|
|
|
License: GPL-2.0-or-later
|
2017-06-19 15:16:47 +02:00
|
|
|
Group: System/Base
|
2020-01-09 13:32:49 +01:00
|
|
|
URL: https://github.com/openSUSE/suse-module-tools
|
2017-06-19 15:16:47 +02:00
|
|
|
Source0: %{name}-%{version}.tar.xz
|
2018-11-05 21:53:40 +01:00
|
|
|
Source1: %{name}.rpmlintrc
|
2021-08-20 11:07:04 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
2020-08-25 17:45:58 +02:00
|
|
|
Requires: /usr/bin/grep
|
|
|
|
Requires: /usr/bin/gzip
|
|
|
|
Requires: /usr/bin/sed
|
2018-10-26 19:17:37 +02:00
|
|
|
Requires: coreutils
|
2016-02-23 15:09:56 +01:00
|
|
|
Requires: findutils
|
2021-07-02 11:37:20 +02:00
|
|
|
Requires: systemd-rpm-macros
|
2018-10-26 19:17:37 +02:00
|
|
|
Requires: rpm
|
2020-08-25 17:45:58 +02:00
|
|
|
Requires(post): /usr/bin/grep
|
|
|
|
Requires(post): /usr/bin/sed
|
|
|
|
Requires(post): coreutils
|
2021-11-09 11:35:47 +01:00
|
|
|
Provides: udev-extra-rules = 0.3.0
|
|
|
|
Obsoletes: udev-extra-rules < 0.3.0
|
|
|
|
Provides: system-tuning-common-SUSE = 0.3.0
|
|
|
|
Obsoletes: system-tuning-common-SUSE < 0.3.0
|
2021-05-27 13:10:39 +02:00
|
|
|
# Use weak dependencies for dracut and kmod in order to
|
2019-01-30 18:01:31 +01:00
|
|
|
# keep Ring0 lean. In normal deployments, these packages
|
|
|
|
# will be available anyway.
|
2021-05-27 13:10:39 +02:00
|
|
|
Recommends: dracut
|
2019-01-30 18:01:31 +01:00
|
|
|
Recommends: kmod
|
2021-05-27 13:10:39 +02:00
|
|
|
# This release requires the dracut module 90nvdimm
|
|
|
|
Conflicts: dracut < 49.1
|
2021-07-02 11:37:20 +02:00
|
|
|
# TW: conflict with pre-usrmerge
|
2023-08-15 18:33:53 +02:00
|
|
|
Conflicts: filesystem < 16
|
2012-11-23 16:19:32 +01:00
|
|
|
|
|
|
|
%description
|
2018-12-12 08:57:48 +01:00
|
|
|
This package contains helper scripts for KMP installation and
|
2012-11-23 16:19:32 +01:00
|
|
|
uninstallation, as well as default configuration files for depmod and
|
2021-09-14 16:24:15 +02:00
|
|
|
modprobe.
|
2012-11-23 16:19:32 +01:00
|
|
|
|
2021-06-17 16:20:57 +02:00
|
|
|
|
2022-11-29 17:15:14 +01:00
|
|
|
%package scriptlets
|
|
|
|
Summary: Kernel rpm scriptlets
|
|
|
|
Provides: suse-kernel-rpm-scriptlets = 0
|
|
|
|
Requires: suse-module-tools = %{version}
|
|
|
|
Provides: suse-module-tools:/usr/lib/module-init-tools/kernel-scriptlets
|
|
|
|
|
|
|
|
%description scriptlets
|
|
|
|
Scripts called by the SUSE kernel packages on installation
|
|
|
|
|
2012-11-23 16:19:32 +01:00
|
|
|
%prep
|
2017-06-19 15:16:47 +02:00
|
|
|
%setup -q
|
2012-11-23 16:19:32 +01:00
|
|
|
|
|
|
|
%build
|
2021-07-02 11:37:20 +02:00
|
|
|
sed -i 's/@FS_BLACKLIST@.*/%{fs_blacklist}/' README.md
|
2012-11-23 16:19:32 +01:00
|
|
|
|
|
|
|
%install
|
2021-07-02 11:37:20 +02:00
|
|
|
install -d -m 755 "%{buildroot}%{modprobe_dir}"
|
2017-06-19 15:16:47 +02:00
|
|
|
install -d -m 755 "%{buildroot}%{_sysconfdir}/modprobe.d"
|
2022-01-28 22:01:59 +01:00
|
|
|
|
2021-12-06 10:09:17 +01:00
|
|
|
install -pm644 -t "%{buildroot}%{modprobe_dir}" modprobe.conf/common/*.conf
|
|
|
|
if [ -d modprobe.conf/%{_arch} ]; then
|
|
|
|
install -pm644 -t "%{buildroot}%{modprobe_dir}" modprobe.conf/%{_arch}/*.conf
|
|
|
|
fi
|
|
|
|
%ifarch i386
|
|
|
|
install -pm644 -t "%{buildroot}%{modprobe_dir}" modprobe.conf/x86_64/*.conf
|
|
|
|
%endif
|
|
|
|
%ifarch ppc64le
|
|
|
|
install -pm644 -t "%{buildroot}%{modprobe_dir}" modprobe.conf/ppc64/*.conf
|
2019-01-30 18:01:31 +01:00
|
|
|
%endif
|
2021-12-06 10:09:17 +01:00
|
|
|
|
2021-07-02 11:37:20 +02:00
|
|
|
install -d -m 755 "%{buildroot}/%{depmod_dir}"
|
2017-06-19 15:16:47 +02:00
|
|
|
install -d -m 755 "%{buildroot}%{_sysconfdir}/depmod.d"
|
2021-07-02 11:37:20 +02:00
|
|
|
install -pm 644 "depmod-00-system.conf" "%{buildroot}%{depmod_dir}/00-system.conf"
|
2012-11-23 16:19:32 +01:00
|
|
|
|
2023-03-15 16:22:22 +01:00
|
|
|
# "/usr/lib/module-init-tools" name hardcoded in other packages
|
2019-11-07 21:40:04 +01:00
|
|
|
install -d -m 755 "%{buildroot}/usr/lib/module-init-tools"
|
2021-07-02 11:37:20 +02:00
|
|
|
install -pm 755 -t "%{buildroot}/usr/lib/module-init-tools/" \
|
2023-10-25 21:58:44 +02:00
|
|
|
weak-modules2 driver-check.sh unblacklist lsinitrd-quick get_dracut_drivers
|
2019-11-07 21:40:04 +01:00
|
|
|
install -pm 755 "regenerate-initrd-posttrans" "%{buildroot}/usr/lib/module-init-tools/"
|
2021-09-14 16:24:15 +02:00
|
|
|
install -d -m 755 "%{buildroot}/usr/lib/module-init-tools/kernel-scriptlets"
|
|
|
|
install -pm 755 "kernel-scriptlets/cert-script" "%{buildroot}/usr/lib/module-init-tools/kernel-scriptlets"
|
|
|
|
install -pm 755 "kernel-scriptlets/inkmp-script" "%{buildroot}/usr/lib/module-init-tools/kernel-scriptlets"
|
|
|
|
install -pm 755 "kernel-scriptlets/kmp-script" "%{buildroot}/usr/lib/module-init-tools/kernel-scriptlets"
|
|
|
|
install -pm 755 "kernel-scriptlets/rpm-script" "%{buildroot}/usr/lib/module-init-tools/kernel-scriptlets"
|
|
|
|
for i in "pre" "preun" "post" "posttrans" "postun" ; do
|
|
|
|
ln -s cert-script %{buildroot}/usr/lib/module-init-tools/kernel-scriptlets/cert-$i
|
|
|
|
ln -s inkmp-script %{buildroot}/usr/lib/module-init-tools/kernel-scriptlets/inkmp-$i
|
|
|
|
ln -s kmp-script %{buildroot}/usr/lib/module-init-tools/kernel-scriptlets/kmp-$i
|
|
|
|
ln -s rpm-script %{buildroot}/usr/lib/module-init-tools/kernel-scriptlets/rpm-$i
|
|
|
|
done
|
2014-04-09 11:56:47 +02:00
|
|
|
|
2017-06-19 15:16:47 +02:00
|
|
|
install -d -m 755 "%{buildroot}%{_prefix}/bin"
|
2014-03-12 14:45:04 +01:00
|
|
|
|
2021-08-19 13:41:18 +02:00
|
|
|
# systemd service(s) to load kernel-specific sysctl settings
|
2019-11-07 21:40:04 +01:00
|
|
|
install -d -m 755 "%{buildroot}%{_unitdir}/systemd-sysctl.service.d"
|
2021-08-19 13:41:18 +02:00
|
|
|
echo '[Unit]' >"%{buildroot}%{sysctl_dropin}"
|
|
|
|
%if %{with kernel_sysctl}
|
2022-06-02 12:58:58 +02:00
|
|
|
install -pm 644 kernel-sysctl.service "%{buildroot}%{_unitdir}"
|
2021-08-19 13:41:18 +02:00
|
|
|
echo 'Wants=kernel-sysctl.service' >>"%{buildroot}%{sysctl_dropin}"
|
|
|
|
%endif
|
|
|
|
%if %{with boot_sysctl}
|
2022-06-02 12:58:58 +02:00
|
|
|
install -pm 644 boot-sysctl.service "%{buildroot}%{_unitdir}"
|
2021-08-19 13:41:18 +02:00
|
|
|
echo 'Wants=boot-sysctl.service' >>"%{buildroot}%{sysctl_dropin}"
|
|
|
|
%endif
|
2018-11-02 21:35:11 +01:00
|
|
|
|
2021-07-02 11:37:20 +02:00
|
|
|
install -d -m 755 "%{buildroot}%{_modulesloaddir}"
|
2023-10-27 17:49:25 +02:00
|
|
|
for _x in modules-load.d/*.conf; do
|
|
|
|
[ -e "$_x" ] || continue
|
|
|
|
install -pm 644 -t "%{buildroot}%{_modulesloaddir}" "$_x"
|
|
|
|
done
|
2022-06-02 12:58:58 +02:00
|
|
|
|
2021-05-27 13:10:39 +02:00
|
|
|
%ifarch ppc64 ppc64le
|
2020-11-04 21:33:48 +01:00
|
|
|
install -d -m 755 %{buildroot}/usr/lib/systemd/system-generators
|
2022-06-02 12:58:58 +02:00
|
|
|
install -pm 755 udev-trigger-generator %{buildroot}/usr/lib/systemd/system-generators
|
2020-11-04 21:33:48 +01:00
|
|
|
%endif
|
2018-11-02 21:35:11 +01:00
|
|
|
|
2021-11-09 11:35:47 +01:00
|
|
|
# udev rules (formerly system-tuning-common-SUSE, udev-extra-rules)
|
2021-11-09 14:46:24 +01:00
|
|
|
install -d -m 755 %{buildroot}%{_udevrulesdir}
|
2022-06-02 12:58:58 +02:00
|
|
|
install -pm 644 udevrules/*.rules %{buildroot}%{_udevrulesdir}
|
2021-11-09 11:35:47 +01:00
|
|
|
|
2018-11-02 21:35:11 +01:00
|
|
|
mkdir -p %{buildroot}%{_defaultlicensedir}
|
2016-05-09 10:35:02 +02:00
|
|
|
|
2019-02-13 17:58:42 +01:00
|
|
|
for mod in %{fs_blacklist}; do
|
|
|
|
echo "\
|
2021-07-02 11:37:20 +02:00
|
|
|
# DO NOT EDIT THIS FILE!
|
|
|
|
#
|
2019-02-13 17:58:42 +01:00
|
|
|
# The $mod file system is blacklisted by default because it isn't actively
|
2023-08-15 18:33:53 +02:00
|
|
|
# supported by SUSE.
|
2019-02-13 17:58:42 +01:00
|
|
|
blacklist $mod
|
2021-07-02 11:37:20 +02:00
|
|
|
# The filesystem can be un-blacklisted by running \"modprobe $mod\".
|
|
|
|
# See README.md in the %{name} package for details.
|
|
|
|
install $mod /usr/lib/module-init-tools/unblacklist $mod; /sbin/modprobe --ignore-install $mod
|
|
|
|
" \
|
|
|
|
>%{buildroot}%{modprobe_dir}/60-blacklist_fs-"$mod".conf
|
2019-02-13 17:58:42 +01:00
|
|
|
done
|
|
|
|
|
2021-07-02 11:37:20 +02:00
|
|
|
%pre
|
2021-08-19 13:41:18 +02:00
|
|
|
%service_add_pre %{systemd_units}
|
2021-07-02 11:37:20 +02:00
|
|
|
# Avoid restoring old .rpmsave files in %posttrans
|
|
|
|
for f in %{modprobe_conf_rpmsave}; do
|
|
|
|
if [ -f ${f} ]; then
|
|
|
|
mv -f ${f} ${f}.%{name}
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -f %{_sysconfdir}/depmod.d/00-system.conf.rpmsave ]; then
|
|
|
|
mv -f %{_sysconfdir}/depmod.d/00-system.conf.rpmsave \
|
|
|
|
%{_sysconfdir}/depmod.d/00-system.conf.rpmsave.%{name}
|
2018-10-26 19:17:37 +02:00
|
|
|
fi
|
2021-07-02 11:37:20 +02:00
|
|
|
exit 0
|
|
|
|
|
2021-08-19 13:41:18 +02:00
|
|
|
%post
|
2021-11-09 11:35:47 +01:00
|
|
|
%udev_rules_update
|
2021-08-19 13:41:18 +02:00
|
|
|
%service_add_post %{systemd_units}
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun %{systemd_units}
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%postun
|
2021-11-09 11:35:47 +01:00
|
|
|
%udev_rules_update
|
2021-08-19 13:41:18 +02:00
|
|
|
%service_del_postun_without_restart %{systemd_units}
|
|
|
|
exit 0
|
|
|
|
|
2021-07-02 11:37:20 +02:00
|
|
|
%posttrans
|
|
|
|
# If the user had modified any of the configuration files installed under
|
|
|
|
# /etc, they'll now be renamed to .rpmsave files. Restore them.
|
|
|
|
for f in %{modprobe_conf_rpmsave}; do
|
|
|
|
if [ -f ${f} ]; then
|
|
|
|
mv -fv ${f} ${f%.rpmsave}
|
|
|
|
fi
|
2019-02-13 17:58:42 +01:00
|
|
|
done
|
2021-07-02 11:37:20 +02:00
|
|
|
if [ -f %{_sysconfdir}/depmod.d/00-system.conf.rpmsave ]; then
|
|
|
|
mv -fv %{_sysconfdir}/depmod.d/00-system.conf.rpmsave \
|
|
|
|
%{_sysconfdir}/depmod.d/00-system.conf
|
|
|
|
fi
|
|
|
|
exit 0
|
2019-02-13 17:58:42 +01:00
|
|
|
|
2012-11-23 16:19:32 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2018-11-02 21:35:11 +01:00
|
|
|
|
2018-10-26 19:17:37 +02:00
|
|
|
%license LICENSE
|
2021-07-02 11:37:20 +02:00
|
|
|
%doc README.md
|
|
|
|
%{modprobe_dir}
|
2017-06-19 15:16:47 +02:00
|
|
|
%dir %{_sysconfdir}/modprobe.d
|
2021-07-02 11:37:20 +02:00
|
|
|
%{depmod_dir}
|
2017-06-19 15:16:47 +02:00
|
|
|
%dir %{_sysconfdir}/depmod.d
|
2022-11-29 17:15:14 +01:00
|
|
|
%dir /usr/lib/module-init-tools
|
|
|
|
/usr/lib/module-init-tools/driver-check.sh
|
|
|
|
/usr/lib/module-init-tools/lsinitrd-quick
|
|
|
|
/usr/lib/module-init-tools/unblacklist
|
|
|
|
/usr/lib/module-init-tools/weak-modules2
|
2023-10-25 21:58:44 +02:00
|
|
|
/usr/lib/module-init-tools/get_dracut_drivers
|
2021-08-19 13:41:18 +02:00
|
|
|
%{_unitdir}/*.service
|
2019-11-07 21:40:04 +01:00
|
|
|
%{_unitdir}/systemd-sysctl.service.d
|
2021-07-02 11:37:20 +02:00
|
|
|
%{_modulesloaddir}
|
2021-11-09 14:46:24 +01:00
|
|
|
%{_udevrulesdir}
|
2021-06-10 10:48:04 +02:00
|
|
|
%ifarch ppc64 ppc64le
|
2020-11-04 21:33:48 +01:00
|
|
|
/usr/lib/systemd/system-generators
|
|
|
|
%endif
|
2022-11-29 17:15:14 +01:00
|
|
|
#
|
|
|
|
%files scriptlets
|
|
|
|
/usr/lib/module-init-tools/kernel-scriptlets
|
2023-09-05 21:12:13 +02:00
|
|
|
/usr/lib/module-init-tools/regenerate-initrd-posttrans
|
2022-11-29 17:15:14 +01:00
|
|
|
|
2012-11-23 16:19:32 +01:00
|
|
|
%changelog
|