]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
10 years agosfdisk: add --name
Karel Zak [Thu, 2 Oct 2014 11:22:56 +0000 (13:22 +0200)] 
sfdisk: add --name

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --uuid command
Karel Zak [Thu, 2 Oct 2014 11:00:35 +0000 (13:00 +0200)] 
sfdisk: add --uuid command

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: more update to the man page
Karel Zak [Thu, 2 Oct 2014 10:18:31 +0000 (12:18 +0200)] 
sfdisk: more update to the man page

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: update man page
Karel Zak [Tue, 23 Sep 2014 13:14:44 +0000 (15:14 +0200)] 
sfdisk: update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --append
Karel Zak [Tue, 23 Sep 2014 10:28:01 +0000 (12:28 +0200)] 
sfdisk: add --append

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: be sensitive to PT limits
Karel Zak [Tue, 23 Sep 2014 09:39:02 +0000 (11:39 +0200)] 
sfdisk: be sensitive to PT limits

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --backup and --backup-file
Karel Zak [Fri, 19 Sep 2014 09:31:07 +0000 (11:31 +0200)] 
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>
10 years agosfdisk: add --no-reread and --force
Karel Zak [Fri, 19 Sep 2014 08:30:14 +0000 (10:30 +0200)] 
sfdisk: add --no-reread and --force

