From ed7e178cca561ec3ba29d78ee76c5a5665408cca Mon Sep 17 00:00:00 2001 From: wangkaiyuan Date: Tue, 21 Jan 2025 15:08:32 +0800 Subject: [PATCH] spec: don't run drcut when installing the driver in the installation ISO Signed-off-by: wangkaiyuan --- kmod-ixgbe.spec | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/kmod-ixgbe.spec b/kmod-ixgbe.spec index 2354757..4b9da9b 100644 --- a/kmod-ixgbe.spec +++ b/kmod-ixgbe.spec @@ -413,12 +413,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..." @@ -454,13 +456,15 @@ fi 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 + if [ -e "/boot/initramfs-`uname -r`.img" ]; 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 fi elif which mkinitrd >/dev/null 2>&1; then echo "Updating initrd with mkinitrd..." -- Gitee