]> err.no Git - util-linux/log
util-linux
15 years agofdisk: fix max. ptname
Karel Zak [Wed, 29 Apr 2009 12:24:45 +0000 (14:24 +0200)]
fdisk: fix max. ptname

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblockdev: fix possible buffer overflow
Karel Zak [Wed, 29 Apr 2009 12:17:39 +0000 (14:17 +0200)]
blockdev: fix possible buffer overflow

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: split SONAME and LIBBLKID_VERSION
Karel Zak [Tue, 28 Apr 2009 20:51:53 +0000 (22:51 +0200)]
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 a0487b1cb5beffb8f6783476664b01e8833e0ea8
where was introduced library versioning.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agocfdisk: fix "cannot seek on disk drive" bug
Karel Zak [Tue, 28 Apr 2009 07:16:32 +0000 (09:16 +0200)]
cfdisk: fix "cannot seek on disk drive" bug

Addresses-Debian-Bug: #511161
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: remove whole-disk entries from cache when partitions are found
Eric Sandeen [Fri, 24 Apr 2009 19:08:45 +0000 (21:08 +0200)]
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>
15 years agoagetty: IUCLC and OLCUC are Linux extensions
Aurelien Jarno [Wed, 22 Apr 2009 07:34:10 +0000 (09:34 +0200)]
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>
15 years agolosetup: mount endless loop hang
Karel Zak [Thu, 23 Apr 2009 13:09:04 +0000 (15:09 +0200)]
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>
15 years agoionice: change Jens Axboe's email
Karel Zak [Thu, 23 Apr 2009 11:22:27 +0000 (13:22 +0200)]
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>
15 years agochrt: add a comment about non POSIX 1003.1b attributes in chrt.1
Aurelien Jarno [Wed, 22 Apr 2009 07:19:26 +0000 (09:19 +0200)]
chrt: add a comment about non POSIX 1003.1b attributes in chrt.1

Mention that only SCHED_FIFO, SCHED_OTHER and SCHED_RR are part of
POSIX 1003.1b Process Scheduling in chrt.1.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agodocs: add a note about /proc/sys/kernel/random/uuid
Karel Zak [Wed, 22 Apr 2009 15:08:28 +0000 (17:08 +0200)]
docs: add a note about /proc/sys/kernel/random/uuid

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: do not include <linux/fd.h> in ismounted.c
Aurelien Jarno [Sun, 19 Apr 2009 14:33:44 +0000 (16:33 +0200)]
lib: do not include <linux/fd.h> in ismounted.c

