diff --git a/kmod-ice.spec b/kmod-ice.spec index 696b81ec9209ee3edf68a17e1d110e0afa78a939..705b13e1f3121b1ec4d1ed7725c24e9fe962f8b3 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..."