]> err.no Git - util-linux/log
util-linux
16 years agocfdisk: accept yes/no as fallback
Matthias Koenig [Thu, 6 Nov 2008 14:49:30 +0000 (15:49 +0100)]
cfdisk: accept yes/no as fallback

Accept "yes" or "no" as fallback in case the question
has not been translated.

[kzak@redhat.com: note that rpmatch(3) looks at only the first
                  character of response, but we need have to
                  check the full yes/no string.]

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
16 years agomkfs.minix: fix size detection
Matthias Koenig [Thu, 6 Nov 2008 14:43:46 +0000 (15:43 +0100)]
mkfs.minix: fix size detection

blkdev_get_size returns size in bytes, so BLOCKS has to be
calculated accordingly.
Use stat value for size if device is not a block device.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
16 years agofdisk: add some missing includes
Matthias Koenig [Thu, 6 Nov 2008 14:24:24 +0000 (15:24 +0100)]
fdisk: add some missing includes

Currently these missing includes prevent that HDIO_GETGEO
is defined, so is_probably_full_disk always uses the
"silly heuristic" method.

[kzak@redhat.com: add also unistd.h]

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agonamei: add --owners and --long options
Karel Zak [Thu, 30 Oct 2008 12:42:50 +0000 (13:42 +0100)]
namei: add --owners and --long options

Added file owner and group name printing support. The groupnames and
usernames are cached to avoid an extra overhead. This implementation
does not use fixed width of user/group name columns.

$ namei -l /var/www/cgi-bin
f: /var/www/cgi-bin
 drwxr-xr-x root root /
 drwxr-xr-x root root var
 drwxr-xr-x root root www
 drwxr-xr-x root root cgi-bin

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agonamei: new re-written version
Karel Zak [Thu, 30 Oct 2008 09:19:39 +0000 (10:19 +0100)]
namei: new re-written version