and also check if the device is in use.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --no-act
Karel Zak [Thu, 18 Sep 2014 10:31:52 +0000 (12:31 +0200)] 
sfdisk: add --no-act

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add deprecated --Linux
Karel Zak [Thu, 18 Sep 2014 09:56:49 +0000 (11:56 +0200)] 
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>
10 years agosfdisk: add --quiet
Karel Zak [Thu, 18 Sep 2014 08:43:19 +0000 (10:43 +0200)] 
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>
10 years agosfdisk: add --unit and --show-geometry, update deprecated.txt
Karel Zak [Thu, 18 Sep 2014 08:21:35 +0000 (10:21 +0200)] 
sfdisk: add --unit and --show-geometry, update deprecated.txt

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: remove old label drives' API for parttypes
Karel Zak [Wed, 17 Sep 2014 13:25:02 +0000 (15:25 +0200)] 
libfdisk: remove old label drives' API for parttypes

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (sgi) add set_part() API
Karel Zak [Wed, 17 Sep 2014 11:53:16 +0000 (13:53 +0200)] 
libfdisk: (sgi) add set_part() API

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (bsd) add set_part() API
Karel Zak [Wed, 17 Sep 2014 11:43:14 +0000 (13:43 +0200)] 
libfdisk: (bsd) add set_part() API

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: use new set_part API in fdisk_set_partition_type()
Karel Zak [Wed, 17 Sep 2014 11:14:01 +0000 (13:14 +0200)] 
libfdisk: use new set_part API in fdisk_set_partition_type()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) check string_to_guid()
Karel Zak [Wed, 17 Sep 2014 11:10:14 +0000 (13:10 +0200)] 
libfdisk: (gpt) check string_to_guid()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: cleanup sync() usage, fix --activate
Karel Zak [Wed, 17 Sep 2014 10:56:39 +0000 (12:56 +0200)] 
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>
10 years agolinfdisk: cleanup fsync usage
Karel Zak [Wed, 17 Sep 2014 10:54:05 +0000 (12:54 +0200)] 
linfdisk: cleanup fsync usage

 * always use fsync() if the device open read-write
 * use sync() on demand

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: use fdisk_set_partition_type()
Karel Zak [Wed, 17 Sep 2014 10:24:33 +0000 (12:24 +0200)] 
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>
10 years agosfdisk: cleanup usage() and long options
Karel Zak [Mon, 15 Sep 2014 11:02:04 +0000 (13:02 +0200)] 
sfdisk: cleanup usage() and long options

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --parttype
Karel Zak [Mon, 15 Sep 2014 10:37:52 +0000 (12:37 +0200)] 
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>
10 years agosfdisk: add --verify
Karel Zak [Thu, 11 Sep 2014 13:28:15 +0000 (15:28 +0200)] 
sfdisk: add --verify

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --list-types
Karel Zak [Thu, 11 Sep 2014 12:41:46 +0000 (14:41 +0200)] 
sfdisk: add --list-types

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add missing stuff to usage()
Karel Zak [Thu, 11 Sep 2014 12:23:50 +0000 (14:23 +0200)] 
sfdisk: add missing stuff to usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: make dump format usable on stdin
Karel Zak [Thu, 11 Sep 2014 12:13:57 +0000 (14:13 +0200)] 
sfdisk: make dump format usable on stdin

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) use generic API to change UUID and name
Karel Zak [Thu, 11 Sep 2014 11:53:35 +0000 (13:53 +0200)] 
libfdisk: (gpt) use generic API to change UUID and name

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (gpt) implement fdisk_set_partition() backend
Karel Zak [Thu, 11 Sep 2014 11:34:15 +0000 (13:34 +0200)] 
libfdisk: (gpt) implement fdisk_set_partition() backend

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (dos) implement fdisk_set_partition() backend
Karel Zak [Thu, 11 Sep 2014 10:52:49 +0000 (12:52 +0200)] 
libfdisk: (dos) implement fdisk_set_partition() backend

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add fdisk_set_partition()
Karel Zak [Thu, 11 Sep 2014 10:48:56 +0000 (12:48 +0200)] 
libfdisk: add fdisk_set_partition()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: cleanup internal drivers' API
Karel Zak [Thu, 11 Sep 2014 09:48:06 +0000 (11:48 +0200)] 
libfdisk: cleanup internal drivers' API

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: support -N for primary partitions
Karel Zak [Wed, 10 Sep 2014 12:31:28 +0000 (14:31 +0200)] 
sfdisk: support -N for primary partitions

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add fdisk_copy_parttype()
Karel Zak [Wed, 10 Sep 2014 12:31:08 +0000 (14:31 +0200)] 
libfdisk: add fdisk_copy_parttype()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: require confirmation before write to the device
Karel Zak [Wed, 10 Sep 2014 11:18:15 +0000 (13:18 +0200)] 
sfdisk: require confirmation before write to the device

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: make yes/no dialogs more robust
Karel Zak [Wed, 10 Sep 2014 10:51:25 +0000 (12:51 +0200)] 
libfdisk: make yes/no dialogs more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: improve UI
Karel Zak [Tue, 9 Sep 2014 13:51:19 +0000 (15:51 +0200)] 
sfdisk: improve UI

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: cleanup script size= code
Karel Zak [Tue, 9 Sep 2014 11:36:16 +0000 (13:36 +0200)] 
libfdisk: cleanup script size= code

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: return partno when add new partition
Karel Zak [Tue, 9 Sep 2014 11:04:57 +0000 (13:04 +0200)] 
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>
10 years agosfdisk: implement command_fdisk()
Karel Zak [Mon, 8 Sep 2014 14:17:11 +0000 (16:17 +0200)] 
sfdisk: implement command_fdisk()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: fix script partitions size parsing
Karel Zak [Mon, 8 Sep 2014 14:16:31 +0000 (16:16 +0200)] 
libfdisk: fix script partitions size parsing

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: (dos) more carefully check for primary partitions
Karel Zak [Mon, 8 Sep 2014 14:13:42 +0000 (16:13 +0200)] 
libfdisk: (dos) more carefully check for primary partitions

  * check if there is space for primary partitions, if no and extended
    exists then create logical partitions

  * create extended if @pa->type is extended partition

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: cleanup comments and command_activate()
Karel Zak [Fri, 5 Sep 2014 12:11:12 +0000 (14:11 +0200)] 
sfdisk: cleanup comments and command_activate()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --activate
Karel Zak [Fri, 5 Sep 2014 11:05:49 +0000 (13:05 +0200)] 
sfdisk: add --activate

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: add fdisk_partition_is_bootable()
Karel Zak [Fri, 5 Sep 2014 11:05:34 +0000 (13:05 +0200)] 
libfdisk: add fdisk_partition_is_bootable()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add comments, remove unnecessary function
Karel Zak [Fri, 5 Sep 2014 09:21:21 +0000 (11:21 +0200)] 
sfdisk: add comments, remove unnecessary function

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --show-size
Karel Zak [Fri, 5 Sep 2014 09:11:38 +0000 (11:11 +0200)] 
sfdisk: add --show-size

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: refactor /proc/partitions usage
Karel Zak [Fri, 5 Sep 2014 08:35:29 +0000 (10:35 +0200)] 
fdisk: refactor /proc/partitions usage

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: update usage()
Karel Zak [Thu, 4 Sep 2014 13:54:59 +0000 (15:54 +0200)] 
sfdisk: update usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: add --dump functionality
Karel Zak [Thu, 4 Sep 2014 13:50:36 +0000 (15:50 +0200)] 
sfdisk: add --dump functionality

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: --list just one device
Karel Zak [Thu, 4 Sep 2014 12:16:08 +0000 (14:16 +0200)] 
sfdisk: --list just one device

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: implement --list
Karel Zak [Thu, 4 Sep 2014 12:05:16 +0000 (14:05 +0200)] 
sfdisk: implement --list

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: improve --list output
Karel Zak [Thu, 4 Sep 2014 12:04:50 +0000 (14:04 +0200)] 
fdisk: improve --list output

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agofdisk: move --list functionality to separated file
Karel Zak [Thu, 4 Sep 2014 10:07:44 +0000 (12:07 +0200)] 
fdisk: move --list functionality to separated file

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agosfdisk: basic main() and friends
Karel Zak [Tue, 2 Sep 2014 16:57:27 +0000 (18:57 +0200)] 
sfdisk: basic main() and friends

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agotests: add sfdisk test
Karel Zak [Tue, 7 Oct 2014 12:54:58 +0000 (14:54 +0200)] 
tests: add sfdisk test

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: fix mnt_is_readonly() #ifdef
Karel Zak [Tue, 7 Oct 2014 11:41:40 +0000 (13:41 +0200)] 
libmount: fix mnt_is_readonly() #ifdef

