]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: be more verbose about PMBR on --activate
authorKarel Zak <kzak@redhat.com>
Thu, 4 Oct 2018 10:40:10 +0000 (12:40 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 4 Oct 2018 10:40:10 +0000 (12:40 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/699
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.8
disk-utils/sfdisk.c

index 98b574e45fb59a32238f794d6d5b11978a77bf43..ff54760ca08e8762d7a5e7ccd3c23ae55fba5ae7 100644 (file)
@@ -100,6 +100,9 @@ bootable flag on all unspecified partitions. The special placeholder '-'
 may be used instead of the partition numbers to switch off the bootable flag
 on all partitions.
 
+The activation command is supported for MBR and PMBR only.  If GPT label is detected
+than sfdisk prints warning and automatically enter PMBR.
+
 If no \fIpartition-number\fR is specified, then list the partitions with an
 enabled flag.
 .TP
index 9f031126f73bc88102ae6f782634cadc1af5ea4d..21fcfa68649ee808cfbc4cbff8f0c1fc2fb5ff68 100644 (file)
@@ -828,6 +828,8 @@ static int command_activate(struct sfdisk *sf, int argc, char **argv)
                sf->cxt = fdisk_new_nested_context(sf->cxt, "dos");
                if (!sf->cxt)
                        err(EXIT_FAILURE, _("cannot switch to PMBR"));
+               fdisk_info(sf->cxt, _("Activation is unsupported for GPT -- entering nested PMBR."));
+
        } else if (!fdisk_is_label(sf->cxt, DOS))
                errx(EXIT_FAILURE, _("toggle boot flags is supported for MBR or PMBR only"));