]> err.no Git - util-linux/log
util-linux
15 years agomount: add long options to mount.8
Karel Zak [Mon, 2 Nov 2009 10:27:47 +0000 (11:27 +0100)]
mount: add long options to mount.8

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdisk: add regression test listing empty/nonsense images
Zdenek Behan [Sun, 1 Nov 2009 23:38:36 +0000 (00:38 +0100)]
fdisk: add regression test listing empty/nonsense images

Signed-off-by: Zdenek Behan <rain@matfyz.cz>
15 years agomkswap: restore device argument in mkswap.8 synopsis
Peter Breitenlohner [Thu, 29 Oct 2009 15:29:56 +0000 (16:29 +0100)]
mkswap: restore device argument in mkswap.8 synopsis

Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
15 years agowipefs: remove obsolete comment
Karel Zak [Fri, 30 Oct 2009 12:48:10 +0000 (13:48 +0100)]
wipefs: remove obsolete comment

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: refresh GPT regression test
Karel Zak [Fri, 30 Oct 2009 11:26:03 +0000 (12:26 +0100)]
tests: refresh GPT regression test

The n+1 change has been introduced by commit
4c8e837230bb96dc3c447706d9c3b11e4167ba13.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: does not return useless binary data
Karel Zak [Fri, 30 Oct 2009 11:20:51 +0000 (12:20 +0100)]
libblkid: does not return useless binary data

Currently, the binary blkid_probe_get_{topology,partitions}() API
returns empty structs when information has not been gathered. This is
confusing for applications. It's seems better to return NULL.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: topology - add logical and physical sector size
Karel Zak [Fri, 30 Oct 2009 11:08:01 +0000 (12:08 +0100)]
libblkid: topology - add logical and physical sector size

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: add HAVE_LIBBLKID_INTERNAL
Karel Zak [Tue, 27 Oct 2009 11:11:37 +0000 (12:11 +0100)]
build-sys: add HAVE_LIBBLKID_INTERNAL

It's better to use one macro for all situations where we depends on
in-tree (internal) libblkid.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add BLKID_{VERSION,DATE} to blkid.h
Karel Zak [Tue, 27 Oct 2009 10:30:37 +0000 (11:30 +0100)]
libblkid: add BLKID_{VERSION,DATE} to blkid.h

The original e2fsprogs has BLKID_{VERSION,DATE} macros in blkid.h.
Although the macros are not updated for many years in e2fsprogs. So I
guess nobody uses it.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: return first detected crypto device
Scott James Remnant [Mon, 26 Oct 2009 12:49:17 +0000 (13:49 +0100)]
libblkid: return first detected crypto device

Crypto devices may sometimes have multiple additional prober matches,
however just like RAID, there's no danger of activating the wrong one
since special help is needed to activate the block device before it
can be used.

Thus modify blkid_do_safeprobe() to break out of the loop when a
crypto device is detected, as it does already for RAID.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add test cases for VMFS
Mike Hommey [Fri, 16 Oct 2009 10:38:10 +0000 (12:38 +0200)]
libblkid: add test cases for VMFS

Signed-off-by: Mike Hommey <mh@glandium.org>
15 years agomount: and libblkid: covert /dev/dm-N to /dev/mapper/<name>
Karel Zak [Mon, 26 Oct 2009 12:33:03 +0000 (13:33 +0100)]
mount: and libblkid: covert /dev/dm-N to /dev/mapper/<name>

 * mount(8) uses private device-mapper names in mtab

 * libblkid returns private device-mapper names when evaluate udev
   /dev/disk-by symlinks.

 * on systems where DM is fully integrated with udev the /dev/mapper/<name>
   files are symlinks to /dev/dm-N. It means we need a special care to hide
   private device-mapper names.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: convert GPT partition LBA to 512-byte sectors
Karel Zak [Thu, 22 Oct 2009 19:40:27 +0000 (21:40 +0200)]
libblkid: convert GPT partition LBA to 512-byte sectors

The libblkid keeps information about partitions in 512-byte counts.
This patch:

 * convert GPT partition LBA to 512-byte sectors

 * fix n+1 bug in GPT partition size, because:

   "The partition is defined as all the logical blocks **inclusive**
    of the StartingLBA and EndingLBA." (UEFI 2.3)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: use BLKSSZGET for GPT sectors
