From 75c33ea1d08deb0e89731025e03826367b5ada73 Mon Sep 17 00:00:00 2001 From: wangkaiyuan Date: Mon, 20 Jan 2025 17:14:42 +0800 Subject: [PATCH] spec: don't run drcut when installing the driver in the installation ISO Signed-off-by: wangkaiyuan --- kmod-i40e.spec | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/kmod-i40e.spec b/kmod-i40e.spec index cb7d5c2..a834b47 100644 --- a/kmod-i40e.spec +++ b/kmod-i40e.spec @@ -433,12 +433,14 @@ fi if which dracut >/dev/null 2>&1; then echo "Updating initramfs with dracut..." - if dracut --force ; then - echo "Successfully updated initramfs." - else - echo "Failed to update initramfs." - echo "You must update your initramfs image for changes to take place." - exit -1 + if [ -e "/boot/initramfs-`uname -r`.img" ]; then + if dracut --force ; then + echo "Successfully updated initramfs." + else + echo "Failed to update initramfs." + echo "You must update your initramfs image for changes to take place." + exit -1 + fi fi elif which mkinitrd >/dev/null 2>&1; then echo "Updating initrd with mkinitrd..." @@ -473,13 +475,15 @@ rm /var/run/rpm-%{pkg}-modules.list if which dracut >/dev/null 2>&1; then echo "Updating initramfs with dracut..." - if dracut --force ; then - echo "Successfully updated initramfs." - else - echo "Failed to update initramfs." - echo "You must update your initramfs image for changes to take place." - exit -1 - fi + if [ -e "/boot/initramfs-`uname -r`.img" ]; then + if dracut --force ; then + echo "Successfully updated initramfs." + else + echo "Failed to update initramfs." + echo "You must update your initramfs image for changes to take place." + exit -1 + fi + fi elif which mkinitrd >/dev/null 2>&1; then echo "Updating initrd with mkinitrd..." if mkinitrd; then -- Gitee