From 75c38a1fb5950951310e845503d7b537ac391a49 Mon Sep 17 00:00:00 2001 From: wangkaiyuan Date: Mon, 20 Jan 2025 17:41:05 +0800 Subject: [PATCH] spec: don't run drcut when installing the driver in the installation ISO Signed-off-by: wangkaiyuan --- kmod-ice.spec | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/kmod-ice.spec b/kmod-ice.spec index 696b81e..705b13e 100644 --- a/kmod-ice.spec +++ b/kmod-ice.spec @@ -416,12 +416,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..." @@ -449,12 +451,14 @@ depmod -a > /dev/null 2>&1 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..." -- Gitee