]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
13 years agoswapon: use libmount for /proc/swaps parsing
Karel Zak [Tue, 17 Apr 2012 10:49:11 +0000 (12:49 +0200)] 
swapon: use libmount for /proc/swaps parsing

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: (new) improve error messages
Karel Zak [Tue, 17 Apr 2012 09:36:36 +0000 (11:36 +0200)] 
mount: (new) improve error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add mnt_context_fstab_applied()
Karel Zak [Tue, 17 Apr 2012 09:36:32 +0000 (11:36 +0200)] 
libmount: add mnt_context_fstab_applied()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowdctl: add watchdog status tool
Lennart Poettering [Thu, 5 Apr 2012 21:31:41 +0000 (23:31 +0200)] 
wdctl: add watchdog status tool

For: util-linux

This patch adds a tiny tool "wdctl" which may be used to query the
status of Linux watchdog devices (/dev/watchdog).

This will simply query all fields that may be queried from the
device and print them nicely formatted.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
13 years agocal: Fix building under uClibc.
James Le Cuirot [Mon, 16 Apr 2012 10:05:27 +0000 (11:05 +0100)] 
cal: Fix building under uClibc.

Commit fbc333fec09394bf4e47707de08a65e8c0e9c288 broke building under uClibc because HAVE_DECL macros are set to 0, not undefined.

Signed-off-by: James Le Cuirot <chewi@aura-online.co.uk>
13 years agofdisk: remove unused file
Karel Zak [Wed, 11 Apr 2012 10:55:51 +0000 (12:55 +0200)] 
fdisk: remove unused file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agologin-utils: add missing header, fix setpwnam.c fclose logic
Karel Zak [Wed, 11 Apr 2012 10:52:36 +0000 (12:52 +0200)] 
login-utils: add missing header, fix setpwnam.c fclose logic

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoMerge branch 'close_stream' of git://github.com/kerolasa/lelux-utiliteetit
Karel Zak [Wed, 11 Apr 2012 10:37:59 +0000 (12:37 +0200)] 
Merge branch 'close_stream' of git://github.com/kerolasa/lelux-utiliteetit

* 'close_stream' of git://github.com/kerolasa/lelux-utiliteetit:
  disk-utils: verify writing to streams was successful
  fdisk: verify writing to streams was successful
  getopt: verify writing to streams was successful
  hwclock: verify writing to streams was successful
  login-utils: verify writing to streams was successful
  misc-utils: verify writing to streams was successful
  mount: verify writing to streams was successful
  partx: verify writing to streams was successful
  schedutils: verify writing to streams was successful
  sys-utils: verify writing to streams was successful
  term-utils: verify writing to streams was successful
  text-utils: verify writing to streams was successful
  include: add stream error checking facility

Conflicts:
fdisk/fdisk.c

13 years agolibuuid: use randutils
Davidlohr Bueso [Thu, 5 Apr 2012 21:52:10 +0000 (23:52 +0200)] 
libuuid: use randutils

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofdisk: use randutils for mbr signature creation
Davidlohr Bueso [Thu, 5 Apr 2012 21:52:07 +0000 (23:52 +0200)] 
fdisk: use randutils for mbr signature creation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agolib: random utilities
Davidlohr Bueso [Thu, 5 Apr 2012 21:52:04 +0000 (23:52 +0200)] 
lib: random utilities

Add a random number(s) generator specific file. The intial functions are based
on what libuuid provide. I did some modifications like avoid WIN32 checks - this
is util-LINUX.

[kzak@redhat.com: - move jrand_seed to lib/randutils.c
                  - use TLS for jrand_seed (like original code from libuuid)
                  - use size_t for buffer sizes
                  - add close() to random_get_bytes]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib/blkdev: fix compiler warning [-Wreturn-type]
Karel Zak [Tue, 10 Apr 2012 10:29:10 +0000 (12:29 +0200)] 
lib/blkdev: fix compiler warning [-Wreturn-type]

../lib/blkdev.c: In function ‘blkdev_get_geometry’:
../lib/blkdev.c:287:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosfdisk: fix calculation due to type mismatch (ix86)
Petr Uzel [Fri, 6 Apr 2012 14:53:13 +0000 (16:53 +0200)] 
sfdisk: fix calculation due to type mismatch (ix86)

Instructing sfdisk to create one partition spanning
across entire disk (",,") on 32bit system, if the disk
is sufficiently large (~2TB) leads to wrong calculation
in compute_start_sect() due to type mismatch.