This new version:
 * not based on chdir()
 * implemented without recursion (does not depend on stack size)
 * list of directories is stored in allocated memory (the code is
   extendable with new functionality (e.g. show usernames, groupnames,
   selunux contexts, ...).
 * supports long command line options
 * adds a new command line option:
     -n, --nosymlinks    don't follow symlinks

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: support +cylinder notation
Karel Zak [Thu, 13 Nov 2008 22:08:34 +0000 (23:08 +0100)]
fdisk: support +cylinder notation

Currently fdisk does not support +cylinder notation and reports
"Unsupported suffix: ''".

Reported-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: read /proc/partitions in more robust way
Karel Zak [Thu, 13 Nov 2008 14:37:22 +0000 (15:37 +0100)]
fdisk: read /proc/partitions in more robust way

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: cannot create partition with starting beyond 1 TB
Karel Zak [Thu, 13 Nov 2008 13:56:17 +0000 (14:56 +0100)]
fdisk: cannot create partition with starting beyond 1 TB

fdisk(8) uses "unsigned long long" for all internal calculations --
let use it for start of partition too.

Address-Red-Hat-Bugzilla: #471369
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agosfdisk: fix Compilation Error
CAI Qian [Thu, 23 Oct 2008 04:21:14 +0000 (21:21 -0700)]
sfdisk: fix Compilation Error

This patch fixes a compilation error in the latest tree.

Signed-off-by: CAI Qian <caiqian@cclom.cn>
16 years agolscpu: return EXIT_SUCCESS at the end
Matthias Koenig [Tue, 21 Oct 2008 16:45:40 +0000 (18:45 +0200)]
lscpu: return EXIT_SUCCESS at the end

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
16 years agotests: refresh Makefile.am (add missing lscpu tests)
Karel Zak [Wed, 22 Oct 2008 11:56:07 +0000 (13:56 +0200)]
tests: refresh Makefile.am (add missing lscpu tests)

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: add lscpu(1) test for fullvirt. Xen x86_64
Karel Zak [Wed, 22 Oct 2008 11:49:23 +0000 (13:49 +0200)]
tests: add lscpu(1) test for fullvirt. Xen x86_64

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: add lscpu(1) test for paravirt. Xen i386
Karel Zak [Wed, 22 Oct 2008 11:22:21 +0000 (13:22 +0200)]
tests: add lscpu(1) test for paravirt. Xen i386

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: add mk-lscpu-input.sh
Karel Zak [Wed, 22 Oct 2008 11:13:41 +0000 (13:13 +0200)]
tests: add mk-lscpu-input.sh

This script makes a copy from system /proc and /sys. The result is
useful for lscpu(1) regression tests.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolscpu: add Hypervisor detection
Karel Zak [Tue, 30 Sep 2008 23:29:32 +0000 (01:29 +0200)]
lscpu: add Hypervisor detection

This patch adds two new fields:

 * "Hypervisor vendor"  -- based on CPUID and hypervisor specific
   PCI devices. lscpu(1) supports KVM, XEN, Microsoft HV now.

 * "Virtualization type"
- "none" = Xen dom0
- "full" = full virtualization (KVM, Xen, ...)
- "para" = Xen paravirtualization

Co-Author: Ky Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agodocs: update TODO list
Karel Zak [Thu, 16 Oct 2008 21:44:59 +0000 (23:44 +0200)]
docs: update TODO list

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: remove "cli" and "sti" from i386 CMOS code
Karel Zak [Thu, 16 Oct 2008 21:37:38 +0000 (23:37 +0200)]
hwclock: remove "cli" and "sti" from i386 CMOS code

The protection against context switch is nonsense. There is possible
to optimize the access to CMOS by mlockall(MCL_CURRENT) and SCHED_FIFO.

For more details see: http://lkml.org/lkml/2008/10/12/132

Reported-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoipcs: fix exit codes, remove tailing white-spaces
Karel Zak [Tue, 7 Oct 2008 08:23:23 +0000 (10:23 +0200)]
ipcs: fix exit codes, remove tailing white-spaces

Addresses-Red-Hat-Bugzilla: #465911
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: sync tmpfs info in mount.8 with Documentation/filesystems/tmpfs.txt
Karel Zak [Mon, 6 Oct 2008 10:56:37 +0000 (12:56 +0200)]
mount: sync tmpfs info in mount.8 with Documentation/filesystems/tmpfs.txt

Addresses-Red-Hat-Bugzilla: #465761
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: sync FAT info in mount.8 with Documentation/filesystems/vfat.txt
Karel Zak [Mon, 6 Oct 2008 10:25:59 +0000 (12:25 +0200)]
mount: sync FAT info in mount.8 with Documentation/filesystems/vfat.txt

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: suggest partprobe(8) and kpartx(8) when BLKRRPART failed
Vincent Deffontaines [Tue, 16 Sep 2008 11:08:12 +0000 (13:08 +0200)]
fdisk: suggest partprobe(8) and kpartx(8) when BLKRRPART failed

Signed-off-by: Vincent Deffontaines <vincent@gryzor.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Karel Zak <kzak@redhat.com>

16 years agomount: remove link to namesys.com
Karel Zak [Fri, 3 Oct 2008 07:34:25 +0000 (09:34 +0200)]
mount: remove link to namesys.com

Ricardo Catalinas Jiménez  wrote:
  In the man page mount(8) there is the url
  "http://www.namesys.com/mount-options.html". The web site has been
  down for a long time and the Namesys company is trying to be sold.

Reported-By: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agopg: several strings without gettext calls
Pedro Ribeiro [Fri, 3 Oct 2008 07:31:44 +0000 (09:31 +0200)]
pg: several strings without gettext calls

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoreadprofile: several strings without gettext calls
Pedro Ribeiro [Fri, 3 Oct 2008 07:27:33 +0000 (09:27 +0200)]
readprofile: several strings without gettext calls

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolosetup: several strings without gettext strings
Pedro Ribeiro [Fri, 3 Oct 2008 07:25:10 +0000 (09:25 +0200)]
losetup: several strings without gettext strings

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agologger: several strings without gettext calls
Pedro Ribeiro [Fri, 3 Oct 2008 07:17:07 +0000 (09:17 +0200)]
logger: several strings without gettext calls

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agologin-utils: several strings without gettext calls
Pedro Ribeiro [Fri, 3 Oct 2008 07:13:20 +0000 (09:13 +0200)]
login-utils: several strings without gettext calls

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: several strings without gettext calls
Pedro Ribeiro [Fri, 3 Oct 2008 06:57:43 +0000 (08:57 +0200)]
hwclock: several strings without gettext calls

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: several strings without gettext calls
Pedro Ribeiro [Fri, 3 Oct 2008 06:52:35 +0000 (08:52 +0200)]
fdisk: several strings without gettext calls

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoraw: add NLS support
Pedro Ribeiro [Fri, 3 Oct 2008 06:46:36 +0000 (08:46 +0200)]
raw: add NLS support

[kzak@redhat.com: - add setlocale(), ...
                  - remove tailing white spaces]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomkfs.cramfs: several strings without gettext calls
Pedro Ribeiro [Fri, 3 Oct 2008 06:35:16 +0000 (08:35 +0200)]
mkfs.cramfs: several strings without gettext calls

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofsck.cramfs: add NLS support
Pedro Ribeiro [Fri, 3 Oct 2008 06:30:33 +0000 (08:30 +0200)]
fsck.cramfs: add NLS support

[kzak@redhat.com: - add setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoelvtune: add NLS support
Pedro Ribeiro [Fri, 3 Oct 2008 06:22:50 +0000 (08:22 +0200)]
elvtune: add NLS support

[kzak@redhat.com: - add missing setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: mtab created multiple times with -a option
Karel Zak [Tue, 30 Sep 2008 22:27:37 +0000 (00:27 +0200)]
mount: mtab created multiple times with -a option

When /etc/mtab does not exist and mount is called with -a, for every
mount point that is mounted a root-fs record is added to mtab. This is
because get_mtab_info() sets the flag mtab_does_not_exist to 1 when it
doesn't find /etc/mtab. However, if it actually finds /etc/mtab, the
variable is not reset to 0. So on every subsequent call to
get_mtab_info() (as it is the case when mounting several mount points
with the -a option), mount will think that /etc/mtab does not exist,
even if it was created in the meantime by mount itself.

Reported-By: Jonas Kramer <jkramer@nex.scrapping.cc>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolosetup: missing EBUSY error hint message
Karel Zak [Tue, 30 Sep 2008 10:49:58 +0000 (12:49 +0200)]
losetup: missing EBUSY error hint message

old version:
 # losetup /dev/loop0 /foo.img
 # losetup /dev/loop0 /bar.img; echo $?
 2

new version:
 # losetup /dev/loop0 /foo.img
 # losetup /dev/loop0 /bar.img; echo $?
 losetup: /dev/loop0: device is busy
 2

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agologin: fix compiler warning (int32 time() arg)
Karel Zak [Mon, 29 Sep 2008 10:53:39 +0000 (12:53 +0200)]
login: fix compiler warning (int32 time() arg)

login.c: In function ‘dolastlog’:
login.c:1438  warning: passing argument 1 of ‘time’ from incompatible pointer type

Unfortunately, on-disk lastlog format is always 32bit, bits/utmp.h:

  struct lastlog
  {
  #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
     int32_t ll_time;
  #else
     __time_t ll_time;
  #endif

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofsck.cramfs: fix compiler warning
Karel Zak [Mon, 29 Sep 2008 10:24:38 +0000 (12:24 +0200)]
fsck.cramfs: fix compiler warning

fsck.cramfs.c: In function ‘main’:
fsck.cramfs.c:676  warning: ‘length’ may be used uninitialized in this function

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoumount: no checking mount point removal
Signed-off-by: Guan Xin [Mon, 29 Sep 2008 10:13:54 +0000 (12:13 +0200)]
umount: no checking mount point removal

No longer checks if mount point has been renamed or removed.
Linux reports EBUSY for these actions, so this check is redundant.

[kzak@redhat.com: - remove the check rather than "#if 0"
                  - remove unnecessary mnt_err2 stuff]

Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: fix typo
Guan Xin [Mon, 29 Sep 2008 09:43:45 +0000 (11:43 +0200)]
mount: fix typo

Signed-off-by: Guan Xin <guanx.bac@gmail.com>
16 years agoumount: check for overlaid mounts
Guan Xin [Mon, 29 Sep 2008 09:38:06 +0000 (11:38 +0200)]
umount: check for overlaid mounts

Linux cannot umount a device whose mount point is hidden by subsequent
mount(s). i.e. We must umount the devices associated to a mount point
in the reverse order of when they were mounted.  If umount was called
violating this rule, report error and exit.

Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: add info about /proc/mounts to mount.1
Karel Zak [Mon, 29 Sep 2008 09:04:59 +0000 (11:04 +0200)]
mount: add info about /proc/mounts to mount.1

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: fix typo
Karel Zak [Thu, 25 Sep 2008 20:25:38 +0000 (22:25 +0200)]
mount: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agochrt: add NLS support, clean error messages and return codes
Karel Zak [Tue, 23 Sep 2008 21:17:36 +0000 (23:17 +0200)]
chrt: add NLS support, clean error messages and return codes

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agochrt: support CFS SCHED_IDLE priority and document it
Martin Steigerwald [Tue, 23 Sep 2008 12:23:03 +0000 (14:23 +0200)]
chrt: support CFS SCHED_IDLE priority and document it

Signed-off-by: Martin Steigerwald <ms@teamix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: add -luuid to BLKID_LIBS
Karel Zak [Wed, 17 Sep 2008 11:49:45 +0000 (13:49 +0200)]
build-sys: add -luuid to BLKID_LIBS

The libblkid is always linked with libuuild, so this indirect
dependence in BLKID_LIBS is not a problem. This change helps to people
who compile util-linux-ng with non-standard prefix, ..etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agopartx: don't redeclare daddr_t
maximilian attems [Sun, 7 Sep 2008 19:57:24 +0000 (21:57 +0200)]
partx: don't redeclare daddr_t

klibc porting fix, use proper include, nuke redefinition.
solaris.c:8: error: redefinition of typedef ‘daddr_t’
/usr/lib/klibc/include/sys/types.h:29: error: previous declaration of ‘daddr_t’ was here

Signed-off-by: maximilian attems <max@stro.at>
16 years agoipcmk: add NLS support
Karel Zak [Wed, 10 Sep 2008 14:03:43 +0000 (16:03 +0200)]
ipcmk: add NLS support

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoipcmk: fix error codes and error messages
Karel Zak [Wed, 10 Sep 2008 14:00:17 +0000 (16:00 +0200)]
ipcmk: fix error codes and error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoipcmk: new command
Hayden James [Wed, 10 Sep 2008 13:31:36 +0000 (15:31 +0200)]
ipcmk: new command

Small patch to create an application that can easily create ad-hoc ipc
resources, along with man page.

[kzak@redhat.com: - rename from ipccreat to ipcmk
                  - minor coding style changes]

Signed-off-by: Hayden James <hayden.james@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoionice: add strtol() checks, cleanup usage text and man page
Karel Zak [Sat, 6 Sep 2008 12:54:01 +0000 (14:54 +0200)]
ionice: add strtol() checks, cleanup usage text and man page

 * cleanup usage() output

 * check strtol(); don't ignore wrong command line options

The original ionice design was a little broken, because it was
possible to specify a PID and also a COMMAND:

ionice -c2 -p 123 /bin/foo

but the command /bin/foo was executed without requested scheduling
class. That's stupid behaviour.

Now you have to use "-p PID" **or** COMMAND, but not both. Nothing is
ignored and all options are checked.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoionice: let -p handle multiple PIDs
Stephan Maka [Wed, 20 Aug 2008 21:51:55 +0000 (23:51 +0200)]
ionice: let -p handle multiple PIDs

Makes ionice -p usable like renice, this time backwards compatible

[kzak@redhat.com: - fix coding style
                  - add ioprio_setpid()]

Signed-off-by: Stephan Maka <stephan@spaceboyz.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agologin: fix warning "dereferencing type-punned pointer will break strict-aliasing...
Karel Zak [Mon, 1 Sep 2008 10:41:57 +0000 (12:41 +0200)]
login: fix warning "dereferencing type-punned pointer will break strict-aliasing rules"

This patch fix problems with odd pam_get_iten( ..., void **) API.
(tested by gcc-4.1.2-42.el5.i386)

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolosetup: remove dependence on minor numbers
Karel Zak [Thu, 21 Aug 2008 10:06:25 +0000 (12:06 +0200)]
losetup: remove dependence on minor numbers

The latest kernel supports partitioned loop devices (kernel commit
476a4813cfddf7cf159956cc0e2d3c830c1507e3). Unfortunately, this change
makes minor numbers useless, because mirror number does not match with
loop device name (loop<N>).

We have to follow loop device names only.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: round reported sizes rather than truncate
Karel Zak [Wed, 20 Aug 2008 21:27:50 +0000 (23:27 +0200)]
fdisk: round reported sizes rather than truncate

Exmaples (-old, +new):

- Disk /dev/mapper/bar: 266.6 GB, 266666666496 bytes
+ Disk /dev/mapper/bar: 266.7 GB, 266666666496 bytes

- WARNING: The size of this disk is 2.1 TB (2199023255552 bytes).
+ WARNING: The size of this disk is 2.2 TB (2199023255552 bytes).

Reported-by: Stepan Kasal <skasal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoipcs: adjust some field positions and widths for correct alignment
Benno Schulenberg [Thu, 14 Aug 2008 22:27:02 +0000 (00:27 +0200)]
ipcs: adjust some field positions and widths for correct alignment

[kzak@redhat.com:
- note that "ipcs -m -t" did not work correctly on
          terminal with 80 columns
- the change of output alignment should be mentioned
          in the Release Notes]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
16 years agoipcs: ungettextize the spacing of the table headers
Benno Schulenberg [Thu, 14 Aug 2008 22:27:03 +0000 (00:27 +0200)]
ipcs: ungettextize the spacing of the table headers

It makes no sense to allow translators to adjust the spacing when
they cannot adjust the spacing of the actual data too.  Adjusting
such spacing is not really a translator's task.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
16 years agofdisk: don't check for GPT when asked for disk size only
Karel Zak [Tue, 19 Aug 2008 09:21:09 +0000 (11:21 +0200)]
fdisk: don't check for GPT when asked for disk size only

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: warn users about 2.2TB dos partition limit
Karel Zak [Tue, 19 Aug 2008 11:53:28 +0000 (13:53 +0200)]
fdisk: warn users about 2.2TB dos partition limit

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoswapon: -a has to complain, fix leaks
Karel Zak [Mon, 18 Aug 2008 23:14:14 +0000 (01:14 +0200)]
swapon: -a has to complain, fix leaks

The "swapon -a" command (without "-e" option) has to complain always
when LABEL or UUID does not exist.

Test:

# grep foo /etc/fstab
LABEL=foo swap swap defaults 0 0

   Old version:

# swapon -a; echo $?
0

   Fixed version:

# swapon -a; echo $?
swapon: cannot find the device for LABEL=foo
255

# swapon -a -e; echo $?
0

This version also fix two memory leaks.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: don't open /dev/rtc repeatedly
Karel Zak [Mon, 18 Aug 2008 12:08:57 +0000 (14:08 +0200)]
hwclock: don't open /dev/rtc repeatedly

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: remove obsolete information from man page
Karel Zak [Mon, 18 Aug 2008 11:15:10 +0000 (13:15 +0200)]
fdisk: remove obsolete information from man page

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolscpu: regression tests
Cai Qian [Thu, 14 Aug 2008 11:15:43 +0000 (13:15 +0200)]
lscpu: regression tests

This patch added regression tests for lscpu. It tests lscpu for 3
architecutres, i386, x86_64 and ia64, with data from 3 different
machines each.

Signed-off-by: Cai Qian <qcai@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: detect libvolume_id when mount(8) is compiled
Karel Zak [Thu, 14 Aug 2008 11:01:04 +0000 (13:01 +0200)]
tests: detect libvolume_id when mount(8) is compiled

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolscpu: --sysroot option and stable cache output
Cai Qian [Sun, 10 Aug 2008 07:33:51 +0000 (15:33 +0800)]
lscpu: --sysroot option and stable cache output

This patch added a --sysroot command-line option for testing purpose. It
also sorted cache names, and displayed cache information in a sorted
manner instead of randomly before. In addition, it had some other minor
fixes.

Signed-off-by: Cai Qian <qcai@redhat.com>
16 years agodocs: TODO update
Karel Zak [Thu, 14 Aug 2008 09:48:26 +0000 (11:48 +0200)]
docs: TODO update

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoionice: cleanup error messages, add NLS support
Karel Zak [Thu, 14 Aug 2008 09:40:08 +0000 (11:40 +0200)]
ionice: cleanup error messages, add NLS support

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoionice: cleanup man page
Karel Zak [Thu, 14 Aug 2008 09:19:07 +0000 (11:19 +0200)]
ionice: cleanup man page

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoscriptreplay: new implementation is out-of-sync
Karel Zak [Wed, 30 Jul 2008 10:39:04 +0000 (12:39 +0200)]
scriptreplay: new implementation is out-of-sync

Reproduction steps:

1. Run "script -t 2>timing".
2. When the prompt comes up, hit return.
3. New prompt. Wait several seconds, then type "true" and hit return.
4. Repeat (3) as desired, then exit scripted shell.
5. Run "scriptreplay timing".

You'll find on the replay that, rather than waiting several seconds
between the prompt and true, the wait will actually occur after the
first "t" of true.

Reported-by: Micah Cowan <micah@cowan.name>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: read_hardware_clock_rtc() need to return error codes
Karel Zak [Wed, 13 Aug 2008 09:47:10 +0000 (11:47 +0200)]
hwclock: read_hardware_clock_rtc() need to return error codes

We shouldn't ignore RTC_RD_TIME/RTCGET error codes.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: delay loop in set_hardware_clock_exact
Kalev Soikonen [Sun, 27 Jul 2008 23:26:44 +0000 (02:26 +0300)]
hwclock: delay loop in set_hardware_clock_exact

- Avoid delaying 1.5 seconds when 0.5 will do.
- Guard for forward time resets as well.

[kzak@redhat.com: - fix the "Delaying.." debug message
                  - add comments]

Signed-off-by: Kalev Soikonen <ksop@hot.ee>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: use time limit for synchronization busy wait
Karel Zak [Tue, 12 Aug 2008 11:58:51 +0000 (13:58 +0200)]
hwclock: use time limit for synchronization busy wait

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: use carefully synchronize_to_clock_tick() return codes
Karel Zak [Fri, 8 Aug 2008 23:22:08 +0000 (01:22 +0200)]
hwclock: use carefully synchronize_to_clock_tick() return codes

* It seems that

rtc-isl1208 0-006f: chip found, driver version 0.3
rtc-isl1208 0-006f: rtc core: registered rtc-isl1208 as rtc0
rtc-isl1208 0-006f: rtc power failure detected, please set clock.

  causes that hardware clock returns persistent time and synchronization
  is impossible. The hwclock(8) has to ignore this problem and allows to
  set clock anyway.

* synchronize_to_clock_tick() shouldn't to print the "...got clock tick"
  debug message in case of failure.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: add docs about utf8=0 for vfat
Karel Zak [Tue, 12 Aug 2008 12:58:50 +0000 (14:58 +0200)]
mount: add docs about utf8=0 for vfat

Addresses-Red-Hat-Bugzilla: #454354
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: remove x86_64-specific bogon
David Brownell [Tue, 12 Aug 2008 10:13:52 +0000 (03:13 -0700)]
hwclock: remove x86_64-specific bogon

I was puzzled why "hwclock" wrongly reported my x86_64 sytem didn't
support RTC update interrupts.  Bogus #ifdef, that's why ... added
by the 2.11y patch (from 2.11t).  Probably this whole #ifdef should
just vanish ... if the kernel rejects UIE_ON, the program ought to
just cope with it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
16 years agobuild-sys: tgets is not in ncurses but in tinfo
Arkadiusz Miskiewicz [Fri, 8 Aug 2008 06:21:23 +0000 (08:21 +0200)]
build-sys: tgets is not in ncurses but in tinfo

ncurses library can be build with terminal related functions
landing in separate libtinfo library. Check for ncurses function
when testing ncurses library existence.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
16 years agosfdisk: print version should end with a newline
Denis ChengRq [Thu, 7 Aug 2008 09:07:49 +0000 (17:07 +0800)]
sfdisk: print version should end with a newline

Signed-off-by: Denis ChengRq <crquan@gmail.com>
16 years agohwclock: cleanup help output and man page
Karel Zak [Wed, 6 Aug 2008 11:19:40 +0000 (13:19 +0200)]
hwclock: cleanup help output and man page

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: unshadow a diagnostic printf
Kalev Soikonen [Sun, 27 Jul 2008 23:13:53 +0000 (02:13 +0300)]
hwclock: unshadow a diagnostic printf

- Bogus if test means one message is never produced.

- Avoid needless passing of a global variable (debug).

The --test option flag ought to be a global as well (and perhaps -n/--dry-run).

Signed-off-by: Kalev Soikonen <ksop@hot.ee>
16 years agortcwake: cleanup return codes
Karel Zak [Wed, 6 Aug 2008 10:36:10 +0000 (12:36 +0200)]
rtcwake: cleanup return codes

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agortcwake: prefer RTC_WKALM_SET over RTC_ALM_SET
Gabriel Burt [Tue, 5 Aug 2008 05:18:52 +0000 (00:18 -0500)]
rtcwake: prefer RTC_WKALM_SET over RTC_ALM_SET

rtcwake: Prefer RTC_WKALM_SET over RTC_ALM_SET, fixing bug with not
waking up with new RTCs.  Also, return error if unable to set the alarm.

Signed-off-by: Gabriel Burt <gburt@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoscript: don't flush input when starting script
Andrew McGill [Tue, 29 Jul 2008 21:56:05 +0000 (23:56 +0200)]
script: don't flush input when starting script

script currently flushed the input buffer when starting up.  This undocumented
behaviour prevents typeahead when starting up (e.g. as part of .profile).
Rather retain queued input. Don't discard queued output either.

Signed-off-by: Andrew McGill <andrew@lunch.za.net>
16 years agoFix dmesg.1 installation
Alexey Gladkov [Thu, 31 Jul 2008 11:45:57 +0000 (15:45 +0400)]
Fix dmesg.1 installation

Signed-off-by: Alexey Gladkov <legion@altlinux.org>
16 years agolosetup: looplist_* refactoring, remove scandir()
Karel Zak [Fri, 1 Aug 2008 10:18:03 +0000 (12:18 +0200)]
losetup: looplist_* refactoring, remove scandir()

This patch replaces scandir-based implementation with readdir(). The
readdir(3) is less expensive and more portable (to non-glibc environment).

The patch also replaces sysfs-based solution with simpler /proc/partitions
parsing. The /proc/partitions includes all used loop devices on all systems
(include 2.4). This solution seems faster than scandir(/sys/block/) too.

Summary, the losetup (with this patch) uses three methods to found a
loop device:

  a) parse /proc/partitions to found already used loop devices (for
     loserup -a)

  b) stat(2) for all loop[0-7] devices (default number of loop devices).
     This is classic method from util-linux <= 2.13. This method is good
     enough for standard Linux machines with default number of loop
     devices.

  c) scan all /dev or /dev/loop/ for loop devices. This is useful for
     crazy people who need more than 8 loop devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agouse getpagesize()
maximilian attems [Wed, 30 Jul 2008 09:46:32 +0000 (11:46 +0200)]
use getpagesize()

getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE)
to anything Linux.

