Commit Graph

1228 Commits

Author SHA1 Message Date
Chris Morin b0ff9a76b7 sfdisk: disambiguate units of --show-size
[kzak@redhat.com: - use optutils.h]

Signed-off-by: Chris Morin <chris.morin2@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-22 11:29:10 +02:00
Karel Zak 780ce22cda misc: consolidate smartcols error messages
... just to keep translators happy

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-18 11:39:34 +02:00
Karel Zak 76ae3fe37a sfdisk: add hints for scanners [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-17 12:28:07 +02:00
Karel Zak d2f265d629 mkswap: use memcpy() for non-terminated string [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-17 12:27:59 +02:00
Karel Zak 82c7ab9cb8 fsck.minix: add hint for scanners [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-17 11:38:54 +02:00
Karel Zak 25d1a7e5a6 fdisk: check scols_line_refer_data() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-17 11:32:50 +02:00
Karel Zak 08099e41b9 cfdisk: add hints for scanners [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-17 11:26:54 +02:00
Sami Kerola 51b4b39870 fsck.minix: fix crash
disk-utils/fsck.minix.c:421:30: runtime error: index 513 out of bounds for
type 'unsigned short [512]'

Addresses: https://github.com/karelzak/util-linux/issues/373
Reported-by: Hanno Bock <hanno@gentoo.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-05-16 14:54:41 +02:00
Karel Zak 84111dbae4 fdisk: fix type dialog
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-11 15:53:07 +02:00
Karel Zak ddead341c5 fdisk: inform on 'p' about wiped partitions
The wipe operation is potentially dangerous. Let's inform about it
always by 'p' (list) command to make sure user knowns about it.

	Command (m for help): p
	...
	Device     Boot Start    End Sectors Size Id Type
	/dev/sdc1        2048 204799  202752  99M 83 Linux

	Filesystem/RAID signature on partition 1 will be wiped.

Addresses: https://github.com/karelzak/util-linux/issues/437
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-09 14:30:36 +02:00
Karel Zak a4aa4a6c9d fdisk: add to the man page missing option
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-09 13:05:26 +02:00
Sami Kerola 2cdaf94b55
partx: add --list-types option
Use libblkid as the source of truth what partition type names exist, and are
supported.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-05-02 23:22:04 +01:00
Sami Kerola abec3cb1de
docs: try to convince open(2) O_DIRECT rather than using raw device
Tell in manual page that one should use open(2) O_DIRECT flag rather than
raw device.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-05-02 23:22:04 +01:00
Sami Kerola 99d8ed0ac5
bash-completion: update disk-utils
fdformat:

	Add --from, --to, and --repair options.

	Commit: e0402441a1

fdisk:

	Add --output [1], --bytes [2], --wipe [3], --wipe-partition [4], and
	remove --geom- from from --cylinders, --heads, --sector options [5].

	Commit [1]: fff8ad5882
	Commit [2]: 354f8cc8cf
	Commit [3]: cb9a4b0033
	Commit [4]: ba465623d8
	Commit [5]: 4b4e391a28

fsck.cramfs:

	Broken since first commit.

	Commit: bf60993cf2

mkswap:

	Provide random uuid when completing --uuid argument.

partx:

	Add --sector-size option.  Fix also list of known partition types to
	match with libblkid blkid_idinfo names.  The fix is also applied to
	manual page.

	Commit: f8a4a0d4f2

	Reference: git grep -A 4 blkid_idinfo libblkid/src/partitions | grep name

sfdisk:

	Add --reoder, --delete, --mode-dataa, -no-tell-kernel, --wipe, and
	--wipe-partitions options.  In same go fix some option argument
	completions.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-17 18:12:10 +01:00
Karel Zak b607e5faca Fix menu spelling in cfdisk debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-22 10:43:55 +01:00
Sami Kerola 57ebfde291 fdisk, sfdisk: avoid non-ANSI function declarations [smatch scan]
Adding _FUNCTION_DEF definition will exclude compatibility type definitions
that do include void key word in empty argument list.

/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function
declaration of function 'Function'

These functions has been replaced by set of new ones in readline 4.2 (April
2001), and removed in 6.3 (February 2014).

Reference: https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES
Rererence: https://blueslugs.com/blog/2016-10-23-updating-cppfunction-in-old-readline-consumers/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-14 14:01:14 +01:00
Sami Kerola c308e2050f misc: stop mixing declarations and code
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-13 14:48:04 +01:00
Karel Zak 208b2ef0b6 sfdisk: note about small partition in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-02 13:51:40 +01:00
Karel Zak 86800f5d75 sfdisk: add note about alignment to man page
Addresses: https://github.com/karelzak/util-linux/issues/417
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-02 13:44:26 +01:00
Sami Kerola 2ba641e5f3 misc: add static keyword to where needed [smatch scan]
text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be
static?

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-02-20 12:58:49 +01:00
Sami Kerola 8791804065 misc: do not use plain 0 as NULL [smatch scan]
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer

Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.

Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-02-20 12:58:49 +01:00
Sami Kerola e948f4b616 cfdisk: avoid use of VLA in combination with sizeof() [smatch scan]
disk-utils/cfdisk.c:1066:29: error: cannot size expression

One should use sizeof() only when variable size can be known at time of
compilation.  That is not the case with variable length arrays.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-02-20 12:58:12 +01:00
Karel Zak 1b6d02fe8c cfdisk: use buffer editor for ui_get_string()
Addresses: https://github.com/karelzak/util-linux/issues/403
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-02-16 13:47:44 +01:00
Karel Zak 5635d19550 fdisk: improve --wipe functionality
* always (except --wipe=never) wipe old partition tables
* improve warn messages
* improve man page

Addresses: https://github.com/karelzak/util-linux/issues/410
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-02-14 15:13:35 +01:00
Karel Zak bb88152764 sfdisk: improve --wipe functionality
* always (except --wipe=never) wipe old partition tables
* improve warn messages
* improve man page

Addresses: https://github.com/karelzak/util-linux/issues/410
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-02-14 15:11:35 +01:00
Yuri Chornoivan a7349ee315 docs: Fix word repetitions 2017-02-13 14:10:12 +01:00
Karel Zak 91cce31a8e sfdisk: --quiet fixes
Addresses: https://github.com/karelzak/util-linux/issues/412
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-02-10 12:54:23 +01:00
Karel Zak e7e7697612 cfdisk: add copyright to help
... to make it obvious this is a new cfdisk.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-02-02 10:28:38 +01:00
Karel Zak 2f4eb047e5 cfdisk: support UI refresh on ^L
Addresses: https://github.com/karelzak/util-linux/issues/404
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-02-01 15:34:57 +01:00
Karel Zak f8a4a0d4f2 partx: add --sector-size option
/dev/sdc is 4K disk:

 # fdisk -l /dev/sdc
 Disk /dev/sdc: 100 MiB, 104857600 bytes, 25600 sectors
 ...
 Device     Boot Start   End Sectors Size Id Type
 /dev/sdc1        1024 25599   24576  96M 83 Linux

let's use it as disk image:

 # dd if=/dev/sdc of=~/sdc.img
 # losetup -f ~/sdc.img

old version:

 # partx --show /dev/loop0
 NR START   END SECTORS SIZE NAME UUID
 1  1024 25599   24576  12M      6a4ba75b-01

new version:

 # partx --show /dev/loop0 --sector-size 4096
 NR START    END SECTORS SIZE NAME UUID
  1  8192 204799  196608  96M      6a4ba75b-01

Addresses: https://github.com/karelzak/util-linux/issues/396
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-13 13:30:22 +01:00
Sami Kerola 12d69ae8bb man: fix couple tools/checkmans.sh warnings
<standard input>:407: warning: macro `fi.' not defined (possibly missing space after `fi')
From: cat ./disk-utils/fsck.8 | troff -mandoc -ww -z

<standard input>:71: warning: escape character ignored before `1'
From: cat ./disk-utils/partx.8 | troff -mandoc -ww -z

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-01-10 17:32:32 +01:00
Karel Zak 11e1097e6c sfdisk: unused parameter 'sf' [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 11:53:56 +01:00
Nate Clark b7b26945d1 disk-utils/mkfs.minix: Set ninodes after checking max
ninodes in the superblock needs to be set after inodes is checked
against MINIX_MAX_INODES otherwise a value larger than MINIX_MAX_INODES
can be attempted to be stored in the superblock.

Without this change the command "mkfs.minix -2 -i 65530 <dev>" would
write a minix superblock with ninodes set to 0.

Signed-off-by: Nate Clark <nate@neworld.us>
2017-01-04 14:42:59 -05:00
Karel Zak 677ec86cef Use --help suggestion on invalid option
The current default is to print all usage() output. This is overkill
in many case.

Addresses: https://github.com/karelzak/util-linux/issues/338
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 13:13:34 +01:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Karel Zak 8fdd483c53 fdisk: don't be silent when list non-existing device
Addresses: https://github.com/karelzak/util-linux/issues/376
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-13 12:11:32 +01:00
Michael Kerrisk 46f057ed37 docs: various pages: Format pathnames as italic (.I)
In the majority of pages, pathnames are formatted as Italic,
which is the norm. However, there are several cases where they
are formatted as bold. This patch fixes a number of those
exceptions.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Ruediger Meier 223939d95b misc: spelling, always use "cannot" instead of "can not"
Just to be consistent ...

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-30 14:56:50 +01: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 c49b765a6e sfdisk: cleanup --dump error messages
old:
  # truncate -s 1G empty && ./sfdisk --dump empty
  sfdisk: failed to dump partition table: Success

new:
  # truncate -s 1G empty && ./sfdisk --dump empty
  sfdisk: empty: does not contain a recognized partition table.

Addresses: https://github.com/karelzak/util-linux/issues/375
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-30 10:57:39 +01:00
Karel Zak fed304837f sfdisk: don't be silent when list non-existing device
Addresses: https://github.com/karelzak/util-linux/issues/376
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-29 16:01:46 +01:00
Michael Kerrisk (man-pages) b2cc2a7fc6 Fix formatting errors in page cross references
These pages had errors such as

    .BR page (x) .

which should be

    .BR page (x).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) f053ff1e3a Place SEE ALSO entries in order
This patch does only the following:

* Order SEE ALSO entries first by section name, then alphabetically
  within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
  at the end of SEE ALSO lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Ruediger Meier 0f2eb577ac fdisk: fix memleak in list_disk_geometry()
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-27 11:03:16 +02:00
Karel Zak e4015b348f fdisk: fix compiler warning
disk-utils/fdisk-menu.c: In function ‘gpt_menu_cb’:
disk-utils/fdisk-menu.c:709: warning: passing argument 6 of ‘fdisk_ask_number’ from incompatible pointer type
./libfdisk/src/libfdisk.h:688: note: expected ‘uintmax_t *’ but argument is of type ‘long unsigned int *’

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-26 10:28:41 +02:00
Karel Zak bae57b5a3c misc: fix unsigned int usage for ctype.h functions
Reported-by: "Yuriy M. Kaminskiy" <yumkam@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-26 10:13:47 +02:00
Karel Zak 2687686cf4 cramfs: revert crc32 changes
We cannot use our crc32 without changes in the code, because our
ul_crc32() assumes that post-conditioning (xor) is done by
application. The zlib implementation does everything.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19 13:33:15 +02:00
Karel Zak 98fd13a169 cramfs: add missing includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-19 12:17:19 +02:00
Gustavo Zacarias 7f0d4d56a2 lib/crc32: prefix public functions
Make the publicly-visible crc32 library functions prefixed by ul_, such
as crc32() -> ul_crc32().
This is because it clashes with the crc32() function from zlib.
For newer versions of glib (2.50+) zlib and libblkid are required
dependencies and otherwise results in build failure when building
statically.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
2016-10-19 12:11:59 +02:00
Karel Zak 17dd04c92a isosize: fix read() result check 2016-10-04 20:15:09 +02:00
Karel Zak 2d1fa4fdc3 sfdisk: cleanup before going out of scope [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04 16:08:55 +02:00
Karel Zak 6387bf33db sfdisk: free before going out of scope [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04 16:03:11 +02:00
Karel Zak 4c906abea2 isosize: don't ignore read() result [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04 15:56:59 +02:00
Karel Zak 10c66b0b9e fsck.cramfs: don't ignore read() result [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04 15:53:55 +02:00
Karel Zak cf9b302d46 cfdisk: fix mountpoint detection
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-04 15:02:00 +02:00
Karel Zak 37948503c9 libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=on
This env.variable forces libsmartcols to use visible padding chars.
The standard debug has to be enabled (to minimize overhead for
non-debug execution).

For example:

 $ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-07 12:25:06 +02:00
Karel Zak 7208ef864b fsck: remove fs-specific options from man page
Let's force users to read fs-specific man pages rather than try to be
smart and maintain some non-fsck options in fsck.8.

Reported-by: Matej Cepl <mcepl@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-06 14:49:48 +02:00
Karel Zak d4a90151e3 sfdisk: add --no-tell-kernel
The option forces sfdisk to not call re-read partitions ioctl after
write PT.

Requested-by: Scott Moser <smoser@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-02 11:20:06 +02:00
Karel Zak ad8cd66adf sfdisk: make non-interactive output more readable
# echo -e ',1M\n,2M' | sfdisk /dev/sdc

Old version:

  >>> Created a new DOS disklabel with disk identifier 0x8fc7d065.
  Created a new partition 1 of type 'Linux' and of size 1 MiB.
  /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB.
  /dev/sdc3:

New version:

  >>> Created a new DOS disklabel with disk identifier 0x9afe17c0.
 /dev/sdc1: Created a new partition 1 of type 'Linux' and of size 1 MiB.
 /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB.
 /dev/sdc3: Done.

Addresses: https://github.com/karelzak/util-linux/issues/337
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-31 15:51:11 +02:00
Karel Zak 8d2f449818 fdisk: use PAGER for 'l' command.
The list of the partition types is too long. Let's try to use $PAGER.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-26 12:15:38 +02:00
Karel Zak 090d8c763a include/closestream: define exit codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-16 13:35:06 +02:00
Karel Zak 349ac67273 sfdisk: add show-pt-geometry to usage() and sfdisk.8
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-08-08 12:15:47 +02:00
Stanislav Brabec f7c6c31f08 sfdisk: Add --show-pt-geometry compatibility code
--show-pt-geometry existed since cf3f26bf (2006), and it is used by third party
tools. To prevent failure of these tools, add a minimal compatibility code.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2016-08-08 12:03:12 +02:00
Sami Kerola 74ce680a3e
misc: simplify if clauses [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-07-21 21:14:33 +01:00
Karel Zak 78e7f78896 Revert "sfdisk: exit with error if rereading partition table fails"
This reverts commit 14f644f386.

It seems we have mess in reread-after-write:

all old versions to v2.20  -- returns 0
from v2.20 to v2.26        -- returns 1
since v2.26                -- returns 0

I think re-read errors should not be interpreted as fatal errors,
because it's pretty common that you want to modify only one partition
(e.g. resize) and then another partitions are probably still in use
and re-read all PT does not make sense.

What we need is to improve granularity for re-read and calls it only
when really necessary (all PT modified) and otherwise call BLKPG
(add/delete/resize) ioctls.

Reported-by: Nikhil Valluru <vvnikhil@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-07-20 11:24:36 +02:00
Thierry Vignaud 04c163ed16 fdisk: make -l <dev ...> behaves like fdisk -l
aka having the same spacing between disks

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-07-14 12:04:04 +02:00
Karel Zak 6e51ab0c5c cfisk: add /dev/vda as another default disk
And use array for all default alternative disks.

Reported-by: Thierry Vignaud <thierry.vignaud@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-07-07 15:02:20 +02:00
Karel Zak 9907a95a7d cfdisk: use libsmartcols ASCII for non-widechar environment
Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-06-03 12:20:24 +02:00
Karel Zak 65c74885df fsck.minix: fix endless loop and out of stack
It seems there is no elegant way how to recovery if a directory i_zone
(and i_size) is out of reality. Let's require human interaction to
avoid endless loop when executed with --auto, etc.

Addresses: https://github.com/karelzak/util-linux/issues/228
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-06-01 14:55:15 +02:00
Sebastian Rasmussen d1b7bfe506 fdisk: Fix typo RequiredPartiton -> RequiredPartition
This typo fix is backwards compatible in that fdisk will accept both
the GPT attribute RequiredPartition and RequiredPartiton with the typo.
Update documentation and tests to all use the new attribute name.

Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
2016-05-31 23:51:07 +02:00
Sebastian Rasmussen 9e93004171 misc: Fix various typos
Fix various typos in error messages, warnings, debug strings,
comments and names of static functions.

Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
2016-05-31 23:40:21 +02:00
Sebastian Rasmussen d35df4db5b docs: Fix various typos
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
2016-05-31 23:40:21 +02:00
Tobias Stoeckmann 8f35b3a998 fsck.minix: Verify more fields in super-block.
The field s_ninodes in super-block is used for memory allocation and
division without verifications. The memory allocation increments the
unchecked value by 1, making it vulnerable to an integer overflow
on 32 bit systems with minix 3 file systems. I did not find a (good)
way to exploit this by crafting a malicious file system, so I consider
it as a reliability issue. If it's 0, a division by zero occurs when
"-v" has been used. A filesystem without any inodes is definitely
wrong, because it means that there's not even the root inode, which is
accessed unchecked later on.

The field s_firstdatazone has to be checked against s_(n)zones. If it
is larger than the highest allowed index, the file system is definitely
corrupted -- hard to say which value is wrong though, therefore I
decided to simply call die(). A maliciously created file system could
do more harm in this way: single bits inside the memory area could be
flipped because range checks would fail. Hard to consider it as a
security issue though, because these addresses are not arbitrarily
accessible without very careful crafting (if at all possible).

[kzak@redhat.com: - fix compiler warning (cast get_nzones()) [-Wsign-compare]]

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-05-31 13:18:06 +02:00
Mike Frysinger 5593132a90 man pages: fix spacing between man page name & section number
Most have standardized correctly, but fix a few latent ones.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2016-05-20 10:54:31 +02:00
Sassan Panahinejad 304cf9499d fdisk: Add support for altering GPT size
Adds an options (l) to the GPT menu to resize the GPT.
2016-05-18 13:46:35 +02:00
Victor Dodon 14f644f386 sfdisk: exit with error if rereading partition table fails
Use the return value of fdisk_reread_partition_table in write_changes so that
sfdisk exits with error if re-reading the partition table fails.

Signed-off-by: Victor Dodon <dodonvictor@gmail.com>
2016-05-05 11:43:07 +02:00
Karel Zak 832bbc73b2 build-sys: remove obsolete [cs]fdisk LDADDs
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-05-04 15:02:02 +02:00
Karel Zak 3d6db3fdb1 sfdisk: add --wipe-partitions=auto|never|default
The option allows to remove filesystes/RAIDs from newly created
partitions before the partition table is updated (and partition
device created).

The default is "auto" in this case wipe is enabled in interactive mode
only and user's confirmation (yes/no dialog) is required. Note that
keep filesystem signature on partition is pretty valid use-case, so we
don't erase anything by default.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-05-04 12:47:17 +02:00
Karel Zak ba465623d8 fdisk: add --wipe-partitions=auto|never|default
The option allows to remove filesystes/RAIDs from newly created
partitions before the partition table is updated (and partition
device created).

The default is "auto" in this case wipe is enabled in interactive mode
only and user's confirmation (yes/no dialog) is required. Note that
keep filesystem signature on partition is pretty valid use-case, so we
don't erase anything by default.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-05-04 12:43:35 +02:00
Yuriy M. Kaminskiy fc75981a22 fsck: fix racing between unlock/unlink and open
Process A	Process B	Process C
open()
[creates file]
lock()
[succeed]
		open()
		[open existing]
		lock()...
running()
close()
		[...succeed]
unlink()
		running()
				open()
				[creates file] {BAD!}
				lock()
				[succeed] {BAD!}
				running() {BAD!}
		close()

Cons: leaves empty (unlocked/harmless) .lock files in /run/fsck/
Signed-off-by: Yuriy M. Kaminskiy <yumkam@gmail.com>
2016-04-22 11:07:42 +02:00
Lubomir Rintel d97dc0ee25 mkswap: tolerate ENOTSUP when failing to relabel
It might be that the underlying filesystem just doesn't support SELinux
labeling. This fixes creating swap on vfat live media:

  # livecd-iso-to-disk.sh --msdos --swap-size-mb 666 ...

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2016-04-18 10:51:28 +02:00
Karel Zak c6121fec26 fdisk: remove dead assignment [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-29 14:13:22 +02:00
Karel Zak 2d47fa3921 partx: fix --nr usage
Reported-by: Serge van den Boom <serge+util-linux@vdboom.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-22 15:49:00 +01:00
Benno Schulenberg 49b7f95e43 docs: miscellaneous tiny tweaks of man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-17 12:18:54 +01:00
Benno Schulenberg 718b6f0cda fdisk: fix the grammar of an option description
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-17 12:18:54 +01:00
Benno Schulenberg b779c1aecb mount, umount, swapon, fsck, lsblk, findmnt: harmonize six error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-16 10:39:38 +01:00
Benno Schulenberg cb19f5479b fdisk, cfdisk, sfdisk: improve the grammar of three messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-16 10:39:35 +01:00
Benno Schulenberg 1a60a5ecb0 sfdisk: improve the wording of seven error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-16 10:39:34 +01:00
Karel Zak 785539baa3 Merge branch 'travis-osx' of https://github.com/rudimeier/util-linux
* 'travis-osx' of https://github.com/rudimeier/util-linux:
  travis: add OSX build
  travis: switch to Ubuntu 14.04 Trusty
  build-sys: improve uuidd and script build conditions
  build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms
  build-sys: add missing "not found" strings
  build-sys: fix again UL_SCANF_TYPE_MODIFIER
  tests: don't use system's mount commands
  tests: improve skipping of old btrfs-tools
  tests: remove invalid argument in libmount/debug
  tests: skip old socat silently
  misc: fix icc/clang compiler warnings
  misc: fix printf i386 compiler warnings
2016-03-14 15:59:10 +01:00
Sami Kerola 5a2ed45309 isosize: stop unmeaningful printing errno message
Earlier printout had strange looking 'Success'.

$ isosize --sectors /dev/urandom
isosize: /dev/urandom: might not be an ISO filesystem
isosize: 733error: le=-1971599244 be=1633181607: Success
...

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-14 13:15:12 +01:00
Ruediger Meier 58c87bd045 misc: fix icc/clang compiler warnings
clang warning:
libmount/src/tab.c:1833:6: warning: variable 'rc' is used uninitialized whenever
      'if' condition is true [-Wsometimes-uninitialized]
        if (!mpc)
            ^~~~

icc printf warnings:
    libmount/src/monitor.c(348): warning #2279: printf/scanf format not a string literal and no format arguments
            DBG(MONITOR, ul_debugobj(mn, status == 1 ? " success" : " nothing"));
            ^
    login-utils/vipw.c(348): warning #2279: printf/scanf format not a string literal and no format arguments
                           : _("You are using shadow passwords on this system.\n"));
                                                                                  ^

icc enum warnings:
    disk-utils/fdisk-menu.c(150): warning #188: enumerated type mixed with another type
            .exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD,
                       ^
    libsmartcols/src/table_print.c(750): warning #188: enumerated type mixed with another type
                            &width, align,
                                    ^

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-13 21:47:27 +01:00
Karel Zak 8e2e9144ef misc: remove duplicate includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-10 14:30:32 +01:00
Karel Zak 95aae4fcee sfdisk, fdisk: add fflush()
Let's add fflush(stdout) before we print to stderr to make output
order more deterministic.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-10 12:26:43 +01:00
Karel Zak 322e553a1c Merge branch 'port-osx' of https://github.com/rudimeier/util-linux
* 'port-osx' of https://github.com/rudimeier/util-linux:
  fdisk: fix warning, uninitialized variable
  logger: fix compiler warning, const facilitynames
  include/bitops: avoid fallbacks for more systems
  include/bitops: add casts to bswap functions
2016-03-09 13:12:50 +01:00
Ruediger Meier 056e622c91 fdisk: fix warning, uninitialized variable
This was a typo in 4afb337e.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-08 14:56:02 +01:00
Karel Zak 075d2c0754 include: move sys/sysmacros.h to c.h
The file is no portable (#ifdef HAVE_SYS_SYSMACROS_H is necessary),
but needed on many places. It seems better to keep it in c.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-08 14:29:45 +01:00
Karel Zak 3fe3f560b7 Revert "include sysmacros.h where used"
This reverts commit 46a40c0184.
2016-03-08 14:26:33 +01:00
Benno Schulenberg c805c36923 sfdisk: adjust more wordings and formatting in the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Benno Schulenberg 589b69316c fdisk, sfdisk: adjust the wording of the --wipe option
Use "when" as argument, to match the argument of --color,
that can have the same three values.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Benno Schulenberg 7e3b3f4710 fdisk, sfdisk: adjust some formatting in the man pages
Only the optional argument should be in italics,
the literal = should be bold.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2016-03-08 14:21:55 +01:00
Mike Frysinger 46a40c0184 include sysmacros.h where used
BSD/Linux systems stick major/minor/makedev in sysmacros.h.  Newer Linux
libraries have been moving away from including sysmacros.h implicitly via
sys/types.h, so include it directly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2016-03-08 14:21:55 +01:00
Ruediger Meier fea1cbf748 misc: never cast void* from malloc(3) and friends
Such cast could hide serious compiler warnings in case we are
missing includes (e.g. <stdlib.h> or "xalloc.h").

See
http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 23:29:27 +01:00
Ruediger Meier fdbd7bb940 misc: again fixing many printf format strings
This is again a huge patch regarding printf format strings to
fix compiler warnings seen on clang/OSX.

I'm trying to follow these rules strictly:

 #type      #format   #cast
 uintmax_t   %ju      -
 intmax_t    %jd      -
 uint64_t    PRIu64   -
 int64_t     PRId64   -
 size_t      %zu      -
 ssize_t     %zd      -
 ino_t       %ju      (uintmax_t)
 off_t       %jd      (intmax_t)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 23:16:04 +01:00
Ruediger Meier 8acff75afc wipefs, sfdisk: include libgen.h for basename(3p)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 21:25:36 +01:00
Karel Zak fdbfe2e7f0 Merge branch 'fix-minix' of https://github.com/rudimeier/util-linux
* 'fix-minix' of https://github.com/rudimeier/util-linux:
  tests: minix, add a useful non-root check
  tests: fix minix tests for big endian
  mkfs.minix: fix v2/v3 .badblocks inode number for big endian
  fsck.minix: fix v3 version offset
  tests: minix, some corrections and cleanup
  tests: minix, use hexdump instead of md5sum
2016-03-07 15:50:34 +01:00
Ruediger Meier e0dfdfeca0 fdisk: remove unused include sysfs.h
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 15:37:09 +01:00
Ruediger Meier 2208b3ccb2 lib: remove openat fallback functions (include/at.h)
I have validated that we are still compatible at least back to
  - openSUSE 11.4
  - SLE 11
  - RHEL/CentOS 6
  - OSX 10.10.x, (Xcode 6.3)
  - FreeBSD 10.2

Confirmed incompatibility:
  - OSX 10.9.x, (Xcode 6.2)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-07 15:33:56 +01:00
Yuriy M. Kaminskiy 06fa581748 misc: safer (and uniform) handling of return value
When `rc` is `INT_MAX`, `rc + 1` result in signed integer overflow.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-07 15:11:06 +01:00
Ruediger Meier 7252874a48 mkfs.minix: fix v2/v3 .badblocks inode number for big endian
For minix v2/v3 on big endian systems the inode number of the unwanted
".badblocks" file was not set to zero. This was introduced when v3 was
added in a2657ae3.

Actually it did not seem to cause any problems but since we zero it out
at all we should do it correctly. Now we zero out the whole directory
entry (inclusive ".badblocks" file name, also for v1). Unfortunately we
have to update the test data checksums.

CC: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-03 09:25:10 +01:00
Ruediger Meier fcb1242601 fsck.minix: fix v3 version offset
Our test-suite discoverd it on big endian systems, but it was also
broken on little endian for inode numbers > 0xffff.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-03 09:24:06 +01:00
Ruediger Meier 262c94c2c7 fdisk: fix warning, incompatible pointer types passing 'uint64_t *'
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-29 13:04:48 +01:00
Ruediger Meier b9710f1f08 misc: fix compiler warnungs (unsigned/signed)
These ones should be fixed:
libblkid/src/probe.c:393:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/probe.c:907:25: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/probe.c:1221:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:540:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1043:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1056:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1057:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1061:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/partitions/partitions.c:1199:27: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/partitions/partitions.c:1410:26: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/partitions/partitions.c:1431:25: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libblkid/src/superblocks/linux_raid.c:151:8: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
libblkid/src/superblocks/linux_raid.c:155:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
libblkid/src/superblocks/superblocks.c:375:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libblkid/src/superblocks/xfs.c:141:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libsmartcols/src/table.c:333:24: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libsmartcols/src/table.c:344:25: warning: signed and unsigned type in conditional expression [-Wsign-compare]
libsmartcols/src/table_print.c:753:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/ask.c:364:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/utils.c:33:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/context.c:435:56: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/context.c:730:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/script.c:557:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/dos.c:1791:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
libfdisk/src/gpt.c:813:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
misc-utils/logger.c:408:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
disk-utils/partx.c:140:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
disk-utils/partx.c:551:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
disk-utils/partx.c:640:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 03:18:27 +01:00
Ruediger Meier b0b54cc582 build-sys: always add AM_CFLAGS
We were missing our nice compliler warnings for many programs
and libs. See next commits how many trivial and non-trival
warnings have to be fixed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-23 01:17:29 +01:00
Karel Zak 45c9a3d27f Merge branch 'port-osx' of https://github.com/rudimeier/util-linux
* 'port-osx' of https://github.com/rudimeier/util-linux:
  include: fix sys/sysinfo.h
  libblkid: don't include endian.h
  lib: fix ismounted includes for FreeBSD
  lib: remove unused variable
  lsns: use xcalloc()
  include: remove unused mntent.h
  include: check for sys/sysmacros.h
  lib: define LOGIN_NAME_MAX fallback
  include: provide MAP_ANONYMOUS on OSX
  lib: rename strmode() and setmode()
  tests: fix ts_option helpers
  build-sys: fix [g]libtoolize version for OSX
  build-sys: check linker support for version scripts
  build-sys: portable usage of find command
  travis: minor cleanup
2016-02-19 11:30:53 +01:00
Ruediger Meier f3e0213aa4 include: remove unused mntent.h
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 16:54:23 +01:00
Ruediger Meier 66daee0765 include: check for sys/sysmacros.h
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 16:54:17 +01:00
Karel Zak 97ffbd43d2 cfdisk: wipe device if create a new label
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-18 12:58:12 +01:00
Karel Zak 15b5e942f2 sfdisk: add --wipe
This patch changes sfdisk 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> | sfdisk), 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 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
Ruediger Meier 7231fb2a5b misc: fix some printf format strings
Fix the warnings below for OSX clang and add a few more
casts for timeval:

lib/at.c:131:27: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Wformat]

                        printf("%16jd bytes ", st.st_size);

                                ~~~~~          ^~~~~~~~~~

lib/strutils.c:522:52: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]

                snprintf(buf, sizeof(buf), "%d%s%jd%s", dec, dp, frac, suffix);

                                                ~~~              ^~~~

lib/sysfs.c:468:42: warning: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]

        len = snprintf(buf, sizeof(buf), "%ju", num);

                                          ~~~   ^~~

libuuid/src/gen_uuid.c:316:34: warning: format specifies type 'unsigned long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]

                              clock_seq, last.tv_sec, last.tv_usec, adjustment);

                                                      ^~~~~~~~~~~~

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-11 13:39:56 +01:00
Karel Zak 300e24a8ea sfdisk: add ESP shortcut also for Legacy MBR
References: https://github.com/karelzak/util-linux/issues/267
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-08 16:37:03 +01:00
Karel Zak b1d31d03de Merge branch 'master' of https://github.com/rudimeier/util-linux
* 'master' of https://github.com/rudimeier/util-linux:
  script: fix misspelling
  docs: fix typos found by codespell
2016-02-04 16:02:17 +01:00
Ruediger Meier 3fd1f7711e docs: fix typos found by codespell
Using "codespell" from https://github.com/lucasdemarchi/codespell

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-03 15:10:08 +01:00
Karel Zak 4afb337e00 fdisk: make 'f' command more verbose
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-03 13:40:25 +01:00
Karel Zak c809b20aa4 sfdisk: make --quiet really quiet
References: https://github.com/karelzak/util-linux/issues/268
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-01 14:30:31 +01:00
Karel Zak d09c06baf4 sfdisk: add 'U' shortcut for ESP
echo -e ',512M,U\n,,L' | sfdisk --label gpt /dev/foo

to make ESP system partition.

References: https://github.com/karelzak/util-linux/issues/267
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-02-01 14:08:04 +01:00
Wayne R. Roth cc706d9f09 mkswap: add warnings for insecure device permissions/owners
Logic modified from sys-utils/swapon.c

Signed-off-by: Wayne R. Roth <wayneroth42@gmail.com>
2016-01-26 11:26:00 +01:00
Boris Egorov 43b4f7ea5f lib/tty: Pass default width to get_terminal_width()
Almost any code calling get_terminal_width() checks returned width for
non-positive values and sets it to some default value (say, 80). So,
let's pass this default value directly to the function.

[kzak@redhat.com: - get_terminal_width() refactoring]

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-01-06 12:22:07 +01:00
Karel Zak 717fff869e cfdisk: use new libsmartcols functionality to fix output
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 12:23:26 +01:00
Karel Zak 86688c378b Revert "cfdisk: make sure that output fits to terminal width"
This reverts commit ed99eac0e2.
2015-12-07 10:42:15 +01:00
Sami Kerola f5320b483c
fdformat: fix block device open race
This fix makes fdformat also to detect if block device is busy, and warn if
the device is misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 80c320fac1
mkswap: fix block device open race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 8a4eb983d8
mkfs.minix: fix block device open race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 98b4f74e1f
mkfs.bfs: allow creating file system to a file
Most, if not all, linux file systems allow this and there should not be a
reason why bfs could not do the same.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:37 +00:00
Sami Kerola 5fc7694a54
mkfs.bfs: fix block device open race
This fix makes mkfs.bfs also to detect if block device is busy, and warn if
the device is misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:37 +00:00
Sami Kerola d0a050e0f9 fsck: retire stat(3) when access(3) does better job
The stat(3) and access(3) are in this case almost interchangeable, so choose
the lightweight function with additional advantage checking the file is
executable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Karel Zak 1cd9d0d746 mount, umount, swapon, fsck, lsblk, findmnt: ignore malformed lines
The libmount provides way how to deal with parsing errors in fstab --
on error callback function is executed and according to the return
libmount manipulate with the malformed line, possible are three
states:

  1/ fatal error; all file ignored              (callback rc < 0)
  2/ recoverable error; malformed line ignored  (callback rc > 0)
  3/ ignore the error                           (callback rc == 0)

The 2/ is the default if no callback specified.

Unfortunately our utils uses 3/. The correct way is to use 2/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-15 12:01:48 +02:00
Karel Zak 24b7db7e4e partx: prevent code duplication
Reported-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-09 12:18:28 +02:00
Karel Zak aab9be66c4 sfdisk: add --delete
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 13:57:44 +02:00
Karel Zak 31c79e1823 sfdisk: fix -N return code detection, add debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 11:45:02 +02:00
Karel Zak d85a7fa744 sfdisk: cleanup and optimize --move-data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-09 14:48:33 +02:00
Karel Zak f42205d89a sfdisk: add --move-data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-08 16:37:08 +02:00
Karel Zak 9a17d9460a sfdisk: add --reorder
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1232707
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 10:18:46 +02:00
Yuri Chornoivan 75a8e726e9 Fix trivial typos 2015-08-25 20:02:53 +03:00
Sami Kerola 624e147ba2 misc: fix shadow declarations
sys-utils/zramctl.c: In function 'get_mm_stat':
sys-utils/zramctl.c:276:58: warning: declaration of 'inbytes' shadows a global declaration [-Wshadow]
 static char *get_mm_stat(struct zram *z, size_t idx, int inbytes)
sys-utils/zramctl.c:119:39: note: shadowed declaration is here
 static unsigned int raw, no_headings, inbytes;

libmount/src/tab.c: In function 'mnt_table_get_fs_root':
libmount/src/tab.c:1221:22: warning: declaration of 'fs' shadows a parameter [-Wshadow]
    struct libmnt_fs *fs = mnt_table_find_mountpoint(tb,
libmount/src/tab.c:1197:24: note: shadowed declaration is here
      struct libmnt_fs *fs,

disk-utils/fsck.minix.c: In function 'main':
disk-utils/fsck.minix.c:1364:17: warning: declaration of 'i' shadows a previous local [-Wshadow]
   unsigned long i, free;
disk-utils/fsck.minix.c:1250:6: note: shadowed declaration is here
  int i;

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-24 10:55:37 +02:00
Karel Zak ffab025db8 cfdisk, sfdisk: remove unused variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 12:41:46 +02:00
Ian Wienand 11aa2aa290 sfdisk: clarification for sfdisk man page
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1249893
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-05 09:21:27 +02:00
Karel Zak 70e0513563 mkfs.minix: add hint for scanners [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:42:27 +02:00
Karel Zak cd16685e94 mkfs.minix: use xalloc
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:39:49 +02:00
Karel Zak 101c80f316 mkfs.cramfs: remove dead code [coverity scan]
There two possible ways, print error and exit on too long names or
truncate the filename -- but it's impossible to do both in the same
code :-) It seems that code already assumes warning on long names, so
let's remove errx() and keep the behavior in dependence on -E.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:33:57 +02:00
Karel Zak 1e9d849b8d fsck.minix: be more paranoid with block buffers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 11:15:53 +02:00
Karel Zak 4c166c2200 cfdisk: check return value [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 10:59:52 +02:00
Sami Kerola 98f8b800dc tests: add way to control mkfs.minix time stamps
Needed in order to create reproducable file systems image files, so that
out come of mkfs.minix can be checksum'ed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 11:27:37 +02:00
Sami Kerola 3e56e36291 mkfs.minix: re-fix block count maths
Error, that Joshua Hudson already pointed out, creapped back to commit
da41ff5 when changes were applied from mailbox rather than git remote, as
the corrected change had included some accidental rubbish.

Reference: http://www.spinics.net/lists/util-linux-ng/msg11764.html
Reference: http://www.spinics.net/lists/util-linux-ng/msg11848.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 11:27:36 +02:00
Benno Schulenberg 62eea9ce12 textual: adjust grammar and punctuation of some messages
Also equalize three messages to one other one,
and fix a typo in USE_COLORS_BY_DEFAULT.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:18:56 +02:00
Karel Zak 901f85fe54 sfdisk: don't print extra linebreaks on --quiet
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 13:22:35 +02:00
Sami Kerola e87a6ee0f5 docs: make fsck.minix(8) more pretty
Use real table to device list, add missing new paragraph markers, remove
braces that cause reader to wonder if test is meant or not, squeeze error
code list, move references to bottom of the manual, and use mail or web
address macro when possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:18 +02:00
Sami Kerola 158b8d6918 fsck.minix: introduce long options to the command
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:17 +02:00
Sami Kerola 86a9f3dad5 fsck.minix: add minix v3 support
Relates-to: a2657ae3ff
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:16 +02:00
Sami Kerola e1df9d4cd6 fsck.minix: rename device file descriptor variable
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:16 +02:00
Sami Kerola ed7f9c5d96 mkfs.minix: refactor root block content creation
This does not belong to main() function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:15 +02:00
Sami Kerola a232cfdc0a mkfs.minix: check requested blocks will not exceed available on device
Earlier user could define more blocks than device, or backing file for
loopback file system, had available.  That lead to a system crash with
following commands;

fallocate --length 64KiB test-file
mkfs.minix -3 -i 842160 test-file 104882174
mkdir test-file.d
mount test-file test-file.d
cp /etc/service test-file.d
Killed
sudo umount test-file.d

The minix driver should probably not hang the whole kernel, but the least
that mkfs.minix ought to do is not to let users to get that condition
quite as easily.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:15 +02:00
Sami Kerola 2159dbf365 mkfs.minix: check user input carefully
File name lenght and version input needs to be checked against each
other, which will determine what version of file system is in question.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:14 +02:00
Sami Kerola 77799d7c38 mkfs.minix: add fs_control structure, and remove most global variables
This allows better code structure in future.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:14 +02:00
Sami Kerola 3bb74a3ada mkfs.minix: remove unuseful code
Checks about inodes vs block sizes does not add much robustness.  Both
values are derived at compilation time from struct minix_inode size, and
they form full definition circle.

Bad block check for none-block devices should not be supressed, user
requested it so let him have it.

Check for st_rdev == 0x0300 || st_rdev == 0x0340 was unreachable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:13 +02:00
Sami Kerola c99128bcf5 mkfs.minix: use is_mounted() from libcommon
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:13 +02:00
Sami Kerola b59c5925ce mkfs.minix: introduce long options to the command
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-30 11:39:12 +02:00
Joshua Hudson da41ff553a mkfs.minix: increase maximum minix v2 and v3 file system sizes
mkfs.minix misbehaves when attempting to create a large v2 or v3
filesystem.  I finally traced it down to attempting to create too many
inodes so that the first zone is past 65535 blocks in.  This obviously
doesn't work as the on-disk superblock says this is a 16 bit integer.

I wrote a patch that catches this, clamps to the absolute v2/v3 limit
(like it already does for v1), and sets the blocks per inode to a more
reasonable ratio when exceeding half a gigabyte.  Having a half-gig
filesystem with most files being smaller than 3k isn't really reasonable.

I suppose if you don't want to adjust inode sizes automatically you could
take that part out, and it will just crab sooner.

Given the non-attention in the code, I suspect nobody ever had cause to
try such a big minix filesystem.  Well I have my reasons involving some
deeply embedded work where ext2 would place too much strain on the
hardware.

Reviewed-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Joshua Hudson <joshudson@gmail.com>
2015-07-30 11:39:12 +02:00
Karel Zak 4df892812b fdisk: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:59:19 +02:00
Karel Zak e5161deefb fdisk: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:57:28 +02:00
Karel Zak f45f5c83f9 fdisk: value is never read [clang analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:51:05 +02:00
Karel Zak 8abdb91211 sfdisk: add --list-free
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-28 15:54:07 +02: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 1b2e9dd01d cfdisk: don't print obsolete CHS addresses
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 15:49:14 +02:00
Karel Zak ed99eac0e2 cfdisk: make sure that output fits to terminal width
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 15:29:37 +02:00
Karel Zak 053939a45a fdisk: init libsmartcols debug
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 13:33:09 +02:00
Karel Zak 6e07b904e7 cfdisk: remove extra line between menu and info line
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 12:37:15 +02:00
Benno Schulenberg d48fc38307 cfdisk: spell "label" in lower case
To be less shouty.  It is not an abbreviation like "UUID".

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-07-27 11:57:11 +02:00
Benno Schulenberg 80351b1f4a cfdisk: allow an uppercase X to toggle the extra info
To make true the help text line that says that all commands
can be entered with either upper or lower case.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-07-27 11:57:08 +02:00
Karel Zak cbcafba2bb cfdisk: make sure that extra info is refreshed/removed
For example when you move from a Partition to the FreeSapce then we
need to remove old extra info and draw nothing.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-22 14:28:33 +02:00
Karel Zak a2d0dbb433 cfdisk: properly toggle extra info window, make it more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-22 14:11:27 +02:00
Karel Zak 4bd02cdfdf libfdisk: fix fdisk_label_parse_parttype() for unknown types
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 15:42:22 +02:00
Sami Kerola 55034ed00e docs: unify mkswap(8) with swapon(8) about holes warning
Reviewed-by: Dave Rutherford <dave@evilpettingzoo.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 12:06:00 +02:00
Boris Egorov 13c551f259 cfdisk: fix condition logic [cppcheck]
[disk-utils/cfdisk.c:1181] -> [disk-utils/cfdisk.c:1181]: (warning)
Possible null pointer dereference: data - otherwise it is redundant to
check it against null.

Signed-off-by: Boris Egorov <egorov@linux.com>
2015-06-25 12:08:53 +02:00
Boris Egorov e3ca1312a2 sys-utils/disk-utils/lib: fix printf format types [cppcheck]
Fix 'invalidPrintfArgType' cppcheck warnings

Signed-off-by: Boris Egorov <egorov@linux.com>
2015-06-25 12:08:45 +02:00
Benno Schulenberg 7f5769182f sfdisk: improve some formatting and wording in the man page
The main fix is: giving -J, --json its own paragraph.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-06-17 11:01:38 +02:00
Benno Schulenberg 3f43f5d05e sfdisk: show that the command --verify optionally takes device names
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-06-17 11:01:33 +02:00
Karel Zak a592b4b580 sfdisk: add --json
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-15 13:23:36 +02:00
Karel Zak 5989556ad3 libfdisk: add new API to read label specific data
* removes list() label operation from internal API

  The list() has been based on fdisk_info() it was useless for
  anything else than print on stdout...

* add a new get_item() label operation and fdisk_get_disklabel_item() public API

  The new API provides abstract and pretty simple way how to get label
  specific disk label information, for example

     fdisk_get_disklabel_item(cxt, GPT_LABELITEM_ENTRIESLBA, &iterm);

  return LBA of the array with GPT entries.

  Note that this patch does not implement public functions to get
  data from the @item object.

* removes get_id() label operation -- it's subset of the new get_item()

* the new internal API is also used to implement backwardly compatible
  fdisk_list_disklabel() and fdisk_get_disklabel_id()

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-11 14:19:47 +02:00
Karel Zak 8c73e5096d fdisk: differentiate between +<sector> and +<size>{M,G,...}
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-10 13:06:15 +02:00
Karel Zak 765004f3eb libfdisk: (gpt) make it possible to create really small partitions
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-08 16:02:17 +02:00
Karel Zak 6360bccad5 fdisk: provide more information by 'i'nfo command
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-05-11 12:45:21 +02:00
Jean-Loup 'clippix' Bogalho 3e3b51b3b1 fdisk: add the 'i'nfo command
Add the 'i'nfo command to fdisk that prints details about a specific partition.
Details are everything the function 'fdisk_label_get_field' can return.

Signed-off-by: Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr>
2015-05-11 12:26:30 +02:00
Stanislav Brabec d60d5b74d2 fsck: Fix parsing of -r
Fix regression introduced by commit 658c089: -r cannot be used as a last
option:

fsck -r /dev/sda1
fsck: invalid argument -r: '/dev/sda1'

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2015-05-05 12:28:41 +02:00
Karel Zak 658c089190 fsck: print errors on invalid -r argument
The patch also add support for -r 0.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-28 13:43:14 +02:00
Stanislav Brabec 07c09a29ea fsck: implement fsck -r {fd}
Make possible sending of statistics to a dedicated file descriptor.

Rationale: When UI is calling fsck from a remote terminal, fsck progress
needs to be sent to stdout. It is mixed there with output of statistics,
and it is impossible to parse the output to get the statistics.

Now it will be possible e. g. with "fsck -C -r 3 /dev/sda1"

Note: Code in if and else is intentionally partially duplicated. Current
human readable output of floats does not conform to locale conventions,
and may be changed in future. But we want to keep machine readable output
exactly same as it is now.

[kzak@redhat.com: - don't use report_stats_fd globally]

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-28 13:16:41 +02:00
Karel Zak a03bdbcd20 fsck: use PATH or fallback to /sbin
It's overkill to support all the obscure paths like /sbin/fs.d. We
have PATH for customization, that's enough.

It still seems like a good idea to keep fsck robust, because it's used
by boot scripts/systemd. For this reason fsck fallbacks to "/sbin" if
PATH is undefined or empty.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-27 10:52:09 +02:00
Mike Frysinger 07b5156790 mkfs: drop hardcoded search path
Rather than maintain a hardcoded search path for looking up tools and
override the user's PATH env setting, respect whatever the user has.
This matches the convention of just about every other tool out there.

It might break on systems that don't have /sbin in their PATH and they
try to run /sbin/mkfs directly, but so be it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2015-04-27 10:28:44 +02:00
Karel Zak 9d9a1b8760 libfdisk: (gpt) add extra check for First/Last LBA
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-23 12:32:36 +02:00
Karel Zak 40b175084f lib/strutils: fix string_add_to_idarray() int vs. size_t
The function uses "int" as argument, but for array size (and index) is better
to use unsigned type (size_t). If we mix "size_t" in util (e.g. fdisk)
and "int" in lib/strutils.c then result is unexpected behavior on
ppc64.

	# sfdisk --list -o DEVICE,START,SIZE /dev/sdb
	Disk /dev/sdb: 50 MiB, 52428800 bytes, 102400 sectors
	Units: sectors of 1 * 512 = 512 bytes
	Sector size (logical/physical): 512 bytes / 4096 bytes
	I/O size (minimum/optimal): 4096 bytes / 32768 bytes
	Disklabel type: gpt
	Disk identifier: 3B8559DB-33AF-43E9-BEFC-C331D829B539
	lt-sfdisk: libfdisk/src/label.c:178: fdisk_label_get_field: Assertion `id > 0' failed.

The patch cleanup all code to use size_t everywhere.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-22 11:08:05 +02:00
Karel Zak 622be27845 fdisk, sfdisk: fix -o <list> backend
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-22 10:20:31 +02:00
Karel Zak a53e37f9d4 sfdisk: don't use BLKRRPART to check loopdev usage
It seesm that kernel always returns EINVAL for BLKRRPART on loop
devices, we call the ioctl to check if nobody else uses the device.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-17 10:32:48 +02:00
Karel Zak 2928068a3c sfdisk: accept empty partitions from dump
Old sfdisk uses:
  dev/sdc2 : start=        0, size=        0, Id= 0

for undefined MBR partitions. Let's follow this behaviour.

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-16 17:51:18 +02:00
Karel Zak 9ff89c5d9c fdisk: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-13 18:11:38 +02:00
Karel Zak aeb9a30ba4 fdisk: add --protect-boot
Now fdisk erases the begin of the device when create a new disk label, it seems
like disadvantage for some use-cases.

Reported-by: Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-13 17:24:45 +02:00
Karel Zak 6265639505 sfdisk: enable bootbits protection
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1210428
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-13 13:41:10 +02:00
Karel Zak d754d5540f sfdisk: improve -N warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-04-13 12:08:50 +02:00
Karel Zak 3542fc516a cfdisk: cleanup extra partitions info for slang
The patch removes problem with getch() on slang, now the code is based
on subwin() and extra info window is persistent.

A new problem is that slang does not keep sub-window border
persistent. I'm going to ignore this slang problem... use ncurses
dude!

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-31 13:10:17 +02:00
Karel Zak 3ba8e422a0 sfdisk: cleanup prompt usage
Let's use fgets-like callback only when compiled with readline,
otherwise (and also for non-tty) print prompt by printf().

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-27 15:04:58 +01:00
Ondrej Oprala dda7fe12ac cfdisk: provide extra partinfo with "x"
The new 'extra' info provides:

 * filesystem information from libblkid (TYPE, UUID, LABEL)

   This feature is based on libblkid ability to probe specified area
   on the device. It allows to probe for filesystems although the
   partition devices (e.g. /dev/sda2) does not exist. For example from
   disk image:

   	# cfdisk /home/archive/fs-images/disk.img

 * additional information from libfdisk (partition UUID, Name, ...)

 * mount information from libmount (from fstab or mountinfo)

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Karel Zak <kzak@redhat.com>
2015-03-27 14:04:44 +01:00
Karel Zak da99043dc4 build-sys: fix READLINE_LIBS_STATIC usage for fdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-26 19:05:11 +01:00
Karel Zak 703ab08256 sfdisk: fix -a vs. -A bug
The -A has been originally used for --activate, since v2.26 it's used
for --append. This is stupid mistake. This patch reverts the change to:

 -A, --activate
 -a, --append

Note that --append is a new command line option in v2.26.

Addresses: https://bugs.archlinux.org/task/44349
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-26 18:21:53 +01:00
Karel Zak 15eba21796 build-sys: support static build with readline
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-25 17:55:22 +01:00
Karel Zak 7159b496d5 sfdisk: add readline support
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-25 16:06:39 +01:00
Karel Zak 84ab260aa2 fdisk: fix readline wrapper
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-25 16:06:26 +01:00
Karel Zak 740c36f657 fdisk: add GNU Readline support to fdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-25 10:31:37 +01:00
Stanislav Brabec d1bba731c6 fsck: fix fsck -C {fd} parsing
Both fsck(8) and fsck --help documents progress bar redirection as
-C {fd}

This did not work, and only -C{fd} and "-C {fd}" worked.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-25 09:26:23 +01:00
Karel Zak 95305cec15 Since 569d1dac7b we read device start
sector from the /sys/block/.../start file. The file exists only for
partitions, for wholedisk is the start of the device always zero.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1202443
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-17 11:10:20 +01:00
Karel Zak 254743e4a6 build-sys: cleanup realtime lib usage
* check for timer_create()
* define dependence on timer_create() for flock
* rename CLOCKGETTIME_LIBS to REALTIME_LIBS

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-06 14:20:19 +01:00
Karel Zak 4310faf950 lib/colors: use libtinfo to check terminal capability
The current implementation assumes that all terminals supports colors
and users are forcet to use terminal-colors.d/ to disable colors for
some terminals.

This patch checks for maximal supported colors for the current
terminal and colors are automatically disabled for terminals like
vt100.

The patch moves lib/colors.c from libcommon.la to libtcolors.la to
avoid collisions with another utils.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-27 13:57:34 +01:00
Karel Zak 5d51dc2a7f colors: cleanup man pages, add hint to usage()
cfdisk, fdisk, calm dmesg and hexdump

Signed-off-by: Karel Zak <kzak@redhat.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-25 12:40:06 +01:00
Karel Zak da25898b7a sfdisk: add missing --color
The util already support lib/colors.c stuff, but without command line
option.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-25 12:37:04 +01:00
Sami Kerola cd2a6f1cfd rpmatch: use symbolic value when evaluation return codes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 12:42:06 +01:00
Sami Kerola 6340e9137f sfdisk: include rpmatch.h
Some libc's do not have rpmatch(), and they need the workaround in the
header file.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-16 11:08:24 +01:00
Karel Zak 0b1bb28399 fsck: fix compiler warning [-Wlogical-not-parentheses]
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-16 11:02:53 +01:00
Karel Zak 941409c066 cfdisk: improve create-label UI
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-10 12:50:33 +01:00
Benno Schulenberg 57eae22317 textual: sort the options in the usage text of sfdisk alphabetically
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-10 12:23:15 +01:00
Benno Schulenberg 80840c1665 docs: sort the options in the man page of sfdisk alphabetically
Also fix some typos.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-10 12:23:15 +01:00
Benno Schulenberg f16c37f4a5 cfdisk: also recognize a lowercase 'l' for loading a script file
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-10 12:23:15 +01:00
Benno Schulenberg 5088d642dd cfdisk: do not startle the user with a false message when --zero is used
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-10 12:23:15 +01:00
Sami Kerola c9e24d604a fsck: use monotonic time to fsck run time measurement
Earlier use of gettimeofday() resulted to wrong measurement if system
administrator did manual time changes, or NTP or adjtime(3) adjusment
happen during fsck run.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-10 11:18:51 +01:00
Karel Zak 29e9b787da cfdisk: improve ui_get_size() warnings
- don't reset to default after error
 - clean previous warnings after users response
 - remove unnecessary warning

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 13:06:20 +01:00
Karel Zak 1bb387bdbd libfdisk: fix issues with very small partitions
- cfdisk: minimal partitions size is 1 sector
 - dos: when align last sector then don't set partition size to zero
   for very small partitions.
 - don't ignore tiny partitions before free space when define
   free-space start offset
 - improve some debug messages

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 12:44:00 +01:00
Karel Zak 47dd69188a docs: add info about *_DEBUG= to man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 11:16:46 +01:00
Karel Zak f9fb8290d8 cfdisk: print "wrong order" warning after startup, colorize info messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 11:04:37 +01:00
Karel Zak b5ef65a931 cfdisk: force main menu to default to Quit/New menu items
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 10:37:33 +01:00
Karel Zak 635a81513a cfdisk: disable some KEY_* in ui_get_wqstring()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-02 13:05:48 +01:00
Karel Zak 316bce9dd4 cfdisk: default to Quit menu item
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-02 12:47:50 +01:00
Benno Schulenberg fc14ceba5e textual: grammarize and harmonize the stat error message
The message "stat failed %s" seems to say that stat() failed to
do something, or failed to pass a test, but of course it means
that the statting of something failed.  So say so.  Also make
two very similar messages equal to this one.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 11:27:10 +01:00
Benno Schulenberg 9ac1fcf6c5 sfdisk: actually translate the table headers by calling gettext()
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg c7b1fbb4c5 docs: add the Sort command to the man page of cfdisk
Also sort T into its proper position, improve the wording of U,
and add the Left and Right arrow keys.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg 2a0ffa311c cfdisk: make '?' an alias of 'h', to also show the help screen
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg d4640320df cfdisk: punctuate the bottombar messages consistently
Also adjust the style of two comments and add another.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg 143d9e3e52 cfdisk: improve wording and consistency of the size warnings
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg a4fbbbd491 cfdisk: remove the mistaken B from the explanation of size suffixes
Also reword the explanation to be clearer.  It is not necessary to
be complete -- that is what the man page is for.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Karel Zak 54efd37875 sfdisk: fix --id fallthrough [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 14:50:38 +01:00
Karel Zak 52c56476ae fsck: deallocate when no cache [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 14:45:15 +01:00
Karel Zak 68ddb13662 fdisk: check return and robust label usage [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 14:40:10 +01:00
Karel Zak 9eaa7292e4 blockdev: check return when read from sysfs [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 14:33:36 +01:00
Karel Zak ec8a728ae0 cfdisk: fix mem leak and main_menu_action() logic [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 14:30:20 +01:00
Karel Zak bf031d89ea libfdisk: support unknown partition types in sfdisk scripts
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1183234
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 09:57:03 +01:00
Karel Zak 9bbcf43f88 libfdisk: don't use off_t in public API
It's better to use exact and explicitly defined types (e.g. uint64_t)
rather than something like off_t to make code more portable.

[reported with gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3)]

The patch also fixes one debug message.

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-26 12:26:00 +01:00
Benno Schulenberg b6e3c61464 cfdisk: actually translate the table headers and the bottom line
The printout of the table headers and the bottomline descriptions
were lacking calls to gettext().

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:53:51 +01:00
Benno Schulenberg e993b9c8e5 cfdisk: shorten the help screen to make it fit within 25 lines
When the terminal has less than 32 lines, the new cfdisk ignored the
fact that the help-screen text was longer and just skipped printing
the remaining lines.  Instead of introducing a minipager for the help
screen, just condense its text and remove unneeded lines.  Now the
text occupies just 25 lines, which should fit on most terminals.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:53:49 +01:00
Benno Schulenberg fd4484a712 cfdisk: don't mess up the help screen by printing the PO file header
Asking for the translation of the empty string ("") produces the header
of the PO file corresponding to the current locale, which messes up the
help screen.  So, don't use empty strings in the array of help strings
but (arbitrary) double spaces.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:53:48 +01:00
Yuri Chornoivan 6e834d67ee textual: fix various minor typos 2015-01-26 11:38:38 +01:00
Karel Zak 3d0b57d62c Merge branch 'opts' of https://github.com/jwpi/util-linux 2015-01-26 11:31:05 +01:00
Benno Schulenberg 54fefa078e textual: fix spellos and inconsistencies in several program messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:17:55 +01:00
J William Piggott b06c1ca6f8 docs: restore minus symbols in long opts
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-20 18:15:30 -05:00
Karel Zak ce9f568c25 libfdisk: accept Start offset in {B,M,G..}iB in sfdisk scripts
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-20 14:20:47 +01:00
Karel Zak 8de07279bb sfdisk: fix --bytes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-19 12:26:37 +01:00
Karel Zak 354f8cc8cf libfdiskL add API to print SIZE field in bytes
The patch also add --bytes to fdisk and fdisk.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-19 11:24:48 +01:00
Karel Zak 2d7dffebac fdisk: add --output to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-14 12:07:52 +01:00
J William Piggott 973252578d docs: fix-up man-pages flaged by checkmans.sh
disk-utils/sfdisk.8	Fix font escape
login-utils/vipw.8	Delete bogus macro
misc-utils/look.1	Delete bogus macro
sys-utils/prlimit.1	Delete bogus macro

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-13 11:43:46 -05:00
Karel Zak 2e5bf10e32 build-sys: add sfdisk.static
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-13 16:59:03 +01:00
Karel Zak a434e2398a raw: fix raw query
Bug introduced by commit cd121363.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1181444
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-13 09:53:46 +01:00
Karel Zak 4926bc3683 partx: don't use "hard drive" in man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-12 11:15:55 +01:00
Benno Schulenberg e04b812407 docs: make the wording of the partx man page a bit more precise
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:04:35 +01:00
Benno Schulenberg 4b8dfcc8a4 partx: simplify a --verbose progress message
Reported-by: Antonio Ceballos <aceballos@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:03:27 +01:00
Benno Schulenberg 3a60b1c26b docs: remove obsolete and unneeded comments from man-page files
Transform some of them into copyright lines.
Also fix three header lines and snip some trailing whitespace.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:03:26 +01:00
Benno Schulenberg 4f8d6551d6 docs: sync the docstring of addpart, delpart and resizepart to the man page
Also tweak the wording of those man pages a bit.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:03:26 +01:00
Karel Zak 08ec8a6fad partx: add --update to ul_excl_twq list
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-12 10:58:00 +01:00
Karel Zak 4bb82a4554 libfdisk: (gpt) cleanup header size usage
Kay reported that Windows 8.1 installed does not recognize GPT created
by libfdisk, but parted works as expected.

It seems (according to the header hexdump) that the problem is
HeaderSize GPT field where libfdisk uses 512 (header + reserved area),
but parted uses 92. The both is pretty valid according to the current
EFI standard, but 92 is probably more backwardly compatible.

I also found places in code where libfdisk gpt driver is inconsistent
and uses sometimes all sector and simetimes sizeof(gpt_header) only.
The right solution is to read all sector (into zeroized memory) and
later write again all sector to the device.

Reported-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-09 13:05:49 +01:00
Sami Kerola 730ae9c899 fsck.minix: fix segmentation fault
Return from check_file() and check_file2() functions when maximum name
depth is reached.  The use unsafe strncpy() is also removed just to be on
safe side.

Addresses: https://bugs.debian.org/773892
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:14:13 +01:00
Sami Kerola 7ee26cbf02 maint: fix shadow declaration
This change fixes all shadow declarations.  The worth while to mention
fix is with libfdisk sun geometry.  It comes from bitops.h cpu_to_be16
macro that further expands from include/bits/byteswap.h that has the
shadowing.

libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow]
libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow]

That could have caused earlier some unexpected results.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:08:21 +01:00
Benno Schulenberg 451dbcfae1 textual: add a docstring to most of the utilities
This adds a concise description of a tool to its usage text.

A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:27:38 +01:00
Karel Zak 8c9615a99b cfdisk: improve Dump dialog
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-05 12:53:50 +01:00
Karel Zak 702d0e1cef cfdisk: improve menu clean function
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-05 12:42:24 +01:00
Karel Zak 7509020126 cfdisk: detect too small partition sizes
References: https://github.com/karelzak/util-linux/issues/136
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-05 12:13:25 +01:00
Benno Schulenberg edac3e2c2e sfdisk: in the usage text show -v for --version instead of -V
In sfdisk -V is taken by --verify.  Use for the description of --version
the same indentation as for --help, not that of the other options.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:28 +01:00
Benno Schulenberg 689d83de5a docs: fix the grammar and formatting in the man page of sfdisk
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:26 +01:00
Benno Schulenberg 7ab7109972 docs: adjust some formatting and wordings in a handful of man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:25 +01:00
Benno Schulenberg f49ccec212 docs: don't use bold or italics for "[option]" in synopsis of man pages
As per the convention shown in Documentation/howto-man-page.txt.
Also make a few other tiny adjustments along the way.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:23 +01:00
Sami Kerola 338a6bc55b textual: improve error messages
Use error printing facilities that add command name in front of the error
message, and add explanation that is part of existing translations.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-12-09 09:19:22 +01:00
Karel Zak 0073a4cff2 libfdisk: rename sector_t to fdisk_sector_t
.. just to avoid too generic names for public API.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-12-04 11:41:51 +01:00
Karel Zak a1ef792fda libfdisk: rename and move function
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-26 17:33:07 +01:00
Karel Zak 0477369af4 libfdisk: remove flags from fdisk_ask API
We don't use it for anything usable, lets kill this over-engineering.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-21 15:31:55 +01:00
Karel Zak 333c376138 libfdisk: (dos) allow to maximize partition
The struct fdisk_partition has special flag "end_follow_default" to
make the partition large as much as possible. This patch makes this
flag usable for fdisk_set_partition() function.

Command line example (enlarge the first partition):

	# echo ',+' | ./sfdisk -N1 /dev/sdb
	...
	Disk /dev/sdb: 100 MiB, 104857600 bytes, 204800 sectors
	...
	Old situation:
	Device     Boot Start   End Sectors Size Id Type
	/dev/sdb1        2048 22527   20480  10M 83 Linux
			      ^^^^^
	New situation:
	Device     Boot Start    End Sectors Size Id Type
	/dev/sdb1        2048 204799  202752  99M 83 Linux
			      ^^^^^^

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-20 13:11:38 +01:00
Sami Kerola acec6eec4e mkswap: remove memory leaks [LeakSanitizer] [valgrind]
==18922==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x49d12b in __interceptor_malloc (/home/src/util-linux/.libs/lt-mkswap+0x49d12b)
    #1 0x7faf2a5069c9 in __GI___strdup (/usr/lib/libc.so.6+0x819c9)
    #2 0xffff96e7e33 (<unknown module>)

SUMMARY: AddressSanitizer: 8 byte(s) leaked in 1 allocation(s).

And another one that valgrind found.

==6316== 8 bytes in 1 blocks are definitely lost in loss record 1 of 1
==6316==    at 0x4C29F90: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6316==    by 0x5E3F9C9: strdup (in /usr/lib/libc-2.20.so)
==6316==    by 0x43A25F: size_to_human_string (strutils.c:495)
==6316==    by 0x42B35C: main (mkswap.c:488)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-18 12:56:46 +01:00
Boris Egorov 1ce1a112c4 fdisk: missing break in switch
Signed-off-by: Boris Egorov <egorov@linux.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-13 15:10:58 +01:00
Karel Zak 5c04b40850 cfdisk: cleanup menuitem draw functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-13 12:52:03 +01:00
Karel Zak 5cb9918d59 cfdisk: remove [Load] from menu
This functionality will be rarely used, so it does not make sense to
waste screen space with this menu item. It's enough to provide this
functionality in "Select label type" dialog (cfdisk --zero and then
'L' command).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-13 11:19:58 +01:00
Karel Zak a89eafed85 cfdisk: add support for sfdisk scripts
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-12 16:12:39 +01:00
Karel Zak a30e4ef423 fdisk: add support for sfdisk scripts
New commands 'I' and 'O' allows to read and write sfdisk compatible
scripts by fdisk. It means that you can save your work (partition
table) and later use it (in fdisk, sfdisk or cfdisk) to create a new
partition table.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-12 11:15:06 +01:00
Karel Zak 9a83b03c73 mkswap: make final report more human readable
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 14:03:35 +01:00
Karel Zak 3ba01c145c mkswap: device write code refactoring
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 13:55:37 +01:00
Karel Zak fabf29f4fe mkswap: device open code refactoring
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 13:46:42 +01:00
Karel Zak 99f78758aa mkswap: always use header from control struct
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 13:35:50 +01:00
Karel Zak 8591859cd7 mkswap: coding style improvements
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 13:25:11 +01:00
Benno Schulenberg 24930e7088 docs: fix some wording, grammar and formatting in man page of swapon
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-11-07 13:21:06 +01:00