diff --git a/kmod-igb.spec b/kmod-igb.spec index 58514a3373f5965ddf84fc0895e79b1b49288938..1023c1d18e46f93b6e625b6de9ccf0b309aaa134 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