]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
13 years agomount: (new) print error messages
Karel Zak [Fri, 13 Jan 2012 15:29:21 +0000 (16:29 +0100)] 
mount: (new) print error messages

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: allow to toggle ro/rw and mount again
Karel Zak [Fri, 13 Jan 2012 15:27:50 +0000 (16:27 +0100)] 
libmount: allow to toggle ro/rw and mount again

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: allow to use UUID and LABEL for owner/group mount options in fstab
Karel Zak [Fri, 13 Jan 2012 13:37:09 +0000 (14:37 +0100)] 
libmount: allow to use UUID and LABEL for owner/group mount options in fstab

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add functions to export syscall/helpers status
Karel Zak [Fri, 13 Jan 2012 12:01:18 +0000 (13:01 +0100)] 
libmount: add functions to export syscall/helpers status

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: fix mount/special to be compatible with libmount
Karel Zak [Thu, 12 Jan 2012 20:51:29 +0000 (21:51 +0100)] 
tests: fix mount/special to be compatible with libmount

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: fix auto-loopdev
Karel Zak [Thu, 12 Jan 2012 20:51:00 +0000 (21:51 +0100)] 
libmount: fix auto-loopdev

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: support umount /path/file.img
Karel Zak [Thu, 12 Jan 2012 20:30:58 +0000 (21:30 +0100)] 
libmount: support umount /path/file.img

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: add exceptions for libmount
Karel Zak [Thu, 12 Jan 2012 19:37:21 +0000 (20:37 +0100)] 
tests: add exceptions for libmount

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: make options in fstab optional
Karel Zak [Thu, 12 Jan 2012 15:52:32 +0000 (16:52 +0100)] 
libmount: make options in fstab optional

 .. to be compatible with old mount(8).

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: update tests with fdisk output
Karel Zak [Thu, 12 Jan 2012 10:35:10 +0000 (11:35 +0100)] 
tests: update tests with fdisk output

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: remove unssuported losetup -s
Karel Zak [Thu, 12 Jan 2012 10:31:54 +0000 (11:31 +0100)] 
tests: remove unssuported losetup -s

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: remove unexpected set -x
Karel Zak [Thu, 12 Jan 2012 10:28:42 +0000 (11:28 +0100)] 
tests: remove unexpected set -x

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: cleanup paths
Karel Zak [Thu, 12 Jan 2012 10:15:53 +0000 (11:15 +0100)] 
tests: cleanup paths

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: suport static build for new [u]mount
Karel Zak [Wed, 11 Jan 2012 16:54:04 +0000 (17:54 +0100)] 
build-sys: suport static build for new [u]mount

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add --enable-new-mount
Karel Zak [Wed, 11 Jan 2012 16:05:08 +0000 (17:05 +0100)] 
build-sys: add --enable-new-mount

 Now we have three versions of the mount(8) utility

 * old mount(8)
   --enable-mount [default]

 * old mount(8) linked with libmount
   This is this is necessary for systems without mtab file.
   --enable-libmount-mount

 - new mount(8)
   This is completely new pure-libmount based mount(8).
   --enable-new-mount

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add --pass-fd to samples/mount
Karel Zak [Wed, 11 Jan 2012 15:17:06 +0000 (16:17 +0100)] 
libmount: add --pass-fd to samples/mount

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: add support for encrypted loopdevs
Karel Zak [Wed, 11 Jan 2012 15:16:00 +0000 (16:16 +0100)] 
libmount: add support for encrypted loopdevs

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: add note about non-root users to losetup.8
Karel Zak [Wed, 11 Jan 2012 14:45:36 +0000 (15:45 +0100)] 
losetup: add note about non-root users to losetup.8

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: move xgetpass() to lib/xgetpass.c
Karel Zak [Wed, 11 Jan 2012 14:17:06 +0000 (15:17 +0100)] 
losetup: move xgetpass() to lib/xgetpass.c

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: move swapon from mount/ to sys-utils/
Karel Zak [Wed, 11 Jan 2012 11:14:29 +0000 (12:14 +0100)] 
build-sys: move swapon from mount/ to sys-utils/

 ... to make it independent on mount stuff.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoswapon: merge swap_constants.h into swapon.c
