diff --git a/kmod-bnxt.spec b/kmod-bnxt.spec index 95fd4c73ed86ec2c47871273359f2b9ae1d1dac9..e0a5dd4977c4ea131b0e97eca762998e29128eec 100644 --- a/kmod-bnxt.spec +++ b/kmod-bnxt.spec @@ -123,7 +123,7 @@ depmod -a > /dev/null 2>&1 if [ -x "/usr/sbin/weak-modules" ]; then printf '%s\n' "/lib/modules/%{kernel}.%{_arch}/extra/%{pkg}/bnxt_en.ko" | /usr/sbin/weak-modules --no-initramfs --add-modules fi -if [ ! -e "/tmp/kos_anaconda_tmp" ]; then dracut -f > /dev/null 2>&1 ;fi +if [ -e "/boot/initramfs-`uname -r`.img" ]; then dracut -f > /dev/null 2>&1 ;fi if [ -d /usr/local/share/%{name} ]; then rm -rf /usr/local/share/%{name} @@ -678,12 +678,14 @@ rm /var/run/rpm-bnxt_en-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 + 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..."