From ba6c5b073d9b774a3dae696fdc5e31c60b652b46 Mon Sep 17 00:00:00 2001 From: Peter Georg Date: Aug 09 2021 07:46:06 +0000 Subject: Rebuild initramfs --- diff --git a/SPECS/kmod-skge.spec b/SPECS/kmod-skge.spec index 4827278..6a67746 100644 --- a/SPECS/kmod-skge.spec +++ b/SPECS/kmod-skge.spec @@ -66,6 +66,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 driver supports Gigabit Ethernet adapters based on the Marvell Yukon @@ -124,6 +127,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 @@ -137,6 +153,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