aboutsummaryrefslogtreecommitdiffstats
path: root/disk-utils/sfdisk.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2020-10-15 12:04:15 +0200
committerKarel Zak <kzak@redhat.com>2020-10-15 12:04:15 +0200
commit29decc7b374ab522bbcf814c3e0536b090a3aac5 (patch)
treeef448483608fc6dfb8e1fb6e06554c56e9dba84b /disk-utils/sfdisk.c
parente57cbfe0aada02ad8556a3c6dcd6a5018bde9c01 (diff)
downloadutil-linux-29decc7b374ab522bbcf814c3e0536b090a3aac5.tar.gz
sfdisk: disable bootbits protection on '--wipe always'
Addresses: https://github.com/karelzak/util-linux/issues/1156 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/sfdisk.c')
-rw-r--r--disk-utils/sfdisk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 54d3b60e71..2e8d7ea0e5 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -230,7 +230,9 @@ static void sfdisk_init(struct sfdisk *sf)
if (!sf->cxt)
err(EXIT_FAILURE, _("failed to allocate libfdisk context"));
fdisk_set_ask(sf->cxt, ask_callback, (void *) sf);
- fdisk_enable_bootbits_protection(sf->cxt, 1);
+
+ if (sf->wipemode != WIPEMODE_ALWAYS)
+ fdisk_enable_bootbits_protection(sf->cxt, 1);
if (sf->label_nested) {
struct fdisk_context *x = fdisk_new_nested_context(sf->cxt,
@@ -1627,7 +1629,7 @@ static void follow_wipe_mode(struct sfdisk *sf)
if (dowipe) {
if (!fdisk_is_ptcollision(sf->cxt)) {
fdisk_warnx(sf->cxt, _(
- "The device contains '%s' signature and it will be removed by a write command. "
+ "The device contains '%s' signature and it may be removed by a write command. "
"See sfdisk(8) man page and --wipe option for more details."),
fdisk_get_collision(sf->cxt));
fputc('\n', stdout);