Can be reproduced as:

--------------------------
linux-3ln5:~ # modprobe scsi_debug virtual_gb=2000
linux-3ln5:~ # sfdisk /dev/sda <<< ',,'
Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 261083 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
sfdisk:  /dev/sda: unrecognized partition table type

Old situation:
sfdisk: No partitions found

no room for partition descriptor
sfdisk: bad input
--------------------------

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=754789
Reported-by: Dan Mares <dan.mares@norcrossgroup.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agodocs: eject.1: align with Documentation/howto-man-page.txt
Sami Kerola [Thu, 5 Apr 2012 20:40:49 +0000 (22:40 +0200)] 
docs: eject.1: align with Documentation/howto-man-page.txt

* Add spaces after dots (English spacing).
* Add line break macros.
* Use URL and email macros where appropriate.
* Fix typo at the end of the manual (s/lsblk/eject/).

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoeject: close open file [cppcheck]
Sami Kerola [Thu, 5 Apr 2012 20:40:48 +0000 (22:40 +0200)] 
eject: close open file [cppcheck]

[eject.c:498]: (error) Resource leak: f

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoeject: inform why open failed
Sami Kerola [Thu, 5 Apr 2012 20:40:47 +0000 (22:40 +0200)] 
eject: inform why open failed

Mostly to cover common case when user does not have permission to use
eject.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agostrutils: return success on test program
Davidlohr Bueso [Thu, 5 Apr 2012 20:35:19 +0000 (22:35 +0200)] 
strutils: return success on test program

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agoeject: use CDROM_DRIVE_STATUS if available for tray toggling
Mike Frysinger [Thu, 5 Apr 2012 15:50:46 +0000 (11:50 -0400)] 
eject: use CDROM_DRIVE_STATUS if available for tray toggling

One some platforms, the -T option can be unreliable (see reference bug
report for some examples).  Instead, if the kernel supports the cdrom
status ioctl, use that to ask explicitly for the current tray status
and then open/close accordingly.

The eject_cdrom() func was reworked slightly, but none of the existing
callers care about the explicit normalization to [0,1] values, so have
it return the raw value so we can convert toggle_tray() over to using
that.

Finally, now that toggle_tray() uses a lot of helper functions, drop
the check on CDROMCLOSETRAY.  The sub-functions take care of that.

Reference: https://bugs.gentoo.org/261880
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoeject(1): fix typo in mount(1) reference
Mike Frysinger [Thu, 5 Apr 2012 15:50:45 +0000 (11:50 -0400)] 
eject(1): fix typo in mount(1) reference

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoeject: constify array
Mike Frysinger [Thu, 5 Apr 2012 15:50:44 +0000 (11:50 -0400)] 
eject: constify array

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agofdisk: move kernel geometry into blkdev
Davidlohr Bueso [Wed, 4 Apr 2012 17:01:24 +0000 (19:01 +0200)] 
fdisk: move kernel geometry into blkdev

This is a more generic place for this ioctl.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofsck: don't free fstab table on parse failure
Dave Reisner [Tue, 27 Mar 2012 12:53:58 +0000 (08:53 -0400)] 
fsck: don't free fstab table on parse failure

Even if we fail parsing, fstab gets referenced later in the code (and
will subsequently crash via heap corruption). Take the easy way out and
simply avoid deallocating this table, as it will be freed for us on
program exit regardless.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agosfdisk: make -l less verbose about missing PT
Karel Zak [Fri, 6 Apr 2012 08:12:32 +0000 (10:12 +0200)] 
sfdisk: make -l less verbose about missing PT

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoMerge branch 'eject'
Karel Zak [Thu, 5 Apr 2012 13:58:02 +0000 (15:58 +0200)] 
Merge branch 'eject'

* eject: (47 commits)
  tests: use eject --force
  eject: use BUILD_EJECT, move to sys-utils
  eject: clean up usage()
  eject: clean up man page
  eject: add --force option
  eject: check for hotplug/removable attribute
  eject: remove obsolete code, use EXIT_* macros
  tests: add umount-by-eject tests
  eject: improve work with partitioned devices
  lib/sysfs: improve sysfs_is_partition_dirent()
  eject: call umount <mountpoint> rather than <device>
  eject: use libmount to detect if cdrom is mounted
  eject: make the code robust
  eject: use SG_IO ioctl for scsi
  eject: support CDIOCEJECT ioctl
  eject: new close_tray code from Fedora
  eject: new auto_eject code from Fedora
  eject: add -X from Fedora
  eject: add --manualeject from fedora
  eject: clean up devname usage
  ...

