restore --bindir=%{_sbindir} to fix major boot problems with systemd [release 28-3mamba;Thu Apr 22 2021]

This commit is contained in:
Silvan Calarco 2024-01-06 02:12:01 +01:00
parent cdf2225e48
commit 899592c156

View File

@ -1,6 +1,6 @@
Name: kmod
Version: 28
Release: 1mamba
Release: 3mamba
Summary: Utilities for Linux kernel module handling
Group: System/Kernel and Hardware
Vendor: openmamba
@ -13,17 +13,20 @@ Patch1: kmod-13-arm-revert-add-finit_module-logic.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: liblzma-devel
BuildRequires: libopenssl-devel
BuildRequires: libz-devel
BuildRequires: libzstd-devel
## AUTOBUILDREQ-END
Requires: libkmod = %{?epoch:%epoch:}%{version}-%{release}
Provides: module-init-tools
Obsoletes: module-init-tools
Obsoletes: module-init-tools < 28
# Compatibility stuff
Provides: init_tools
Provides: modutils
Obsoletes: modutils
Obsoletes: modutils < 28
Provides: klibc-module-init-tools
Obsoletes: klibc-module-init-tools
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Obsoletes: klibc-module-init-tools < 28
%description
kmod is a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases.
@ -42,11 +45,11 @@ Group: Development/Libraries
Summary: Development files for libkmod
Requires: libkmod = %{?epoch:%epoch:}%{version}-%{release}
%debug_package
%description -n libkmod-devel
This package contains libraries and header files for developing applications that use libkmod.
%debug_package
%prep
%setup -q
#%patch0 -p1
@ -57,8 +60,11 @@ cp libkmod/README README.libkmod
%build
%configure \
--bindir=/sbin \
--with-rootlibdir=/%{_lib} \
--bindir=%{_sbindir} \
--with-xz \
--with-zlib \
--with-zstd \
--with-openssl \
--enable-debug
# --with-zlib
@ -69,17 +75,18 @@ cp libkmod/README README.libkmod
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
# add symlinks to kmod
cd %{buildroot}/sbin
for tool in depmod insmod lsmod rmmod modinfo modprobe; do
ln -s kmod ${tool}
done
install -d %{buildroot}%{_bindir}
ln -s /sbin/kmod %{buildroot}%{_bindir}/lsmod
install -d %{buildroot}%{_sysconfdir}/modprobe.d
install -d %{buildroot}%{_sysconfdir}/depmod.d
install -d %{buildroot}/lib/modprobe.d
install -d %{buildroot}%{_prefix}/lib/depmod.d
## add symlinks to kmod
for tool in depmod insmod lsmod rmmod modinfo modprobe; do
ln -s kmod %{buildroot}%{_sbindir}/${tool}
done
# legacy symlink for systemd-kmod service
ln -s ../sbin/kmod %{buildroot}%{_bindir}/lsmod
# we have a .pc file for people to use
rm -f %{buildroot}%{_libdir}/libkmod.la
@ -90,19 +97,32 @@ rm -f %{buildroot}%{_libdir}/libkmod.la
%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig
%posttrans
# Migrate /lib/modprobe.d to /usr/lib/modprobe.d
[ ! -L /lib -a ! -L /lib/modprobe.d ] && {
for f in /lib/modprobe.d/*; do
mv $f /usr/lib/modprobe.d/
done
rmdir /lib/modprobe.d || mv /lib/modprobe.d /lib/modprobe.d.notmigrated
ln -s ../usr/lib/modprobe.d /lib/modprobe.d
ln -s ../usr/lib/depmod.d /lib/depmod.d
}
:
%files
%defattr(-,root,root)
%dir %{_sysconfdir}/depmod.d
%dir %{_sysconfdir}/modprobe.d
/sbin/kmod
/sbin/depmod
/sbin/insmod
/sbin/lsmod
/sbin/modinfo
/sbin/modprobe
/sbin/rmmod
%{_bindir}/lsmod
%dir /lib/modprobe.d
%{_sbindir}/kmod
%{_sbindir}/depmod
%{_sbindir}/insmod
%{_sbindir}/lsmod
%{_sbindir}/modinfo
%{_sbindir}/modprobe
%{_sbindir}/rmmod
%{_sbindir}/lsmod
%dir %{_prefix}/lib/depmod.d
%{_datadir}/bash-completion/completions/kmod
%{_mandir}/man5/depmod.d.*
%{_mandir}/man5/modprobe.d.*
@ -114,11 +134,11 @@ rm -f %{buildroot}%{_libdir}/libkmod.la
%{_mandir}/man8/modinfo.*
%{_mandir}/man8/modprobe.*
%{_mandir}/man8/rmmod.*
%doc COPYING
%files -n lib%{name}
%defattr(-,root,root)
/%{_lib}/libkmod.so.*
%{_libdir}/libkmod.so.*
%doc COPYING
%files -n lib%{name}-devel
%defattr(-,root,root)
@ -128,6 +148,14 @@ rm -f %{buildroot}%{_libdir}/libkmod.la
%doc NEWS README TODO README.libkmod
%changelog
* Thu Apr 22 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 28-3mamba
- restore --bindir=%{_sbindir} to fix major boot problems with systemd
* Wed Apr 21 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 28-2mamba
- rebuilt in flat /usr filesystem
- migrate /lib/modprobe.d to /usr/lib/modprobe.d and add symlink
- add configure options
* Fri Jan 08 2021 Automatic Build System <autodist@mambasoft.it> 28-1mamba
- automatic version update by autodist