Karel Zak [Wed, 11 Jan 2012 10:43:42 +0000 (11:43 +0100)] 
swapon: merge swap_constants.h into swapon.c

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: add info about virt-what to TODO
Karel Zak [Tue, 10 Jan 2012 15:48:37 +0000 (16:48 +0100)] 
docs: add info about virt-what to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: add hint that context= has to be quoted
Karel Zak [Tue, 10 Jan 2012 14:43:56 +0000 (15:43 +0100)] 
mount: add hint that context= has to be quoted

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=747038
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: update info about check= mount option
Karel Zak [Tue, 10 Jan 2012 13:01:17 +0000 (14:01 +0100)] 
mount: update info about check= mount option

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=770172
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: add --partscan option
Karel Zak [Mon, 9 Jan 2012 22:27:53 +0000 (23:27 +0100)] 
losetup: add --partscan option

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoloopdev: improve debug messages
Karel Zak [Mon, 9 Jan 2012 22:22:04 +0000 (23:22 +0100)] 
loopdev: improve debug messages

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoloopdev: support LO_FLAGS_PARTSCAN flag (kernel 3.2)
Karel Zak [Tue, 15 Nov 2011 11:35:23 +0000 (12:35 +0100)] 
loopdev: support LO_FLAGS_PARTSCAN flag (kernel 3.2)

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosfdisk: use is_blkdev
Davidlohr Bueso [Wed, 4 Jan 2012 23:02:11 +0000 (00:02 +0100)] 
sfdisk: use is_blkdev

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agoblockdev: make functions static
Wanlong Gao [Tue, 27 Dec 2011 14:09:19 +0000 (22:09 +0800)] 
blockdev: make functions static

make the functions in blockdev to statics.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
13 years agolscpu: fix compiler warnings
Davidlohr Bueso [Wed, 4 Jan 2012 22:28:59 +0000 (23:28 +0100)] 
lscpu: fix compiler warnings

The string format is not being passed triggering:

    lscpu.c: In function ‘read_hypervisor’:
    lscpu.c:545:4: warning: format not a string literal and no format arguments
    lscpu.c: In function ‘get_cell_header’:
    lscpu.c:904:2: warning: format not a string literal and no format arguments
    lscpu.c:904:2: warning: format not a string literal and no format arguments

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agoblkdev: add is_blkdev function
Davidlohr Bueso [Wed, 4 Jan 2012 23:02:06 +0000 (00:02 +0100)] 
blkdev: add is_blkdev function

We should have the most basic of checks in this library to see whether or not a block device is being used.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofdisk: remove PACKED macro
Karel Zak [Thu, 5 Jan 2012 16:01:19 +0000 (17:01 +0100)] 
fdisk: remove PACKED macro

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosfdisk: remove PACKED macro
Karel Zak [Thu, 5 Jan 2012 15:58:56 +0000 (16:58 +0100)] 
sfdisk: remove PACKED macro

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agosfdisk: remove do_warn
Davidlohr Bueso [Tue, 20 Dec 2011 13:42:03 +0000 (14:42 +0100)] 
sfdisk: remove do_warn

Replace it with warnx() instead.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agosfdisk: remove fatal
Davidlohr Bueso [Tue, 20 Dec 2011 13:42:00 +0000 (14:42 +0100)] 
sfdisk: remove fatal

Since fatal() exists with a standard 1 code, it can easily be replaced by errx(3).
The xalloc lib is also introduced in this patch.

[kzak@redhat,com: - fix coding style]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agocolumn: don't check result from xmalloc()
Karel Zak [Wed, 4 Jan 2012 13:29:26 +0000 (14:29 +0100)] 
column: don't check result from xmalloc()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add checkxalloc to toplevel Makefile
Karel Zak [Wed, 4 Jan 2012 13:25:21 +0000 (14:25 +0100)] 
build-sys: add checkxalloc to toplevel Makefile

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agocolumn: use xalloc libs
Dave Reisner [Tue, 20 Dec 2011 13:36:02 +0000 (08:36 -0500)] 
column: use xalloc libs

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agolscpu: use xalloc libs
Dave Reisner [Tue, 20 Dec 2011 13:36:03 +0000 (08:36 -0500)] 
lscpu: use xalloc libs

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agotools: add new code checking script
Dave Reisner [Tue, 20 Dec 2011 13:36:04 +0000 (08:36 -0500)] 
tools: add new code checking script

Finds usage of strdup, malloc, calloc, and realloc when xalloc.h is
included.

http://marc.info/?l=util-linux-ng&m=132438338929925&w=2

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agolibmount: fixed a small typo
s.p@orbitalfox.com [Fri, 16 Dec 2011 12:19:56 +0000 (12:19 +0000)] 
libmount: fixed a small typo

13 years agofdisk: fix incorrect position of is_ide_cdrom_or_tape() call
Francesco Cosoleto [Thu, 22 Dec 2011 14:53:25 +0000 (15:53 +0100)] 
fdisk: fix incorrect position of is_ide_cdrom_or_tape() call

Reported-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agolibmount: fix typo in function name
Dave Reisner [Mon, 2 Jan 2012 14:49:42 +0000 (09:49 -0500)] 
libmount: fix typo in function name

Build broken in c70d9d7.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agolibmount: consolidate MNT_FS_* code
Karel Zak [Mon, 2 Jan 2012 14:00:27 +0000 (15:00 +0100)] 
libmount: consolidate MNT_FS_* code

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: don't canonicalize the source of a pseudofs
Dave Reisner [Mon, 26 Dec 2011 23:47:24 +0000 (18:47 -0500)] 
mount: don't canonicalize the source of a pseudofs

In line with previous patches, the source of a pseudofs is strictly
semantic; do not attempt to resolve it to a filesystem path.

As a side effect of this, nspec needs to be initialized to NULL since
it may not be assigned null by spec_to_devname when the FS is deemed
a pseudofs.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agolibmount: avoid resolving pseudofs source on update
Dave Reisner [Mon, 26 Dec 2011 22:10:23 +0000 (17:10 -0500)] 
libmount: avoid resolving pseudofs source on update

Similar to the previous commit, when mounting a pseudofs, trust the
source of the fs, as it cannot be matched to backing device on the
filesystem.

Similar situation, but slightly different bug:

  # mkdir /foo /root/foo
  # echo 'foo  /foo  tmpfs  defaults  0  0' >> /etc/fstab
  # cd /root
  # mount -a
  # mount | grep /foo
  /root/foo on /foo type tmpfs (rw,relatime)

This fixes the pure libmount based mount utility, but the legacy mount
tool will still fail to handle this properly.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount; fix possible mem-leak
Karel Zak [Mon, 2 Jan 2012 13:16:15 +0000 (14:16 +0100)] 
libmount; fix possible mem-leak

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: always trust the source of a pseudofs
Dave Reisner [Mon, 26 Dec 2011 22:10:22 +0000 (17:10 -0500)] 
libmount: always trust the source of a pseudofs

Since nodev FSs have no backing block device, it's unreasonable to try
and resolve the source back to a path on the filesystem. Always trust
the source of the FS given in /etc/fstab to avoid remounting the device
when a directory of the same name exists in the current working
directory.

Example reproduction:

  # mkdir /foo
  # echo 'foo  /foo  tmpfs  defaults  0  0' >> /etc/fstab
  # mount -a
  # cd /root; mkdir foo
  # mount -a
  # mount | grep /foo
  foo on /foo type tmpfs (rw,relatime)
  /root/foo on /foo type tmpfs (rw,relatime)

[kzak@redhat.com: - use fs->flags to detect pseudo FS]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: use CDROM_GET_CAPABILITY ioctl
Davidlohr Bueso [Tue, 20 Dec 2011 13:42:10 +0000 (14:42 +0100)] 
fdisk: use CDROM_GET_CAPABILITY ioctl

And replace the current archaic logic of is_ide_cdrom_or_tape().

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agomount: append inverting options for mount.<type>
Karel Zak [Mon, 2 Jan 2012 10:08:17 +0000 (11:08 +0100)] 
mount: append inverting options for mount.<type>

 fstab:
server://foo   /mnt/foo    nfs    user,exec

