]> err.no Git - util-linux/log
util-linux
13 years agobuild-sys: remove unnecessary header
Karel Zak [Wed, 29 Dec 2010 19:58:10 +0000 (20:58 +0100)]
build-sys: remove unnecessary header

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: remove generated po/POTFILES.in
Karel Zak [Wed, 29 Dec 2010 19:51:58 +0000 (20:51 +0100)]
build-sys: remove generated po/POTFILES.in

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofsck: returns proper code on exec() error
Karel Zak [Mon, 27 Dec 2010 21:30:24 +0000 (22:30 +0100)]
fsck: returns proper code on exec() error

# fsck -t foo /dev/sda1; echo $?
fsck: fsck.foo: not found
/sbin/fsck: Error 2 while executing fsck.foo for /dev/sda1
0

new version:

# fsck -t foo /dev/sda1; echo $?
fsck: fsck.foo: not found
fsck: Error 2 while executing fsck.foo for /dev/sda1
8

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=619139
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolsblk: rename "RA" column to "RE"
Karel Zak [Sun, 26 Dec 2010 22:53:21 +0000 (23:53 +0100)]
lsblk: rename "RA" column to "RE"

The RA abbreviation is usually used for readahead, the column in
lsblk(8) means removable.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: use canonicalized names for -l (and sfdisk -d)
Karel Zak [Fri, 17 Dec 2010 00:28:59 +0000 (01:28 +0100)]
fdisk: use canonicalized names for -l (and sfdisk -d)

.. no more /dev/dm-X in "fdisk -l" and "sfdisk -d" output, always use
/dev/mapper/<name>.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoswpaon: use canonicalized devnames on -s output
Karel Zak [Fri, 17 Dec 2010 00:10:36 +0000 (01:10 +0100)]
swpaon: use canonicalized devnames on -s output

Old version
   Filename                                Type            Size    Used Priority
   /dev/sda3                               partition       2353516 76  -1
   /dev/dm-1                               partition       409596  0   -2

New version:
   Filename                                Type            Size    Used Priority
   /dev/sda3                               partition       2353516 76   -1
   /dev/mapper/VUL-lvol0                   partition       409596  0    -2

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoswapon: Canonicalize swap device
Alexey Gladkov [Tue, 14 Dec 2010 23:14:18 +0000 (02:14 +0300)]
swapon: Canonicalize swap device

Swapon checks whether a swap device is active by searching for the
device name in /proc/swaps. /proc/swaps always specifies the path
to real device file, even if the path to real device file, even
if symlink was passed to the swapon() system call.

This differs from /proc/mounts semantics where each string contains
exactly the same device name as it was passed to the mount*() system call.

