From 8a0a5fc3c6f60a4b5e1c0647f71260b33941d392 Mon Sep 17 00:00:00 2001 From: Peter Georg Date: Aug 09 2021 07:47:43 +0000 Subject: Rebuild initramfs --- diff --git a/SPECS/kmod-aacraid.spec b/SPECS/kmod-aacraid.spec index 238361e..664d920 100644 --- a/SPECS/kmod-aacraid.spec +++ b/SPECS/kmod-aacraid.spec @@ -67,6 +67,9 @@ Provides: %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{vers Requires(post): /usr/sbin/depmod Requires(postun): /usr/sbin/depmod +Requires(post): /usr/bin/dracut +Requires(postun): /usr/bin/dracut + %description This package provides the Dell PERC2, 2/Si, 3/Si, 3/Di, Adaptec Advanced Raid @@ -179,6 +182,19 @@ then /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch} fi + if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ] + then + if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch} + then + if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew + then + mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img + else + rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew + fi + fi + fi + rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods fi @@ -192,6 +208,19 @@ then /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch} fi + if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ] + then + if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch} + then + if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew + then + mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img + else + rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew + fi + fi + fi + rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods fi