diff options
author | Karel Zak | 2017-11-02 13:50:30 +0100 |
---|---|---|
committer | Karel Zak | 2017-11-02 13:50:30 +0100 |
commit | 8175ed3d74adacc895657ded7546cb3c5deeabad (patch) | |
tree | 140fec59226f5e8eaa6d94c2103cf3a26a5fecce /disk-utils/sfdisk.c | |
parent | sfdisk: allow to use --activate for PMBR (diff) | |
download | kernel-qcow2-util-linux-8175ed3d74adacc895657ded7546cb3c5deeabad.tar.gz kernel-qcow2-util-linux-8175ed3d74adacc895657ded7546cb3c5deeabad.tar.xz kernel-qcow2-util-linux-8175ed3d74adacc895657ded7546cb3c5deeabad.zip |
sfdisk: allow to disable bootable flag on all partitions
Let use '-' rather than a partition number to disable the bootable flag
on all partitions:
sfdisk --activate /dev/sdc -
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/sfdisk.c')
-rw-r--r-- | disk-utils/sfdisk.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 46b7e54db..ac4f71106 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -853,7 +853,11 @@ static int command_activate(struct sfdisk *sf, int argc, char **argv) /* sfdisk --activate <partno> [..] */ for (i = 1; i < argc; i++) { - int n = strtou32_or_err(argv[i], _("failed to parse partition number")); + int n; + + if (i == 1 && strcmp(argv[1], "-") == 0) + break; + n = strtou32_or_err(argv[i], _("failed to parse partition number")); rc = fdisk_toggle_partition_flag(sf->cxt, n - 1, DOS_FLAG_ACTIVE); if (rc) |