this patch helps klibc porting effort as the sysconf
multiplex API is not supported there.

also remove comment of the switch to sysconf in mkswap.c.

Signed-off-by: maximilian attems <max@stro.at>
16 years agomount: retry on ENOMEDIUM
Matthias Koenig [Mon, 9 Jun 2008 14:38:25 +0000 (16:38 +0200)]
mount: retry on ENOMEDIUM

Due to a change in kernel behaviour when opening CDROM devices,
we need to retry the open/mount call when ENOMEDIUM is returned.

Explanation from Tejun Heo:
Okay, the difference is from the addition of cdrom_get_media_event()
call to both sr_drive_status() and ide_cdrom_drive_status().
Previously, the cdrom driver can't differentiate between tray closed
w/ no media and tray open and always returned tray open, which
triggers close and retry in the open logic which probably have delayed
things enough to get the media recognized.

Now the cdrom driver can discern between tray closed w/o media and
device not ready for other reasons and returns -ENOMEDIUM on the
former.  This is all good and dandy but the problem seems that some
drives report no media right after the tray is closed but it hasn't
properly detected the media yet.

It seems the only way to work around the problem is via sensible
retries (e.g.  try three times 5 secs apart) and I don't think we can
add that type of retry logic into cdrom open path.  Please note that
the previous logic wasn't water proof.  Some drives can take longer to
recognize the media is there and could have failed the in-kernel retry
too.  Also, reading the media can take quite some time and during that
period the drive reports media present but device not ready.  The
driver will retry the command (e.g. READ TOC for open) five times but
all of them can fail w/ EMEDIUMTYPE.

