x86: grub2: search for the "kernel" filesystem on all disks
authorJax Jiang <jax.jiang.007@gmail.com>
Thu, 10 Feb 2022 17:46:55 +0000 (01:46 +0800)
committerChristian Lamparter <chunkeey@gmail.com>
Thu, 24 Feb 2022 19:45:12 +0000 (20:45 +0100)
commit1050e66c8f7c67ab8b3d1895e2559f03baeb2345
treebbb5471d905e7163bc6905bd3f0e5d0b4ee6081e
parent83f2f1ad5840eae4bd265ffc46f1982571514123
x86: grub2: search for the "kernel" filesystem on all disks

Previously, grub2 was hardcoded to always look on "hd0" for the
kernel.

This works well when the system only had a single disk.
But if there was a second disk/stick present, it may have look
on the wrong drive because of enumeration races.

This patch utilizes grub2 search function to look for a filesystem
with the label "kernel". This works thanks to existing setup in
scripts/gen_image_generic.sh. Which sets the "kernel" label on
both the fat and ext4 filesystem variants.

Signed-off-by: Jax Jiang <jax.jiang.007@gmail.com>
Suggested-by: Alberto Bursi <bobafetthotmail@gmail.com> (MX100 WA)
(word wrapped, slightly rewritten commit message, removed MX100 WA)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
package/boot/grub2/Makefile
target/linux/x86/base-files/lib/upgrade/platform.sh
target/linux/x86/image/grub-efi.cfg