Karel Zak [Thu, 22 Oct 2009 12:52:39 +0000 (14:52 +0200)]
libblkid: use BLKSSZGET for GPT sectors

The current implementation uses fixed sector size (512 bytes), that's
wrong. UEFI standard requires real logical sector size -- it means
BLKSSZGET for Linux.

The size of GPT header is not static, but whole sector is allocated
for the header. In theory the HeaderSize field could be greater than
sizeof(struct gpt_header). It means we have to read whole sector with
the header, because the header crc32 checksum is counted according to
HeaderSize.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodmesg: fix typo in man page
Ken Kopin [Mon, 19 Oct 2009 13:58:57 +0000 (07:58 -0600)]
dmesg: fix typo in man page

Signed-off-by: LaMont Jones <lamont@debian.org>
15 years agolibblkid: topology - ignore non-blockdevs
Karel Zak [Mon, 19 Oct 2009 13:39:31 +0000 (15:39 +0200)]
libblkid: topology - ignore non-blockdevs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add support for topology ioctls
Karel Zak [Mon, 19 Oct 2009 13:33:00 +0000 (15:33 +0200)]
libblkid: add support for topology ioctls

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: add 'unshare' and 'wipefs' to AUTHORS
Karel Zak [Mon, 19 Oct 2009 09:26:12 +0000 (11:26 +0200)]
docs: add 'unshare' and 'wipefs' to AUTHORS

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: update AUTHORS file
Karel Zak [Mon, 19 Oct 2009 08:59:15 +0000 (10:59 +0200)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: merge changes
Karel Zak [Mon, 19 Oct 2009 08:55:17 +0000 (10:55 +0200)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: update po/POTFILES.in
Karel Zak [Mon, 19 Oct 2009 08:53:52 +0000 (10:53 +0200)]
po: update po/POTFILES.in

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: update vi.po (from translationproject.org)
Clytie Siddall [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update vi.po (from translationproject.org)

15 years agopo: update ja.po (from translationproject.org)
Makoto Kato [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update ja.po (from translationproject.org)

15 years agopo: update id.po (from translationproject.org)
Arif E. Nugroho [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update id.po (from translationproject.org)

15 years agopo: update fr.po (from translationproject.org)
Nicolas Provost [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update fr.po (from translationproject.org)

15 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update fi.po (from translationproject.org)

15 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Mon, 19 Oct 2009 08:45:58 +0000 (10:45 +0200)]
po: update cs.po (from translationproject.org)

15 years agoinitctl: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 21:37:22 +0000 (23:37 +0200)]
initctl: fix strict-aliasing bugs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkfs.minix: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 20:13:14 +0000 (22:13 +0200)]
mkfs.minix: fix strict-aliasing bugs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofsck.minix: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 20:08:35 +0000 (22:08 +0200)]
fsck.minix: fix strict-aliasing bugs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdisk: fix strict-aliasing bugs
Karel Zak [Fri, 16 Oct 2009 19:49:33 +0000 (21:49 +0200)]
fdisk: fix strict-aliasing bugs

gcc 4.4 produces tons of

  "dereferencing type-punned pointer will break strict-aliasing rules"

warnings for fdisk code where is

  char buffer[BUFSIZ];

  ((struct disklabel *) MBRBuffer)->foo

There are two ways how fix the problem:

  1/ union {
          char buffer[BUFSIZ], struct disklabel label
     } MBRBuffer;

  2/ use allocated buffer, this way seems less invasive.

This patch implements 2/.

Old version:
  $ make -C fdisk | grep -c warning
  236

New version:
  $ make -C fdisk | grep -c warning
  0

About aliasing:
 - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40665
 - http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html
 - C99

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoRevert "build-sys: move fsck/mkfs for bfs/cramfs/minix to /usr"
Karel Zak [Fri, 16 Oct 2009 20:53:12 +0000 (22:53 +0200)]
Revert "build-sys: move fsck/mkfs for bfs/cramfs/minix to /usr"

See http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2689/focus=2690

This reverts commit d4fa971c42467fb69e5d89d28e1b98c491a1505a.

15 years agofdisk: sgi label - remove duplicate swab16swab[16,32]() definitions
Karel Zak [Fri, 16 Oct 2009 09:43:02 +0000 (11:43 +0200)]
fdisk: sgi label - remove duplicate swab16swab[16,32]() definitions

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add support for VMFS (VMware File System)
Mike Hommey [Fri, 16 Oct 2009 07:26:07 +0000 (09:26 +0200)]
libblkid: add support for VMFS (VMware File System)

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: update docs/.gitignore
Karel Zak [Fri, 16 Oct 2009 08:21:44 +0000 (10:21 +0200)]
libblkid: update docs/.gitignore

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add missing packed attributes
Karel Zak [Fri, 16 Oct 2009 00:34:28 +0000 (02:34 +0200)]
libblkid: add missing packed attributes

This patch add __attribute__((packed)) to almost all superblock and
disk label definitions. Well, in many cases this is not necessary, but
it's a cheap way how to keep the code robust...

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoinclude: use c.h in canonicalize.h
Karel Zak [Thu, 15 Oct 2009 23:45:42 +0000 (01:45 +0200)]
include: use c.h in canonicalize.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agonamei: use c.h
Karel Zak [Thu, 15 Oct 2009 23:44:33 +0000 (01:44 +0200)]
namei: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: use c.h in samples
Karel Zak [Thu, 15 Oct 2009 23:43:07 +0000 (01:43 +0200)]
libblkid: use c.h in samples

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agosetterm: use c.h, remove tailing whitespace
Karel Zak [Thu, 15 Oct 2009 23:40:58 +0000 (01:40 +0200)]
setterm: use c.h, remove tailing whitespace

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agonewgrp: use c.h, remove tailing whitespace
Karel Zak [Thu, 15 Oct 2009 23:38:29 +0000 (01:38 +0200)]
newgrp: use c.h, remove tailing whitespace

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agohwclock: use c.h
Karel Zak [Thu, 15 Oct 2009 23:37:09 +0000 (01:37 +0200)]
hwclock: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopartx: use c.h
Karel Zak [Thu, 15 Oct 2009 23:35:55 +0000 (01:35 +0200)]
partx: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolosetup: remove unused macro
Karel Zak [Thu, 15 Oct 2009 23:34:20 +0000 (01:34 +0200)]
losetup: remove unused macro

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agocal: use c.h
Karel Zak [Thu, 15 Oct 2009 23:32:28 +0000 (01:32 +0200)]
cal: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agokill: use c.h
Karel Zak [Thu, 15 Oct 2009 23:28:41 +0000 (01:28 +0200)]
kill: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdisk: use c.h
Karel Zak [Thu, 15 Oct 2009 23:26:46 +0000 (01:26 +0200)]
fdisk: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agosfdisk: use c.h, remove obsolete #ifdefs
Karel Zak [Thu, 15 Oct 2009 23:15:19 +0000 (01:15 +0200)]
sfdisk: use c.h, remove obsolete #ifdefs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: use c.h
Karel Zak [Thu, 15 Oct 2009 23:05:45 +0000 (01:05 +0200)]
blockdev: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agochrt: use c.h
Karel Zak [Thu, 15 Oct 2009 23:01:48 +0000 (01:01 +0200)]
chrt: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoldattach: use c.h
Karel Zak [Thu, 15 Oct 2009 23:00:27 +0000 (01:00 +0200)]
ldattach: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: use c.h
Karel Zak [Thu, 15 Oct 2009 22:58:53 +0000 (00:58 +0200)]
libblkid: use c.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoinclude: add c.h with fundamental C definitions
Karel Zak [Thu, 15 Oct 2009 22:42:22 +0000 (00:42 +0200)]
include: add c.h with fundamental C definitions

Add:
  * ARRAY_SIZE with array type check
  * PATH_MAX, TRUE and FALSE macros
  * dummy __attribute__ for non-gcc compilers

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: update fsck.ismounted test
Karel Zak [Thu, 15 Oct 2009 21:37:34 +0000 (23:37 +0200)]
tests: update fsck.ismounted test

The latest version of the lib/test_ismounted binary returns absolute
mountpoint path too. This patch removes the path from test output (the
path is variable).

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix typo s/Hihg/High/
Jim Meyering [Thu, 15 Oct 2009 13:28:58 +0000 (15:28 +0200)]
libblkid: fix typo s/Hihg/High/

* shlibs/blkid/docs/libblkid-docs.xml

Signed-off-by: Jim Meyering <meyering@redhat.com>
15 years agolibblkid: add note about UUID_SUB, increment number of superblock values
Karel Zak [Thu, 15 Oct 2009 13:20:38 +0000 (15:20 +0200)]
libblkid: add note about UUID_SUB, increment number of superblock values

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofsck.minix: fix broken zone checking
Karel Zak [Thu, 15 Oct 2009 12:14:32 +0000 (14:14 +0200)]
fsck.minix: fix broken zone checking

This bug has been introduced by commit
95356e8b744439336925eeb36f01399f1ee8a5e9.

The fsck.minix code assumes that isset() macro returns boolean,
unfortunately the generic implementation from libc returns integer.

This patch also add a fallback for the bitmap macros to include/bitops.h.

Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: fix topology ioctls
Karel Zak [Thu, 15 Oct 2009 00:32:03 +0000 (02:32 +0200)]
blockdev: fix topology ioctls

 kernel 2.6.32-rc4 (kvm):

 # blockdev -v --getss --getpbsz --getiomin --getioopt --getmaxsect --getalignoff   /dev/sda
 get logical block (sector) size: 512
 get physical block (sector) size: 512
 get minimum I/O size: 512
 get optimal I/O size: 0
 get max sectors per request: 1024
 get alignment offset: 0

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: add topology ioctls support
Karel Zak [Wed, 14 Oct 2009 23:22:42 +0000 (01:22 +0200)]
blockdev: add topology ioctls support

new options:

   --getpbsz                      get physical block (sector) size
   --getiomin                     get minimum I/O size
   --getioopt                     get optimal I/O size
   --getalignoff                  get alignment offset
   --getmaxsect                   get max sectors per request

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: add support for uint and ushort ioctls
Karel Zak [Wed, 14 Oct 2009 22:06:07 +0000 (00:06 +0200)]
blockdev: add support for uint and ushort ioctls

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: refactoring (better commands definition)
Karel Zak [Wed, 14 Oct 2009 21:57:52 +0000 (23:57 +0200)]
blockdev: refactoring (better commands definition)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add pretty output, document -L incompatibility with e2fsprogs
Karel Zak [Wed, 14 Oct 2009 00:17:27 +0000 (02:17 +0200)]
blkid: add pretty output, document -L incompatibility with e2fsprogs

... sad story, I have temporary disabled pretty-output code
in very early version of blkid.c in u-l-ng. (It was also in
time when pretty-output was very new feature in e2fsprogs.)

Unfortunately, the -L option (shortcut to "-o list") in u-l-ng version
was reused for for any other functionality few months later.... this
stupid thing was released in u-l-ng 2.15 and 2.16 without any negative
feedback from users.

It means the blkid from u-l-ng is not backwardly compatible with
the original version from e2fsprogs. The -L option has a different
meaning there.

I'm sorry about this bug...

This patch:

  * enable pretty-output (-o line)
  * add a note about incompatibility between u-l-ng and e2fsprogs
    to blkid.8 man page

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: import whole ismounted.c code from e2fsprogs
Karel Zak [Tue, 13 Oct 2009 23:13:18 +0000 (01:13 +0200)]
lib: import whole ismounted.c code from e2fsprogs

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agohwclock: set kernel timezone with --systz --utc
Scott James Remnant [Thu, 24 Sep 2009 19:17:23 +0000 (12:17 -0700)]
hwclock: set kernel timezone with --systz --utc

Even though --systz doesn't need to change the system clock when the
hardware clock is in UTC time (--systz --utc), it does need to set
the kernel timezone so that FAT timestamps, etc. will be correct.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
15 years agotests: swapon workaround for libtool wrapper
Karel Zak [Tue, 13 Oct 2009 13:37:49 +0000 (15:37 +0200)]
tests: swapon workaround for libtool wrapper

The swapon command behaviour depends on program name (argv[0] = swapon
| swapoff). It means we cannot use the libtool wrapper script in our
regression tests. It seems better to call the binaries directly with
proper LD_LIBRARY_PATH. This is probably less portable, but good
enough for our tests.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: more robust progname probing
Karel Zak [Tue, 13 Oct 2009 12:22:33 +0000 (14:22 +0200)]
swapon: more robust progname probing

Currently, the 'swapoff' is the default behavior. It means that if you
have a libtool wrapper script in your build directory the executed binary
name is 'lt-swapon' and then "swapon -a" is interpreted as "swapoff -a".

Any random argv[0] should not be interpreted as "swapoff".

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: handle <=linux-2.6.19 bug in /proc/swaps
Mike Frysinger [Tue, 13 Oct 2009 10:05:19 +0000 (06:05 -0400)]
swapon: handle <=linux-2.6.19 bug in /proc/swaps

Linux <=2.6.19 contained a bug in the /proc/swaps code where the header
would not be displayed (the first line).  Most people report the issue as
a sequence of swapon/swapoff calls to trigger, but for some lucky people,
it triggers all the time at initial boot.  Since this throws up an error,
init systems don't actually activate any swap files.

First, swapon shouldn't whine about unexpected format if the file is empty
(the default at boot).  This is easy to do by putting the warning behind a
check to ferror().

Second, we can detect that the first line isn't actually the header but
instead is a valid swap line and so need to be processed.  This assumes
that the first line will always be the same format.  Looking quickly at
older versions shows that this header has retained its exact format since
at least Linux 2.2.0 and considering the concern that goes along with proc
files and the ABI, it's highly unlikely it will ever change.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agohwclock: do not access hardware clock when using --systz
Scott James Remnant [Thu, 24 Sep 2009 18:59:33 +0000 (11:59 -0700)]
hwclock: do not access hardware clock when using --systz

When using --systz we do not read from the hardware clock, so there
is no need to search for a hardware clock.  Indeed, we may be running
hwclock --systz before /dev is mounted.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
15 years agobuild-sys: clean up gtk-doc usage
Karel Zak [Mon, 12 Oct 2009 12:14:56 +0000 (14:14 +0200)]
build-sys: clean up gtk-doc usage

Currently gtk-doc is optional. Unfortunately, the ./configure script
still depends on GTK_DOC_CHECK macro and shlibs/blkid/docs/Makefile.am
depends on gtk-doc.make.

It seems that the best solution is to add gtk-doc.[make,m4] files to
the repository.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: fix typo on swapon.8 manpage
Florentin Duneau [Sun, 11 Oct 2009 00:45:42 +0000 (18:45 -0600)]
swapon: fix typo on swapon.8 manpage

Addresses-Debian-Bug: 487497
Signed-off-by: LaMont Jones <lamont@debian.org>
15 years agobuild-sys: move fsck/mkfs for bfs/cramfs/minix to /usr
Mike Frysinger [Sun, 11 Oct 2009 00:07:16 +0000 (20:07 -0400)]
build-sys: move fsck/mkfs for bfs/cramfs/minix to /usr

The bfs/cramfs/minix rarely (if ever?) are used for root filesystems, so
it doesn't make much sense to keep them in the root partition.  Move them
to /usr by default.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
15 years agonamei: better mount points detection
Karel Zak [Fri, 9 Oct 2009 14:26:45 +0000 (16:26 +0200)]
namei: better mount points detection

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswitch_root: remove TIOCSCTTY and setsid()
Karel Zak [Fri, 9 Oct 2009 13:00:38 +0000 (15:00 +0200)]
switch_root: remove TIOCSCTTY and setsid()

requested by dracut developers because:

   bash: cannot set terminal process group (-1): Inappropriate ioctl for device

Addresses-Red-Hat-Bug: #519237
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoRemove now unused <sys/ioctl.h> includes
Guillem Jover [Thu, 8 Oct 2009 11:40:14 +0000 (13:40 +0200)]
Remove now unused <sys/ioctl.h> includes

Those became unused with the switch to the blkdev functions.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agocal: remove obsolete <localeinfo.h> include
Guillem Jover [Thu, 8 Oct 2009 11:40:13 +0000 (13:40 +0200)]
cal: remove obsolete <localeinfo.h> include

The fact that the system does not have <langinfo.h> does not imply that
it has <localeinfo.h> (which is an ancient header from Linux libc4).

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agoipcs: use __GLIBC__ instead of obsolete __GNU_LIBRARY__
Guillem Jover [Thu, 8 Oct 2009 11:40:12 +0000 (13:40 +0200)]
ipcs: use __GLIBC__ instead of obsolete __GNU_LIBRARY__

The latter is obsolete and it's currently defined to 6 for historical
reasons (as per comment in <features.h>) instead of 2 as what would be
expected.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agobuild-sys: check for union semun instead of using _SEM_SEMUN_UNDEFINED
Guillem Jover [Thu, 8 Oct 2009 11:40:11 +0000 (13:40 +0200)]
build-sys: check for union semun instead of using _SEM_SEMUN_UNDEFINED

Older versions of glibc used to declare ‘union semun’ in <sys/sem.h>,
but POSIX.1-2001 requires the caller to declare it instead. Later
versions of glibc started defining _SEM_SEMUN_UNDEFINED to note that
the union was not being declared, but conforming systems are not
required to define that macro (e.g. FreeBSD). As a side effect we get
rid of some obsolete __GNU_LIBRARY__ macro usage.

[kzak@redhat.com: - use #ifndef]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: enable silent rules if automake >= 1.11
Guillem Jover [Thu, 8 Oct 2009 11:40:09 +0000 (13:40 +0200)]
build-sys: enable silent rules if automake >= 1.11

Make the build silent if the system has a new enough automake,
otherwise keep the current behaviour.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agobuild-sys: detect if volatile is available
Guillem Jover [Thu, 8 Oct 2009 11:40:07 +0000 (13:40 +0200)]
build-sys: detect if volatile is available

Do not defined volatile away on non-Linux systems, detect its presence
using AC_C_VOLATILE instead.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agobuild-sys: detect if const is available
Guillem Jover [Thu, 8 Oct 2009 11:40:06 +0000 (13:40 +0200)]
build-sys: detect if const is available

Some systems define __STDC__ and do not have a working const, some do
not define the macro but do have a working const. Use AC_C_CONST to
check for its presence.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
15 years agolibblkid: fix warning message in mkfs sample
Karel Zak [Wed, 7 Oct 2009 22:40:34 +0000 (00:40 +0200)]
libblkid: fix warning message in mkfs sample

15 years agonamei: gater information about / (root)
Karel Zak [Tue, 6 Oct 2009 23:37:57 +0000 (01:37 +0200)]
namei: gater information about / (root)

$ ll -d /foo
drwxr-xr-x 2 kzak kzak 4096 2009-10-07 01:23 /foo

old version:

$ namei -l /foo
f: /foo
Segmentation fault

new version:

$ namei -l /foo
f: /foo
drwxr-xr-x root root /
drwxr-xr-x kzak kzak foo

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agonamei: fix alone symlink evaluation
Karel Zak [Tue, 6 Oct 2009 23:34:36 +0000 (01:34 +0200)]
namei: fix alone symlink evaluation

$ mkdir aaa
$ ln -s aaa mylink

old version:

$ namei mylink
namei: could not stat 'mylink/aaa': No such file or directory

new version:

        $ namei mylink
f: mylink
 l mylink -> aaa
   d aaa

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agowipefs: fix coding style
Karel Zak [Tue, 6 Oct 2009 22:04:08 +0000 (00:04 +0200)]
wipefs: fix coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofallocate: check for ERANGE errors
Karel Zak [Tue, 6 Oct 2009 21:49:56 +0000 (23:49 +0200)]
fallocate: check for ERANGE errors

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agowipefs: new command
Karel Zak [Mon, 5 Oct 2009 11:14:07 +0000 (13:14 +0200)]
wipefs: new command

 # ./wipefs /dev/sda4
 offset               type
 ----------------------------------------------------------------
 0xff6                swap   [other]
                      UUID:  da6c54ea-77d9-470a-82f1-e793fd5d9131

 0x36                 vfat   [filesystem]
                      UUID:  497F-3013

 # ./wipefs --offset 0x36 /dev/sda4
 8 bytes [46 41 54 31 32 20 20 20] erased at offset 0x36 (vfat)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: add BFS libblkid regression test
Karel Zak [Tue, 6 Oct 2009 20:22:39 +0000 (22:22 +0200)]
tests: add BFS libblkid regression test

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add a probe for bfs
Christoph Hellwig [Tue, 6 Oct 2009 18:10:31 +0000 (14:10 -0400)]
libblkid: add a probe for bfs

blkid is currently missing a probe for the bfs filesystem, leading
to a blkid-enable xfsprogs failing xfsqa testcase 032. This patch adds
a trivial probe for the magic.

Signed-off-by: Christoph Hellwig <hch@lst.de>
15 years agobuild-sys: fix BUILD_PIVOT_ROOT condition
Karel Zak [Tue, 6 Oct 2009 19:57:48 +0000 (21:57 +0200)]
build-sys: fix BUILD_PIVOT_ROOT condition

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: cleanup --disable-{fallocate,pivot_root,unshare}
Karel Zak [Tue, 6 Oct 2009 10:43:22 +0000 (12:43 +0200)]
build-sys: cleanup --disable-{fallocate,pivot_root,unshare}

 * add --disable-fallocate
 * add --disable-pivot_root
 * cleanup --disable-unshare

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agounshare: new command
Mikhail Gusarov [Sat, 3 Oct 2009 19:42:08 +0000 (02:42 +0700)]
unshare: new command

New utility allows to run process with separate mount, UTC, IPC or
network namespaces.

[kzak@redhat.com: - some cosmetic changes in usage() and err() usage
                  - move "if BUILD_UNSHARE" to separate place in Makefile.am
                  - add unshare to .gitignore]

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdformat: fix memory leak in verify_disk()
Cristian Rodríguez [Sun, 4 Oct 2009 20:08:49 +0000 (16:08 -0400)]
fdformat: fix memory leak in verify_disk()

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
15 years agolibblkid: fix buffer usage in FAT prober
Karel Zak [Tue, 6 Oct 2009 07:17:06 +0000 (09:17 +0200)]
libblkid: fix buffer usage in FAT prober

The blkid_probe_get_buffer() function returns buffer that could be
overwritten in the next blkid_probe_get_buffer() call. It means that
we have to save FAT super block to the temporary buffer if we want to
call blkid_probe_get_buffer() for directory entries or fsinfo.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix FAT super block definition
Lawrence Rust [Mon, 5 Oct 2009 13:42:13 +0000 (15:42 +0200)]
libblkid: fix FAT super block definition

Signed-off-by: Lawrence Rust <lawrence@softsystem.co.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofindfs: fix typo in findfs.8
Karel Zak [Mon, 5 Oct 2009 10:31:03 +0000 (12:31 +0200)]
findfs: fix typo in findfs.8

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoMerge branch 'for_upstream' of git://git.kernel.org/pub/scm/utils/util-linux-ng/tytso...
Karel Zak [Mon, 5 Oct 2009 13:23:12 +0000 (15:23 +0200)]
Merge branch 'for_upstream' of git://git.kernel.org/pub/scm/utils/util-linux-ng/tytso/util-linux-ng

15 years agolib: fix file descriptor leak in is_mounted()
Theodore Ts'o [Sat, 3 Oct 2009 16:50:06 +0000 (12:50 -0400)]
lib: fix file descriptor leak in is_mounted()

Remove an extraneous fopen() that leaks memory and a file descriptor.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agolibblkid: fix blkid_do_probe() to work properly with chains
Karel Zak [Thu, 1 Oct 2009 22:49:07 +0000 (00:49 +0200)]
libblkid: fix blkid_do_probe() to work properly with chains

The blkid_do_probe() always switched to the new chain -- that's bad, we
have to try all probing methods in the chain.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: add blkit_[un]ref() to TODO
Karel Zak [Thu, 1 Oct 2009 21:47:49 +0000 (23:47 +0200)]
libblkid: add blkit_[un]ref() to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibblkid: fix segfault in blkid_do_probe()
Karel Zak [Thu, 1 Oct 2009 20:49:44 +0000 (22:49 +0200)]
libblkid: fix segfault in blkid_do_probe()

This:
pr->cur_chain += sizeof(struct blkid_chain);

is nonsense of course, there should be a cast to (char *) or so.

It seems that the most robust solution is to avoid this game with
pointers and use chain->driver-id which is useful as array index.

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