Hello. I think user can select BR2_TARGET_GRUB2_I386_EFI OR BR2_TARGET_GRUB2_I386_PC but not both. At this moment if user select both, post-build.sh ignore BR2_TARGET_GRUB2_I386_PC case. Also please see my commits https://github.com/buildroot/buildroot/pull/121 I also provide git patches via email, but still waiting answer.
Which post-build.sh script are you talking about? post-build.sh scripts provided in Buildroot upstream are bound to a specific defconfig. They are not meant to be generic and valid for all situations. If we assume that you're talking about ./board/pc/post-build.sh, then this script is used by configs/pc_x86_64_bios_defconfig (which enables BR2_TARGET_GRUB2_I386_PC=y) and by configs/pc_x86_64_efi_defconfig (which enables BR2_TARGET_GRUB2_X86_64_EFI=y). Therefore, this post-build.sh script is never used in a situation where both BR2_TARGET_GRUB2_I386_PC and BR2_TARGET_GRUB2_I386_EFI are used. Consequently, there is no bug. If you create your own defconfig, which enables both BR2_TARGET_GRUB2_I386_EFI and BR2_TARGET_GRUB2_I386_PC, you need to provide your own post-build.sh script.