This issue affects util-linux portability to GNU/HURD

Reported-by: Pino Toscano (from Red Hat)
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibblkid: zeroize errno on blkid_probe_get_buffer() success
Karel Zak [Tue, 7 Oct 2014 10:44:34 +0000 (12:44 +0200)] 
libblkid: zeroize errno on blkid_probe_get_buffer() success

Since 37f4060225df0591ab8e1dd676dbc8115d900d4f prober functions are
sensitive to errno, it seems more robust to set errno=0 with in
blkid_probe_get_buffer() on success than set the zero on all places
where we call blkid_probe_get_buffer().

Addresses: https://github.com/karelzak/util-linux/issues/119
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoflock: zero timeout is valid
Karel Zak [Tue, 7 Oct 2014 10:12:39 +0000 (12:12 +0200)] 
flock: zero timeout is valid

This patch reverts Sami's "timeout cannot be zero", introduced
in commit 605325b23b36238c8f3ae165e37cab9064553cf7.

The --timeout 0 has been originally interpreted as --nonblock. The
patch also add hint about this behavior to the man page.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1149974
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolosetup: improve man page -D docs
Karel Zak [Tue, 7 Oct 2014 09:54:33 +0000 (11:54 +0200)] 
losetup: improve man page -D docs

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibfdisk: fix add_logical() assert
Karel Zak [Tue, 7 Oct 2014 09:33:46 +0000 (11:33 +0200)] 
libfdisk: fix add_logical() assert