13 years agotests: use eject --force
Karel Zak [Thu, 5 Apr 2012 13:57:12 +0000 (15:57 +0200)] 
tests: use eject --force

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: use BUILD_EJECT, move to sys-utils
Karel Zak [Thu, 5 Apr 2012 13:39:44 +0000 (15:39 +0200)] 
eject: use BUILD_EJECT, move to sys-utils

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: clean up usage()
Karel Zak [Thu, 5 Apr 2012 11:21:09 +0000 (13:21 +0200)] 
eject: clean up usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: clean up man page
Karel Zak [Thu, 5 Apr 2012 11:12:16 +0000 (13:12 +0200)] 
eject: clean up man page

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: add --force option
Karel Zak [Thu, 5 Apr 2012 10:24:20 +0000 (12:24 +0200)] 
eject: add --force option

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: check for hotplug/removable attribute
Karel Zak [Thu, 5 Apr 2012 10:06:23 +0000 (12:06 +0200)] 
eject: check for hotplug/removable attribute

 * based on code from Fedora

 * supported are only:

   - /sys/dev/block/<maj:min>/removable devices
   - devices connected by usb, ieee1394, pcmcia, mmc or ccw subsystem.

Frankly, this heuristic sucks -- all is hot-pluggable in this days,
but it's probably good idea to restrict the default behavior to avoid
user's mistakes.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodisk-utils: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 18:04:39 +0000 (20:04 +0200)] 
disk-utils: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofdisk: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 18:02:04 +0000 (20:02 +0200)] 
fdisk: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agogetopt: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 18:01:07 +0000 (20:01 +0200)] 
getopt: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agohwclock: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:59:35 +0000 (19:59 +0200)] 
hwclock: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agologin-utils: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:58:34 +0000 (19:58 +0200)] 
login-utils: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agomisc-utils: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:56:48 +0000 (19:56 +0200)] 
misc-utils: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agomount: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:54:15 +0000 (19:54 +0200)] 
mount: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agopartx: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:53:13 +0000 (19:53 +0200)] 
partx: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoschedutils: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:51:32 +0000 (19:51 +0200)] 
schedutils: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosys-utils: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:49:40 +0000 (19:49 +0200)] 
sys-utils: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoterm-utils: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:44:04 +0000 (19:44 +0200)] 
term-utils: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agotext-utils: verify writing to streams was successful
Sami Kerola [Wed, 4 Apr 2012 17:39:15 +0000 (19:39 +0200)] 
text-utils: verify writing to streams was successful

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoinclude: add stream error checking facility
Sami Kerola [Wed, 4 Apr 2012 17:22:08 +0000 (19:22 +0200)] 
include: add stream error checking facility

The close_stream() is copied from GNU lib.  Inspiration to do this is
talk by Jim Meyering - Goodbye World! The perils of relying on output
streams in C.

Reference: http://www.irill.org/events/ghm-gnu-hackers-meeting/videos/jim-meyering-goodbye-world-the-perils-of-relying-on-output-streams-in-c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolsblk: count with terminating character, man page -s entry
Peter Rajnoha [Wed, 4 Apr 2012 11:17:38 +0000 (13:17 +0200)] 
lsblk: count with terminating character, man page -s entry

Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
13 years agobuild-sys: disable chkdupexe by default, mark as deprecated
Karel Zak [Wed, 4 Apr 2012 10:18:32 +0000 (12:18 +0200)] 
build-sys: disable chkdupexe by default, mark as deprecated

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolsblk: use libmount to get mountpoints/swaps
Karel Zak [Tue, 3 Apr 2012 11:43:50 +0000 (13:43 +0200)] 
lsblk: use libmount to get mountpoints/swaps

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add support to parse /proc/swaps
Karel Zak [Tue, 3 Apr 2012 11:20:32 +0000 (13:20 +0200)] 
libmount: add support to parse /proc/swaps

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: clean up MNT_FMT_* usage in parser
Karel Zak [Tue, 3 Apr 2012 09:32:12 +0000 (11:32 +0200)] 
libmount: clean up MNT_FMT_* usage in parser

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: (old) check for LD_FLAGS_AUTOCLEAR more carefully
Karel Zak [Mon, 2 Apr 2012 15:34:07 +0000 (17:34 +0200)] 
mount: (old) check for LD_FLAGS_AUTOCLEAR more carefully

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=803799
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib/loopdev: more robust initialization
Karel Zak [Mon, 2 Apr 2012 15:33:34 +0000 (17:33 +0200)] 
lib/loopdev: more robust initialization

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agortcwake: tiny coding style change
Karel Zak [Mon, 2 Apr 2012 11:21:33 +0000 (13:21 +0200)] 
rtcwake: tiny coding style change

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoscript: error in usage() output
Sami Kerola [Sun, 1 Apr 2012 18:19:31 +0000 (20:19 +0200)] 
script: error in usage() output

