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>
This commit is contained in:
parent
5d5ca9deaf
commit
8175ed3d74
|
@ -78,10 +78,14 @@ partitions may be smaller. In this case \fBsfdisk\fR follows the default
|
||||||
values from the partition table and does not use built-in defaults for the
|
values from the partition table and does not use built-in defaults for the
|
||||||
unused partition given with \fB\-N\fR. See also \fB\-\-append\fR.
|
unused partition given with \fB\-N\fR. See also \fB\-\-append\fR.
|
||||||
.TP
|
.TP
|
||||||
.BR \-A , " \-\-activate \fIdevice " [ \fIpartition-number ...]
|
.BR \-A , " \-\-activate \fIdevice " [ \fIpartition-number...]
|
||||||
Switch on the bootable flag for the specified partitions.
|
Switch on the bootable flag for the specified partitions and switch off the
|
||||||
If no \fIpartition-number\fR is specified,
|
bootable flag on all unspecified partitions. The special placeholder '-'
|
||||||
then list the partitions with an enabled flag.
|
may be used instead of the partition numbers to switch off the bootable flag
|
||||||
|
on all partitions.
|
||||||
|
|
||||||
|
If no \fIpartition-number\fR is specified, then list the partitions with an
|
||||||
|
enabled flag.
|
||||||
.TP
|
.TP
|
||||||
.BR "\-\-delete \fIdevice " [ \fIpartition-number ...]
|
.BR "\-\-delete \fIdevice " [ \fIpartition-number ...]
|
||||||
Delete all or the specified partitions.
|
Delete all or the specified partitions.
|
||||||
|
|
|
@ -853,7 +853,11 @@ static int command_activate(struct sfdisk *sf, int argc, char **argv)
|
||||||
|
|
||||||
/* sfdisk --activate <partno> [..] */
|
/* sfdisk --activate <partno> [..] */
|
||||||
for (i = 1; i < argc; i++) {
|
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);
|
rc = fdisk_toggle_partition_flag(sf->cxt, n - 1, DOS_FLAG_ACTIVE);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
|
Loading…
Reference in New Issue