# If a install device is defined, copy the core.elf to PReP partition.
if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1275" ] && [ -n "${install_device}" ]; then
- if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" != "41" ]; then
- gettext "The chosen partition is not a PReP partition." 1>&2
- echo 1>&2
- exit 1
+
+ if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" != "41" ] \
+ && [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t gpt_parttype)" != "9e1a2d38-c612-4316-aa26-8b49521e5a8b" ]; then
+ gettext "The chosen partition is not a PReP partition." 1>&2
+ echo 1>&2
+ exit 1
fi
if [ "$(file -s -b -L "${install_device}" | awk '{ print $1 }')" = ELF ] || [ x$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t zero_check) = xtrue ]; then
#include <grub/fs.h>
#include <grub/partition.h>
#include <grub/msdos_partition.h>
+#include <grub/gpt_partition.h>
#include <grub/emu/hostdisk.h>
#include <grub/emu/getroot.h>
#include <grub/term.h>
PRINT_ARC_HINT,
PRINT_COMPATIBILITY_HINT,
PRINT_MSDOS_PARTTYPE,
+ PRINT_GPT_PARTTYPE,
PRINT_ZERO_CHECK,
PRINT_DISK
};
grub_device_close (dev);
continue;
}
+
+ if (print == PRINT_GPT_PARTTYPE)
+ {
+ if (dev->disk->partition
+ && strcmp (dev->disk->partition->partmap->name, "gpt") == 0)
+ {
+ struct grub_gpt_partentry gptdata;
+ grub_partition_t p = dev->disk->partition;
+ dev->disk->partition = dev->disk->partition->parent;
+
+ if (grub_disk_read (dev->disk, p->offset, p->index,
+ sizeof (gptdata), &gptdata) == 0)
+ {
+ grub_gpt_part_type_t gpttype;
+ gpttype.data1 = grub_le_to_cpu32 (gptdata.type.data1);
+ gpttype.data2 = grub_le_to_cpu16 (gptdata.type.data2);
+ gpttype.data3 = grub_le_to_cpu16 (gptdata.type.data3);
+ grub_memcpy (gpttype.data4, gptdata.type.data4, 8);
+
+ grub_printf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ gpttype.data1, gpttype.data2,
+ gpttype.data3, gpttype.data4[0],
+ gpttype.data4[1], gpttype.data4[2],
+ gpttype.data4[3], gpttype.data4[4],
+ gpttype.data4[5], gpttype.data4[6],
+ gpttype.data4[7]);
+ }
+ dev->disk->partition = p;
+ }
+ putchar (delim);
+ grub_device_close (dev);
+ continue;
+ }
}
end:
print = PRINT_CRYPTODISK_UUID;
else if (!strcmp (arg, "msdos_parttype"))
print = PRINT_MSDOS_PARTTYPE;
+ else if (!strcmp (arg, "gpt_parttype"))
+ print = PRINT_GPT_PARTTYPE;
else if (!strcmp (arg, "hints_string"))
print = PRINT_HINT_STR;
else if (!strcmp (arg, "bios_hints"))