Commit Graph

1253 Commits

Author SHA1 Message Date
Karel Zak 3ac22f7a17 build-sys: add --disable-tls
* add AX_TLS autoconf macro

 * add --disabletls option

 * cleanup gen_uuid.c code to remove gcc warnings when compiled
   without TLS macro.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:16 +02:00
Karel Zak 6c2a09b3e6 build-sys: enable fsck by default
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:16 +02:00
Karel Zak f910b5594f build-sys: add --disable-libblkid, remove volume_id support
Supported scenarios:

  * internal libblkid (--enable-libblkid, default)

  * external libblkid (--disable-libblkid)
     - systems without pkg-config
     - systems with pkg-config

  * systems without libblkid at all
    (requires --disable-mount and --disable-fsck)

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:16 +02:00
Karel Zak d94e8a9ebc mount: (and fsck) remove libvolume_id support
The libvolume_id is deprecated in favor of libblkid. The libblkid from
u-l-ng provides the same functionality as libvolume_id.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak 17afb0320c build-sys: cleanup libuuid stuff
Supported scenarios:

 * internal libuuid (--enable-libuuid, default)

 * external libuuid (--disable-libuuid)
   - systems without pkg-config
   - systems with pkg-config

 * systems without libuuid at all (the library is optional for u-l-ng)

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak 8c0dc0719d build-sys: fix headers in mkswap and libblkid
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak 6fed18f290 build-sys: add UTIL_{SET,RESTORE}_FLAGS
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak 0eb0aff95e libblkid: update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak af61001011 libuuid: add info about u-l-ng to man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak f6076f557e libuuid: add --disable-libuuid and LIBUUID_VERSION
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:14 +02:00
Karel Zak 754fed0c14 libuuid: import UUID library from e2fsprogs
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:14 +02:00
Karel Zak 28d39b6dd7 mount: fix undefined reference to `security_get_initial_context'
> Gentoo-hardened stable have: sys-libs/libselinux-1.34.14
> I have:
> mount.c:(.text+0x12ce): undefined reference to `security_get_initial_context'

Reported-by: Максим Бритов <maxim.britov@gmail.com>
Addresses-Gentoo-Bug: #270168
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-21 13:20:10 +02:00
Zdenek Behan 13d70bac07 fdisk: add simple test for doslabel stuff
Initial tests/fdisk patch to test most of the doslabel-related stuff.
Coverage of dos-related functions is about 60%, does not test the
verify/fix-PT code.

[kzak@redhat.com: - fix test design to match to
                    output/expect/diff idea]

Signed-off-by: Zdenek Behan <rain@matfyz.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-19 16:19:32 +02:00
Karel Zak 35c636e13b tests: add functions for work withdisk images
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-19 16:13:09 +02:00
Chris Webb f01a2e3e2f fdisk: (and cfdisk) fix to be consistent about maximum heads
Fix fdisk and cfdisk to be consistent about maximum heads

Without this patch, fdisk allows up to 256 heads to be set via the menu, but
only up to 255 heads by command line -H. Similarly, cfdisk's -H option also
enforces heads <= 255 instead of heads <= 256.

The strange limit of 256 comes about because (heads - 1) should fit in a
single byte for legacy CHS. Geometries of 256 heads and 32 sectors are seen
in disks from other operating systems where cylinder-aligned partitions
which are also aligned to a 4MB boundary are wanted.

Signed-off-by: Chris Webb <chris@arachsys.com>
2009-05-19 14:52:06 +02:00
Tom Prince a88057d9a3 cal: uClibc has langinfo.h but not _NL_TIME_WEEK_1STDAY.
Signed-off-by: Tom Prince <cougar@hermes>
2009-05-19 14:25:43 +02:00
Karel Zak 4bf7d60171 blkid: cleanup debug messages and return codes in blkid_do_probe()
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-14 20:28:11 +02:00
Karel Zak 7103157c8b blkid: blkid_do_safeprobe() has to be tolerant to RAIDs
It's pretty generic that RAID signature is on the same device as FS
signature. We have to be tolerant and ignore filesystems signatures
on such devices. The RAID signature is always preferred.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-14 18:29:03 +02:00
Karel Zak 4ce48a971d blkid: fix "hangs forever with partition type mdraid"
> #:> blkid /dev/sda7
> /dev/sda7: UUID="c193d159-1fd4-1a4b-4037-f3433e016f3d" TYPE="mdraid"
>
> The blkid binary build from the util-linux-ng sources just hangs
> forever with 100% cpu load with the same command.

Reported-by: Juergen Daubert <jue@jue.li>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-14 18:04:55 +02:00
Karel Zak 20ad496324 build-sys: complete /libs to /shlibs rename
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-14 17:40:52 +02:00
Karel Zak 40672152dc build-sys: rename /libs to /shlibs
On Wed, May 13, 2009 at 05:38:49AM -0400, Christoph Hellwig wrote:
> Also the lib vs libs toplevel directories probably aren't a too good
> choice.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-14 15:38:50 +02:00
Karel Zak cdd17c7a73 blkid: make libuuid optional
read.c:28:23: error: uuid/uuid.h: No such file or directory
make[3]: *** [read.lo] Error 1
make[3]: *** Waiting for unfinished jobs....

