diff options
author | Karel Zak | 2018-10-04 12:40:10 +0200 |
---|---|---|
committer | Karel Zak | 2018-10-04 12:40:10 +0200 |
commit | 49032ef7a47db51c3e7cf41f5a41ec2b45630717 (patch) | |
tree | 9db1aae740a255d6f33fcc894155e77233480028 /disk-utils | |
parent | rename: avoid undefined function prototype for `fpurge` (diff) | |
download | kernel-qcow2-util-linux-49032ef7a47db51c3e7cf41f5a41ec2b45630717.tar.gz kernel-qcow2-util-linux-49032ef7a47db51c3e7cf41f5a41ec2b45630717.tar.xz kernel-qcow2-util-linux-49032ef7a47db51c3e7cf41f5a41ec2b45630717.zip |
sfdisk: be more verbose about PMBR on --activate
Addresses: https://github.com/karelzak/util-linux/issues/699
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r-- | disk-utils/sfdisk.8 | 3 | ||||
-rw-r--r-- | disk-utils/sfdisk.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/disk-utils/sfdisk.8 b/disk-utils/sfdisk.8 index 98b574e45..ff54760ca 100644 --- a/disk-utils/sfdisk.8 +++ b/disk-utils/sfdisk.8 @@ -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 diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 9f031126f..21fcfa686 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -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")); |