Commit Graph

2345 Commits

Author SHA1 Message Date
Milan Broz 6ebe8f630a wipefs: fail if more device arguments specified
Currently wipefs process only first device argument and silently ignores
remaining.  Print error instead because it can be quite confusing.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-30 23:14:55 +01:00
Sami Kerola 604eb2602c hexdump: remove od functionality in favor to GNU coreutils od
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2010-12-30 23:11:43 +01:00
Karel Zak e02d2b9328 libblkid: fix endian conversion bug in NILFS
Reported-by: Andrew Nayenko <resver@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-30 20:37:22 +01:00
Karel Zak 98496774de build-sys: remove unnecessary header
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-29 20:58:10 +01:00
Karel Zak 7c2ee1d26c build-sys: remove generated po/POTFILES.in
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-29 20:51:58 +01:00
Karel Zak 6c6f2af9e3 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>
2010-12-27 22:31:36 +01:00
Karel Zak 61cbc01a89 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>
2010-12-26 23:53:21 +01:00
Karel Zak 6bec87105c 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>
2010-12-17 01:28:59 +01:00
Karel Zak 57a60bf0ef 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>
2010-12-17 01:10:36 +01:00
Alexey Gladkov b98ff23e87 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>
2010-12-17 00:44:40 +01:00
Karel Zak f31505fe03 lsblk: add --nodeps
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-16 12:47:30 +01:00
Karel Zak f872ed1f22 lib: [tt] fix alignment of the last tree child
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-16 12:12:43 +01:00
Francesco Cosoleto 5eae593093 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>
2010-12-10 21:13:44 +01:00
Karel Zak 07542740b6 docs: update DEPRECATED file
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 17:36:15 +01:00
Karel Zak 5502d92b28 simpleinit: move old init stuff to separate directory
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 17:28:32 +01:00
Karel Zak cda8458b4d docs: update TODO file
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 17:09:43 +01:00
Karel Zak 18be404b29 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>
2010-12-10 17:07:44 +01:00
Karel Zak abafd68667 fix __noreturn__ usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 16:47:18 +01:00
Marek Polacek 39941b4e38 chfn: Use EXIT_* and err()
[kzak@redhat.com: - clean usage() calls and some error messages]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-10 16:41:15 +01:00
Karel Zak 00f41c7dfd wall: fix coding style
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 16:22:29 +01:00
Karel Zak aa00c136a5 wall: remove progname
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 16:20:00 +01:00
Marek Polacek d0acbd38e2 wall: Use EXIT_* and err()
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-10 16:15:19 +01:00
Marek Polacek 9b59ecf082 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>
2010-12-10 15:57:17 +01:00
Marek Polacek 84228d125e simpleinit: Use EXIT_*
[kzak@redhat.com: use the main() part of the patch]

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 15:52:44 +01:00
Marek Polacek 713e0eeed4 shutdown: Use EXIT_*
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 15:48:21 +01:00
Davidlohr Bueso ded850dfb8 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>
2010-12-10 14:08:53 +01:00
Karel Zak 11784a8442 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>
2010-12-10 14:05:27 +01:00
Marek Polacek 66020e56d2 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>
2010-12-10 13:52:37 +01:00
Marek Polacek db797f24f1 last: Use EXIT_* and err()
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-10 13:18:12 +01:00
Karel Zak 3851ebe8f8 login: use EXIT_* in checktty()
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 13:08:33 +01:00
Karel Zak d39d4bf6f5 chsh: use EXIT_* and err.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10 13:01:05 +01:00
Karel Zak f30f2bbc81 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>
2010-12-09 23:13:58 +01:00
Francesco Cosoleto 8aa5046647 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>
2010-12-09 23:07:41 +01:00
Karel Zak 0742ce4ae5 partx: tiny change in usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 23:00:33 +01:00
Karel Zak 5de966b34b partx: cleanup and add columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 22:58:12 +01:00
Davidlohr Bueso 9894961bf9 tests: add regression tests
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 22:56:55 +01:00
Karel Zak 6e6a182ebd delpart: code consolidation
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 21:56:22 +01:00
Karel Zak 74a782e2a2 addpart: code consolidation
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-09 21:56:13 +01:00
Davidlohr Bueso c4ecaf21d5 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>
2010-12-09 21:54:17 +01:00
Karel Zak 4bfa39d5d5 mount: be more explicit about --move in mount.8
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-06 11:17:10 +01:00
Karel Zak 728d2faafd libblkid: NTFS volume label not found
Reported-by: Hugh Eaves <hugh@hugheaves.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-03 15:27:30 +01:00
Karel Zak 7a15536c95 ipc: remove .info file
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-03 13:02:40 +01:00
Karel Zak ea6833c0aa build-sys: add mesg to .gitignore
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-02 18:07:57 +01:00
Marek Polacek 365210fc53 agetty: Use EXIT_* and add noreturn attribute
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-02 18:07:07 +01:00
Marek Polacek 1a68fc8aef 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>
2010-12-02 17:48:29 +01:00
Marek Polacek 1fa30199c6 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>
2010-12-02 17:15:51 +01:00
Davidlohr Bueso 1b7cfdb631 README: fix typo
Change feture for feature

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-12-02 17:01:46 +01:00
Karel Zak db3b5b76a7 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>
2010-12-01 23:02:17 +01:00
Karel Zak d3b24397df remove -ng from some files
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01 22:06:15 +01:00
Karel Zak b61e939013 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>
2010-12-01 14:04:35 +01:00