Reported-by: Olaf <mailinglists@ban-solms.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-12 21:22:19 +02:00
Karel Zak 7c950efa34 build-sys: fix blkid.h include for old e2fsprogs
When building util-linux-ng-2.15, I get this:
   ../lib/fsprobe.c:10:19: error: blkid.h: No such file or directory

Unfortunately, the blkid.pc uses -I${includedir}/blkidi since
e2fsprogs v1.41.2. The old versions use -I${includedir} only.

Reported-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-11 15:06:06 +02:00
Karel Zak 2ef7d41e6b build-sys: fix "make -C" bug
Running:

./configure --with-fsprobe=builtin
make -C mount mount

causes the following error:

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h
-I../include -DLOCALEDIR=\"/home/matthew/util-linux-ng/share/locale\"
-fsigned-char -I../libs/blkid/src   -g -O2 -MT mount-setproctitle.o
-MD -MP -MF .deps/mount-setproctitle.Tpo -c -o mount-setproctitle.o
`test -f '../lib/setproctitle.c' || echo './'`../lib/setproctitle.c mv
-f .deps/mount-setproctitle.Tpo .deps/mount-setproctitle.Po
make -C
make: option requires an argument -- 'C'
Usage: make [options] [target] ...
...

Reported-by: Matthew Burgess <matthew@linuxfromscratch.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-11 11:49:00 +02:00
Mike Frysinger 72f6902e43 losetup: handle symlinks in /dev/loop/
The loop_scandir() expects all the files in /dev/loop/ to be actual
devices and not symlinks to devices.  However, udev by default sets up
symlinks in /dev/loop/ thereby breaking the fallback scan logic when
looking for devices more than the default number of 8.

Simple way to reproduce is:
 - <detach all devices>
 - cd /dev/loop
 - rm -f [2-7]
 - losetup 0 autogen.sh
 - mv 1 8
 - for n in {1..7} ; do ln -s 0 $n ; done
 - losetup -f
	<error but should have found /dev/loop/8>

[kay.sievers@vrfy.org:  
       just a note, udev does not do that by default. It is
       devfs-nonsense, which the "default" never did.]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Mario Bachmann <grafgrimm77@gmx.de>
2009-05-11 10:54:41 +02:00
Mike Frysinger c9239f23ac lscpu: fix cpuid code on x86/PIC
If we build lscpu as PIE, we currently get a build failure:
lscpu.c: In function 'main':
lscpu.c:333: error: can't find a register in class 'BREG' while reloading 'asm'
lscpu.c:333: error: 'asm' operand has impossible constraints
make[2]: *** [lscpu.o] Error 1

So we need a little bit of register shuffling to keep gcc happy.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-11 10:52:02 +02:00
Aurelien Jarno b64279dab8 chrt: don't assume SCHED_BATCH and SCHED_IDLE exist
SCHED_FIFO, SCHED_OTHER, SCHED_RR are part of POSIX 1003.1b Process
Scheduling, so it is correct to assume they always exists.

SCHED_BATCH and SCHED_IDLE are Linux specific, we should not assume
they exists.

Defining SCHED_BATCH and SCHED_IDLE to random values (ie the ones found
on Linux systems) is not an option as they may *collide* with the one of
other systems. For example on GNU/kFreeBSD we have:

   #define SCHED_RR        3

and on Linux we have:

   #define SCHED_BATCH     3

[kzak@redhat.com: - add "Linux specific" notes to chrt.1
                  - add a note about BATCH and PR conflict to
                    this commit message]

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-07 11:28:08 +02:00
Rajeev V. Pillai a43145e157 cal: Highlight today even when month or year specified
* misc-utils/cal.c: Unconditionally call time()
and highlight today where possible.

Signed-off-by: Rajeev V. Pillai <rajeevvp@gmail.com>
Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-05-07 10:59:29 +02:00
Karel Zak 676c8bfa78 build-sys: release++ (v2.15)
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-05 22:21:15 +02:00
Karel Zak de07ce2891 docs: update v2.15 ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-05 22:18:17 +02:00
Karel Zak 969b567e1a docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-05 22:11:22 +02:00
Karel Zak 6f52b6e9ae blkid: use /sys/block/dm-<N>/dm/name
The Linux kernel (since 2.6.29, patch 784aae735d9b0bba3f8b9faef4c8b30df3bf0128)
exports the real DM device names in /sys/block/<ptname>/dm/name.

The sysfs based solution is nicer and faster than scan for devno in
/dev/mapper/.

