From de626c6bce646f1c9d554e0cf2c7f4cba3cfe524 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-mlx4.spec b/SPECS/kmod-mlx4.spec index 55c0837..782fbe3 100644 --- a/SPECS/kmod-mlx4.spec +++ b/SPECS/kmod-mlx4.spec @@ -68,6 +68,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 Mellanos ConnectX HCA (%{pkg}) driver. Compared to @@ -128,6 +131,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 @@ -141,6 +157,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