The zero index is absolutely valid for extended partition (it means
extended partition could be the first partition on the device).

Reported-by: Christoph Hoopmann <christophhoopmann@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agodocs: add swapon -o to TODO file
Karel Zak [Thu, 2 Oct 2014 13:53:34 +0000 (15:53 +0200)] 
docs: add swapon -o to TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agohwclock: use fabs() instead abs() when argument is double
Sami Kerola [Sun, 28 Sep 2014 19:51:51 +0000 (20:51 +0100)] 
hwclock: use fabs() instead abs() when argument is double

sys-utils/hwclock.c:1219:13: warning: using integer absolute value function
      'abs' when argument is of floating point type [-Wabsolute-value]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoinclude/debug: remove duplicate 'const' declaration warning
Sami Kerola [Sun, 28 Sep 2014 19:51:47 +0000 (20:51 +0100)] 
include/debug: remove duplicate 'const' declaration warning

./include/debug.h:89:55: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolsblk: fix compiler warning
Sami Kerola [Sun, 28 Sep 2014 19:51:44 +0000 (20:51 +0100)] 
lsblk: fix compiler warning

warning: ISO C forbids empty initializer braces [-Wpedantic]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoinclude: fix compiler warnings
Sami Kerola [Sun, 28 Sep 2014 19:51:43 +0000 (20:51 +0100)] 
include: fix compiler warnings

This change has motivation to make -Wall -pedantic compiler options to
spit a little bit less noise, which with luck will increase change to
notice real issues.

Multiple of these:

warning: ISO C forbids braced-groups within expressions [-Wpedantic]

And nearly 300 times reported:

include/c.h:75:41: warning: struct has no named members [-Wpedantic]
 #define UL_BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agolibuuid: remove _SVID_SOURCE pre-processor definition
Sami Kerola [Sun, 28 Sep 2014 19:51:42 +0000 (20:51 +0100)] 
libuuid: remove _SVID_SOURCE pre-processor definition

The _SVID_SOURCE is deprecated.

In file included from /usr/include/stdio.h:27:0,
                 from libuuid/src/gen_uuid.c:46: /usr/include/features.h:148:3:
      warning: #warning "_BSD_SOURCE and _SVID_SOURCE are
      deprecated, use _DEFAULT_SOURCE" [-Wcpp]

Notice that the Makefile.am has

AM_CPPFLAGS = \
        -include config.h \

that enforces the config.h is included before any other hearer.  In the
configure.ac there is AC_USE_SYSTEM_EXTENSIONS that makes all possible
features that can be supported in a system are turned on.  With these two
there is absolutely no need for any legacy _SOURCE definitions.

Reference: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=c941736c92fa3a319221f65f6755659b2a5e0a20
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: use usage() text element macros
Sami Kerola [Sun, 28 Sep 2014 19:51:41 +0000 (20:51 +0100)] 
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>
10 years agotextual: use manual tail usage() macro
Sami Kerola [Sun, 28 Sep 2014 19:51:40 +0000 (20:51 +0100)] 
textual: use manual tail usage() macro

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: use version printing macro everywhere
Sami Kerola [Sun, 28 Sep 2014 19:51:39 +0000 (20:51 +0100)] 
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>
10 years agoflock: add error message to translations
Sami Kerola [Sun, 28 Sep 2014 19:51:38 +0000 (20:51 +0100)] 
flock: add error message to translations

And remove type casting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agotextual: fix couple typos in comments
Sami Kerola [Sun, 28 Sep 2014 19:51:37 +0000 (20:51 +0100)] 
textual: fix couple typos in comments

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agohexdump: remove deprecation message
Sami Kerola [Sun, 28 Sep 2014 19:51:36 +0000 (20:51 +0100)] 
hexdump: remove deprecation message