CC: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-05 21:47:01 +02:00
Karel Zak 0e1ae8abce blkid: use /dev/mapper/<name> rather than /dev/dm-<N>
The libblkid (since v1.41.1) returns private device-mapper names (e.g.
/dev/dm-0). It's because the probe_one() function scans /dev before
/dev/mapper.

brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/dm-0
brw-rw---- 1 root disk 253, 0 2009-04-27 13:41 /dev/mapper/TestVolGroup-TestLogVolume

Old version:
  # blkid -t LABEL="TEST-LABEL" -o device
  /dev/dm-0

Fixed version:
  # blkid -t LABEL="TEST-LABEL" -o device
  /dev/mapper/TestVolGroup-TestLogVolume

Addresses-Red-Hat-Bug: #497259
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-05 21:42:29 +02:00
Karel Zak 4884729a6e blkid: linux_raid - fix logic for volumes with size == 0
Based on

    commit 7643819062985d9fc6c7664072576e71d3822b10
    Author: Kay Sievers <kay.sievers@vrfy.org>
    Date:   Sat Sep 6 16:23:21 2008 +0200

 from udev upstream tree.

Reported-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 16:38:36 +02:00
Karel Zak 396b8c0f9f tests: fix -regex in run.sh
Reported-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 15:51:32 +02:00
Karel Zak 2c59ce7990 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 15:36:53 +02:00
Arif E. Nugroho 4e5ffbf38d po: update id.po (from translationproject.org) 2009-04-29 15:34:26 +02:00
Nicolas Provost 2556af1846 po: update fr.po (from translationproject.org) 2009-04-29 15:34:26 +02:00
Petr Pisar 40a16c894a po: update cs.po (from translationproject.org) 2009-04-29 15:34:25 +02:00
Karel Zak cee95a9567 blkid: rename blkid_evaluate_spec to blkid_evaluate_tag
"SPEC" is usually used in mount(8) as a generic term for device name or
tag (LABEL, UUID). The function blkid_evaluate_* works with TAGs only.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 15:11:54 +02:00
Karel Zak 5d5ae40b26 docs: add entry about /proc/partitions parsing
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 14:46:21 +02:00
Karel Zak 047ec698d4 sfdisk: fix possible buffer overflow
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 14:33:52 +02:00
Karel Zak bb66209012 fdisk: fix max. ptname
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 14:24:45 +02:00
Karel Zak 18c3e24341 blockdev: fix possible buffer overflow
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 14:17:39 +02:00
Karel Zak 33b0be6d60 blkid: split SONAME and LIBBLKID_VERSION
It seems better to split SONAME and the public library version. The
library version will be the same as util-linux-ng PACKAGE_VERSION.

PACKAGE_VERSION:               <maj>.<min>[-<suffix>]  e.g. 2.15-rc2
Symbols versioning:            BLKID_<maj>.<min>       e.g. BLKID_2.15
blkid_get_library_version():   <maj>.<min>.0           e.g. 2.15.0
SONAME:                        libblkid.so.1

See also the original patch a0487b1cb5
where was introduced library versioning.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-28 23:29:06 +02:00
Karel Zak 279723e92d cfdisk: fix "cannot seek on disk drive" bug
Addresses-Debian-Bug: #511161
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-28 09:16:32 +02:00
Eric Sandeen 0295be0377 blkid: remove whole-disk entries from cache when partitions are found
We can get into a situation in blkid where whole disks remain
in the cache, even though partitions are found.  For labels
such as sun disklabels which may have the first partition
beginning at sector 0, this is even somewhat likely.

1) create a sun disklabel w/partitions
2) mkfs the first partition (at sector 0)
3) remove the partition table
4) run blkid - this finds the fs on the whole disk, places in cache
5) recreate the partition table
6) run blkid - this finds the partition, places in cache

And now we have both /dev/sda and /dev/sda1 in cache.

There are heuristics in probe_all to avoid putting the whole disk
in cache if it has partitions, but there is nothing to remove the
whole-disk entry in the above case.  I think the below patch
suffices, although I haven't quite convinced myself that setting
the lens[which]=0; is the right logic for that bit of state...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-24 21:08:45 +02:00
Aurelien Jarno ee51904169 agetty: IUCLC and OLCUC are Linux extensions
IUCLC and OLCUC are Linux extensions to termios. The same way it is
already done for XCASE, they can be ignored if not supported.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-04-23 15:43:42 +02:00
Karel Zak fc08b4bb9d losetup: mount endless loop hang
Based on
       fix-hang-on-stale-nfs.diff
from SUSE src.rpm package.

It seems better to more precisely check for ENXIO rather than assume
that all LOOP_GET_STATUS errors mean that the device is not used.

Addresses-Novell-Bugzilla: #449646
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-23 15:09:04 +02:00
Karel Zak 357e7c3b2d ionice: change Jens Axboe's email
Based on
   util-linux-2.14.2-schedutils_fix_email.patch
from SUSE src.rpm package.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-23 13:22:27 +02:00