mirror of
https://abf.rosa.ru/djam/kernel-6.1.git
synced 2025-02-24 15:52:54 +00:00
Remove stale initrd images
This commit is contained in:
parent
ba72441225
commit
ae6ea95100
1 changed files with 12 additions and 1 deletions
13
kernel.spec
13
kernel.spec
|
@ -29,7 +29,7 @@
|
|||
%define rpmrel %mkrel 0.%{kpatch}.%{mibrel}
|
||||
%endif
|
||||
%else
|
||||
%define rpmrel 3
|
||||
%define rpmrel 4
|
||||
%endif
|
||||
|
||||
# fakerel and fakever never change, they are used to fool
|
||||
|
@ -1422,6 +1422,17 @@ for ii in \$(/usr/sbin/dkms status -k $KernelVer | awk '{ print \$1 \$2; }'); do
|
|||
ver=\$(echo \$ii | awk -v FS=',' '{ print \$2; }')
|
||||
/usr/sbin/dkms --rpm_safe_upgrade uninstall -m \$mod -v \$ver -k $KernelVer || true
|
||||
done
|
||||
|
||||
# If any DKMS modules with REMAKE_INITRD=yes in their configs have been
|
||||
# uninstalled, initrd has been regenerated for the given kernel. However,
|
||||
# the kernel itself might have been uninstalled before, so that (defunct)
|
||||
# initrd image files would be left behind. Remove them if the kernel itself
|
||||
# is no longer installed. Should work if they are ininstalled in parallel
|
||||
# too.
|
||||
if ! test -f /boot/vmlinuz-$KernelVer; then
|
||||
rm -f /boot/initrd-$KernelVer.img
|
||||
rm -f /boot/initrd-$KernelVer_old.img
|
||||
fi
|
||||
EOF
|
||||
|
||||
### Create -devel Postun script on the fly
|
||||
|
|
Loading…
Add table
Reference in a new issue