From d4e560771b8a0fc72538d50b4510a31ab1e00a64 Mon Sep 17 00:00:00 2001 From: Geoff Williams Date: Sun, 22 Sep 2019 17:04:42 +1000 Subject: Support placing GPT last when for hybrid MBR Some hardware (notably Raspberry PI) requires a small FAT partition be listed as the first MBR partition to boot. At the moment hybrid MBR disks allowing this can only be made using the interactive `gdisk` program by choosing `h` from the recovery menu and answering `N` when asked: ``` Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? ``` This commit brings feature parity to `sgdisk` by changing `-h` to support an optional final partition `EE` indicating that the GPT partition should be listed last in the MBR instead of first. **Examples**: GPT first (current behaviour) ```shell sgdisk -h 1:2 sdcard.img ``` GPT last ```shell sgdisk -h 1:2:EE sdcard.img ``` --- sgdisk.8 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sgdisk.8') diff --git a/sgdisk.8 b/sgdisk.8 index adae352..f682944 100644 --- a/sgdisk.8 +++ b/sgdisk.8 @@ -264,13 +264,13 @@ in order to render all GUIDs once again unique. .TP .B \-h, \-\-hybrid Create a hybrid MBR. This option takes from one to three partition numbers, -separated by colons, as arguments. The created hybrid MBR places an EFI GPT -(type 0xEE) partition first in the table, followed by the partition(s) you -specify. Their type codes are based on the GPT fdisk type codes divided by -0x0100, which is usually correct for Windows partitions. If the -active/bootable flag should be set, you must do so in another program, such -as \fBfdisk\fR. The \fBgdisk\fR program offers additional hybrid MBR -creation options. +separated by colons, as arguments. You may optionally specify a final partition +"EE" to indicate that the EFI GPT (type 0xEE) should be placed last in the table, +otherwise it will be placed first, followed by the partition(s) you specify. +Their type codes are based on the GPT fdisk type codes divided by 0x0100, which +is usually correct for Windows partitions. If the active/bootable flag should +be set, you must do so in another program, such as \fBfdisk\fR. The \fBgdisk\fR +program offers additional hybrid MBR creation options. .TP .B \-i, \-\-info=partnum -- cgit v1.2.1