Error originates to commit 3ff526391fb5c6b33418dc9cfec31c2ff9b4792e
which is bit more than year, and part or releases v2.20 & v2.21.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agotests: hwclock: locate ntpdate by using path
Sami Kerola [Sun, 1 Apr 2012 18:19:30 +0000 (20:19 +0200)] 
tests: hwclock: locate ntpdate by using path

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agortcwake: only invoke RTC_AIE_ON/OFF ioctls in pairs
Paul Fox [Fri, 30 Mar 2012 12:16:50 +0000 (08:16 -0400)] 
rtcwake: only invoke RTC_AIE_ON/OFF ioctls in pairs

many rtc drivers don't implement the RTC_AIE_ON/OFF ioctls at all --
so if we never tried to enable the alarm interrupt, don't try to
disable it later.

Signed-off-by: Paul Fox <pgf@laptop.org>
13 years agodelpart: improve error messages
Karel Zak [Fri, 30 Mar 2012 14:57:47 +0000 (16:57 +0200)] 
delpart: improve error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoaddpart: improve error messages
Karel Zak [Fri, 30 Mar 2012 14:56:28 +0000 (16:56 +0200)] 
addpart: improve error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotools: ko-release: make scripts bourne sh compliant [checkbashisms]
Sami Kerola [Sun, 18 Mar 2012 20:45:11 +0000 (21:45 +0100)] 
tools: ko-release: make scripts bourne sh compliant [checkbashisms]