<linux/fd.h> is included for no reason in lib/ismounted.c. This
obviously breaks on non-Linux systems.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoblkid: rename blkid_debug_init to blkid_init_debug
Karel Zak [Mon, 20 Apr 2009 09:54:41 +0000 (11:54 +0200)]
blkid: rename blkid_debug_init to blkid_init_debug

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: release++ (v2.15-rc2)
Karel Zak [Fri, 17 Apr 2009 11:06:54 +0000 (13:06 +0200)]
build-sys: release++ (v2.15-rc2)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: update v2.15 ReleaseNotes
Karel Zak [Fri, 17 Apr 2009 11:02:10 +0000 (13:02 +0200)]
docs: update v2.15 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: merge changes
Karel Zak [Fri, 17 Apr 2009 10:50:31 +0000 (12:50 +0200)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add tst_types.c to Makefile.am
Karel Zak [Fri, 17 Apr 2009 10:35:31 +0000 (12:35 +0200)]
blkid: add tst_types.c to Makefile.am

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: update AUTHORS file
Karel Zak [Fri, 17 Apr 2009 10:29:00 +0000 (12:29 +0200)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agologin: use open(2) rather then access(2) for $HOME/.hushlogin
Karel Zak [Fri, 10 Apr 2009 09:02:24 +0000 (11:02 +0200)]
login: use open(2) rather then access(2) for $HOME/.hushlogin

As an NFS client with home directories on mounted NFS share - If the
NFS server exports the share with default root squashed, login cannot
access the filesystem to check for the existence of .hushlogin file.

It seems better to use open(2) rather than access(2).

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add new requirements to TODO list
Karel Zak [Thu, 9 Apr 2009 10:42:56 +0000 (12:42 +0200)]
blkid: add new requirements to TODO list

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add TODO note about blkid_evaluate_spec_to_buffer()
Karel Zak [Wed, 8 Apr 2009 20:22:14 +0000 (22:22 +0200)]
blkid: add TODO note about blkid_evaluate_spec_to_buffer()

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: update TODO
Karel Zak [Mon, 6 Apr 2009 09:08:13 +0000 (11:08 +0200)]
blkid: update TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add ZSF test
Karel Zak [Fri, 3 Apr 2009 09:33:01 +0000 (11:33 +0200)]
blkid: add ZSF test

Thanks to Andreas Dilger.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add ZSF support
Andreas Dilger [Fri, 3 Apr 2009 09:28:31 +0000 (11:28 +0200)]
blkid: add ZSF support

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: check idinfo[] index
Karel Zak [Fri, 3 Apr 2009 09:02:17 +0000 (11:02 +0200)]
blkid: check idinfo[] index
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomount: Add strictatime support
Matthew Garrett [Fri, 27 Mar 2009 00:47:22 +0000 (00:47 +0000)]
mount: Add strictatime support

2.6.30 adds (patch d0adde574b8487ef30f69e2d08bba769e4be513f) support for a
strictatime mount parameter, used to request strict atime update semantics. The
following patch adds support for it to mount.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
15 years agoblkid: fix exit codes in blkid(8)
Scott James Remnant [Tue, 24 Mar 2009 12:15:38 +0000 (13:15 +0100)]
blkid: fix exit codes in blkid(8)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: fix typo, cal(8) --> cal(1)
Karel Zak [Thu, 19 Mar 2009 07:39:47 +0000 (08:39 +0100)]
docs: fix typo, cal(8) --> cal(1)

Reported-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: rewrite update-potfiles script
Karel Zak [Wed, 18 Mar 2009 19:53:43 +0000 (20:53 +0100)]
po: rewrite update-potfiles script

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: release++ (v2.15-rc1)
Karel Zak [Wed, 18 Mar 2009 14:49:48 +0000 (15:49 +0100)]
build-sys: release++ (v2.15-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: fix bugs detected by "make distcheck"
Karel Zak [Wed, 18 Mar 2009 14:45:48 +0000 (15:45 +0100)]
build-sys: fix bugs detected by "make distcheck"

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: update POTFILES.in
Karel Zak [Wed, 18 Mar 2009 14:45:42 +0000 (15:45 +0100)]
po: update POTFILES.in

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: update v2.15 ReleaseNotes
Karel Zak [Wed, 18 Mar 2009 13:00:31 +0000 (14:00 +0100)]
docs: update v2.15 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agodocs: update AUTHORS file
Karel Zak [Wed, 18 Mar 2009 10:11:54 +0000 (11:11 +0100)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: merge changes
Karel Zak [Wed, 18 Mar 2009 10:02:24 +0000 (11:02 +0100)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: fix typo in lscpu test
Karel Zak [Tue, 17 Mar 2009 21:31:14 +0000 (22:31 +0100)]
tests: fix typo in lscpu test

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agotests: fix file name is too long (max 99) - gtar
Karel Zak [Tue, 17 Mar 2009 20:02:40 +0000 (21:02 +0100)]
tests: fix file name is too long (max 99) - gtar

gtar: util-linux-ng-2.15-rc1/tests/ts/lscpu/proc-dumps/i386-dellpe700/sys/devices/system/cpu/cpu1/topology/:
file name is too long (max 99); not dumped

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agologin: use "remote" as a PAM service name for "login -h"
Karel Zak [Tue, 17 Mar 2009 20:00:42 +0000 (21:00 +0100)]
login: use "remote" as a PAM service name for "login -h"

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: fix ocfs2 detection
Karel Zak [Tue, 17 Mar 2009 15:05:47 +0000 (16:05 +0100)]
blkid: fix ocfs2 detection

The regression tests has failed on PPC64, because
OCFS3 suberblock is in little-endian.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: add $usrlibexecdir and fix paths for [/usr]/lib64
Karel Zak [Tue, 17 Mar 2009 13:54:22 +0000 (14:54 +0100)]
build-sys: add $usrlibexecdir and fix paths for [/usr]/lib64

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoinclude: bitops - explicitly include endian.h
Karel Zak [Tue, 17 Mar 2009 11:40:15 +0000 (12:40 +0100)]
include: bitops - explicitly include endian.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: refresh generated libtool-2 stuff
Karel Zak [Tue, 17 Mar 2009 08:40:17 +0000 (09:40 +0100)]
build-sys: refresh generated libtool-2 stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add missing blkidP.h to Makefile.am
Karel Zak [Mon, 16 Mar 2009 21:16:06 +0000 (22:16 +0100)]
blkid: add missing blkidP.h to Makefile.am

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopo: add zh_CN.po (from translationproject.org)
Ray Wang [Mon, 16 Mar 2009 15:07:42 +0000 (16:07 +0100)]
po: add zh_CN.po (from translationproject.org)

15 years agopo: update vi.po (from translationproject.org)
Clytie Siddall [Mon, 16 Mar 2009 15:07:42 +0000 (16:07 +0100)]
po: update vi.po (from translationproject.org)

15 years agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Mon, 16 Mar 2009 15:07:42 +0000 (16:07 +0100)]
po: update nl.po (from translationproject.org)

15 years agopo: update ja.po (from translationproject.org)
Makoto Kato [Mon, 16 Mar 2009 15:07:41 +0000 (16:07 +0100)]
po: update ja.po (from translationproject.org)

15 years agopo: update id.po (from translationproject.org)
Arif E. Nugroho [Mon, 16 Mar 2009 15:07:41 +0000 (16:07 +0100)]
po: update id.po (from translationproject.org)

15 years agopo: update fr.po (from translationproject.org)
Nicolas Provost [Mon, 16 Mar 2009 15:07:41 +0000 (16:07 +0100)]
po: update fr.po (from translationproject.org)

15 years agopo: update fi.po (from translationproject.org)
Lauri Nurmi [Mon, 16 Mar 2009 15:07:41 +0000 (16:07 +0100)]
po: update fi.po (from translationproject.org)

15 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Mon, 16 Mar 2009 15:07:40 +0000 (16:07 +0100)]
po: update cs.po (from translationproject.org)

15 years agotests: disable blkid tests when blkid(8) is not compiled
Karel Zak [Mon, 16 Mar 2009 13:03:03 +0000 (14:03 +0100)]
tests: disable blkid tests when blkid(8) is not compiled

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: fsprobe - fix gcc warning
Karel Zak [Mon, 16 Mar 2009 12:08:45 +0000 (13:08 +0100)]
lib: fsprobe - fix gcc warning

lib/fsprobe.c: In function ‘fsprobe_get_fstype_by_devname’:
lib/fsprobe.c:243: warning: return discards qualifiers from pointer target type

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: fix non-udev low-probe mode output
Karel Zak [Sat, 14 Mar 2009 19:00:03 +0000 (20:00 +0100)]
blkid: fix non-udev low-probe mode output

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkswap: clean up man page
Karel Zak [Fri, 13 Mar 2009 13:31:31 +0000 (14:31 +0100)]
mkswap: clean up man page

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkswap: zap bootbits
Karel Zak [Thu, 12 Mar 2009 15:01:59 +0000 (16:01 +0100)]
mkswap: zap bootbits

/dev/sdb1 originally initialized by cryptsetup:

and OLD mkswap:

        # vol_id /dev/sdb1 | grep TYPE
        ID_FS_TYPE=swap

        # blkid -s TYPE /dev/sdb1
        /dev/sdb1: TYPE="crypt_LUKS"

So, we have two different *valid* signatures on the device now!

NEW mkswap:

        # blkid -s TYPE /dev/sdb1
        /dev/sdb1: TYPE="swap"

        # /lib/udev/vol_id /dev/sdb1 | grep TYPE
        ID_FS_TYPE=swap

the bootbits (first 1024 bytes) was erased.

We shouldn't zap disk labels (BSD, SUN, ...) and boot loaders (on whole
disk):

        # mkswap  /dev/sdb2
        mkswap: /dev/sdb2: warning: don't erase bootbits sectors
                (BSD partition table detected). Use -f to force.
        Setting up swapspace version 1, size = 4348 KiB
        no label, UUID=69d87cef-71ac-4fb0-a689-ce3e930dea17

        # mkswap  /dev/sdb
        mkswap: /dev/sdb: warning: don't erase bootbits sectors
                on whole disk. Use -f to force.
        Setting up swapspace version 1, size = 8188 KiB
        no label, UUID=97757ad7-8a84-43d9-bcb4-16fefd93a2ac

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolibs: pttype - fix typo
Karel Zak [Thu, 12 Mar 2009 13:34:47 +0000 (14:34 +0100)]
libs: pttype - fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: wholedisk - extend API, add test program
Karel Zak [Thu, 12 Mar 2009 13:31:50 +0000 (14:31 +0100)]
lib: wholedisk - extend API, add test program

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: pttype - extend the API to work with file descriptors
Karel Zak [Thu, 12 Mar 2009 13:17:59 +0000 (14:17 +0100)]
lib: pttype - extend the API to work with file descriptors

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: pttype: fix DOS detection
Karel Zak [Thu, 12 Mar 2009 12:20:51 +0000 (13:20 +0100)]
lib: pttype: fix DOS detection

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: pttype: add BSD subpartitions support
Karel Zak [Thu, 12 Mar 2009 12:00:27 +0000 (13:00 +0100)]
lib: pttype: add BSD subpartitions support

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoinclude: add missing files to Makefile.am
Karel Zak [Thu, 12 Mar 2009 09:22:30 +0000 (10:22 +0100)]
include: add missing files to Makefile.am

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: add pttype.c for PT types detection
Karel Zak [Thu, 12 Mar 2009 09:15:50 +0000 (10:15 +0100)]
lib: add pttype.c for PT types detection

This is a small fragment from libdisk (from xfsprogs). The final
solution will be to move the library to util-linux-ng.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkswap: remove v0 swap space support
Karel Zak [Wed, 11 Mar 2009 14:23:16 +0000 (15:23 +0100)]
mkswap: remove v0 swap space support

The kernel has not supported v0 swap space format since 2.5.22. The
new version v1 is supported since 2.1.117.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: add is_whole_disk() from fdisk code
Karel Zak [Wed, 11 Mar 2009 13:00:21 +0000 (14:00 +0100)]
lib: add is_whole_disk() from fdisk code

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoflock: add NLS support, remove tailing white-spaces
Karel Zak [Wed, 11 Mar 2009 12:34:55 +0000 (13:34 +0100)]
flock: add NLS support, remove tailing white-spaces

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoflock: fix printf format error in usage()
Karel Zak [Wed, 11 Mar 2009 12:02:45 +0000 (13:02 +0100)]
flock: fix printf format error in usage()

flock.c: In function ‘usage’:
flock.c:75: warning: too few arguments for format

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoflockc: segfaults when file name is not given
Karel Zak [Wed, 11 Mar 2009 11:49:50 +0000 (12:49 +0100)]
flockc: segfaults when file name is not given

$ flock -s
Segmentation fault

ltrace:
__libc_start_main(0x8048870, 2, 0xbfe9f404, 0x8049070, 0x8049060 <unfinished ...>
getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = 115
getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = -1
strtol(0, 0xbfe9f34c, 10, 0x80494e0, 0xbfe9f354 <unfinished ...>
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

Addresses-Red-Had-Bugzilla: #489672
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agocal: remove gcc-ism from nl_langinfo() call
Karel Zak [Tue, 10 Mar 2009 12:36:56 +0000 (13:36 +0100)]
cal: remove gcc-ism from nl_langinfo() call

> On Tue, Mar 10, 2009 at 01:15:14PM +0100, Samuel Thibault wrote:
> That will only work with the gcc compiler, which allows to read a
> union field what you wrote in another.  Shouldn't
> (int)(intptr_t)nl_langinfo() be just fine?

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agohwclock: add --systz option to set system clock from itself
Scott James Remnant [Wed, 4 Mar 2009 17:10:43 +0000 (17:10 +0000)]
hwclock: add --systz option to set system clock from itself

Since the system clock time is already set from the hardware clock by the
kernel (when compiled with CONFIG_RTC_HCTOSYS), there's no particular need to
read the hardware clock again.

This option sets the system clock using itself as a reference if the
hardware clock was in local time.  The resulting system clock time
is in UTC, with the kernel timezone set to the difference.

[kzak@redhat.com: - fix the condition that controls read_adjtime() call]

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agocal: determine the first day of week from the locale
Pádraig Brady [Wed, 4 Mar 2009 10:07:29 +0000 (10:07 +0000)]
cal: determine the first day of week from the locale

Previously it defaulted to Sunday rather than using
the value from the locale. Lauri Nurmi <lanurmi@iki.fi>
provided the detailed argument for this change while
Samuel Thibault <samuel.thibault@ens-lyon.org> provided
the information on how to read the first day of the week
from the locale correctly.

[kzak@redhat.com: - fix "cast from pointer to integer",
                    nl_langinfo(_NL_TIME_WEEK_1STDAY) call)]

Signed-off-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agorenice: add -n option for compatibility with POSIX
Karel Zak [Mon, 9 Mar 2009 20:09:50 +0000 (21:09 +0100)]
renice: add -n option for compatibility with POSIX

The -n option is required by POSIX.1-200x.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agobuild-sys: cleanup --with-fsprobe help string
Karel Zak [Mon, 9 Mar 2009 11:49:51 +0000 (12:49 +0100)]
build-sys: cleanup --with-fsprobe help string

Thanks to Theodore Tso.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: add fallback to ext4 for 2.6.29+ kernels if ext2 is not present
Theodore Ts'o [Mon, 9 Mar 2009 11:38:02 +0000 (12:38 +0100)]
blkid: add fallback to ext4 for 2.6.29+ kernels if ext2 is not present

Starting in 2.6.29, ext4 can be used to support filesystems without a
journal.  So if ext2 is not present, and the kernel version is greater
than 2.6.29, and ext4 is present, return a filesystme type of ext4.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> blkid: Add fallback to
ext4 for 2.6.29+ kernels if ext2 is not present

Starting in 2.6.29, ext4 can be used to support filesystems without a
journal.  So if ext2 is not present, and the kernel version is greater
than 2.6.29, and ext4 is present, return a filesystme type of ext4.

[kzak@redhat.com: port from e2fsprogs to util-linux-ng tree]

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: recognize ext4(dev) without journal
Eric Sandeen [Mon, 9 Mar 2009 11:17:17 +0000 (12:17 +0100)]
blkid: recognize ext4(dev) without journal

ext4/ext4dev no longer require a journal.

w/o this blkid doesn't recognize after:

We still must have one ext3-incompat-feature to flag
as ext4(dev) so we shouldn't ever mis-recognize it.

[kzak@redhat.com: port from e2fsprogs to util-linux-ng tree]

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>
15 years agoblkid: blkid.static make target
Karel Zak [Mon, 9 Mar 2009 11:10:59 +0000 (12:10 +0100)]
blkid: blkid.static make target

For compatibility with e2fsprogs tree:

commit eb630fd8708ae433e55e384079c08e0f0f040d22
Author: Eric Sandeen <sandeen@redhat.com>
Date:   Tue Feb 24 23:15:33 2009 -0600

e2fsprogs: blkid.static make target

Nice for testing w/o needing to swizzle around system
libraries...

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdisk: support "-b 4096" option
Karel Zak [Mon, 9 Mar 2009 08:52:08 +0000 (09:52 +0100)]
fdisk: support "-b 4096" option

The fdisk code is more ready for 4kB sectors and it makes sense to
support such sectr size for "-b" option.

Address-Red-Hat-Bugzilla: #218915
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agologin: remove "switching users" nonsense from man page
Karel Zak [Mon, 9 Mar 2009 08:43:49 +0000 (09:43 +0100)]
login: remove "switching users" nonsense from man page

For more details see the BUGS section in the man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: add error messages for lseek and write
Karel Zak [Thu, 5 Mar 2009 19:59:30 +0000 (20:59 +0100)]
swapon: add error messages for lseek and write

Thanks to Hugh Dickins.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: fix typo s/warn/warnx/
Karel Zak [Thu, 5 Mar 2009 19:37:31 +0000 (20:37 +0100)]
swapon: fix typo s/warn/warnx/

Thanks to Hugh Dickins.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: fix wording in man page
Karel Zak [Thu, 5 Mar 2009 19:17:19 +0000 (20:17 +0100)]
swapon: fix wording in man page

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: fix fsprobe wrapper (const char * is nonsense)
Karel Zak [Tue, 3 Mar 2009 15:25:23 +0000 (16:25 +0100)]
lib: fix fsprobe wrapper (const char * is nonsense)

The fsprobe_ functions return newly allocated strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agolib: gcc warning in fix fsprobe
Karel Zak [Tue, 3 Mar 2009 15:10:24 +0000 (16:10 +0100)]
lib: gcc warning in fix fsprobe

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: fix gcc warning in blkid_get_cache_filename()
Karel Zak [Tue, 3 Mar 2009 15:06:52 +0000 (16:06 +0100)]
blkid: fix gcc warning in blkid_get_cache_filename()

cache.c: In function `blkid_get_cache_filename':
cache.c:113  warning: return makes pointer from integer without a cast

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoblkid: use "char **" rather than "unsigned char **"
Karel Zak [Tue, 3 Mar 2009 15:00:39 +0000 (16:00 +0100)]
blkid: use "char **" rather than "unsigned char **"

Use "char" to be consistent with the old high level API.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomount: fix gcc warning (variable used uninitialized)
Karel Zak [Tue, 3 Mar 2009 14:34:10 +0000 (15:34 +0100)]
mount: fix gcc warning (variable used uninitialized)

fstab.c: In function ‘getfs_by_spec’:
fstab.c:400  warning: ‘name’ may be used uninitialized in this
function
fstab.c:402  warning: ‘value’ may be used uninitialized in this
function

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agosimmpleinit: fix gcc warning (buffer size in read())
Karel Zak [Tue, 3 Mar 2009 14:31:39 +0000 (15:31 +0100)]
simmpleinit: fix gcc warning (buffer size in read())

simpleinit.c:846:
/usr/include/bits/unistd.h:43  warning: call to ‘__read_chk_warn’
declared with attribute warning: read called with bigger length than
size of the destination buffer

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: add -f/--fixpgsz option
Karel Zak [Tue, 3 Mar 2009 13:53:27 +0000 (14:53 +0100)]
swapon: add -f/--fixpgsz option

The patch:

commit 3399a218f4eff4016a22044e7c416521bc37c53c
Author: Matthias Koenig <mkoenig@suse.de>
Date:   Thu Nov 27 12:32:56 2008 +0100
swapon: add swap format detection and pagesize check

introduced a new feature. This feature should be optional (disabled by
default) to keep happy people who use swap-space bad blocks or
nonstandard swap-space size.

CC: Hugh Dickins <hugh@veritas.com>
CC: Olaf Hering <olh@suse.de>
CC: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: cleanup man page
Karel Zak [Tue, 3 Mar 2009 13:15:35 +0000 (14:15 +0100)]
swapon: cleanup man page

The patch also fix stupid bug in swapoff long options array.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: rewrite SWSUSPEND signature rather than exec mkswap
Karel Zak [Mon, 2 Mar 2009 15:41:03 +0000 (16:41 +0100)]
swapon: rewrite SWSUSPEND signature rather than exec mkswap

> On Thu, Jan 22, 2009 at 04:46:57PM +0000, Hugh Dickins wrote:
> Though your swapon may mkswap for suspend reasons: hmm, wouldn't it
> do very much better just to rewrite the swap signature, than exec
> mkswap - maybe nobody ever uses the badpages list, but it really
> should be respected.

CC: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: do_swapon() refactoring (split into two functions)
Karel Zak [Mon, 2 Mar 2009 15:12:26 +0000 (16:12 +0100)]
swapon: do_swapon() refactoring (split into two functions)

The patch moves all checks to the separate swapon_checks() function.

This is a little more aggressive, but currently the do_swapon() is
too long.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: use err.h stuff
Karel Zak [Mon, 2 Mar 2009 14:16:21 +0000 (15:16 +0100)]
swapon: use err.h stuff

The code is much more simple with warn()/err() that with fprintf() and
strerror(), ...

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: simplify spec to devname conversion
Karel Zak [Mon, 2 Mar 2009 13:21:03 +0000 (14:21 +0100)]
swapon: simplify spec to devname conversion

We needn't to use spec_to_devname() and check for pseudo filesystems.
The swap{on,off} is always checking for the 'swap' fstype.

This patch also removes the dependence on xmalloc.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: add generic swap_get_header()
Karel Zak [Mon, 2 Mar 2009 12:00:49 +0000 (13:00 +0100)]
swapon: add generic swap_get_header()

We need to proper swap header detection for swsuspend data and for
swap PAGE_SIZE checks. It's better to reuse the code in both cases.

The patch removes duplicate stat() call too.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agoswapon: do_swapon() refactoring (move stat() checks)
Karel Zak [Mon, 2 Mar 2009 10:24:03 +0000 (11:24 +0100)]
swapon: do_swapon() refactoring (move stat() checks)

It's better to do stat() based checks immediately after the stat()
call.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agomkswap: handle 2^32 pages
Hugh Dickins [Thu, 22 Jan 2009 16:46:57 +0000 (16:46 +0000)]
mkswap: handle 2^32 pages

mkswap (when built 32-bit) could not quite support the maximum size
of swap area (2^32 pages): change unsigned long pagecounts to unsigned
long long pagecounts, and fix maxpages for the case when more is asked.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
15 years agodocs: add a note about kpartx to TODO
Karel Zak [Thu, 26 Feb 2009 22:46:28 +0000 (23:46 +0100)]
docs: add a note about kpartx to TODO

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopartx: use ioctls from lib/blkdev.c
Karel Zak [Thu, 26 Feb 2009 22:19:19 +0000 (23:19 +0100)]
partx: use ioctls from lib/blkdev.c

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agofdisk: (and partx) remove BLKGETLASTSECT
Karel Zak [Thu, 26 Feb 2009 22:03:46 +0000 (23:03 +0100)]
fdisk: (and partx) remove BLKGETLASTSECT

This odd ioctl is unsupported in the current 2.4 and 2.6 mainline.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopartx: don't duplicate lib/blkdev.c code
Karel Zak [Thu, 26 Feb 2009 14:28:11 +0000 (15:28 +0100)]
partx: don't duplicate lib/blkdev.c code

Signed-off-by: Karel Zak <kzak@redhat.com>
15 years agopartx: convert hard sector size to 512-byte sectors
Karel Zak [Thu, 26 Feb 2009 13:23:06 +0000 (14:23 +0100)]
partx: convert hard sector size to 512-byte sectors

The msdos PT depends on a sector size (BLKSSZGET), but partx(8) counts
internally with 512-byte sectors only. The dos.c has to convert start
and size to 512-byte sectors.

sysfs (kernel uses 512-byte sectors only):

  # cat /sys/block/sdb/sdb1/{start,size}
  256
  16128

(note that 16128 * 512 = 8257536; 8Mb)

old version:

  # partx /dev/sdb
  1:        32-     2047 (     2016 sectors,      1 MB)
                                                  ^^^^
start, end and sectors are correct, but in 4KiB sectors
The size in MB is completely wrong.

new version:

  # partx -l /dev/sdb
  1:       256-    16383 (    16128 sectors,      8 MB)

start, end and sectors are converted to 512-byte sectors. The size in
MB is correct now.

Note that this change is important, because "partx -a" counts the size
of a new partition in 512-byte sectors for all PT formats (sun, gpt, ...).

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