[kzak@redhat.com: - add CRDOM_NOMEDIUM_RETRIES to blkdev.h
                  - add verbose message to mount.c]

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: add shortoptions for bind, move and rbind
maximilian attems [Fri, 25 Jul 2008 07:29:25 +0000 (09:29 +0200)]
mount: add shortoptions for bind, move and rbind

Reserving uppercase letters for mount operations:

    --move  | -M
    --bind  | -B
    --rbind | -R

Add lowercase for the most needed mount operation that happen
in initramfs: mount -M /sys /root/sys

Note, we still have shared-subtree operations (--make-{slave,private,...})
without short options.

[kzak@redhat.com: minor change in mount.8]

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: add info about tz=UTC option for FAT to mount.8
Karel Zak [Mon, 28 Jul 2008 09:18:27 +0000 (11:18 +0200)]
mount: add info about tz=UTC option for FAT to mount.8

CC: Joe Peterson <joe@skyrush.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoremove CVS keywords
maximilian attems [Thu, 24 Jul 2008 22:14:44 +0000 (00:14 +0200)]
remove CVS keywords

this patch removes old CVS keywords from comments.

mount(8) works for newer Linux then 0.99 ;)

Signed-off-by: maximilian attems <max@stro.at>
16 years agofdisk: exit(3) needs stdlib.h include
maximilian attems [Thu, 24 Jul 2008 13:22:11 +0000 (15:22 +0200)]
fdisk: exit(3) needs stdlib.h include

