why does grub detect kernel twice?

I am guessing this is why I see the same kernel twice at boot time?

# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-4.5.0-3-default
Found initrd image: /boot/initrd-4.5.0-3-default
Found linux image: /boot/vmlinuz-4.5.0-3-default <-- again?
Found initrd image: /boot/initrd-4.5.0-3-default <-- again?
done

Here’s what’s in /boot if it helps:


# ls -la /boot
-rw-r--r-- 1 root root     512 Nov 13 11:35 backup_mbr
-rw-r--r-- 1 root root    1725 Apr  3 14:35 boot.readme
-rw-r--r-- 1 root root  178493 Apr  6 04:35 config-4.5.0-3-default
drwxr-xr-x 7 root root    4096 Apr 14 22:15 grub2
-rw-r--r-- 1 root root 8352596 Apr 14 22:02 initrd-4.5.0-3-default
-rw-r--r-- 1 root root  493568 Mar  2 09:18 message
-rwxr-xr-x 1 root root     166 Nov 13 11:34 perl-BL_delayed_exec
-rw-r--r-- 1 root root 1002386 Apr  6 08:52 symtypes-4.5.0-3-default.gz
-rw-r--r-- 1 root root  351121 Apr  6 08:43 symvers-4.5.0-3-default.gz
-rw-r--r-- 1 root root     484 Apr  6 08:43 sysctl.conf-4.5.0-3-default
-rw-r--r-- 1 root root 3395834 Apr  6 08:16 System.map-4.5.0-3-default
-rw-r--r-- 1 root root 7339185 Apr  6 08:56 vmlinux-4.5.0-3-default.gz
-rw-r--r-- 1 root root 6277984 Apr  6 11:06 vmlinuz-4.5.0-3-default
-rw-r--r-- 1 root root      65 Apr  6 11:06 .vmlinuz-4.5.0-3-default.hmac

http://i.imgur.com/167cK6G.png

This is happening because of:

/etc/grub.d/10_linux.rpmorig

Removing *.rpmorig and rerunning grub2-mkconfig resolves the issue. Maybe it should ignore *.rpmorig folders.

Well, the problem should happen only if you edited files under /etc/grub.d and normally you do not need to do it. This is the second report regarding this problem. If you are absolutely sure you did not change any file under /etc/grub.d, something went wrong and warrants bug report.

That said, I fully agree that grub should be more strict regarding which scripts are accepted.

I was poking around there, and may have re-saved some file without changes.