CHRP requires grub at /boot/grub. On CDs, this means any other prefix will be invalid. In particular, a distro grub might prefer /grub2 - but prefix is hardcoded into the signed core.elf, and will always be wrong here.
Also work around a conflict between OF naming and that used by part_msdos: on CDs, we always want the raw device. This fixes an issue where grub would successfully load the menu from an image, but then produce the error: error: ../../grub-core/net/net.c:1552:disk `ieee1275/cdrom,0' not found. and fail to boot further. Signed-off-by: Robbie Harwood <rharw...@redhat.com> --- grub-core/kern/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c index 731c07c290..0a24fe38e4 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -216,6 +216,23 @@ grub_set_prefix_and_root (void) grub_free (prefix_set); } grub_env_set ("root", device); + +#ifdef __powerpc__ + /* When booting from a CD, if part_msdos is enabled, grub will detect + and create access points starting at (ieee1275/cdrom,msdos1). + However, the device detection and OF name transformation will produce + a device named (ieee1275/cdrom,0) - i.e., missing the msdos and also + differently indexed. Furthermore, CHRP mandates boot/grub as prefix, + but our signed images are built with /grub2 to reflect installed + systems. Just ignore both messes. + */ + if (!grub_strncmp (device[0] == '(' ? device + 1 : device, + "ieee1275/cdrom", grub_strlen ("ieee1275/cdrom"))) + { + grub_env_set ("prefix", "/boot/grub"); + grub_env_set ("root", "ieee1275/cdrom"); + } +#endif } grub_free (device); -- 2.39.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel