]> err.no Git - util-linux/log
util-linux
16 years agomkswap: fix compiler warnings
Karel Zak [Thu, 20 Mar 2008 13:54:06 +0000 (14:54 +0100)]
mkswap: fix compiler warnings

mkswap.c:529: warning: pointer targets in assignment differ in signedness
mkswap.c:531: warning: pointer targets in assignment differ in signedness
mkswap.c:550: warning: pointer targets in passing argument 1 of `uuid_parse' differ in signedness

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoswapon: remove unnecessary myrealpath() call
Karel Zak [Thu, 20 Mar 2008 13:45:33 +0000 (14:45 +0100)]
swapon: remove unnecessary myrealpath() call

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoswapon: Reinitialize software suspend areas to avoid future corruption.
Kees Cook [Thu, 20 Mar 2008 08:24:03 +0000 (01:24 -0700)]
swapon: Reinitialize software suspend areas to avoid future corruption.

This is based on the earlier swsuspend re-init patch carried by
RedHat, SuSE, and Ubuntu.  It has been updated to include passing
the known UUID to mkswap, and fixing the fstype name.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: cleanup "x$foo" usage
Karel Zak [Thu, 20 Mar 2008 12:50:08 +0000 (13:50 +0100)]
build-sys: cleanup "x$foo" usage

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: use ncursesw (wide version) when possibe
Karel Zak [Tue, 4 Mar 2008 23:53:24 +0000 (00:53 +0100)]
build-sys: use ncursesw (wide version) when possibe

Detect ncursesw and use it in place of ncurses when possible
(default).  Allow people to use classic (non-wide) version by
--with-ncurses or disable all ncurses/ncursesw support by
--without-ncurses.

Co-Author: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: add VARSUFFIX to UTIL_CHECK_LIB
Karel Zak [Tue, 4 Mar 2008 23:34:49 +0000 (00:34 +0100)]
build-sys: add VARSUFFIX to UTIL_CHECK_LIB

The UTIL_CHECK_LIB macro follows the default autoconf behaviour and
generates have_<libname> and HAVE_LIB<LIBNAME> variables.

Some libraries are substitutional (e.g. ncurses and ncursesw). It would be
nice to generate for that libraries the same HAVE_ variables independently
on a library name.

This patch adds optional VARSUFFIX option to UTIL_CHECK_LIB, so the final
variables are have_<varsuffix> and HAVE_LIB<VARSUFFIX>.

For example:

    UTIL_CHECK_LIB(yyy, func)      generates have_yyy and HAVE_LIBYYY
    UTIL_CHECK_LIB(yyy, func, xxx) generates have_xxx and HAVE_LIBXXX

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agodocs: refresh TODO list
Karel Zak [Wed, 19 Mar 2008 10:43:10 +0000 (11:43 +0100)]
docs: refresh TODO list

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agodocs: add note about static linking
Karel Zak [Wed, 12 Mar 2008 13:07:28 +0000 (14:07 +0100)]
docs: add note about static linking

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: remove useless if-before-my_free, define my_free as a macro
Karel Zak [Wed, 12 Mar 2008 11:28:50 +0000 (12:28 +0100)]
mount: remove useless if-before-my_free, define my_free as a macro

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoremove useless if-before-free tests.
Jim Meyering [Wed, 12 Mar 2008 10:42:16 +0000 (11:42 +0100)]
remove useless if-before-free tests.

E.g., in this example, the "if (p)" test is useless.

  if (p)
    free (p);

I've been removing such tests systematically.
Here's where I proposed it to the git folks, along with justification
for why it's ok to perform this transformation, these days (no one
uses SunOS4 anymore):

    http://thread.gmane.org/gmane.comp.version-control.git/74187

Signed-off-by: Jim Meyering <meyering@redhat.com>
16 years agoldattach: new command
Tilman Schmidt [Mon, 10 Mar 2008 13:20:26 +0000 (14:20 +0100)]
ldattach: new command

Add an ldattach(8) utility program similar to the one in OpenBSD.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
16 years agomount: don't canonicalize LABEL= or UUID= spec
Karel Zak [Thu, 6 Mar 2008 14:43:41 +0000 (15:43 +0100)]
mount: don't canonicalize LABEL= or UUID= spec

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoagetty: make username-in-uppercase feature optional (off by default.)
Hamish Coleman [Mon, 3 Mar 2008 16:52:59 +0000 (09:52 -0700)]
agetty: make username-in-uppercase feature optional (off by default.)

The following patch makes the username-in-upper-case feature optional.

I have chosen to make it default to off since this feature was designed
to cater for serial terminals that were last sold almost 30 years ago,
thus the likelyhood that anyone will need this feature turned on is
vanishingly small.

Addresses-Debian-Bug: 156242
Signed-off-by: Hamish Coleman <hamish@zot.org>
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdformat: install to /usr/sbin instead to /usr/bin
Karel Zak [Tue, 4 Mar 2008 10:10:42 +0000 (11:10 +0100)]
fdformat: install to /usr/sbin instead to /usr/bin

It should be in usrsbinexecdir, since formatting is usually a
privileged util-linux operation (like mkfs).

Reported-By: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: allow auto-destruction of loop devices
Bernardo Innocenti [Mon, 29 Oct 2007 02:47:33 +0000 (22:47 -0400)]
mount: allow auto-destruction of loop devices

This allows a flag to be set on loop devices so that when they are closed
for the last time, they'll self-destruct.

The kernel part has been submitted to lkml by David Woodhouse.

Signed-off-by: Bernardo Innocenti <bernie@codewiz.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: add "sort" to cramfs test
Karel Zak [Mon, 18 Feb 2008 14:22:08 +0000 (15:22 +0100)]
tests: add "sort" to cramfs test

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: use pkg-config to find the libs for static build
Stepan Kasal [Tue, 11 Dec 2007 17:47:37 +0000 (18:47 +0100)]
build-sys: use pkg-config to find the libs for static build

Signed-off-by: Stepan Kasal <skasal@redhat.com>
16 years agobuild-sys: do not add -luuid to BLKID_LIBS
Stepan Kasal [Tue, 11 Dec 2007 17:47:36 +0000 (18:47 +0100)]
build-sys: do not add -luuid to BLKID_LIBS

* configure.ac: Do not include -luuid in BLKID_LIBS, the library
dependencies handle this.

Signed-off-by: Stepan Kasal <skasal@redhat.com>
16 years agobuild-sys: add --enable-static-programs
Stepan Kasal [Tue, 11 Dec 2007 17:47:34 +0000 (18:47 +0100)]
build-sys: add --enable-static-programs

Add support for static versions of mount, umount, losetup, fdisk,
and sfdisk.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Stepan Kasal <skasal@redhat.com>
16 years agofdisk: use more readable "GPT" name rather than "EFI GPT"
Robert Millan [Thu, 14 Feb 2008 23:13:26 +0000 (00:13 +0100)]
fdisk: use more readable "GPT" name rather than "EFI GPT"

Although GPT is defined in EFI spec, it is widely used without EFI, as it
reserves space for the MBR and works fine on PC/BIOS systems provided the
bootloader supports it.

This is in fact the way everyone seems to be following to overcome the 2 TiB
limitation with MSDOS partition table.

Signed-off-by: Robert Millan <rmh@aybabtu.com>
16 years agomount: use canonicalize in getfs_by_devname
Karel Zak [Fri, 15 Feb 2008 00:56:18 +0000 (01:56 +0100)]
mount: use canonicalize in getfs_by_devname

Fixes a problem when you define a device via a persistent
udev device name in /etc/fstab but use the real block device
name on mount invocation.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agortcwake: fix typo SATE -> STATE
Mike Frysinger [Fri, 15 Feb 2008 00:43:24 +0000 (19:43 -0500)]
rtcwake: fix typo SATE -> STATE

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
16 years agortcwake: include libgen.h for basename prototype
Mike Frysinger [Thu, 14 Feb 2008 20:03:21 +0000 (15:03 -0500)]
rtcwake: include libgen.h for basename prototype

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
16 years agomkswap: set UUID for swap space (add -U option)
Martin Schulze [Sun, 27 Jan 2008 06:31:06 +0000 (23:31 -0700)]
mkswap: set UUID for swap space (add -U option)

A friend of mine is looking into the possibility of cloning Debian
(and other) systems automatically and stomped over swap partitions
getting assigned new UUIDs every time the new harddisk is partitioned
and swap is created.

It's essential when partitions are to be recognised by their uuid and
not by their old device path anymore.

Addresses-Ubuntu-Bug: #66637
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: "can't create lock file" message sometimes means failure, sometimes not
Mark McLoughlin [Mon, 28 Jan 2008 13:30:29 +0000 (14:30 +0100)]
mount: "can't create lock file" message sometimes means failure, sometimes not

What the patch does is goes from the situation where:

  1) If /etc/mtab doesn't exist and /etc is read-only, you get the
     "can't create lock file" message and the mount fails

  2) If /etc/mtab does exist and /etc is read-only,you get the same
     message but the mount succeeds

Clearly, the failure to update /etc/mtab should either cause the mount
to fail or not ... sometimes causing it to fail, and sometimes not
(each with the same message) is not useful.

This patch sets the same behaviour for create and update mtab. In both
cases it prints error message and the mount succeeds.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agosetterm: add -blan [force|poke] options for TIOCL_{BLANKED,BLANK}SCREEN
Samuel Thibault [Tue, 27 Nov 2007 22:54:35 +0000 (22:54 +0000)]
setterm: add -blan [force|poke] options for TIOCL_{BLANKED,BLANK}SCREEN

Linux has some interface to force an immediate blank
(TIOCL_BLANK/UNBLANKSCREEN) or get the blank status
(TIOCL_BLANKEDSCREEN), which is useful e.g. for blind people.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agortcwake: fix UTC time usage
David Brownell [Sun, 3 Feb 2008 23:34:35 +0000 (15:34 -0800)]
rtcwake: fix UTC time usage

Timezone handling is broken in this version since it's always
passing UTC time into the kernel, even on systems where the
RTC uses the local timezone.

I think that bug must come from bugs in how the system used to
to originally develop this code handled the RTC timezone.  Both
RTCs should have been kept in UTC ... but only one of them was.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
16 years agolosetup: add --associated option
Karel Zak [Mon, 26 Nov 2007 10:13:37 +0000 (11:13 +0100)]
losetup: add --associated option

    losetup -j | --associated <file> [-o <num>]

This new option lists all loop devices associated with given file
(and optionally file offset).

Examples:

 # losetup -a
 /dev/loop0: [0807]:21921808 (/foo/vfat-mbr.img)
 /dev/loop1: [0807]:21921808 (/foo/vfat-mbr.img), offset 100
 /dev/loop2: [0807]:21921802 (/bar/ext3.img)

 # losetup -j /foo/vfat-mbr.img
 /dev/loop0: [0807]:21921808 (/foo/vfat-mbr.img)
 /dev/loop1: [0807]:21921808 (/foo/vfat-mbr.img), offset 100

 # losetup -j /foo/vfat-mbr.img -o 100
 /dev/loop1: [0807]:21921808 (/foo/vfat-mbr.img), offset 100

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agolosetup: support unlimited number of loops
Karel Zak [Fri, 23 Nov 2007 14:13:22 +0000 (15:13 +0100)]
losetup: support unlimited number of loops

Old implementation:

 - supports 256 loop devices only
 - doesn't support gaps in list of loop devices
   (e.g. loop0, loop1, loop3 -- loop3 is invisible)

Kernel 2.6.21 removes artificial maximum 256 loop device. Now the maximum
of loop devices could be really huge (depends on limit of MINOR
numbers). It means we need a better way how work with loop devices
than blindly call stat(2) for all 0-1048575 devices.

This patch uses three methods:

 a) scan /sys/block/loopN (used for losetup -a only). This method is
    probably the fastest way how found used loop device on machine with
    huge number of devices in /dev.

 b) classic way, stat(2) for all loop[0-7] devices (default number of
    loop devices). This cheap method is sufficient for 99% of all machines.

 c) scan all /dev/loopN or /dev/loop/N

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoipcs: add information about POSIX compatibility to ipcs.1
Karel Zak [Thu, 7 Feb 2008 23:51:04 +0000 (00:51 +0100)]
ipcs: add information about POSIX compatibility to ipcs.1

Addresses-Suse-Bug: #274338
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agorenice: detect errors in arguments, add -v, -h and long options
LaMont Jones [Sun, 13 Jan 2008 05:35:50 +0000 (22:35 -0700)]
renice: detect errors in arguments, add -v, -h and long options

 * renice was using atoi(), which does no error detection, meaning
   that: "renice +20 blah" was accepted as valid.

 * add -h | --help

 * add -v | --version

 * add long options for -p, -u and -g

 * cleanup coding style

Addresses-Debian-Bug: #385245
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agokill: man page is missing a description of "kill -0"
Karel Zak [Mon, 28 Jan 2008 14:17:45 +0000 (15:17 +0100)]
kill: man page is missing a description of "kill -0"

Addresses-Red-Hat-Bugzilla: #429559
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: better fallback for get_random_id()
H. Peter Anvin [Wed, 16 Jan 2008 18:53:56 +0000 (13:53 -0500)]
fdisk: better fallback for get_random_id()

When /dev/urandom is not available, we have to use some kind of a hack
to generate a random MBR identifier.  Use a better fallback that
incorporates the clock down to microsecond granularity.

Signed-off-by: H. Peter Anvin" <hpa@zytor.com>
16 years agologin: fix a small memory leak and remove unnecessary zeroing
Karel Zak [Mon, 28 Jan 2008 13:02:35 +0000 (14:02 +0100)]
login: fix a small memory leak and remove unnecessary zeroing

This patch fix a small memory leak (rh#251539) and also remove
unnecessary pam_set_item(). We needn't to zeroing PAM_USER when the
value is already NULL, it doesn't make sense.

Addresses-Red-Hat-Bugzilla: #251539
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoumount: don't print duplicate error messages
Karel Zak [Mon, 28 Jan 2008 12:13:25 +0000 (13:13 +0100)]
umount: don't print duplicate error messages

umount(8) is trying to umount a device two times to prevent some
obscure scenarios. It's maybe a nice feature, but it also produces
duplicate error messages.

  # umount /home
  umount: /home: device is busy
  umount: /home: device is busy

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoumount: add hint about lsof & fuser
Karel Zak [Mon, 28 Jan 2008 11:52:04 +0000 (12:52 +0100)]
umount: add hint about lsof & fuser

This patch adds a hint about lsof and fuser to the "device is busy"
error message.

Addresses-Red-Hat-Bugzilla: #145844
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agocal: fix weekday alignment for certain locales
Pádraig Brady [Fri, 4 Jan 2008 10:44:53 +0000 (10:44 +0000)]
cal: fix weekday alignment for certain locales

For example this had too much padding: LANG=zh_CN.utf8 cal -j
while this had too little padding:     LANG=hu_HU.utf8 cal
This had invalid chars:                LANG=li_BE.utf8 cal
This had too few chars:                LANG=si_LK.utf8 cal

Note some locales may display with slightly worse alignment
(fa_IR.utf8 for example), but that is only because the terminal
is not merging the combining characters. This happens on
gnome-terminal-2.18.3-1.fc8 at least.

Signed-off-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: calculate +size{K,M,G} in 2^N
Karel Zak [Thu, 13 Dec 2007 00:06:44 +0000 (01:06 +0100)]
fdisk: calculate +size{K,M,G} in 2^N

fdisk(8) does not calculate partition size (+sizeM or +sizeG)
in MiB or GiB correctly. It uses 10^N instead 2^N.

This patch cleanups +sizeX to:

  +sizeK    -- KiB  (2^10)
  +sizeKB   -- KB   (10^3)
  +sizeM    -- MiB  (2^20)
  +sizeMB   -- MB   (10^6)
  +sizeG    -- GB   (10^9)
  +sizeGB   -- GiB  (2^30)

This patch also fixes the "Last cylinder..." hint message. The "+number"
without any suffix is not a size at all. It's number of cylinders/sectors.
Note, the 10^N suffixes are not proposed to end-uses in the hint message.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: add more details to the --version output
Karel Zak [Tue, 8 Jan 2008 12:08:32 +0000 (13:08 +0100)]
mount: add more details to the --version output

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agosys-utils: correct setarch.8 manpage link creation
Frédéric Bothamy [Sun, 13 Jan 2008 05:35:51 +0000 (22:35 -0700)]
sys-utils: correct setarch.8 manpage link creation

At least on Debian, .so commands are relative to the man directory
(e.g., /usr/share/man), not to the subdirectory:
    % man i386
    man: can't open /usr/share/man/setarch.8: No such file or directory
    No manual entry for i386

See also http://bugs.debian.org/453245

Addresses-Debian-Bug: #453245
Signed-off-by: Frédéric Bothamy <frederic.bothamy@free.fr>
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: add AC_CANONICAL_HOST
Miklos Szeredi [Tue, 8 Jan 2008 11:55:18 +0000 (12:55 +0100)]
build-sys: add AC_CANONICAL_HOST

This seems to be needed in certain environments.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
16 years agodocs: mark vipw(1) is deprecated in favor of vipw from shadow-utils
Karel Zak [Mon, 7 Jan 2008 11:53:32 +0000 (12:53 +0100)]
docs: mark vipw(1) is deprecated in favor of vipw from shadow-utils

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: disable syscall fallbacks for non-linux systems
Karel Zak [Tue, 18 Dec 2007 00:53:10 +0000 (01:53 +0100)]
build-sys: disable syscall fallbacks for non-linux systems

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoswapon: add sundries.h
Karel Zak [Mon, 17 Dec 2007 21:28:48 +0000 (22:28 +0100)]
swapon: add sundries.h

so we can compile with -fno-common.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: "nofail" mount option
Matthias Koenig [Mon, 17 Dec 2007 10:33:20 +0000 (11:33 +0100)]
mount: "nofail" mount option

It would be nice to have a mount option "nofail" indicating that mount
should not return an error if the device does not exit. This is useful
for hotpluggable devices which are configured in fstab and __might__
not exist at boot time.

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agocfdisk: define portable {DEFAULT,ALTERNATE}_DEVICE
Samuel Thibault [Tue, 18 Dec 2007 02:00:45 +0000 (02:00 +0000)]
cfdisk: define portable {DEFAULT,ALTERNATE}_DEVICE

Set DEFAULT_DEVICE and ALTERNATE_DEVICE for GNU/Hurd and FreeBSD

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agosetterm: remove unnecessaty ifndef TCGETS
Samuel Thibault [Thu, 3 Jan 2008 15:46:05 +0000 (16:46 +0100)]
setterm: remove unnecessaty ifndef TCGETS

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomore: replace CBAUD with cfgetispeed()
Samuel Thibault [Thu, 3 Jan 2008 15:43:53 +0000 (16:43 +0100)]
more: replace CBAUD with cfgetispeed()

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agologin: replace termio with termios interface
Samuel Thibault [Thu, 3 Jan 2008 15:40:48 +0000 (16:40 +0100)]
login: replace termio with termios interface

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoagetty: replace termio with termios interface
Samuel Thibault [Thu, 3 Jan 2008 15:40:32 +0000 (16:40 +0100)]
agetty: replace termio with termios interface

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotailf: non-linux support
Samuel Thibault [Mon, 17 Dec 2007 23:52:39 +0000 (23:52 +0000)]
tailf: non-linux support

Include <sys/inotify.h> only when inotify_init() was detected

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agoinclude: <stdint.h> provides everything
Samuel Thibault [Mon, 17 Dec 2007 23:38:30 +0000 (23:38 +0000)]
include: <stdint.h> provides everything

Do not include <linux/posix_types.h> as <stdint.h> provides everything.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agopartx: use swab macros from bitops.h
Karel Zak [Mon, 17 Dec 2007 12:57:28 +0000 (13:57 +0100)]
partx: use swab macros from bitops.h

Clean up GPT code:
- remove C++ comments
- tailing white-spaces
- use cpu_to_  swab macros from bitops.h

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: use swab macros from bitops.h
Karel Zak [Mon, 17 Dec 2007 12:26:38 +0000 (13:26 +0100)]
fdisk: use swab macros from bitops.h

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoinclude: add bitops.h with swab{16,32,64} macros
Karel Zak [Mon, 17 Dec 2007 12:18:12 +0000 (13:18 +0100)]
include: add bitops.h with swab{16,32,64} macros

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoinclude: add bitops.h with swab{16,32,64} macros
Karel Zak [Mon, 17 Dec 2007 12:18:12 +0000 (13:18 +0100)]
include: add bitops.h with swab{16,32,64} macros

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: fix building for AVR32 and CRIS
Imre Kaloz [Sun, 9 Dec 2007 17:59:58 +0000 (18:59 +0100)]
fdisk: fix building for AVR32 and CRIS

The following simple patch fixes fdisk compilation for the AVR32 and CRIS architectures.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: build arch(1) during distcheck
Stepan Kasal [Tue, 11 Dec 2007 17:47:35 +0000 (18:47 +0100)]
build-sys: build arch(1) during distcheck

Signed-off-by: Stepan Kasal <skasal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: simplify code around RDEV_LINKS and SETARCH_LINKS
Stepan Kasal [Tue, 4 Dec 2007 18:21:48 +0000 (19:21 +0100)]
build-sys: simplify code around RDEV_LINKS and SETARCH_LINKS

Signed-off-by: Stepan Kasal <skasal@redhat.com>
16 years agobuild-sys: use portable $(VAR:=) instead of gmake-specific $(addsuffix)
Stepan Kasal [Tue, 4 Dec 2007 18:21:47 +0000 (19:21 +0100)]
build-sys: use portable $(VAR:=) instead of gmake-specific $(addsuffix)

Signed-off-by: Stepan Kasal <skasal@redhat.com>
16 years agobuild-sys: use dist_man_MANS instead of man_MANS
Stepan Kasal [Tue, 4 Dec 2007 18:21:46 +0000 (19:21 +0100)]
build-sys: use dist_man_MANS instead of man_MANS

Signed-off-by: Stepan Kasal <skasal@redhat.com>
16 years agoshutdown: use _PATH_MOUNTED instead of _PATH_MTAB
Stepan Kasal [Tue, 4 Dec 2007 18:21:45 +0000 (19:21 +0100)]
shutdown: use _PATH_MOUNTED instead of _PATH_MTAB

Signed-off-by: Stepan Kasal <skasal@redhat.com>
16 years agotailf: inotify based reimplementation
Karel Zak [Fri, 7 Dec 2007 00:56:06 +0000 (01:56 +0100)]
tailf: inotify based reimplementation

This patch:
 - clean up tailf(1) code
 - remove stupid "for() { malloc() }" array allocation in the tailf() function
 - add inotify(7) support

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: hint about helper program if device doesn't exist
Karel Zak [Fri, 14 Dec 2007 14:09:22 +0000 (15:09 +0100)]
mount: hint about helper program if device doesn't exist

Addresses-Debian-Bug: #452330
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: redirect libblkid cache to BLKID_FILE
Karel Zak [Thu, 6 Dec 2007 21:46:00 +0000 (22:46 +0100)]
tests: redirect libblkid cache to BLKID_FILE

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agodocs: add note about incorrect tag 2.13.1
Karel Zak [Wed, 5 Dec 2007 11:40:44 +0000 (12:40 +0100)]
docs: add note about incorrect tag 2.13.1

The git tag 2.13.1 is typo. I forgot to use -rc1 suffix for this tag.
The real 2.13.1 is going to be released with tag 2.13.1-REAL. Sorry.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agohwclock: check for ENODEV
David Woodhouse [Tue, 4 Dec 2007 13:44:05 +0000 (14:44 +0100)]
hwclock: check for ENODEV

/sbin/hwclock is supposed to fall back to using /dev/rtc0 if /dev/rtc isn't
working (which it isn't, because mkinitrd creates it with the old device
numbers, and we're switching to the new RTC_CLASS driver).

Unfortunately, it'll only cope if the error it gets is ENOENT (i.e. the device
node doesn't exist). It doesn't fall back to the next device in the list if the
error is ENODEV, which is what happens when the device node exists, but there's
no driver.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agosfdisk: allow partitioning drives of over 2^31 sectors.
Kunihiko IMAI [Mon, 20 Aug 2007 12:12:53 +0000 (06:12 -0600)]
sfdisk: allow partitioning drives of over 2^31 sectors.

sfdisk would incorrectly complain that there was no room when partitioning
a drive over 2^31 sectors in size.

Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
16 years agolosetup: use standard uintxy_t types (struct loop_info64)
Samuel Thibault [Mon, 3 Dec 2007 13:17:23 +0000 (14:17 +0100)]
losetup: use standard uintxy_t types (struct loop_info64)

The kernel loop_info64 definition uses __u{8,32,64} types,
but userspace uses unsigned {long long,int,char} types.

This patch turns into exactly defined standard uint{8,32,64}_t types.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agofdisk: non-linux support (use standard uintxy_t instead __uxy)
Samuel Thibault [Sat, 27 Oct 2007 17:27:31 +0000 (18:27 +0100)]
fdisk: non-linux support (use standard uintxy_t instead __uxy)

 - #include <linux/types.h> is turned into #include <stdint.h>, much more
   portable, and __uxy were turned into uintxy_t.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agosetarch: add missing alpha subarchs
Oliver Falk [Mon, 3 Dec 2007 12:34:42 +0000 (13:34 +0100)]
setarch: add missing alpha subarchs

Signed-off-by: Oliver Falk <oliver@linux-kernel.at>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoswapon: readjust the usage summaries
Benno Schulenberg [Wed, 28 Nov 2007 19:18:48 +0000 (20:18 +0100)]
swapon: readjust the usage summaries

swapon.8: reorder options, lowercase command names, tweak sentences.
swapon.c: tweak descriptions, adjust spaces for proper alignment.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
16 years agortcwake: misc cleanups
David Brownell [Fri, 30 Nov 2007 21:42:41 +0000 (13:42 -0800)]
rtcwake: misc cleanups

Cleanups for rtcwake:

  - Minor doc updates:  highlight the framebuffer problem,
    give correct history of this code
  - Improve debug output
  - Fix some linelength bugs

Note that this code predated the sysfs "wakealarm" mechanism, and
works around several now-fixed bugs in the kernel RTC framework.

Nowadays it would make sense to make this program use only the sysfs
interface to the RTC, using "since_epoch" instead of RTC_RD_TIME and
"wakealarm" instead of the four other ioctls.  That could simplify
the mess involved in timezone handling.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoblockdev: add --getsz to blockdev.8
Karel Zak [Wed, 28 Nov 2007 14:19:24 +0000 (15:19 +0100)]
blockdev: add --getsz to blockdev.8

This patch also marks --getsize as deprecated option.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoswapon: fix typo in usage()
Karel Zak [Wed, 28 Nov 2007 14:01:14 +0000 (15:01 +0100)]
swapon: fix typo in usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agogetopt: fix path to examples in getopt.1
Karel Zak [Wed, 28 Nov 2007 13:45:27 +0000 (14:45 +0100)]
getopt: fix path to examples in getopt.1

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: use MNTTYPE_SWAP (from mntent.h)
Karel Zak [Wed, 28 Nov 2007 13:37:09 +0000 (14:37 +0100)]
mount: use MNTTYPE_SWAP (from mntent.h)

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomount: cleanup usage of _PATH_*
Karel Zak [Wed, 28 Nov 2007 13:35:24 +0000 (14:35 +0100)]
mount: cleanup usage of _PATH_*

The macros MOUNTED and MNTTAB are deprecated. This patch standardize
and consolidate all path macros and remove mount_paths.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoinclude: add mount paths to pathnames.h
Karel Zak [Wed, 28 Nov 2007 13:08:33 +0000 (14:08 +0100)]
include: add mount paths to pathnames.h

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoagetty: non-linux support (use pathnames.h)
Karel Zak [Wed, 28 Nov 2007 12:19:42 +0000 (13:19 +0100)]
agetty: non-linux support (use pathnames.h)

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoinclude: cleanup pathnames.h
Karel Zak [Wed, 28 Nov 2007 12:17:16 +0000 (13:17 +0100)]
include: cleanup pathnames.h

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: add test for include/pathnames.h
Karel Zak [Wed, 28 Nov 2007 11:52:59 +0000 (12:52 +0100)]
tests: add test for include/pathnames.h

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: move test_bkdev to lib/
Karel Zak [Wed, 28 Nov 2007 11:27:00 +0000 (12:27 +0100)]
tests: move test_bkdev to lib/

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: rename test_sysinfo, remove tailing white-spaces
Karel Zak [Wed, 28 Nov 2007 11:11:51 +0000 (12:11 +0100)]
tests: rename test_sysinfo, remove tailing white-spaces

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoscript: cleanup includes
Samuel Thibault [Wed, 28 Nov 2007 09:59:24 +0000 (10:59 +0100)]
script: cleanup includes

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agosfdisk: remove unnecessary linux/unistd.h
Samuel Thibault [Wed, 28 Nov 2007 09:44:31 +0000 (10:44 +0100)]
sfdisk: remove unnecessary linux/unistd.h

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agobuild-sys: cleanup usage of linux/major.h
Samuel Thibault [Wed, 28 Nov 2007 09:40:32 +0000 (10:40 +0100)]
build-sys: cleanup usage of linux/major.h

The utils like fdisk or login are usable on non-linux systems.
This patch allows to compile on systems without linux/major.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agofdisk: non-linux support (MAXPATHLEN)
Karel Zak [Mon, 26 Nov 2007 14:19:29 +0000 (15:19 +0100)]
fdisk: non-linux support (MAXPATHLEN)

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agonamei: non-linux support (get_current_dir_name() and PATH_MAX)
Karel Zak [Mon, 26 Nov 2007 13:58:29 +0000 (14:58 +0100)]
namei: non-linux support (get_current_dir_name() and PATH_MAX)

Co-Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agowall: cleanup MAXHOSTNAMELEN
Karel Zak [Mon, 26 Nov 2007 13:45:55 +0000 (14:45 +0100)]
wall: cleanup MAXHOSTNAMELEN

Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agoagetty: cleanup MAXHOSTNAMELEN
Karel Zak [Mon, 26 Nov 2007 13:45:55 +0000 (14:45 +0100)]
agetty: cleanup MAXHOSTNAMELEN

Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agocfdisk: display cylinders beyond 1024
Peter Breitenlohner [Fri, 16 Nov 2007 10:37:43 +0000 (11:37 +0100)]
cfdisk: display cylinders beyond 1024

There is absolutely no reason why cfdisk should not display
cylinders beyond 1024. The number of cylinders needs to be
truncated only for the CHS field.

Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
16 years agogetopt: install example scripts as SCRIPTS, not DATA
Peter Breitenlohner [Fri, 16 Nov 2007 10:50:17 +0000 (11:50 +0100)]
getopt: install example scripts as SCRIPTS, not DATA

The example scripts should be installed with execute permissions,
as for util-linux-2.12r and earlier, i.e., as SCRIPTS and not as DATA

Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
16 years agomount: fix fd leak
Matthias Koenig [Wed, 21 Nov 2007 15:46:33 +0000 (16:46 +0100)]
mount: fix fd leak

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
16 years agoswapon: cleanup usage output
Karel Zak [Mon, 26 Nov 2007 12:07:40 +0000 (13:07 +0100)]
swapon: cleanup usage output

16 years agobuild-sys: cleanup disk-utils/Makefile.am (use $utils_common)
Karel Zak [Wed, 21 Nov 2007 01:38:25 +0000 (02:38 +0100)]
build-sys: cleanup disk-utils/Makefile.am (use $utils_common)

Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agomkfs.minix: device size cleanup
Matthias Koenig [Tue, 13 Nov 2007 15:28:39 +0000 (16:28 +0100)]
mkfs.minix: device size cleanup

Use blkdev_get_size() function and some size related cleanup.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
16 years agomkfs.minix: add sectorsize check
Matthias Koenig [Tue, 13 Nov 2007 15:28:38 +0000 (16:28 +0100)]
mkfs.minix: add sectorsize check

Minix filesystem until version 2 has a fixed blocksize of 1024 bytes.
If you try to create a filsystem on a device with a physical sectorsize
larger than 1024 bytes, this resulting minix fs cannot be mounted,
because the physical sectorsize must be smaller than the filesystem
blocksize.
This patch adds a check for this and will refuse to create a filesystem
if the sectorsize is bigger than the blocksize.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
16 years agomount: don't call canonicalize(SPEC) for cifs, smbfs and nfs
Karel Zak [Wed, 21 Nov 2007 00:46:57 +0000 (01:46 +0100)]
mount: don't call canonicalize(SPEC) for cifs, smbfs and nfs

When calling "mount -t smbfs //foo/bar /mnt/foo", mount.smbfs will be
called with /foo/bar if /foo/bar exists locally, and will display its
usage.

The patch also removes duplicate canonicalize() from mounted()
function.

Reported-By: Pascal Terjan <pterjan@linuxfr.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
16 years agotests: add ts-mount-noncanonical
Karel Zak [Wed, 21 Nov 2007 00:42:23 +0000 (01:42 +0100)]
tests: add ts-mount-noncanonical

mount(8) shouldn't canonicalize SPEC path for cifs, smbfs, nfs, ...

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