If a swap partition resides on lvm, libblkid returns a name in
form /dev/mapper/*, but now there are symlinks pointing to device
files /dev/dm-*, resulting to /proc/swaps containing /dev/dm-*,
but swapon still looks for /dev/mapper/* and tries to activate
the swap partition again.

[kzak@redhat.com: - remove unnecessary changes from
                    is_in_proc_swaps()]

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Tested-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolsblk: add --nodeps
Karel Zak [Thu, 16 Dec 2010 11:47:30 +0000 (12:47 +0100)]
lsblk: add --nodeps

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib: [tt] fix alignment of the last tree child
Karel Zak [Thu, 16 Dec 2010 11:12:43 +0000 (12:12 +0100)]
lib: [tt] fix alignment of the last tree child

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomesg: change error exit code from 1 to >1
Francesco Cosoleto [Fri, 10 Dec 2010 16:40:11 +0000 (17:40 +0100)]
mesg: change error exit code from 1 to >1

According to POSIX and mesg(1) error exit code should be >1.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agodocs: update DEPRECATED file
Karel Zak [Fri, 10 Dec 2010 16:32:57 +0000 (17:32 +0100)]
docs: update DEPRECATED file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosimpleinit: move old init stuff to separate directory
Karel Zak [Fri, 10 Dec 2010 16:28:32 +0000 (17:28 +0100)]
simpleinit: move old init stuff to separate directory

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: update TODO file
Karel Zak [Fri, 10 Dec 2010 16:09:43 +0000 (17:09 +0100)]
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agovipw: fix warn_unused_result gcc warning
Karel Zak [Fri, 10 Dec 2010 16:07:44 +0000 (17:07 +0100)]
vipw: fix warn_unused_result gcc warning

vipw.c:194:6: warning: ignoring return value of ‘link’, declared with
attribute warn_unused_result

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofix __noreturn__ usage
Karel Zak [Fri, 10 Dec 2010 15:47:18 +0000 (16:47 +0100)]
fix __noreturn__ usage

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agochfn: Use EXIT_* and err()
Marek Polacek [Wed, 1 Dec 2010 16:18:50 +0000 (17:18 +0100)]
chfn: Use EXIT_* and err()

[kzak@redhat.com: - clean usage() calls and some error messages]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
13 years agowall: fix coding style
Karel Zak [Fri, 10 Dec 2010 15:22:29 +0000 (16:22 +0100)]
wall: fix coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowall: remove progname
Karel Zak [Fri, 10 Dec 2010 15:20:00 +0000 (16:20 +0100)]
wall: remove progname

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowall: Use EXIT_* and err()
Marek Polacek [Wed, 1 Dec 2010 16:18:44 +0000 (17:18 +0100)]
wall: Use EXIT_* and err()

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
13 years agovipw: use EXIT_* and err()
Marek Polacek [Wed, 1 Dec 2010 16:18:38 +0000 (17:18 +0100)]
vipw: use EXIT_* and err()

[kzak@redhat.com: - fix one error message]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosimpleinit: Use EXIT_*
Marek Polacek [Fri, 10 Dec 2010 14:52:44 +0000 (15:52 +0100)]
simpleinit: Use EXIT_*

[kzak@redhat.com: use the main() part of the patch]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoshutdown: Use EXIT_*
Marek Polacek [Wed, 1 Dec 2010 16:18:25 +0000 (17:18 +0100)]
shutdown: Use EXIT_*

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: update TODO file
Davidlohr Bueso [Fri, 10 Dec 2010 11:51:09 +0000 (08:51 -0300)]
docs: update TODO file

Here's a patch to update some the TODO list now that the new partx is
merged.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agologin: fix "ignoring return value" errors
Karel Zak [Fri, 10 Dec 2010 13:05:27 +0000 (14:05 +0100)]
login: fix "ignoring return value" errors

login.c:542:8: warning: ignoring return value of ‘fchown’, declared
with attribute warn_unused_result
login.c:1013:11: warning: ignoring return value of ‘fchown’, declared
with attribute warn_unused_result
login.c: In function ‘dolastlog’:
login.c:1452:7: warning: ignoring return value of ‘write’, declared
with attribute warn_unused_result
login.c: In function ‘motd’:
login.c:1391:7: warning: ignoring return value of ‘write’, declared
with attribute warn_unused_result

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agologin: use EXIT_* and err.h, clean up return codes
Marek Polacek [Wed, 1 Dec 2010 16:18:17 +0000 (17:18 +0100)]
login: use EXIT_* and err.h, clean up return codes

[kzak@redhat.com: - cleanup return codes
                  - use warn()]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolast: Use EXIT_* and err()
Marek Polacek [Wed, 1 Dec 2010 16:18:11 +0000 (17:18 +0100)]
last: Use EXIT_* and err()

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
13 years agologin: use EXIT_* in checktty()
Karel Zak [Fri, 10 Dec 2010 12:08:33 +0000 (13:08 +0100)]
login: use EXIT_* in checktty()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agochsh: use EXIT_* and err.h
Karel Zak [Fri, 10 Dec 2010 12:01:05 +0000 (13:01 +0100)]
chsh: use EXIT_* and err.h

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosfdisk: add option to use maximum partition size
Karel Zak [Thu, 9 Dec 2010 22:13:58 +0000 (23:13 +0100)]
sfdisk: add option to use maximum partition size

Based on patch from Alex Bligh <alex@alex.org.uk>, Alex wrote:

   By default, omitting a size parameter means that the maximum sized partition
   is used. However, this option is not available in conjunction with the -N
   flag, as under such circumstances the default is the current size of the
   partition. This patch allows a size to be specified as "+" in which case
   the maximum sized partition is used, irrespective of the setting of the -N
   flag.

   This allows partitions to be programatically resized to their maximum size,
   by (for instance):

     echo ",+," | sfdisk -N1 /dev/sda

   This is non-trivial to do without the patch, as -N makes the default size
   the existing size. As there is (without this patch) no way of reading the
   maximum size, the only option is to delete the partition and recreate it.
   This is undesirable for a number of reasons (e.g. errors between delete
   and recreate).

Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/686124
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agorenice: improve messages specifying what ID is referring to
Francesco Cosoleto [Thu, 9 Dec 2010 19:03:19 +0000 (20:03 +0100)]
renice: improve messages specifying what ID is referring to

Hello,

On 30/11/2010 13:01, Karel Zak wrote:

> Unfortunately, translators don't like this kind of strings where any
> translatable substring is inserted to the normal sentence. It would be
> better to use something like:
>
>   "%d (%s): failed to set priority", who, idtype
>
>   "%s: %d: failed to set priority", idtype, who
>
> or so...

or "failed to set priority for %d (%s)"?

From 536eb11f873f2c887e075a37ffb3c971cac258d5 Mon Sep 17 00:00:00 2001
From: Francesco Cosoleto <cosoleto@gmail.com>
Date: Mon, 6 Dec 2010 01:23:10 +0100
Subject: [PATCH] renice: improve messages specifying what ID is referring to

This version makes more clear the printed message specially when the
--user option is used.

Old version:
   $ renice 19 10 -u fra -g 1
renice: 10: setpriority: Operation not permitted
renice: 1000: setpriority: Operation not permitted
renice: 1: setpriority: Operation not permitted

   $ renice 19 -u fra
1000: old priority 0, new priority 19

New version:
   $ renice 19 10 -u fra -g 1
renice: failed to set priority for 10 (process ID): Operation not permitted
renice: failed to set priority for 1000 (user ID): Operation not permitted
renice: failed to set priority for 1 (process group ID): Operation not permitted

   $ renice 19 -u fra
1000 (user ID) old priority 0, new priority 19

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agopartx: tiny change in usage()
Karel Zak [Thu, 9 Dec 2010 22:00:33 +0000 (23:00 +0100)]
partx: tiny change in usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: cleanup and add columns
Karel Zak [Thu, 9 Dec 2010 21:58:12 +0000 (22:58 +0100)]
partx: cleanup and add columns

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: add regression tests
Davidlohr Bueso [Thu, 9 Dec 2010 21:56:55 +0000 (22:56 +0100)]
tests: add  regression tests

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodelpart: code consolidation
Karel Zak [Thu, 9 Dec 2010 20:56:22 +0000 (21:56 +0100)]
delpart: code consolidation

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoaddpart: code consolidation
Karel Zak [Thu, 9 Dec 2010 20:56:13 +0000 (21:56 +0100)]
addpart: code consolidation

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: complete rewrite
Davidlohr Bueso [Thu, 9 Dec 2010 20:54:17 +0000 (21:54 +0100)]
partx: complete rewrite

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: be more explicit about --move in mount.8
Karel Zak [Mon, 6 Dec 2010 10:17:10 +0000 (11:17 +0100)]
mount: be more explicit about --move in mount.8

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: NTFS volume label not found
Karel Zak [Fri, 3 Dec 2010 14:27:30 +0000 (15:27 +0100)]
libblkid: NTFS volume label not found

Reported-by: Hugh Eaves <hugh@hugheaves.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoipc: remove .info file
Karel Zak [Fri, 3 Dec 2010 12:02:40 +0000 (13:02 +0100)]
ipc: remove .info file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add mesg to .gitignore
Karel Zak [Thu, 2 Dec 2010 17:07:57 +0000 (18:07 +0100)]
build-sys: add mesg to .gitignore

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoagetty: Use EXIT_* and add noreturn attribute
Marek Polacek [Wed, 1 Dec 2010 16:17:25 +0000 (17:17 +0100)]
agetty: Use EXIT_* and add noreturn attribute

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
13 years agomesg: Use EXIT_* and discard K&R style declaration.
Marek Polacek [Wed, 1 Dec 2010 16:17:16 +0000 (17:17 +0100)]
mesg: Use EXIT_* and discard K&R style declaration.

[kzak@redhat.com: - use return rather than exit() in main()
                  - more verbose error messages]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agonewgrp: Use err() and EXIT_*
Marek Polacek [Tue, 30 Nov 2010 21:53:31 +0000 (22:53 +0100)]
newgrp: Use err() and EXIT_*

Use err() or errx() where appropriate.  Also use EXIT_* macros instead
of 0/1.  All error messages shall start with lowercase.

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoREADME: fix typo
Davidlohr Bueso [Wed, 24 Nov 2010 13:20:55 +0000 (10:20 -0300)]
README: fix typo

Change feture for feature

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agomount: read /sys for loopdev backing file
Karel Zak [Wed, 1 Dec 2010 22:02:17 +0000 (23:02 +0100)]
mount: read /sys for loopdev backing file

On systems without /etc/mtab (or everywhere if kernel >= 2.6.37)
we use loop autoclear flag and then the backing file name is not
stored in /etc/mtab. mount(8) uses sysfs to get the filename (or
LOOP_GET_STATU* ioctls on old kernels).

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoremove -ng from some files
Karel Zak [Wed, 1 Dec 2010 21:06:15 +0000 (22:06 +0100)]
remove -ng from some files

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolosetup: use /sys/dev/block/.../loop/backing_file
Karel Zak [Wed, 1 Dec 2010 13:04:35 +0000 (14:04 +0100)]
losetup: use /sys/dev/block/.../loop/backing_file

The basic loopdev attributes are available in sysfs since kernel
2.6.37. This patch uses the backing_file attribute from sysfs for very
long filenames (the LOOP_GET_STATUS ioctl uses only 64 bytes for the
filename).

old version:
 # losetup -a
 /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_*)

new version:
 # losetup -a
 /dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_name/ext2.img)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolscpu: use GPLv2+
Karel Zak [Wed, 1 Dec 2010 10:20:45 +0000 (11:20 +0100)]
lscpu: use GPLv2+

CAI Qian and I agree that GPLv2+ is better for lscpu.c. This license
is more compatible (than v3) with the rest of the util-linux package.
We need to link the code with functions from lib/ -- mix GPLv3 and
GPLv2 is bad idea.

Note that it was only Cai and I who did significant changes to
lscpu.c, all others changes from others developers was trivial (fix
typos, add _(), ...).

Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update TODO file
Karel Zak [Tue, 30 Nov 2010 12:28:46 +0000 (13:28 +0100)]
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolast: use xalloc lib
Davidlohr Bueso [Mon, 29 Nov 2010 12:27:18 +0000 (09:27 -0300)]
last: use xalloc lib

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agologin: use xalloc lib
Davidlohr Bueso [Mon, 29 Nov 2010 12:27:11 +0000 (09:27 -0300)]
login: use xalloc lib

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agowall: use xalloc lib
Davidlohr Bueso [Mon, 29 Nov 2010 12:27:04 +0000 (09:27 -0300)]
wall: use xalloc lib

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agorenice: rewrite usage()
Karel Zak [Tue, 30 Nov 2010 11:46:06 +0000 (12:46 +0100)]
renice: rewrite usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agorenice: update man page (nice rlimit was added to kernel)
Francesco Cosoleto [Wed, 24 Nov 2010 22:10:19 +0000 (23:10 +0100)]
renice: update man page (nice rlimit was added to kernel)

Non-root tasks can raise nice priority on systems running Linux 2.6.12 or higher
if the nice resource limit is set.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agorenice: reverse %s position in error messages
Francesco Cosoleto [Wed, 24 Nov 2010 22:10:18 +0000 (23:10 +0100)]
renice: reverse %s position in error messages

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agorenice: remove hardcoded program name using warn() and warnx()
Francesco Cosoleto [Wed, 24 Nov 2010 22:10:16 +0000 (23:10 +0100)]
renice: remove hardcoded program name using warn() and warnx()

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agorenice: make some functions static
Francesco Cosoleto [Wed, 24 Nov 2010 22:10:14 +0000 (23:10 +0100)]
renice: make some functions static

14 years agopo: fix note about license
Karel Zak [Tue, 30 Nov 2010 10:56:03 +0000 (11:56 +0100)]
po: fix note about license

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: add missing header
Karel Zak [Tue, 30 Nov 2010 10:52:10 +0000 (11:52 +0100)]
build-sys: add missing header

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: update after rename
Karel Zak [Tue, 30 Nov 2010 10:48:14 +0000 (11:48 +0100)]
po: update after rename

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agorename util-linux-ng back to util-linux
Karel Zak [Tue, 30 Nov 2010 10:41:59 +0000 (11:41 +0100)]
rename util-linux-ng back to util-linux

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: add LINHIB0001 signature to swap prober
Karel Zak [Mon, 29 Nov 2010 09:26:18 +0000 (10:26 +0100)]
libblkid: add LINHIB0001 signature to swap prober

The new swsuspend signature has been added by commit
3624eb04c24861ab296842414f9752a393e68372 to kernel 2.6.37-rc1.

Reported-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/682176
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fix freespace boundaries calculation on SGI disklabel
Karel Zak [Mon, 29 Nov 2010 13:02:56 +0000 (14:02 +0100)]
fdisk: fix freespace boundaries calculation on SGI disklabel

Thanks to Aurelien Jarno <aurelien@aurel32.net>

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510130
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofstrim: fix typo
Karel Zak [Mon, 29 Nov 2010 12:09:16 +0000 (13:09 +0100)]
fstrim: fix typo

Reported-by: Jeroen Oortwijn <oortwijn@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: remove unnecessary __UCLIBC__ check
Mike Frysinger [Mon, 29 Nov 2010 12:00:14 +0000 (13:00 +0100)]
libblkid: remove unnecessary __UCLIBC__ check

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agortcwake: use err.h routines
Karel Zak [Fri, 26 Nov 2010 16:43:54 +0000 (17:43 +0100)]
rtcwake: use err.h routines

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agortcwake: add 'show' mode for rtc alarm
Marek Otahal [Fri, 26 Nov 2010 15:47:38 +0000 (16:47 +0100)]
rtcwake: add 'show' mode for rtc alarm

The 'show' mode prints information on current alarm setting.

[kzak@redhat.com: - code clean up
                  - don't setup alarm on 'disable' mode]

Signed-off-by: Marek Otahal <markotahal@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofstrim: add new command
Lukas Czerner [Wed, 24 Nov 2010 23:05:37 +0000 (00:05 +0100)]
fstrim: add new command

fstrim is used on a mounted filesystem to discard (or "trim") blocks
which are not in use by the filesystem.  This is useful for
solid-state drives (SSDs) and thinly-provisioned storage

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: 256MiB is min size of btrfs
Karel Zak [Fri, 26 Nov 2010 12:40:51 +0000 (13:40 +0100)]
libblkid: 256MiB is min size of btrfs

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofallocate: fix typo
Karel Zak [Wed, 24 Nov 2010 22:16:01 +0000 (23:16 +0100)]
fallocate: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: fix lsblk building
Karel Zak [Wed, 24 Nov 2010 17:16:44 +0000 (18:16 +0100)]
build-sys: fix lsblk building

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolsblk: add new utility
Milan Broz [Wed, 24 Nov 2010 16:06:39 +0000 (17:06 +0100)]
lsblk: add new utility

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [strutils] move strmode() from namei.c to strutils.c
Karel Zak [Wed, 24 Nov 2010 15:41:20 +0000 (16:41 +0100)]
lib: [strutils] move strmode() from namei.c to strutils.c

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [xalloc] add xstrdup()
Karel Zak [Wed, 24 Nov 2010 15:39:15 +0000 (16:39 +0100)]
lib: [xalloc] add xstrdup()

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: apply new changes from tt.c
Karel Zak [Thu, 18 Nov 2010 20:06:27 +0000 (21:06 +0100)]
findmnt: apply new changes from tt.c

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [tt] add TT_FL_RIGHT, add columns list parser
Karel Zak [Thu, 18 Nov 2010 20:04:13 +0000 (21:04 +0100)]
lib: [tt] add TT_FL_RIGHT, add columns list parser

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [ismounted] don't wast time with mtab is /proc/mounts used
Karel Zak [Thu, 18 Nov 2010 20:03:02 +0000 (21:03 +0100)]
lib: [ismounted] don't wast time with mtab is /proc/mounts used

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: remove unused variable
Karel Zak [Tue, 23 Nov 2010 20:14:48 +0000 (21:14 +0100)]
libblkid: remove unused variable

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update TODO file
Karel Zak [Tue, 23 Nov 2010 20:10:48 +0000 (21:10 +0100)]
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: [strutils] general purpose string handling functions
Davidlohr Bueso [Tue, 16 Nov 2010 13:47:35 +0000 (10:47 -0300)]
lib: [strutils] general purpose string handling functions

This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)

A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agolibblkid: cache is incorrectly revalidated
Karel Zak [Tue, 23 Nov 2010 18:49:58 +0000 (19:49 +0100)]
libblkid: cache is incorrectly revalidated

for example:

# echo "password" | cryptsetup luksFormat /dev/loop7
# blkid /dev/loop7
/dev/loop7: UUID="09240a80-1cf1-456d-9a6e-a35b39dc1f2b" TYPE="crypto_LUKS"

# pvcreate -ff /dev/loop7
# blkid /dev/loop7
#

the second blkid call has to return info about LVM.

Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: mark die() as nonreturn
Karel Zak [Tue, 23 Nov 2010 18:42:33 +0000 (19:42 +0100)]
mount: mark die() as nonreturn

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: ignore *context= options on remount
Karel Zak [Fri, 19 Nov 2010 12:37:25 +0000 (13:37 +0100)]
mount: ignore *context= options on remount

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=563267
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: update relatime description in mount.8
Karel Zak [Tue, 16 Nov 2010 09:17:02 +0000 (10:17 +0100)]
mount: update relatime description in mount.8

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=653705
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoagetty: use nl_langinfo()
Karel Zak [Mon, 15 Nov 2010 15:48:27 +0000 (16:48 +0100)]
agetty: use nl_langinfo()

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocal: follow HAVE_LANGINFO
Karel Zak [Mon, 15 Nov 2010 15:48:03 +0000 (16:48 +0100)]
cal: follow HAVE_LANGINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofindmnt: follow HAVE_LANGINFO
Karel Zak [Mon, 15 Nov 2010 15:47:13 +0000 (16:47 +0100)]
findmnt: follow HAVE_LANGINFO

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: add fallback for nl_langinfo()
Karel Zak [Mon, 15 Nov 2010 15:42:45 +0000 (16:42 +0100)]
lib: add fallback for nl_langinfo()

The fallback ignores locales and returns hardcoded static strings. It
should be enough to include "nls.h" to work with nl_langinfo() on all
systems.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib/tt: fix langinfo build break
Davidlohr Bueso [Mon, 15 Nov 2010 11:55:16 +0000 (08:55 -0300)]
lib/tt: fix langinfo build break

When HAVE_LANGINFO_H is not defined we break the compilation in tt.c:

  CC     tt.o
tt.c: In function ‘tt_new_table’:
tt.c:142: warning: implicit declaration of function ‘nl_langinfo’
tt.c:142: error: ‘CODESET’ undeclared (first use in this function)
tt.c:142: error: (Each undeclared identifier is reported only once
tt.c:142: error: for each function it appears in.)
make: *** [tt.o] Error 1

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agolibblkid: add blkid_probe_get_sectors()
Davidlohr Bueso [Thu, 11 Nov 2010 13:34:52 +0000 (10:34 -0300)]
libblkid: add blkid_probe_get_sectors()

This function allows users to obtain the device's 512-byte sector count.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agohwclock: [m68k] unbreak FTBFS with recent (>= 2.4.18?) kernels
Thorsten Glaser [Sun, 7 Nov 2010 14:00:04 +0000 (14:00 +0000)]
hwclock: [m68k] unbreak FTBFS with recent (>= 2.4.18?) kernels

The old KDGHWCLK ioctl was removed from the Linux kernel quite some
time ago. The kd.c source file of hwclock contains fallback code to
handle this, but the fallback code never could have compiled or was
not fixed along other code changes. The Linux kernel nowadays igno-
res the ioctl entirely so removing it unless provided by the kernel
headers, to keep it working on very old kernels, seems the sensible
thing to do, as the comments say m68k only and deprecated (which is
correct AFAICT).

According to pickaxe on gitweb, it was removed in 2002:
http://git.kernel.org/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commit;h=a915e414af5fc541ff62ef0bfec847457ae650bc

Addresses: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578168
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoswapon: better text for "discard", note about swapon in fstab.5
Karel Zak [Wed, 10 Nov 2010 10:48:30 +0000 (11:48 +0100)]
swapon: better text for "discard", note about swapon in fstab.5

Suggested by Hugh Dickins. Thanks.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: remove ipc.texi (info with IPC API docs)
Karel Zak [Tue, 9 Nov 2010 11:40:56 +0000 (12:40 +0100)]
docs: remove ipc.texi (info with IPC API docs)

The IPC API documentation is maintained in the standard man-pages. It does
not make sense to maintain this docs in util-linux-ng.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: add magic to vfat
Jeroen Oortwijn [Tue, 2 Nov 2010 21:13:12 +0000 (22:13 +0100)]
libblkid: add magic to vfat

Add the "FAT     " magic to vfat. There are devices that use this magic
in their FAT filesystem.

Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/491476
Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
14 years agocolumn: segfault on empty input
Karel Zak [Thu, 4 Nov 2010 21:22:49 +0000 (22:22 +0100)]
column: segfault on empty input

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=579955
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agosys-utils: make use xalloc wrappers
Davidlohr Bueso [Wed, 27 Oct 2010 09:14:46 +0000 (06:14 -0300)]
sys-utils: make use xalloc wrappers

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agolibblkid: add signature to FAT32 fsinfo block
Jeroen Oortwijn [Sun, 31 Oct 2010 20:32:21 +0000 (21:32 +0100)]
libblkid: add signature to FAT32 fsinfo block

Add 0x41645252 to the list of valid signatures of the FAT32 fsinfo
block. It isn't a valid signature, but there are devices that use this
signature in their FAT32 filesystem.

Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/589369
Signed-off-by: Jeroen Oortwijn <oortwijn@gmail.com>
14 years agoswapon: add "discard" support
Hugh Dickins [Mon, 25 Oct 2010 00:32:47 +0000 (17:32 -0700)]
swapon: add "discard" support

In kernel 2.6.36 (and in stable kernel 2.6.35.5) I made a tiny change
to the swapon(const char *path, int swapflags) system call interface:
kernel commit 3399446632739fcd05fd8b272b476a69c6e6d14a
swap: discard while swapping only if SWAP_FLAG_DISCARD

As things stand at present, we could just remove the swap discard
support; but since several filesystems (including ext4 and btrfs and
fat) are offering a "discard" mount option, I thought swap should take
the same course, and offer a "--discard" or "-d" option to swapon(8).

[kzak@redhat.com: - update swapon.8 man page
                  - use for -d the same logic as for -p]

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agorev: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:26:24 +0000 (12:26 -0300)]
rev: use xalloc for memory allocation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
14 years agoul: use xalloc for memory allocation
Davidlohr Bueso [Fri, 22 Oct 2010 15:25:46 +0000 (12:25 -0300)]
ul: use xalloc for memory allocation

Signed-off-by: Davidlohr Bueso <dave@gnu.org>