partitiontype.c:57: warning: incompatible implicit declaration of built-in function ‘exit’

Signed-off-by: maximilian attems <max@stro.at>
16 years agodisk-utils: include fcntl.h directly (mkfs.cramfs, raw)
maximilian attems [Thu, 24 Jul 2008 13:08:16 +0000 (15:08 +0200)]
disk-utils: include fcntl.h directly (mkfs.cramfs, raw)

helps klibc support, glibc compile tested.

Signed-off-by: maximilian attems <max@stro.at>
16 years agowhereis: include dirent.h instead sys/dir.h
maximilian attems [Thu, 24 Jul 2008 12:25:06 +0000 (14:25 +0200)]
whereis: include dirent.h instead sys/dir.h

sys/dir.h is an old BSD'ism not carried by klibc,
include dirent directly.

compile tested against glibc.

Signed-off-by: maximilian attems <max@stro.at>
16 years agomisc-utils: write include signal.h directly
maximilian attems [Thu, 24 Jul 2008 12:18:00 +0000 (14:18 +0200)]
misc-utils: write include signal.h directly

another small step for better klibc support, glibc compile tested.

Signed-off-by: maximilian attems <max@stro.at>
16 years agodmesg: nuke old glibc 5 support
maximilian attems [Thu, 24 Jul 2008 11:44:44 +0000 (13:44 +0200)]
dmesg: nuke old glibc 5 support

dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘klogctl’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘type’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘b’
dmesg.c:42: error: expected declaration specifiers or ‘...’ before ‘len’

without belows compat section dmesg just compiles fine against klibc.
as bonus reorder the includes.

Signed-off-by: maximilian attems <max@stro.at>
16 years agodisk-utils: s/MOUNTED/_PATH_MOUNTED/
maximilian attems [Thu, 24 Jul 2008 11:00:48 +0000 (13:00 +0200)]
disk-utils: s/MOUNTED/_PATH_MOUNTED/

no longer use deprecated alias.
helps compiling util-linux-ng against klibc.

add pathnames.h include, where _PATH_MOUNTED is defined.

Signed-off-by: maximilian attems <max@stro.at>
16 years agoldattach: don't compile for non-linux systems
Samuel Thibault [Thu, 24 Jul 2008 00:27:14 +0000 (01:27 +0100)]
ldattach: don't compile for non-linux systems

There is just ldattach which doesn't compile because line disciplines are not
implemented that way on the Hurd.  Is TIOCSETD any kind of standard?  Else I
guess the patch below would be fine.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agomount: make file_t SELinux warning optional and shorter
Karel Zak [Wed, 23 Jul 2008 23:20:00 +0000 (01:20 +0200)]
mount: make file_t SELinux warning optional and shorter