$ checkbashisms ko-release-gen
possible bashism in ko-release-gen line 31 ('function' is useless):
function die {
possible bashism in ko-release-gen line 36 ('function' is useless):
function add_file {
possible bashism in ko-release-gen line 68 ('function' is useless):
function add_html_dir {
possible bashism in ko-release-gen line 72 (brace expansion):
        for fl in $(ls $src/*.{html,css,png}); do

$ checkbashisms ko-release-push
possible bashism in ko-release-push line 29 ('function' is useless):
function die {
possible bashism in ko-release-push line 34 ('function' is useless):
function push_file {

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agotools: config-gen: make scripts bourne sh compliant [checkbashisms]
Sami Kerola [Sun, 18 Mar 2012 20:38:39 +0000 (21:38 +0100)] 
tools: config-gen: make scripts bourne sh compliant [checkbashisms]

$ checkbashisms config-gen
script config-gen does not appear to be a /bin/sh script
possible bashism in config-gen line 27 (export foo=bar should be foo=bar; export foo):
        export CFLAGS="$CFLAGS"
$ checkbashisms config-gen-functions.sh
possible bashism in config-gen-functions.sh line 14 ('function' is useless):

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agotools: checkconfig.sh: make scripts bourne sh compliant [checkbashisms]
Sami Kerola [Sun, 18 Mar 2012 20:34:09 +0000 (21:34 +0100)] 
tools: checkconfig.sh: make scripts bourne sh compliant [checkbashisms]

script checkconfig.sh does not appear to be a /bin/sh script
possible bashism in checkconfig.sh line 14 ('function' is useless):
function die() {
possible bashism in checkconfig.sh line 27 ('((' should be '$(('):
while (( "$#" )); do

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoreset: make scripts bourne sh compliant [checkbashisms]
Sami Kerola [Sun, 18 Mar 2012 20:10:35 +0000 (21:10 +0100)] 
reset: make scripts bourne sh compliant [checkbashisms]

In addition strict compliance the commit will take variable name
quoting, and $(command) substitution in use.

$ checkbashisms reset reset.033c
possible bashism in reset line 11 ('$[' should be '$(('):
bot=$[ ${LINES:-`tput lines`} - 1 ]
possible bashism in reset.033c line 11 (echo -e):
echo -e \\033c

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofstrim: add --version and align with howto-usage-function.txt
Sami Kerola [Sun, 18 Mar 2012 16:32:18 +0000 (17:32 +0100)] 
fstrim: add --version and align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofindmnt: remove dublicate usage() line
Sami Kerola [Sun, 18 Mar 2012 16:22:57 +0000 (17:22 +0100)] 
findmnt: remove dublicate usage() line

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofallocate: add --version and align with howto-usage-function.txt
Sami Kerola [Sun, 18 Mar 2012 15:46:42 +0000 (16:46 +0100)] 
fallocate: add --version and align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoswaplabel: add --version and align with howto-usage-function.txt
Sami Kerola [Sun, 18 Mar 2012 15:11:28 +0000 (16:11 +0100)] 
swaplabel: add --version and align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofsck.minix: fix printf format warning
Sami Kerola [Sun, 18 Mar 2012 13:13:31 +0000 (14:13 +0100)] 
fsck.minix: fix printf format warning

fsck.minix.c:1302:3: warning: ISO C does not support the '%m' gnu_printf format [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofsck.minix: clean up coding style
Sami Kerola [Sun, 18 Mar 2012 12:48:30 +0000 (13:48 +0100)] 
fsck.minix: clean up coding style

$ indent -linux -psl -blf disk-utils/fsck.minix.c

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofsck.minix: align with howto-usage-function.txt
Sami Kerola [Sun, 18 Mar 2012 12:27:19 +0000 (13:27 +0100)] 
fsck.minix: align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofsck.minix: use rpmatch() for yes/no question
Sami Kerola [Sun, 18 Mar 2012 12:11:46 +0000 (13:11 +0100)] 
fsck.minix: use rpmatch() for yes/no question

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofsck.minix: use symbolic exit codes
Sami Kerola [Sun, 18 Mar 2012 12:09:33 +0000 (13:09 +0100)] 
fsck.minix: use symbolic exit codes

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofsck.cramfs: add long options
Sami Kerola [Sat, 17 Mar 2012 21:53:17 +0000 (22:53 +0100)] 
fsck.cramfs: add long options

And align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agopg: align with howto-usage-function.txt
Sami Kerola [Sat, 17 Mar 2012 20:56:06 +0000 (21:56 +0100)] 
pg: align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agopg: correct version printing in help screen
Sami Kerola [Sat, 17 Mar 2012 20:28:33 +0000 (21:28 +0100)] 
pg: correct version printing in help screen

Commit also adds -V option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoraw: clean up coding style
Sami Kerola [Sat, 17 Mar 2012 19:46:12 +0000 (20:46 +0100)] 
raw: clean up coding style

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoraw: check numeric user inputs
Sami Kerola [Sat, 17 Mar 2012 19:27:43 +0000 (20:27 +0100)] 
raw: check numeric user inputs

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoraw: use pathnames.h for file locations
Sami Kerola [Sat, 17 Mar 2012 19:15:25 +0000 (20:15 +0100)] 
raw: use pathnames.h for file locations

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoraw: use libc error printing facilities
Sami Kerola [Sat, 17 Mar 2012 19:05:56 +0000 (20:05 +0100)] 
raw: use libc error printing facilities

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoraw: use symbolic exit numbers
Sami Kerola [Sat, 17 Mar 2012 17:58:36 +0000 (18:58 +0100)] 
raw: use symbolic exit numbers

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoraw: add long options and version printing
Sami Kerola [Sat, 17 Mar 2012 17:51:59 +0000 (18:51 +0100)] 
raw: add long options and version printing

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoraw: align with howto-usage-function.txt
Sami Kerola [Sat, 17 Mar 2012 17:38:53 +0000 (18:38 +0100)] 
raw: align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodelpart: align with util-linux coding standards
Sami Kerola [Sat, 17 Mar 2012 17:10:58 +0000 (18:10 +0100)] 
delpart: align with util-linux coding standards

Add long options and usage function, use gnu errror printing
facilities and validate inputs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoaddpart: align with util-linux coding standards
Sami Kerola [Sat, 17 Mar 2012 17:04:37 +0000 (18:04 +0100)] 
addpart: align with util-linux coding standards

Add long options and usage function, use gnu errror printing
facilities and validate inputs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agopartx: add --version option
Sami Kerola [Thu, 15 Mar 2012 22:12:30 +0000 (23:12 +0100)] 
partx: add --version option

Th commit 8275b7326e535c6d745414baca680f03e9eccdf3 added --version to
usage() but not as working option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosetterm: correct manual page reference
Sami Kerola [Thu, 15 Mar 2012 22:06:39 +0000 (23:06 +0100)] 
setterm: correct manual page reference

An error from commit faa0548de47df5691cf56dd49daaba8dbc89d34a

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofindfs: add --version & align with howto-usage-function.txt
Sami Kerola [Thu, 15 Mar 2012 21:58:09 +0000 (22:58 +0100)] 
findfs: add --version & align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofindmnt: add --version & align with howto-usage-function.txt
Sami Kerola [Thu, 15 Mar 2012 21:32:48 +0000 (22:32 +0100)] 
findmnt: add --version & align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agomountpoint: add --version & align with howto-usage-function.txt
Sami Kerola [Thu, 15 Mar 2012 21:24:41 +0000 (22:24 +0100)] 
mountpoint: add --version & align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agohexdump: use strtosize_or_err()
Karel Zak [Fri, 30 Mar 2012 14:18:54 +0000 (16:18 +0200)] 
hexdump: use strtosize_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: use strtosize_or_err()
Karel Zak [Fri, 30 Mar 2012 14:18:30 +0000 (16:18 +0200)] 
losetup: use strtosize_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofstrim: use strtosize_or_err()
Karel Zak [Fri, 30 Mar 2012 14:18:18 +0000 (16:18 +0200)] 
fstrim: use strtosize_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowipefs: use strtosize_or_err()
Karel Zak [Fri, 30 Mar 2012 14:17:49 +0000 (16:17 +0200)] 
wipefs: use strtosize_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoblkid: use strtosize_or_err()
Karel Zak [Fri, 30 Mar 2012 14:17:36 +0000 (16:17 +0200)] 
blkid: use strtosize_or_err()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib/strutils: add strtosize_or_err, clean up
Karel Zak [Fri, 30 Mar 2012 14:11:31 +0000 (16:11 +0200)] 
lib/strutils: add strtosize_or_err, clean up

 * add strtosize_or_err(), we use strtosize() + err() on many places

 * add STRTOXX_EXIT_CODE to overwrite the default EXIT_FAILURE

 * remove else-after-noreturn (e.g. if (foo) err(...); else err(...))

 * clean up indent...

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: clarify KiB vs. KB in man pages
Bernhard Voelker [Mon, 26 Mar 2012 09:30:16 +0000 (11:30 +0200)] 
docs: clarify KiB vs. KB in man pages

Update the man pages of blkid, wipefs, fallocate, fstrim, losetup
and hexdump to clarify the suffixes for the numerical values of the
offset and size/length arguments regarding KiB=1024 vs KB=1000.
Also mention the ZiB/YiB and ZB/YB suffixes supported by strtosize().

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agotools: improve ko-release-* scripts
Karel Zak [Fri, 30 Mar 2012 11:43:45 +0000 (13:43 +0200)] 
tools: improve ko-release-* scripts

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoblkid: add note about variable tags and devices order.
Karel Zak [Thu, 29 Mar 2012 13:06:49 +0000 (15:06 +0200)] 
blkid: add note about variable tags and devices order.

Reported-by: Michael Conrad <mconrad@intellitree.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: remove obsolete code, use EXIT_* macros
Karel Zak [Thu, 29 Mar 2012 10:56:17 +0000 (12:56 +0200)] 
eject: remove obsolete code, use EXIT_* macros

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: add umount-by-eject tests
Karel Zak [Thu, 29 Mar 2012 10:50:50 +0000 (12:50 +0200)] 
tests: add umount-by-eject tests

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: improve work with partitioned devices
Karel Zak [Thu, 29 Mar 2012 10:44:25 +0000 (12:44 +0200)] 
eject: improve work with partitioned devices

 * remove horrible regex based code
 * use /sys to read list of the disk partitions
 * use always whole-disk device for eject ioctl(s)

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib/sysfs: improve sysfs_is_partition_dirent()
Karel Zak [Thu, 29 Mar 2012 10:42:24 +0000 (12:42 +0200)] 
lib/sysfs: improve sysfs_is_partition_dirent()

... to work with absolute disk device path too.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoeject: call umount <mountpoint> rather than <device>
Karel Zak [Wed, 28 Mar 2012 12:24:57 +0000 (14:24 +0200)] 
eject: call umount <mountpoint> rather than <device>

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