The mount(8) does not append the option "exec" to /sbin/mount.<type>
helper's command line. This is no problem when executed by non-root
user as it reads the options from fstab only.

.. but when executed by root (UID=0) then the mount.<type> helper
follows the command where the "exec" option is missing. This is bug.

original version (strace output):

 execve("/sbin/mount.nfs", ["/sbin/mount.nfs",
        "sr.net.home:/mnt/store", "/mnt/store", "-o",
        "rw,nosuid,nodev,noauto,user"], [/* 21 vars */]) = 0

fixed version:

 execve("/sbin/mount.nfs", ["/sbin/mount.nfs",
        "sr.net.home:/mnt/store", "/mnt/store", "-o",
        "rw,nosuid,nodev,noauto,user,exec"], [/* 21 vars */]) = 0
                                    ^^^^^

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib,tt: don't trim last line char
Karel Zak [Thu, 22 Dec 2011 12:21:16 +0000 (13:21 +0100)] 
lib,tt: don't trim last line char

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: cleanup headers, cmdline checks
Karel Zak [Thu, 22 Dec 2011 11:18:43 +0000 (12:18 +0100)] 
losetup: cleanup headers, cmdline checks

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: cleanup man page
Karel Zak [Thu, 22 Dec 2011 11:08:37 +0000 (12:08 +0100)] 
losetup: cleanup man page

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: cleanup usage()
Karel Zak [Thu, 22 Dec 2011 11:08:23 +0000 (12:08 +0100)] 
losetup: cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: check to control debug output
Karel Zak [Thu, 22 Dec 2011 10:07:21 +0000 (11:07 +0100)] 
losetup: check  to control debug output

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: print info about one device
Karel Zak [Thu, 22 Dec 2011 10:02:58 +0000 (11:02 +0100)] 
losetup: print info about one device

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: rewrite loop setup
Karel Zak [Wed, 21 Dec 2011 18:24:58 +0000 (19:24 +0100)] 
losetup: rewrite loop setup

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: rewrite -f
Karel Zak [Wed, 21 Dec 2011 14:38:59 +0000 (15:38 +0100)] 
losetup: rewrite -f

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: rewrite -d and -D
Karel Zak [Wed, 21 Dec 2011 14:28:10 +0000 (15:28 +0100)] 
losetup: rewrite -d and -D

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: rewrite -c
Karel Zak [Wed, 21 Dec 2011 14:02:47 +0000 (15:02 +0100)] 
losetup: rewrite -c

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: rewrite -j
Karel Zak [Wed, 21 Dec 2011 13:44:53 +0000 (14:44 +0100)] 
losetup: rewrite -j

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: rewrite -a
Karel Zak [Tue, 20 Dec 2011 19:43:09 +0000 (20:43 +0100)] 
losetup: rewrite -a

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolib,loopdev: add missing functions
Karel Zak [Tue, 20 Dec 2011 17:25:04 +0000 (18:25 +0100)] 
lib,loopdev: add missing functions

 - improve loop_info usage (don't call ioctl more than once)
 - add functions to get devno and inode of the backing file
 - add function for compare any file with backing file by devno + inode
   or by filename

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid; fix memory leak in blkid_probe_get_wholedisk_probe()
Karel Zak [Wed, 21 Dec 2011 16:32:01 +0000 (17:32 +0100)] 
libblkid; fix memory leak in blkid_probe_get_wholedisk_probe()

Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: use xalloc libs
Davidlohr Bueso [Tue, 20 Dec 2011 11:58:16 +0000 (12:58 +0100)] 
prlimit: use xalloc libs

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agolosetup: move to sys-utils directory
Karel Zak [Tue, 20 Dec 2011 12:07:54 +0000 (13:07 +0100)] 
losetup: move to sys-utils directory

Now losetup(8) is independent on mount/ stuff at all.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: remove mount-specific headers
Karel Zak [Tue, 20 Dec 2011 11:52:00 +0000 (12:52 +0100)] 
losetup: remove mount-specific headers

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: remove unnecessary header files
Karel Zak [Tue, 20 Dec 2011 11:36:02 +0000 (12:36 +0100)] 
losetup: remove unnecessary header files

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: remove 32-bit ioctls
Karel Zak [Tue, 20 Dec 2011 11:20:51 +0000 (12:20 +0100)] 
losetup: remove 32-bit ioctls

 ... kernel 2.4 ?! Who cares?

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: remove #ifdef LOOP_SET_FD nonsense
Karel Zak [Tue, 20 Dec 2011 11:13:06 +0000 (12:13 +0100)] 
losetup: remove #ifdef LOOP_SET_FD nonsense

It's build-system task to enable/disable utils according to accessible
system features.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: remove obsolete #ifdef MAIN
Karel Zak [Tue, 20 Dec 2011 10:41:24 +0000 (11:41 +0100)] 
losetup: remove obsolete #ifdef MAIN

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: don't use "new" in header file
Karel Zak [Mon, 19 Dec 2011 21:51:38 +0000 (22:51 +0100)] 
libmount: don't use "new" in header file

Reported-by: ben <benscott@nwlink.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: update fdisk tests
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:49 +0000 (20:02 +0100)] 
tests: update fdisk tests

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: improve some messages
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:48 +0000 (20:02 +0100)] 
fdisk: improve some messages

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: Fix bad invalid flag 0x00000 warning message
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:47 +0000 (20:02 +0100)] 
fdisk: Fix bad invalid flag 0x00000 warning message

This splits check_dos_label() and dos_init() off from get_boot() and gets
rid of the invalid flag 0x00000 warning message due to a check for MBR
signs in zeroized buffer:

memset(MBRbuffer, 0, 512);

if (what == create_empty_dos)
goto got_dos_table;
[...]
got_dos_table:
if (!valid_part_table_flag(MBRbuffer)) {
[...]
if (!valid_part_table_flag(pe->sectorbuffer))
fprintf(stderr, _("Warning: invalid flag 0x%04x of partition "
[...]

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: avoid an intermediate variable in command_prompt()
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:46 +0000 (20:02 +0100)] 
fdisk: avoid an intermediate variable in command_prompt()

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: don't use get_existing_partition() if disk label isn't dos
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:45 +0000 (20:02 +0100)] 
fdisk: don't use get_existing_partition() if disk label isn't dos

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: remove unused guess_device_type() function
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:44 +0000 (20:02 +0100)] 
fdisk: remove unused guess_device_type() function

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: get rid of get_boot(create_empty_sun) call
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:43 +0000 (20:02 +0100)] 
fdisk: get rid of get_boot(create_empty_sun) call

create_sunlabel() should create a new empty SUN disklabel without checking data
itself writes to memory and initialize internal related fdisk variables.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: get rid of type_open global variable
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:42 +0000 (20:02 +0100)] 
fdisk: get rid of type_open global variable

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: rename try() and tryprocpt() functions
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:41 +0000 (20:02 +0100)] 
fdisk: rename try() and tryprocpt() functions

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: drop one parameter from try() function
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:40 +0000 (20:02 +0100)] 
fdisk: drop one parameter from try() function

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: move code for renaming SGI bootfile to SGI module
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:39 +0000 (20:02 +0100)] 
fdisk: move code for renaming SGI bootfile to SGI module

This moves the code for renaming SGI bootfile from command_prompt() to
sgi_set_bootfilename() function.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: remove possibly_osf_label variable that is only assigned
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:38 +0000 (20:02 +0100)] 
fdisk: remove possibly_osf_label variable that is only assigned

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agofdisk: remove unused 'require' member in enum action
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:37 +0000 (20:02 +0100)] 
fdisk: remove unused 'require' member in enum action

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agoagetty: add static and const qualifiers
Francesco Cosoleto [Thu, 15 Dec 2011 19:02:06 +0000 (20:02 +0100)] 
agetty: add static and const qualifiers

Remove also a static qualifier in main() function.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agolibblkid: minor docs changes
Francesco Cosoleto [Thu, 15 Dec 2011 19:01:40 +0000 (20:01 +0100)] 
libblkid: minor docs changes

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
13 years agowipefs: use xalloc lib
Davidlohr Bueso [Wed, 14 Dec 2011 17:56:57 +0000 (18:56 +0100)] 
wipefs: use xalloc lib

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agolists: add list sorting routine
Davidlohr Bueso [Mon, 12 Dec 2011 22:52:26 +0000 (23:52 +0100)] 
lists: add list sorting routine