The patch:

   Commit:  4edebc1486133231e38b3881325c374eda567f74
   Date:    Mon Jun 23 13:00:00 2008 +0200
   Subject: mount: warn on "file_t" selinux context

introduces a new warning. This warning should be shorter and optional
-- it means visible in verbose mode only.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agodisk-utils: clean up code, use blkdev_* functions
Samuel Thibault [Wed, 23 Jul 2008 23:15:07 +0000 (01:15 +0200)]
disk-utils: clean up code, use blkdev_* functions

[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: non-linux support (BLK* and HDIO_*)
Samuel Thibault [Wed, 23 Jul 2008 22:46:05 +0000 (00:46 +0200)]
fdisk: non-linux support (BLK* and HDIO_*)

BLK* and HDIO_* are not available on all platform. Work around this
in a few places.

[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolib: blkdev.c clean up, non-linux support
Samuel Thibault [Wed, 23 Jul 2008 22:30:21 +0000 (00:30 +0200)]
lib: blkdev.c clean up, non-linux support

[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: s/MOUNTED/_PATH_MOUNTED/
maximilian attems [Wed, 23 Jul 2008 10:06:48 +0000 (12:06 +0200)]
mount: s/MOUNTED/_PATH_MOUNTED/

no longer use deprecated alias.
clears a useless compile error when compiling against klibc:
mount.c:995: error: `MOUNTED' undeclared (first use in this function)

Signed-off-by: maximilian attems <max@stro.at>