From 8551a3f35d262ae94c3610fa0627b3f7eb40a7a5 Mon Sep 17 00:00:00 2001 From: wangkaiyuan Date: Mon, 20 Jan 2025 17:52:47 +0800 Subject: [PATCH] spec: don't run drcut when installing the driver in the installation ISO Signed-off-by: wangkaiyuan --- kmod-igb.spec | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/kmod-igb.spec b/kmod-igb.spec index 58514a3..1023c1d 100644 --- a/kmod-igb.spec +++ b/kmod-igb.spec @@ -396,8 +396,10 @@ echo "Updating initrd..." # Default is dracut but we'll try mkinitrd if that's not found. which dracut >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo "Using dracut to update initrd..." - initrd_cmd="dracut --force" + if [ -e "/boot/initramfs-`uname -r`.img" ]; then + echo "Using dracut to update initrd..." + initrd_cmd="dracut --force" + fi else which mkinitrd >/dev/null 2>&1 if [ $? -eq 0 ]; then @@ -445,13 +447,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