We need a list sorting function, just to mention one example user that could
benefit is the lib/tt code to sort columns.

This patch adds list_sort() which uses the Merge Sort algorithm, behaving
nicely in O(nlog(n)), heavily based on the kernel's implementation[1].  The
private data (void *priv) passed to the comparison function as been removed to
adopt a qsort(3)-like syntax, and IMHO we don't really need it anyways.

[1]: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=lib/list_sort.c;h=d7325c6b103f0be078ff3672c35c468ed35738f1;hb=HEAD

[kzak@redhat.com: - use size_t in list_sort()]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofindmnt: support alternative location of fstab
Dave Reisner [Sun, 11 Dec 2011 18:58:05 +0000 (13:58 -0500)] 
findmnt: support alternative location of fstab

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofindmnt: use warnx for libmnt error callback
Dave Reisner [Sun, 11 Dec 2011 18:58:04 +0000 (13:58 -0500)] 
findmnt: use warnx for libmnt error callback

libmount doesn't set errno appropriately here:

$ findmnt -s
findmnt: /etc/fstab: parse error at line 20: Success

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
13 years agosetterm: order man page items alphabetically
Jari Aalto [Sun, 11 Dec 2011 11:09:31 +0000 (13:09 +0200)] 
setterm: order man page items alphabetically

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
13 years agoprlimit: return proper type
Davidlohr Bueso [Thu, 8 Dec 2011 20:19:19 +0000 (21:19 +0100)] 
prlimit: return proper type

The add_prlim() function's definition currently returns a bogus structure.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agodocs: add hwclock -c to TODO file
Karel Zak [Fri, 9 Dec 2011 13:08:02 +0000 (14:08 +0100)] 
docs: add hwclock -c to TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: don't treat empty partition table as error
Karel Zak [Thu, 8 Dec 2011 13:22:04 +0000 (14:22 +0100)] 
partx: don't treat empty partition table as error

Phillip wrote:
 If a partition table was detected, but it had no partitions
 in it, a poorly worded error message was printed and further
 action halted.  For partx -a, this gave an unnecessary error.

Reported-by: Phillip Susi <psusi@cfl.rr.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: cleanup usage() and man page, add undocumented --verbose
Karel Zak [Thu, 8 Dec 2011 13:14:28 +0000 (14:14 +0100)] 
partx: cleanup usage() and man page, add undocumented --verbose

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: don't print error when partition already doesn't exist
Phillip Susi [Mon, 5 Dec 2011 20:02:51 +0000 (15:02 -0500)] 
partx: don't print error when partition already doesn't exist

If you run partx -d to delete partitions, and there are gaps
in the sequence ( partition 2 exists, but 1 doesn't ), then it
would complain that it had errors trying to remove the partitions
that already don't exist. Changed to ignore the error when
errno == ENXIO.

Signed-off-by: Phillip Susi <psusi@cfl.rr.com>
13 years agoagetty: don't use log_err() for non-fatal errors
Karel Zak [Thu, 8 Dec 2011 10:39:05 +0000 (11:39 +0100)] 
agetty: don't use log_err() for non-fatal errors

The TIOCSCTTY ioctl requires that caller is session leader -- so it
depends on initd (or we have to add setsid() to aggety). It seems that the
traditional way is to setup tty in agetty and session in login(1).

It means that all session related things (TIOCSCTTY, vhangup, ...) in the
command agetty should be optional. (Note that vhangup() is called when
--hangup is explicitly specified on command line, so log_err() makes
sense there.)

Reported-by: Andrew Walrond <andrew@walrond.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agologger: fix remote logging
Karel Zak [Thu, 8 Dec 2011 09:20:22 +0000 (10:20 +0100)] 
logger: fix remote logging

Reported-by: Hervé Quillévéré <herve_quillevere@herveq.tk>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agobuild-sys: add log_err to smatch non-return functions
Karel Zak [Fri, 2 Dec 2011 17:31:20 +0000 (18:31 +0100)] 
build-sys: add log_err to smatch non-return functions

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