Clean up deps and scriptlets

* the kernel may work OK without WiFi and firmware stuff, make it easy to uninstall it (e.g. when trying to save disk space in a VM)
* sysfsutils is not used in scriptlets, remove it
* symlinks vmlinuz-%{flavour} and initrd-%{flavour}.img have not existed for ages, they were removed lots of time ago in ROSA, there is no sense in trying to delete what does not exist and is never created
This commit is contained in:
Mikhail Novosyolov 2020-12-27 23:46:32 +03:00
parent 5c184f0011
commit 9c1919cb5b

View file

@ -24,7 +24,7 @@
%define sublevel 3 %define sublevel 3
# Release number. Increase this before a rebuild. # Release number. Increase this before a rebuild.
%define rpmrel 1 %define rpmrel 2
%define fullrpmrel %{rpmrel} %define fullrpmrel %{rpmrel}
%define rpmtag %{disttag} %define rpmtag %{disttag}
@ -425,19 +425,17 @@ Provides: kernel-hardened-%{flavour} = %{kverrel}
Provides: alsa = 1.0.27 Provides: alsa = 1.0.27
Provides: should-restart = system Provides: should-restart = system
Requires(pre): grub2 Requires(post): dracut
Requires(pre): dracut >= 046 Requires(post): kmod
Requires(pre): kmod >= 20-1 # Usually necessary, but sometimes user may want to not install them
Requires(pre): sysfsutils >= 2.1.0-12 Recommends: linux-firmware
Requires: dracut >= 046 Recommends: wireless-regdb
Requires: linux-firmware >= 20181026 Recommends: crda
Requires: wireless-regdb
%if %{with flow_abi} %if %{with flow_abi}
Requires: kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi Requires: kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
%endif %endif
Recommends: crda
# Set BFQ as default scheduler for HDDs # Set BFQ as default scheduler for HDDs
# https://www.phoronix.com/scan.php?page=article&item=linux-50hdd-io # https://www.phoronix.com/scan.php?page=article&item=linux-50hdd-io
Recommends: udev-rules-ioschedulers Recommends: udev-rules-ioschedulers
@ -481,35 +479,6 @@ input and output, etc. This is a general-purpose kernel.
# File triggers from grub packages will handle this. # File triggers from grub packages will handle this.
#/usr/sbin/update-grub2 #/usr/sbin/update-grub2
pushd /boot > /dev/null
if [ -L vmlinuz-%{flavour} ]; then
rm -f vmlinuz-%{flavour}
fi
if [ -L initrd-%{flavour}.img ]; then
rm -f initrd-%{flavour}.img
fi
popd > /dev/null
exit 0
%preun -n kernel-%{flavour}-%{buildrel}
pushd /boot > /dev/null
if [ -L vmlinuz-%{flavour} ]; then
if [ "$(readlink vmlinuz-%{flavour})" = "vmlinuz-%{kver_full}" ]; then
rm -f vmlinuz-%{flavour}
fi
fi
if [ -L initrd-%{flavour}.img ]; then
if [ "$(readlink initrd-%{flavour}.img)" = "initrd-%{kver_full}.img" ]; then
rm -f initrd-%{flavour}.img
fi
fi
# File triggers from grub packages will handle this.
#/usr/sbin/update-grub2
popd > /dev/null
exit 0
%postun -n kernel-%{flavour}-%{buildrel} %postun -n kernel-%{flavour}-%{buildrel}
rm -f /boot/initrd-%{kver_full}.img rm -f /boot/initrd-%{kver_full}.img
rm -f /boot/initrd-%{kver_full}_old.img rm -f /boot/initrd-%{kver_full}_old.img