Message 'calling hexdump as od has been deprecated in favor of GNU
coreutils od' has informed the hexdump not to be used like that for three
and half years, and five releases.  It is time to get rid of notice.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agodocs: update deprecation banners
Sami Kerola [Sun, 28 Sep 2014 19:51:35 +0000 (20:51 +0100)] 
docs: update deprecation banners

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agoswapon: align available columns section in usage()
Sami Kerola [Sun, 28 Sep 2014 19:51:34 +0000 (20:51 +0100)] 
swapon: align available columns section in usage()

Commit 5db57cfc469b45ada0162a64d627ce25a3d2431f missed doing this change.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
10 years agocfdisk: don't modify ncurses LINES and COLS
Karel Zak [Wed, 1 Oct 2014 09:38:49 +0000 (11:38 +0200)] 
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>
10 years agosu: print proper core dump message when killed
pcpa [Sat, 27 Sep 2014 19:04:16 +0000 (16:04 -0300)] 
su: print proper core dump message when killed

An example is, in one terminal "sudo su -; echo $$", and in
another terminal, "kill -9  $PID" (the pid of the su -). It
should not print "(core dumped)", unless the kill signal
specified so, e.g. kill -7 or kill -11.

Signed-off-by: pcpa <paulo.cesar.pereira.de.andrade@gmail.com>
10 years agotests: fix the ipcs test for shmall being too big to show
Karel Zak [Wed, 1 Oct 2014 08:13:09 +0000 (10:13 +0200)] 
tests: fix the ipcs test for shmall being too big to show

Based on hints from Adam Sampson, Ruediger Meier and Sami Kerola.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolibmount: don't return root if path contains // or ending /
Søren Holm [Fri, 26 Sep 2014 16:35:11 +0000 (18:35 +0200)] 
libmount: don't return root if path contains // or ending /

If the path fx. is /foo/bar/ the initial stripoff will replace the last slash
with \0 and return a pointer to that exact \0 character. The same thing will
happen if the path contains // somewhere.

Signed-off-by: Søren Holm <sgh@sgh.dk>
10 years agotextual: there may be no space between option and optional =arg
Benno Schulenberg [Mon, 22 Sep 2014 20:15:40 +0000 (22:15 +0200)] 
textual: there may be no space between option and optional =arg

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: angular brackets around a non-literal argument, singular
Benno Schulenberg [Mon, 22 Sep 2014 20:15:39 +0000 (22:15 +0200)] 
textual: angular brackets around a non-literal argument, singular

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: grammarize another error message
Benno Schulenberg [Mon, 22 Sep 2014 20:15:38 +0000 (22:15 +0200)] 
textual: grammarize another error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: using angular brackets around individual arguments
Benno Schulenberg [Mon, 22 Sep 2014 20:15:37 +0000 (22:15 +0200)] 
textual: using angular brackets around individual arguments

And separate short and long options with the standard comma.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: grammarize an error message
Benno Schulenberg [Mon, 22 Sep 2014 20:15:36 +0000 (22:15 +0200)] 
textual: grammarize an error message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: not using angular brackets around literal arguments
Benno Schulenberg [Mon, 22 Sep 2014 20:15:35 +0000 (22:15 +0200)] 
textual: not using angular brackets around literal arguments

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: add a comma for clarity, plus some other tweaks
Benno Schulenberg [Mon, 22 Sep 2014 20:15:34 +0000 (22:15 +0200)] 
textual: add a comma for clarity, plus some other tweaks

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: use a somewhat clearer and more standard failure message
Benno Schulenberg [Mon, 22 Sep 2014 20:15:33 +0000 (22:15 +0200)] 
textual: use a somewhat clearer and more standard failure message

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: "ambivalent" applies to intentions, "ambiguous" to results
Benno Schulenberg [Mon, 22 Sep 2014 20:15:32 +0000 (22:15 +0200)] 
textual: "ambivalent" applies to intentions, "ambiguous" to results

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agotextual: use angular brackets around each individual argument
Benno Schulenberg [Mon, 22 Sep 2014 20:15:31 +0000 (22:15 +0200)] 
textual: use angular brackets around each individual argument

