Commit Graph

843 Commits

Author SHA1 Message Date
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
Sami Kerola d68f402c54 mkswap: various minor improvement
Use correct data type in page_bad(), and add information to error message
how many bad pages were seen.

In check_blocks() move initialization to variable introduction, fix typo,
and avoid memset() when array initializer can do the job.

In main() use correct initializer for pointer.  Move swap file specific
actions to same location, and add warning when request too --check is
dismissed by command.  At the end remove momory leak.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-07 13:21:06 +01:00
Sami Kerola 076ba5a696 mkswap: set variable only when it's value is known
Avoid updating ctl->pagesize twice when user does specify page size.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-07 13:21:06 +01:00
Sami Kerola 6af1822752 mkswap: make remaining functions to take control structure as argument
The wipe_device() and new_prober().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-07 13:21:06 +01:00
Sami Kerola de3822c39c mkswap: add struct mkswap_control to remove global variables
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-07 13:21:06 +01:00
Sami Kerola 3d5c8ba1c9 mkswap: use err() rather than perror() && exit()
The messsages in err() are verified from po/util-linux.pot to be already
part of translations.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-07 13:21:05 +01:00
Sami Kerola c181617cfb mkswap: remove unnecessary size check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-07 13:21:05 +01:00
Sami Kerola a1466ab2b2 mkswap: remove system architecture specific max swap size checks
Since kernel version 2.3.4 (June 1999) all architectures has used
uint32_t as maximum number or pages in a swap device or file, there is no
longer need to support systems earlier than that.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-11-07 13:21:05 +01:00
Karel Zak c747564764 fdisk: fix and improve -l warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 10:42:49 +01:00
Karel Zak d5206b9667 sfdisk: fix version typos in man page
Reported-by: JWP <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-07 09:33:57 +01:00
Karel Zak 68e422ecae docs: update info about env debug variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-03 13:13:54 +01:00
Sami Kerola 5d36513976 sfdisk: return deterministic value from sfdisk_deinit()
disk-utils/sfdisk.c:222:9: warning: variable 'rc' is uninitialized when
used here [-Wuninitialized]
        return rc;
disk-utils/sfdisk.c:208:8: note: initialize the variable 'rc' to silence
this warning
        int rc;

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-31 10:38:55 +01:00
Karel Zak 819d9a2975 include/debug: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-24 11:19:23 +02:00
Karel Zak fd211531e8 fdisk: add section about sizes to the man page
Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594005
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-23 12:11:50 +02:00
Sami Kerola f0f2be20ed sfdisk: fix compiler warnings about uninitialized variables
warning: 'str' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-20 14:07:21 +02:00
Karel Zak dfc6db2a35 libfdisk: cleanup parttype API
* add reference counting
 * add functions to set allocated types

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-15 14:10:25 +02:00
Karel Zak ecf40cda76 libfdisk: make it possible to use zero for size and start
The zero may be valid size and start of the partition. This patch
introduces:

	fdisk_partition_has_start()
	fdisk_partition_has_size()
	fdisk_partition_unset_size()
	fdisk_partition_unset_start()

to make it possible to work with zero. The feature is internally
implemented by magic constant ((type) -1) for undefined sizes and
offsets.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-15 12:17:40 +02:00
Karel Zak 3692c28d06 tests: add PMBR sfdisk test
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-13 13:30:28 +02:00
Karel Zak 90dc69e40a sfdisk: leave on error
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-10 12:52:24 +02:00
Karel Zak 05af8bd4f0 sfdisk: ask on EOF
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-09 12:23:59 +02:00
Karel Zak 9b0b9fb1bf libfdisk: follow explicitly specified partition size
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-09 12:09:07 +02:00
Karel Zak 6d812a4859 fdisk: reset cached output fields when change disk label
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-09 12:03:32 +02:00
Karel Zak 8be199ea2b sfdisk: cleanup isatty() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-08 13:00:56 +02:00
Karel Zak e1422de3d8 sfdisk: add --label-nested for hybrid GPT
regular disk label:
	# sfdisk --list /dev/sdb
	..
	Disklabel type: gpt
	Disk identifier: 9DF9A9F1-0654-4E7A-9A5E-36E66D60FD79

	Device     Start    End Sectors Size Type
	/dev/sdb1   2048  22527   20480  10M Linux filesystem
	/dev/sdb2  22528  43007   20480  10M Linux swap
	/dev/sdb3  43008 204766  161759  79M Linux filesystem

