We have this in recipes-bsp/grub/grub/40_custom: #!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. menuentry "Linux" { set root=(hd0,1) linux /vmlinuz root=__ROOTFS__ rw __CONSOLE__ __VIDEO_MODE__ __VGA_MODE__ quiet } These lines are for initrdscripts/files/init-install.sh, the side effect is that it would make the target's grub-mkconfig doesn't work well since the 40_custom will be installed to /etc/grub.d/40_custom, the grub-mkconfig will run the 40_custom, and there will always be a 'menuentry "Linux"' menu in grub.cfg no matter it is valid or not, we need do this in init-install.sh rather than grub to fix the problem.
Fixed on master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ec53bfd18c4e5d92ec4baedd702248a303a15dfa http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c2e63957d5abaa4bb10507da5ba16f01112d0bf5