Commit Graph

10 Commits

Author SHA1 Message Date
Samanta Navarro cb77628876 misc: fix typos [codespell]
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:42:25 +00:00
Wolfram Sang 9bf7517162 sfdisk: avoid unneeded empty lines with '--list-free'
Similar to commit 4a52959d1 ("(s)fdisk: avoid unneeded empty lines with
'--list'"), there were also two superfluous empty lines when /dev/sr0
didn't contain a medium. Refactor the '--list-free' code the same way as
in the mentioned commit.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
2020-05-12 10:09:46 +02:00
Wolfram Sang 4a52959d18 (s)fdisk: avoid unneeded empty lines with '--list'
On my system, I got two superfluous empty lines because /dev/sr0 didn't
contain a medium. Refactor the code to handle the seperator within
print_device_pt() and print it only when assigning the device worked.
This unifies handling between print_all_devices_pt and (s)fdisk because
the latter did not consider the return code for the seperator while the
former did. Also, it saves some lines of code.

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814184 (first part)
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2020-05-11 11:28:49 +02:00
Karel Zak 35ca511827 sfdisk: support empty label use-case
By default sfdisk creates partition table when a first partition is
specified, otherwise the device is not modified. This force users to
create at least one partition.

This commit allows to create empty label without partitions if "label:
<name>" header line is specified by script.

The commit also modifies "New situation:" output to list label name
and label identifier.

Addresses: https://github.com/karelzak/util-linux/issues/374
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-30 13:01:33 +01:00
Karel Zak cb9a4b0033 fdisk: add --wipe
This patch changes fdisk behavior and it wipes foreign signatures
from the device to avoid collisions. The wipe functionality is
automatically enabled in the interactive mode only (user is always
warned about it), otherwise it's possible to control all by --wipe
<auto|never|always>.

The program does not change behavior when executed in scripts (echo
<something> | fdisk), the option "--wipe=always" is required to enable
in this case.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-18 12:58:12 +01:00
Karel Zak 0efd951c80 fdisk: add 'F' command to list free unpartitioned space
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-28 15:53:42 +02:00
Karel Zak fff8ad5882 fdisk: add --output <list> for print command(s)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak d2c47697e1 sfdisk: add --verify
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak d464e2f0f9 fdisk: refactor /proc/partitions usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 152788aacb fdisk: improve --list output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00