nested (PMBR):
	# sfdisk --list --label-nested dos /dev/sdb
	...
	Disklabel type: dos
	Disk identifier: 0x00000000

	Device     Boot Start    End Sectors  Size Id Type
	/dev/sdb1           1 204799  204799  100M ee GPT

and for example:
        # sfdisk --label-nested dos /dev/sdb <<EOF
        1, 2047, ee
        , 10M, L
        , 10M, S
        ,,

creates hybrid GPT (PMBR partitions point to the same location as GPT)

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:33 +02:00
Karel Zak a8a4887bcd libfdisk: fix sun and sgi to be usable from sfdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:33 +02:00
Karel Zak f5aa7b613d fdisk: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 01f9286cb1 sfdisk: 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 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 bc9e854709 sfdisk: add --part-attrs
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak e36fb07af6 sfdisk: cleanup option names
Rename options to --part-{label,uuid,type} to be compatible with
another tools (like lsblk, parts, etc).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 351fad5069 sfdisk: add --name
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 3a5bdedf6a sfdisk: add --uuid command
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 9a79aa6e7a sfdisk: more update to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 5aac742940 sfdisk: update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 347a7f7756 sfdisk: add --append
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak e54b1c6fcb sfdisk: be sensitive to PT limits
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak ab02d87e4f sfdisk: add --backup and --backup-file
The option --backup force sfdisk to store *all* fragments of the
partition table (including MBR partition tables store in the
extended partitions) to

	$HOME/sfdisk-<devname>-<offset>.bak

The options -O, -backup-file <path> allows to override the default
path, but sfdisk still appends <devname>-<offset>.bak to the <path>.
The backup files always contain only raw data from the device, so it's
possible to use dd(1) to restore original data on the device.

The original sfdisk also supported -O <file>, but semantic was little
bit different:

   - all was based on 512-byte sectors
   - all sectors was stored to the one file in format
	  <offset>|<sector>|<offset>|...

this original concept makes the backup files specific to sfdisk and with
dependence on sector size.

The new concept is the same we already use for wipefs(8) backup files.

Example (disk with GPT):

   # sfdisk /dev/sda --backup

   Welcome to sfdisk (util-linux 2.25.202-f4deb-dirty).
   Changes will remain in memory only, until you decide to write them.
   Be careful before using the write command.

   Backup files:
          PMBR (offset     0, size   512): /root/sfdisk-sda-0x00000000.bak
    GPT Header (offset   512, size   512): /root/sfdisk-sda-0x00000200.bak
   GPT Entries (offset  1024, size 16384): /root/sfdisk-sda-0x00000400.bak

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak db48b6a189 sfdisk: add --no-reread and --force
and also check if the device is in use.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak f01f252857 sfdisk: add --no-act
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 35ce145f6a sfdisk: add deprecated --Linux
The sfdisk does not care about compatibility with classic DOS
partitioning, and it does not warn about incompatibility with DOS at
all. It means that --Linux is default and it's unnecessary to use
this option.

It's the same situation like with "--unit S", these options are very
probably often used in scripts, and these all is default now. So for
backward compatibility new sfdisk accepts these options on command
line, but prints "option is deprecated" warning message.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak f0edb076ed sfdisk: add --quiet
Note that original sfdisk implementation suppressed warning
messages for --quiet.