In usage texts each word that is an argument should be marked
separately with angular brackets.  Also add a translator comment.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
10 years agolslogins: free after error [coverity scan]
Karel Zak [Fri, 26 Sep 2014 09:25:24 +0000 (11:25 +0200)] 
lslogins: free after error [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agolslogins: cleanup after error [coverity scan]
Karel Zak [Fri, 26 Sep 2014 09:23:32 +0000 (11:23 +0200)] 
lslogins: cleanup after error [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agomount: improve --move docs
Karel Zak [Thu, 25 Sep 2014 09:01:39 +0000 (11:01 +0200)] 
mount: improve --move docs

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoMerge branch 'misc' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Mon, 22 Sep 2014 12:55:37 +0000 (14:55 +0200)] 
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

10 years agoMerge branch 'renice' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Mon, 22 Sep 2014 12:43:30 +0000 (14:43 +0200)] 
Merge branch 'renice' of git://github.com/kerolasa/lelux-utiliteetit

* 'renice' of git://github.com/kerolasa/lelux-utiliteetit:
  renice: reorder usage() option descriptions
  rename: add getpriority() message lookup table
  renice: fix numeric uid argument parsing
  renice: avoid having same lines of code twice
  renice: disallow --priority <arg> without pid argument
  rename: use usage and version print out macros
  renice: reorder functions to avoid need of function prototype

10 years agolib/swapprober: add missing header file
Karel Zak [Mon, 22 Sep 2014 12:26:54 +0000 (14:26 +0200)] 
lib/swapprober: add missing header file

Signed-off-by: Karel Zak <kzak@redhat.com>
10 years agoswapon: split swapon-common.c
Karel Zak [Mon, 22 Sep 2014 11:16:25 +0000 (13:16 +0200)] 
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>
10 years agologger: gettimeofday needs <sys/time.h>
Andreas Henriksson [Thu, 18 Sep 2014 23:36:37 +0000 (01:36 +0200)] 
logger: gettimeofday needs <sys/time.h>

Either works on linux, but kfreebsd build fails
if we don't use the <sys/time.h> include.

According to man gettimeofday the correct include is <sys/time.h>

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agobuild-sys: build libmount everywhere
Andreas Henriksson [Thu, 18 Sep 2014 23:36:35 +0000 (01:36 +0200)] 
build-sys: build libmount everywhere

This enables libmount to build on non-linux, which also
means we can build fsck on non-linux again.
(Since the context part of libmount still needs porting,
building the mount utility has instead been restricted
to only build on Linux.)

This has been build-tested on Debian GNU/kFreeBSD.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agolibmount: only include context on linux
Andreas Henriksson [Thu, 18 Sep 2014 23:36:34 +0000 (01:36 +0200)] 
libmount: only include context on linux

This is part of an attempt to make libmount buildable on non-linux.

The parts that need architecture specific porting is under
the context*.c files and the rest of libmount is useful/used
by for example fsck.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agolibmount: only invoke loopcxt on linux
Andreas Henriksson [Thu, 18 Sep 2014 23:36:33 +0000 (01:36 +0200)] 
libmount: only invoke loopcxt on linux

This is part of an attempt to make libmount buildable on non-linux.

The support for /dev/loop* is Linux-specific so just disable
it on non-linux for now.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
10 years agoumount: read mountinfo if --detach-loop given
Robert Schiele [Thu, 18 Sep 2014 06:09:59 +0000 (08:09 +0200)] 
umount: read mountinfo if --detach-loop given

Don't use the optimization not to read mountinfo from commit
6a52473ecd877227f6f7da2b95da0b51593ffec1 if --detach-loop was given
since we need the name of the loop device in that case and with the
optimization this is not present and thus the detach operation
obviously fails.

Signed-off-by: Robert Schiele <rschiele@gmail.com>