Now we keep warning and error messages visible, but suppress
extra info messages only (for example to make it more usable in
scripts). IMHO suppress warnings is bad idea.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak d420a7f9f6 sfdisk: add --unit and --show-geometry, update deprecated.txt
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 21ca986d71 sfdisk: cleanup sync() usage, fix --activate
* use sync() only if we change disk layout
 * don't use sync() when we change details (like partition type)

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 2e73a998f4 sfdisk: use fdisk_set_partition_type()
This is more simple than the generic fdisk_set_partition() API.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:32 +02:00
Karel Zak 43a1ccecda sfdisk: cleanup usage() and long options
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 8eab3194ce sfdisk: add --parttype
The patch also makes --{id,change-id,print-id} deprecated in favour
of --parttype. The original --id is too generic option name and the
--print-id and --change-id are unnecessary and inconsistent with
another sfdisk options (e.g. we don't have --change-bootable)

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +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 058dd97a1c sfdisk: add --list-types
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 2aa36b7372 sfdisk: add missing stuff to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 6936c081ab libfdisk: (gpt) use generic API to change UUID and name
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 0ecf3ab504 libfdisk: (dos) implement fdisk_set_partition() backend
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak b4df449f53 sfdisk: support -N for primary partitions
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak e881349460 sfdisk: require confirmation before write to the device
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 2d12903265 libfdisk: make yes/no dialogs more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 3186f4a927 sfdisk: improve UI
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak d5bee4bb59 libfdisk: cleanup script size= code
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak c3bc748352 libfdisk: return partno when add new partition
* improve the way how sfdisk report results
 * the API change simplify applications

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 7324f1bf8c sfdisk: implement command_fdisk()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 254b1dfcc3 sfdisk: cleanup comments and command_activate()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 54b13b0c5c sfdisk: add --activate
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak 148f6e6d1c sfdisk: add comments, remove unnecessary function
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Karel Zak d2eb145785 sfdisk: add --show-size
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 e3bb13d96c sfdisk: update usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00
Karel Zak 8a8d204cd1 sfdisk: add --dump functionality
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00
Karel Zak 207de32a97 sfdisk: --list just one device
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00
Karel Zak 9c1f9dd3a0 sfdisk: implement --list
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +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
Karel Zak fdb006e8b5 fdisk: move --list functionality to separated file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00
Karel Zak 1881390de2 sfdisk: basic main() and friends
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:30 +02:00
Sami Kerola db433bf737 textual: use usage() text element macros
Translating these text elements should happen only once, which is
more likely when the text macros are used properly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:26 +02:00
Sami Kerola a587cc5520 textual: use manual tail usage() macro
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:24 +02:00
Sami Kerola f627750083 textual: use version printing macro everywhere
Only mount, umount, and blkid remains not using the macro because they
are print also library references.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:23 +02:00
Sami Kerola 7d2600e2d0 docs: update deprecation banners
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:11 +02:00
Karel Zak eef6397023 cfdisk: don't modify ncurses LINES and COLS
On Sun, Sep 28, 2014 at 01:48:38AM -0700, pv4 wrote:
 If ncurses is build with --enable-reentrant, building
 util-linux-2.25.1 fails with the folllowing error:

     disk-utils/cfdisk.c: In function 'resize':
     disk-utils/cfdisk.c:202:9: error: lvalue required as left operand of assignment
        LINES = ws.ws_row;
              ^
     disk-utils/cfdisk.c:203:8: error: lvalue required as left operand of assignment
        COLS = ws.ws_col;
             ^

 man COLS gives the following:

     Depending on the configuration, these may be actual variables,
     or macros (see curs_threads(3X)) which provide read-only
     access to curses's state.  In either case, applications should
     treat them as read-only to avoid confusing the library.

Addresses: https://github.com/karelzak/util-linux/issues/125
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-01 11:38:49 +02:00
Karel Zak 286f1e229b Merge branch 'misc' of git://github.com/kerolasa/lelux-utiliteetit
* 'misc' of git://github.com/kerolasa/lelux-utiliteetit:
  textual: share crypt() error message in sulogin and newgrp
  newgrp: avoid use of obsolete getpass() function
  newgrp: use libc function to read gshadow if it is available
  setarch: use personality() system call when it is available
  setarch: reindent code
  hwclock: remove referal to deprecated keyboard interface
  eject: make open_device() and select_speed() to use struct eject_control
  eject: add struct eject_control to remove global variables
  mountpoint: simplify if statement
  mkfs.minix: fix couple compiler warnings
  mountpoint: add struct mountpoint_control
  last: improve code readability by renaming variable names
  last: make is_phantom() when kernel config does not include audit support
  lib: remove xgetpass()
  include: simplify fputc_careful() in carefulputc.h
  libuuid: add extern qualifiers to uuid/uuid.h system header
2014-09-22 14:55:37 +02:00
Karel Zak 18b3e5495b swapon: split swapon-common.c
swapon    - requires libmount and libblkid
 swapoff   - requires libmount
 swaplabel - requires libblkid

This patch add lib/swapprober.c with blkid stuff for swap. It allows
to use and link libblkid only when necessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-09-22 13:16:25 +02:00
Sami Kerola e9b0ac10f2 mkfs.minix: fix couple compiler warnings
disk-utils/mkfs.minix.c:366:3: warning: ISO C forbids 'return' with
expression, in function returning void [-Wpedantic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-09-19 19:31:01 +01:00
Jaromir Capik 0cbdf6e22f fdformat: fixing copy'n'paste issue in the manual
The end track default is media specific, not zero.
2014-09-16 11:14:25 +02:00
Karel Zak c7119037f0 libfdisk: use reference counting for context
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-28 12:49:16 +02:00
Karel Zak 59af21c3f2 cfdisk: fix typo in the previous commit
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-26 22:19:26 +02:00
Karel Zak ce3134dfdd cfdisk: wrong interpretation of yes in non-english language
Reported-by: tnut@nutyx.org
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-26 17:03:11 +02:00
Karel Zak 385810d22a libfdisk: remove debug dump function, cleanup API
The fdisk_dump_* prefix will be used for sfdisk-like functionality.
The patch also add FDISK_ prefix to fdisk_get_unit() options.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-22 10:25:35 +02:00
Karel Zak 6b11aad26b libfdisk: fix fdisk_get_optimal_iosize() and update tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-20 11:43:02 +02:00
Karel Zak e6d0c4c1ac fdisk: add independent debug stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-15 12:38:02 +02:00
Karel Zak 8eccde20dd fdisk: use libfdisk public API only
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-15 12:16:55 +02:00
Karel Zak 57c83d63e4 cfdisk: use only public libfdisk API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-15 10:50:33 +02:00
Karel Zak a745611d69 libfdisk: final parttype API cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 13:28:37 +02:00
Karel Zak 5ab3760071 libfdisk: move get_parttypes to label API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 12:01:38 +02:00
Karel Zak 11ee1177ff libfdisk: make it possible to get fields for all labes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 00:27:28 +02:00
Karel Zak 72d2965c44 libfdisk: cleanup label geometry API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-14 00:09:48 +02:00
Karel Zak aa36c2cf2c libfdisk: cleanup fdisk_is_label stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 23:57:54 +02:00
Karel Zak 8d605c884a libfdisk: clean up API (alignment.c)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 23:27:00 +02:00
Karel Zak 6a6321360d libfdisk: clean up API (context.c)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 22:26:53 +02:00
Karel Zak 14620822c0 cfdisk: add libfdisk independent debug stuff
Now it's possible to use
	CFDISK_DEBUG=0xffff ./cfdisk
to debug only cfdisk UI.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 21:21:46 +02:00
Karel Zak bd85d11fba libfdisk: rename fdisk_column to fdisk_field
.. to make the API and fdisk(s) code more readable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 11:12:27 +02:00
Karel Zak d44115f3b5 libfdisk: remove dependence on libsmartcols
It's application business to convert libfdisk_table to string.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 10:10:11 +02:00
Benno Schulenberg 1d23119072 textual: remove some inconsistent periods from error messages
While doing so, also improve translatability and some wordings.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-08-11 14:51:54 +02:00
Karel Zak 4fdde144f0 fdisk: update tests and clean up output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-08 12:35:20 +02:00
Karel Zak c9400a1ea7 fdisk: always print warning for mis-aligned partitions
This patch restores the original fdisk behavior and always prints
information about misaligned partitions in 'p'print output.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-08 11:33:28 +02:00
Karel Zak cd8414f7a1 cfdisk: move curs_set(1) to ui_end()
This is probably correct to have curs_set() in ui_end(), but according
to Martin it does not work with slang library from signal handler.

Reported-by: Martin Steigerwald <Martin@lichtvoll.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 15:39:27 +02:00
Steven Honeyman 1b19ea31a3 docs: fix inconsistencies in man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-06 14:50:20 +02:00
Karel Zak 80b037cc6f fdformat: clean up usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:53:26 +02:00
Jaromir Capik e0402441a1 fdformat: Add new switches -f/--from, -t/--to, -r/--repair
This commit introduces a support for user configurable
from/to track and a basic repair mode for broken floppies.
It also fixes a recently introduced bug that causes
a line breakage when printing the track number.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-29 13:44:04 +02:00
Sami Kerola 25a365ef5a swaplabel: move swapon-common to include directory
This fixes the following compiler warning.

disk-utils/swaplabel.c:175:2: warning: implicit declaration of function
'get_swap_prober' [-Wimplicit-function-declaration]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:28:05 +02:00
Karel Zak 52d92543ff fdisk: fix -l [<device>]
* don't use err(), but warn(), so don't stop after the first error

 * display all errors when "-l <device> ..." specified

 * display only EACCES errors when list whole disks from
   /proc/partitions ("fdisk -l" )

Reported-by: Boian Bonev <bbonev@ipacct.com>
Addresses: https://github.com/karelzak/util-linux/pull/106
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:07:32 +02:00
Lauri Nurmi 58ac82ae2f sfdisk: use pluralized translation. 2014-07-28 11:45:30 +02:00
Benno Schulenberg 556c9c4842 various: erase all traces of the long-obsolete xiafs
The xiafs filesystem was removed from the kernel fifteen years ago,
and any kernel that contained it reached end of life ten years ago.
It's time to stop mentioning it in the mount man page and elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:57 +02:00
Andreas Henriksson 4f4daf8f90 cfdisk: reenable cursor when quitting
After quitting cfdisk (built with slang) the cursor would be
missing at the command prompt.

Reported-by: Martin Steigerwald <Martin@Lichtvoll.de>
Addresses-Debian-Bug: #755991
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-07-28 11:09:56 +02:00
Benno Schulenberg 09af3db48e textual: fix some typos and inconsistencies in various messages
Fixing plain typos, miswordings, inconsistent periods, some missing
angular brackets, and a proper pluralization (even when it involves
a constant, because for some languages the precise value matters).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-23 08:56:00 +02:00
Sami Kerola 5db57cfc46 swapon: share get_swap_prober() with swaplabel to print uuid and label
The swapon(8) listing was almost complete, apart from label and uuid.
This change moves the code from swaplabel(8) to shared scope to be used
for printouts in other swap commands, such as swapon.

Adding this feature to lsblk(8) was a consideration, but lsblk is not
interested of swapfiles, so the swapon seems like a better option to add
this information.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-22 12:17:20 +02:00
Benno Schulenberg 86407f2cae cfdisk: actually translate the partition types in the menu
[kzak@redhat.com: - translate also GPT types]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-21 15:36:33 +02:00
Karel Zak a4f0a42dd2 cfdisk: use /dev/sda by default
.. this all is for backward compatibility.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-18 12:54:40 +02:00
Karel Zak d02c203512 cfdisk: make code more readable for analyzers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 13:59:01 +02:00
Karel Zak a9408274b7 cfdisk: fix possible memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-17 13:46:27 +02:00
Benno Schulenberg 2ddfd9e424 cfdisk: restore the license that was lost in January
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 13:25:19 +02:00
Benno Schulenberg 9bef99ccb1 docs: improve wording and formatting of the man page of cfdisk
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-15 13:22:26 +02:00
Karel Zak 33f7c502c6 cfdisk: fix warning usage, improve 's' help
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 13:12:23 +02:00
Karel Zak bfdb3244e3 cfdisk: accept 's' as well as 'S' for sectors
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 13:01:56 +02:00
Karel Zak ad5d45c046 cfdisk: make menus sensitive to ESC
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 12:41:30 +02:00
Karel Zak 8fc37981cf cfdisk: use \n for messages on stdout and stderr
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 12:32:38 +02:00
Karel Zak bc787727d4 libfdisk: make disk sync() optional
... this allows to avoid unnecessary sync() from cfdisk.

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-15 12:32:03 +02:00
Sami Kerola bbe67996ad fdisk: avoid code duplication
To me having call to close() twice is less readable than one new
variable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:38 +01:00
Sami Kerola 9cbf20040b mkfs.cramfs: use defined failure name rather than magic value
From manual page; 'On error, the value MAP_FAILED is returned, and errno
is set appropriately'.

Reference: http://man7.org/linux/man-pages/man2/mmap.2.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 18:35:32 +01:00
Sami Kerola 18b1fcb9cc fdformat: match variable and print format types
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:34:25 +01:00
Sami Kerola 3524452a71 cfdisk: add braces to ensure operation order
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-13 17:31:11 +01:00
Karel Zak 1bf9e264e2 fsck: uninitialized argument value [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:48:01 +02:00
Karel Zak a1da27a8c0 cfdisk: fix division by zero [clang-analyze]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-01 13:25:46 +02:00
Karel Zak 4b4e391a28 fdisk: don't use --geom-* prefix for CHS options
We already use --cylinders, --heads and --sectors for sfdisk, let's
make new fdisk option compatible.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-30 15:10:29 +02:00
Karel Zak e3a4aaa7d3 fdisk: add long options, cleanup man page and usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-25 13:31:14 +02:00
Karel Zak d121efdb6e cfdisk: add --zero command line option
The option has been supported by previous versions, we can easily
support it too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-20 12:17:53 +02:00
Karel Zak dd626abdbe cfdisk: don't offer BSD
BSD is nested within DOS partition, so for disk without any partition
table it does not make any sense to offer BSD label.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-20 12:07:30 +02:00
Karel Zak 62acb047a6 build-sys: remove obsolete wholedisk.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-17 12:16:29 +02:00
Karel Zak 83b69e409c sfdisk: use sysfs_devno_is_wholedisk()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-17 12:16:05 +02:00
Karel Zak a22c6eb206 fdisk: use sysfs_devno_is_wholedisk()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-17 12:15:59 +02:00
Karel Zak 3bbdae633f fsck: use private lock file rather than whole-disk directly
It seems overkill to lock directly whole-disk device (for -l) when we use the
lock only to synchronize fsck instances.

It's fsck private business, so don't use system files, but let's use private
/run/fsck/<diskname>.lock file.

Addresses: https://bugs.freedesktop.org/show_bug.cgi?id=79576
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-09 11:59:44 +02:00
Karel Zak 934530c7e8 lib/fileutils: add mkdir_p() from libmount 2014-06-09 10:59:18 +02:00
Karel Zak 710ed55dcd libsmartcols: add debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 13:47:06 +02:00
Karel Zak ee312c654b docs: fix "behaviour" vs. "behavior"
Sometimes we use "behaviour" and "behavior" in the same text, let's
use "behavior" only everywhere.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 09:49:35 +02:00
Karel Zak 7556c9443a cfdisk: resize UI on SIGWINCH
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-05 14:32:51 +02:00
Karel Zak d5314bf56f cfdisk: add [Sort] operation
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-05 12:13:41 +02:00
Ruediger Meier 60cb2c3720 build: fix some compiler warnings
Most of them catched on 32bit gcc and icc.

disk-utils/fsck.cramfs.c:     printf format type
lib/boottime.c:               unused variables
misc-utils/cal.c:             set but never used
sys-utils/losetup.c:          set but never used
sys-utils/lscpu-dmi.c:        defined but not used
sys-utils/switch_root.c:      comparison between signed and unsigned
tests/helpers/test_sysinfo.c: printf format type
2014-05-30 01:18:09 +02:00
Petr Uzel ee6369973e sfdisk: suppress Linux-irrelevant warnings with -L
Sfdisk prints out a warning about extended partition not
starting at a cylinder boundary. Since this is irrelevant
for linux, the -L option should suppress this warning.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2014-05-27 16:12:54 +02:00
Karel Zak ecc6047ecd build-sys: add BUILD_{SFDISK,BLOCKDEV,MKSWAP,IOSIZE,MKFS}
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 12:34:34 +02:00
Karel Zak 3d9fdac5ea build-sys: add --disable-minix
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 12:13:12 +02:00
Karel Zak deedae5f5c fsck.cramfs: cleanup usage() and warning messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-20 10:32:57 +02:00
Ruediger Meier ae2f9c71ae mkfs.cramfs: fix crash when -b 0
Now -b 0 gives us the default (page size) like we do it in
fsck.cramfs.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:29 +02:00
Ruediger Meier dfd7dbb468 fsck.cramfs: update man page (--extract and --blocksize)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:26 +02:00
Ruediger Meier 2c972db424 tests: remove test_fsck.cramfs (reverts 6c32ae78)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:22 +02:00
Ruediger Meier 34731f89c7 fsck.cramfs: remove define INCLUDE_FS_TESTS
There is only one non-trivial issue where we now print a
warning instead of exit error.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:06 +02:00
Ruediger Meier 2d317f117b fsck.cramfs: refactor option -x/--extract
We want to clean it up to compile it later per default (not only
if defined INCLUDE_FS_TESTS).

- Rename option --destination to --extract.
- DIR argument is now optional because we want to keep the use
  case "test uncompression without writing files" ... but we
  don't want it always.
- Remove shortopt -x because shortopts with optional args are
  evil.

Changing the cmd interface is no compatibility issue here because
all affected options errored out per default in past.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 15:07:17 +02:00
Ruediger Meier 5cd50ebc96 fsck.cramfs: add option --blocksize
.. similar to mkfs.cramfs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:48 +02:00
Ruediger Meier 38141baff6 fsck.cramfs: rename variable page_size to blksize
... similar to mkfs.cramfs.c

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:44 +02:00
Ruediger Meier b7a7520692 fsck.cramfs: ifdef unused outbuffer and page_size
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:39 +02:00
Ruediger Meier f991dbd31f fsck.cramfs: allow smaller superblock sizes
We are already fine with checking for different endianess. Now we
also succeed if systems's page size does not match.

Note that page_size is only really used if INCLUDE_FS_TESTS is
defined, see followups.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:19:29 +02:00
Karel Zak 538c18569e cfdisk: update man page COLORS section
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:13:02 +02:00
Karel Zak 496c979a09 fdisk: support colors customization
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:13:02 +02:00
Karel Zak e66a662726 lib/colors: allow to temporary disable colors
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:09:02 +02:00
Karel Zak a08fa9ab57 cfdisk: fix compiler warning [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 09:58:58 +02:00
Benno Schulenberg aa06617f6e textual: remove square brackets from around three dots
Also improve some option descriptions here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-05-06 11:12:13 +02:00
Sami Kerola 24f83f7392 swapon, swapheader, mkswap: move swap signature to header
Both swapon and mkswap need to know what is valid device signature, so
share the value.

[kzak@redhat.com: - use SWAP_SIGNATURE_SZ properly in write_signature()]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:16:54 +02:00
Sami Kerola 506b499991 mkswap: remove legacy swap structure
If software archeolgists want to know how the old, and unused, swap
header looked they can dig it from the revision history.

[kzak@redhat.com: - use sizeof() for SWAP_HEADER_SIZE]

Reference: 4c85aa3a4c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:08:51 +02:00
Sami Kerola 8a101b1447 mkswap, swaplabel: move version number to header
Corrently only the swap version 1 is supported, which is a magic value so
move it to header.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-04 11:42:03 +01:00
Bjarni Ingi Gislason 46b11619a1 swaplabel: Improve the typesetting of the manual
Change macro 'IR' to 'I' if it has only one (italic) argument

  Remove space at end of lines

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:38 +02:00
Bjarni Ingi Gislason 2ad6d4fefe sfdisk: Improve the typesetting of the manual
FIXME
  Units KB, MB, GB, etc. are ambiguous (not necessarily used here)
  Prefixes kilo, mega, giga, etc. are ambiguous with the unit byte (ditto)

  Change ' \- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

  Change ' - ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

  Change '\-' to '-' (code "hyphen-minus", rendered with the glyph
hyphen in troff), if it is a part of a compound name.
  A minus is not used in words.  People using UTF-8 and copy-and-paste
can(?) (may?) use "info", "man --ascii" or the command "man" should
have an option to display the '-' ("hyphen-minus") in names of options
with the code (character name) "hyphen-minus" (u002D) instead of
"u2010" (code (character) name "hyphen").

  Change '-' to '\-', if it indicates an option

  Protect a full stop (.), that begins or ends a string, with \&

  Correct space between sentences to two space characters (or begin
each sentence on a new line).

  Change '--' to '\-\-', if it indicates an option

  Add \~ (no-break space) around '|' (means "or")

  Change ' -- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:28 +02:00
Bjarni Ingi Gislason 930f40e319 raw: Improve the typesetting of the manual
Remove space at end of lines

  Change '-' to '\-', if it indicates an option

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:17 +02:00
Bjarni Ingi Gislason b4261b5eda partx: Improve the typesetting of the manual
Add a space character around '|' (means "or")

  Add "(hyphen-minus)" after "\-" to show character name for input

  Change '\-\-' to '\en', when it is used as a dash (pause, separation)

  Add a comma before "or" in a series of words (3 or more)

  Change '-' to '\(en' (an en-dash), if it means a range

  Protect a full stop (.), that begins or ends a string, with \&

  Change '--' to '\-\-', if it indicates an option

  Change '-' to '\-', if it indicates an option

  Change '-' to '\-', if means a minus

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2014-04-22 12:14:10 +02:00
Karel Zak dd7ba60463 libfdisk: add partitions reorder operation to label API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-18 13:26:08 +02:00
Karel Zak 8b60872ec0 libfdisk: add generic function to check partitions order
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-16 12:51:08 +02:00
Ondrej Oprala b32fc3bb32 delpart: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:46:05 +02:00
Ondrej Oprala df0a8e7a78 cfdisk: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:46:04 +02:00
Ondrej Oprala d2d5466d77 addpart: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:46:02 +02:00
Bjarni Ingi Gislason 9697975498 mkswap: Some minor typographical corrections to the manual
-- changed to \(en (an en-dash) if it is a dash (pause, separation)

  - changed to \- if it indicates an option

  A full stop (.), that begins or ends a string, protected with \&

  Space between sentences corrected to two word spaces

  -- changed to \-\- if it indicates an option

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:31:48 +02:00
Bjarni Ingi Gislason 2f52fc4feb mkfs.minix: Some typographical changes in the manual
- between numbers changed to \(en if it is a range

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:31:48 +02:00
Bjarni Ingi Gislason 10c70f0507 mkfs.cramfs: Some typographical corrections to the manual
The unit "MB" is ambigous.  Use "MiB" if "M" does not mean 10^6.
Otherwise add "(M = 10^6)" after it.

  Changes:

  Unpaddable space (\ ) added between a number and an unit.  A nuber
and a unit are not one word.  Is "16MB" written "sixteenmegabytes"?

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:31:48 +02:00
Bjarni Ingi Gislason cdd710a1e3 mkfs.bfs: One typographical correction to the manual
- between numbers changed to \(en  (an en-dash)

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:31:42 +02:00
Bjarni Ingi Gislason 920d44f5fd mkfs: Some typographical changes to the manual
- changed to \- if it means an option

  A full stop (.), that begins or ends a string, protected with \&

  No line adjustment used for section "SEE ALSO" (.na/.ad)

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:30:17 +02:00
Bjarni Ingi Gislason 98cd16d369 isosize: A few typographical changes to the manual
A full stop (.), that begins or ends a string, protected with \&

  A space between a number and an unit changed to an unpaddable space
"\ "

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:30:17 +02:00
Bjarni Ingi Gislason 897776a0d2 fsck.minix: A few typographical corrections to the manual
- between numbers changed to \(en if it means a range

  A full stop (.), that begins or ends a string, protected with \&

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:30:17 +02:00
Bjarni Ingi Gislason dbaa5fda4b fsck: Some typographical corrections to the manual
The word "kilobytes" is ambiguous.  Change it to "kibibytes" if kilo
does not mean 1000.  Otherwise add "(1000 B)" after it.

  A string, that begins or ends with a full stop (.), protected with \&

  - changed to \- if it shows an option

  -- change to \(en if it means a dash (pause, separation)

  Space between sentences is two word spaces in *roff.  Thus it is
better to begin each sentence on a new line when the file contains
formatting commands

  --- changed to \(en if it means a dash (pause, separation)

  Punctuation separated from a word with a space, if it is an argument
to a macro like "BR" (two font styles used alternately)

  Adjusting inhibited for the section "SEE ALSO" with ".na/.ad"

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:30:12 +02:00
Bjarni Ingi Gislason dce8463c56 fdformat: Some minor change to the manual
\- changed to - (code "hyphen-minus", rendered with the glyph hyphen
in troff) if it is a part of a compound name.  A minus is not used in
words.  People using UTF-8 and copy-and-pase can(?) (may?) use "info",
"man --ascii" or the command "man" should have an option to display the
- in names of options with the code (character name) "hyphen-minus"
(u002D) instead of "u2010" (code (character) name "hyphen")

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:21:24 +02:00
Bjarni Ingi Gislason 023dcba0f0 blockdev: Some minor corrections to the manual
Macro, that alternately changes the input between two font styles,
changed to the macro for one font style change, if there is only one
argument

 Text string, that begins or ends with a full stop (.) protected with \&

 -- changed to \-\- if it is an option

 - changed to \(en if it is a dash (pause, seperation)


Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 12:18:04 +02:00
Karel Zak 0925a9dd6c libsmartcols: clean up flags usage
* rename flags functions to scols_table_enable_*
 * rename *_no_foo() functions to _nofoo()
 * output formats are mutually exclusive, so don't use flags there
 * don't assume symbols in scols_new_table(), use scols_table_set_symbols()

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 16:09:57 +02:00
Karel Zak 7fa74cb098 fdisk: print table header as bold
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:43:36 +02:00
Karel Zak c743bf744a cfdisk: clean up scols usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:21 +02:00
Karel Zak 3b80b37035 partx: cleanup libsmartcols usage
* more carefully set data
 * care about return codes

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:19 +02:00