]> err.no Git - util-linux/log
util-linux
14 years agoAdd preliminary powerpcspe support
Sebastian Andrzej Siewior [Sat, 15 May 2010 15:27:27 +0000 (09:27 -0600)]
Add preliminary powerpcspe support

Addresses-Debian-Bug: 579844
Signed-off-by: LaMont Jones <lamont@debian.org>
14 years agopretty up the removal of /usr/share/info/dir
LaMont Jones [Wed, 12 May 2010 12:51:00 +0000 (06:51 -0600)]
pretty up the removal of /usr/share/info/dir

14 years agoshould build Depend: dpkg or install-info
LaMont Jones [Wed, 12 May 2010 12:41:40 +0000 (06:41 -0600)]
should build Depend: dpkg or install-info

14 years agowe need Required-Start: checkroot, to avoid loops, in hwclock.sh
LaMont Jones [Wed, 12 May 2010 11:35:58 +0000 (13:35 +0200)]
we need Required-Start: checkroot, to avoid loops, in hwclock.sh

14 years agochangelog: release
LaMont Jones [Wed, 12 May 2010 10:56:24 +0000 (12:56 +0200)]
changelog: release

14 years agoadjust mount.8 manpage to avoid man error
LaMont Jones [Wed, 12 May 2010 10:54:50 +0000 (12:54 +0200)]
adjust mount.8 manpage to avoid man error

Signed-off-by: LaMont Jones <lamont@debian.org>
14 years agolintian cleanup
LaMont Jones [Wed, 12 May 2010 10:54:20 +0000 (12:54 +0200)]
lintian cleanup

14 years agodrop use of install-info in postinst
LaMont Jones [Wed, 12 May 2010 09:53:46 +0000 (11:53 +0200)]
drop use of install-info in postinst

Signed-off-by: LaMont Jones <lamont@debian.org>
14 years agoupdated symbols file for libblkid1
LaMont Jones [Wed, 12 May 2010 09:48:22 +0000 (11:48 +0200)]
updated symbols file for libblkid1

Signed-off-by: LaMont Jones <lamont@debian.org>
14 years agocheck for existance of rcS before sourcing it.
LaMont Jones [Wed, 12 May 2010 07:53:10 +0000 (09:53 +0200)]
check for existance of rcS before sourcing it.

Signed-off-by: LaMont Jones <lamont@debian.org>
14 years agonew upstream
LaMont Jones [Sat, 8 May 2010 11:34:39 +0000 (13:34 +0200)]
new upstream

14 years agoMerge remote branch 'origin/stable/v2.17' into stable/v2.17
LaMont Jones [Sat, 8 May 2010 10:09:40 +0000 (04:09 -0600)]
Merge remote branch 'origin/stable/v2.17' into stable/v2.17

14 years agobuild-sys: release++ (v2.17.2)
Karel Zak [Mon, 22 Mar 2010 09:09:12 +0000 (10:09 +0100)]
build-sys: release++ (v2.17.2)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: add v2.17.2 ReleaseNotes
Karel Zak [Mon, 22 Mar 2010 09:05:11 +0000 (10:05 +0100)]
docs: add v2.17.2 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update AUTHORS file
Karel Zak [Mon, 22 Mar 2010 08:48:56 +0000 (09:48 +0100)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: merge changes
Karel Zak [Mon, 22 Mar 2010 08:46:57 +0000 (09:46 +0100)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: update vi.po (from translationproject.org)
Clytie Siddall [Mon, 22 Mar 2010 08:36:51 +0000 (09:36 +0100)]
po: update vi.po (from translationproject.org)

14 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 22 Mar 2010 08:36:51 +0000 (09:36 +0100)]
po: update pl.po (from translationproject.org)

14 years agopo: update ja.po (from translationproject.org)
Makoto Kato [Mon, 22 Mar 2010 08:36:51 +0000 (09:36 +0100)]
po: update ja.po (from translationproject.org)

14 years agofdisk: fix -b <sectorsize>
Karel Zak [Fri, 19 Mar 2010 14:56:27 +0000 (15:56 +0100)]
fdisk: fix -b <sectorsize>

The old fdisk (<2.17) does not differentiate between logical and
physical sector size, it uses the <sectorsize> for everything.

Now, we have logical and physical sectors size, but the -b option
changes the logical size only. The second bug is that "fdisk -b <sz>"
does not read topology information (it means that all I/O limits and
physical sector size are 512 (default).

The backwardly compatible bug fix is to override both sizes, logical
and physical if "-b" is used.

In future we can add a special option for physical size only.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolib: add #ifndef around min() max() macros
Karel Zak [Tue, 16 Mar 2010 14:24:04 +0000 (15:24 +0100)]
lib: add #ifndef around min() max() macros

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: more explicitly explain fstab usage in mount.8
Karel Zak [Mon, 15 Mar 2010 13:36:22 +0000 (14:36 +0100)]
mount: more explicitly explain fstab usage in mount.8

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agowipefs: cleanup usage() and man page
Karel Zak [Mon, 15 Mar 2010 12:45:03 +0000 (13:45 +0100)]
wipefs: cleanup usage() and man page

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoionice: fix typo
Pierre Hauweele [Sat, 13 Mar 2010 23:50:36 +0000 (00:50 +0100)]
ionice: fix typo

Signed-off-by: Pierre Hauweele <antegallya@gmail.com>
14 years agolibblkid: fix infinite loop when probe chain bails out early
Colin Watson [Sat, 13 Mar 2010 00:46:35 +0000 (00:46 +0000)]
libblkid: fix infinite loop when probe chain bails out early

The superblocks probe bails out early with no results in some cases.  If
this happens, blkid_do_probe needs to go to the next chain, rather than
entering an infinite loop calling superblocks_probe over and over again.

[kzak@redhat.com: - print debug message always when leaving
                    superblocks_probe()]

Addresses: https://bugs.launchpad.net/bugs/528073
Signed-off-by: Colin Watson <cjwatson@canonical.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: remove "0x" prefix from DRBD UUID
Karel Zak [Thu, 11 Mar 2010 14:52:54 +0000 (15:52 +0100)]
libblkid: remove "0x" prefix from DRBD UUID

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: properly ignore comments in /etc/filesystems
Mike Frysinger [Sun, 7 Mar 2010 05:16:41 +0000 (00:16 -0500)]
mount: properly ignore comments in /etc/filesystems

The POSIX spec for sscanf() says that whitespace may be matched against 0
bytes which means doing sscanf(" %s") against "#foo" will result in a
match. You can see this behavior by using the verbose options on a garbage
file:

...
mount: you didn't specify a filesystem type for /dev/null
       I will try all types mentioned in /etc/filesystems or /proc/filesystems
Trying #
mount: mount(2) syscall: source: "/dev/null", target: "/", filesystemtype: "#", mountflags: -1058209792, data: (null)
Trying #vfat
mount: mount(2) syscall: source: "/dev/null", target: "/", filesystemtype: "#vfat", mountflags: -1058209792, data: (null)
...

Reported-by: Dave Barton <dave.barton@comodo.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoswapon: remove " (deleted)" from filenames from /proc/swaps
Karel Zak [Wed, 10 Mar 2010 22:08:26 +0000 (23:08 +0100)]
swapon: remove " (deleted)" from filenames from /proc/swaps

The filenames in /proc/swaps are generated by seq_path() and this
function uses __d_path() from fs/dcache.c. The filename could
generated with " (deleted)" suffix. We need real filenames without
the suffix.

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=562403
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: reset BLKID_TINY_DEV flag in blkid_probe_set_device
Pascal Terjan [Wed, 10 Mar 2010 10:08:02 +0000 (11:08 +0100)]
libblkid: reset BLKID_TINY_DEV flag in blkid_probe_set_device

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
14 years agolibblkid: fix display of device size
Karel Zak [Wed, 10 Mar 2010 10:08:01 +0000 (11:08 +0100)]
libblkid: fix display of device size

blkid_loff_t is int64 so use %jd not %zd in debug

Reported-by: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: more robust minix probing
Karel Zak [Mon, 8 Mar 2010 12:05:09 +0000 (13:05 +0100)]
libblkid: more robust minix probing

Unfortunately, it's still possible to interpret some parts of ext3
filesystem as minix superblock ;-(

So, the most robust is to check for the extN magic string in minix
probing function.

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=570606
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: support alignment_offset=-1
Karel Zak [Wed, 10 Mar 2010 11:49:56 +0000 (12:49 +0100)]
libblkid: support alignment_offset=-1

Unfortunately, Linux kernel uses "signed int" for alignment_offset and
the offset could be -1 for devices with undefined alignment (if no
compatible sizes and alignments exist for stacked devices).

There is no way how libblkid caller can respond to the value -1, so we
are going to hide this corner case...

This patch also cleanups usage of empty topology values (e.g.
MINIMUM_IO_SIZE=0 value should not be returned by NAME=value API. The
binary blkid_topology_get_* is not affected by this change.)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: posix option of vfat is obsolete
Yoshihiro Takahashi [Mon, 1 Mar 2010 10:43:02 +0000 (11:43 +0100)]
mount: posix option of vfat is obsolete

Summary of changes from v2.5.42 to v2.5.43
[PATCH] removes posix option of fat (3/5)
  This removes the posix option of vfat. The current posix options works
  only as an alias of name_check=s.

Signed-off-by: Yoshihiro Takahashi <ytakahashi@miraclelinux.com>
14 years agolscpu: fix cpuid opcode detection
Henne Vogelsang [Mon, 1 Mar 2010 10:35:54 +0000 (11:35 +0100)]
lscpu: fix cpuid opcode detection

Fixes commit c9239f23acdc8b50f8bcbfadf967c6a490fd4693. The author
didn't care for matching constraints when resorting the register
constraints.  The eax register (with the cpuid opcode) is now in
operand 1, not zero anymore.

Signed-off-by: Henne Vogelsang <hvogel@opensuse.org>
14 years agoMerge remote branch 'origin/stable/v2.17' into stable/v2.17
LaMont Jones [Mon, 1 Mar 2010 15:53:53 +0000 (08:53 -0700)]
Merge remote branch 'origin/stable/v2.17' into stable/v2.17

14 years agoMerge commit 'v2.17.1' into stable/v2.17
LaMont Jones [Mon, 1 Mar 2010 15:53:05 +0000 (08:53 -0700)]
Merge commit 'v2.17.1' into stable/v2.17

Conflicts:
tests/ts/blkid/images-fs/adaptec-raid.img.bz2
tests/ts/blkid/images-fs/ddf-raid.img.bz2
tests/ts/blkid/images-fs/gfs2.img.bz2
tests/ts/blkid/images-fs/hpt37x-raid.img.bz2
tests/ts/blkid/images-fs/isw-raid.img.bz2
tests/ts/blkid/images-fs/jbd.img.bz2
tests/ts/blkid/images-fs/jmicron-raid.img.bz2
tests/ts/blkid/images-fs/lvm2.img.bz2
tests/ts/blkid/images-fs/nvidia-raid.img.bz2
tests/ts/blkid/images-fs/ocfs2.img.bz2
tests/ts/blkid/images-fs/promise-raid.img.bz2
tests/ts/blkid/images-fs/reiser4.img.bz2
tests/ts/blkid/images-fs/romfs.img.bz2
tests/ts/blkid/images-fs/silicon-raid.img.bz2
tests/ts/blkid/images-fs/swap0.img.bz2
tests/ts/blkid/images-fs/swap1.img.bz2
tests/ts/blkid/images-fs/via-raid.img.bz2
tests/ts/blkid/images-fs/vmfs_volume.img.bz2
tests/ts/blkid/images-fs/zfs.img.bz2

14 years agodocs: fix small typo in v2.17.1-ReleaseNotes
Karel Zak [Mon, 22 Feb 2010 10:31:10 +0000 (11:31 +0100)]
docs: fix small typo in v2.17.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: release++ (v2.17.1)
Karel Zak [Mon, 22 Feb 2010 10:23:02 +0000 (11:23 +0100)]
build-sys: release++ (v2.17.1)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update v2.17.1 ReleaseNotes
Karel Zak [Mon, 22 Feb 2010 09:40:05 +0000 (10:40 +0100)]
docs: update v2.17.1 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update AUTHORS file
Karel Zak [Mon, 22 Feb 2010 09:37:34 +0000 (10:37 +0100)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: merge changes
Karel Zak [Mon, 22 Feb 2010 09:35:30 +0000 (10:35 +0100)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 22 Feb 2010 09:31:33 +0000 (10:31 +0100)]
po: update pl.po (from translationproject.org)

14 years agopo: update id.po (from translationproject.org)
Arif E. Nugroho [Mon, 22 Feb 2010 09:31:32 +0000 (10:31 +0100)]
po: update id.po (from translationproject.org)

14 years agopo: update eu.po (from translationproject.org)
Mikel Olasagasti Uranga [Mon, 22 Feb 2010 09:31:32 +0000 (10:31 +0100)]
po: update eu.po (from translationproject.org)

14 years agopo: update cs.po (from translationproject.org)
Petr Pisar [Mon, 22 Feb 2010 09:31:32 +0000 (10:31 +0100)]
po: update cs.po (from translationproject.org)

14 years agofdisk: swap VTOC values for warning messages
Karel Zak [Fri, 19 Feb 2010 15:11:49 +0000 (16:11 +0100)]
fdisk: swap VTOC values for warning messages

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agosfdisk: make sure writes make it to disk in write_partitions()
Bryn M. Reeves [Thu, 18 Feb 2010 20:39:22 +0000 (21:39 +0100)]
sfdisk: make sure writes make it to disk in write_partitions()

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=565946
Signed-off-by: Bryn M. Reeves <bmr@errorists.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: fix ZSF detection
Andreas Dilger [Wed, 17 Feb 2010 09:21:27 +0000 (10:21 +0100)]
libblkid: fix ZSF detection

Fix the ZFS device detection by looking at multiple uberblocks to see
if any are present, rather than looking for the ZFS boot block which
is not always present.

There may be up to 128 uberblocks, but the first 4 are not written to
disk on a newly-formatted filesystem so check several of them at
different offsets within the uberblock array.

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

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoswapon: fix swapsize calculation
Karel Zak [Tue, 16 Feb 2010 12:48:09 +0000 (13:48 +0100)]
swapon: fix swapsize calculation

Reported-by: Peter Breitenlohner <peb@mppmu.mpg.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: release++ (v2.17.1-rc1)
Karel Zak [Tue, 16 Feb 2010 10:07:47 +0000 (11:07 +0100)]
build-sys: release++ (v2.17.1-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: add v2.17.1 ReleaseNotes
Karel Zak [Tue, 16 Feb 2010 09:59:00 +0000 (10:59 +0100)]
docs: add v2.17.1 ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agodocs: update AUTHORS file
Karel Zak [Tue, 16 Feb 2010 09:29:37 +0000 (10:29 +0100)]
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: merge changes
Karel Zak [Tue, 16 Feb 2010 09:27:49 +0000 (10:27 +0100)]
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agopo: update vi.po (from translationproject.org)
Clytie Siddall [Tue, 16 Feb 2010 09:21:43 +0000 (10:21 +0100)]
po: update vi.po (from translationproject.org)

14 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 16 Feb 2010 09:21:43 +0000 (10:21 +0100)]
po: update pl.po (from translationproject.org)

14 years agopo: update id.po (from translationproject.org)
Arif E. Nugroho [Tue, 16 Feb 2010 09:21:43 +0000 (10:21 +0100)]
po: update id.po (from translationproject.org)

14 years agotests: update fdisk tests (add whitespaces)
Karel Zak [Tue, 16 Feb 2010 09:12:43 +0000 (10:12 +0100)]
tests: update fdisk tests (add whitespaces)

... because git has removed whitespaces after rebase to
stable/v2.17 branch.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoblkid: report open() errors in low-level probing
Karel Zak [Tue, 16 Feb 2010 08:43:26 +0000 (09:43 +0100)]
blkid: report open() errors in low-level probing

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: don't use 1MiB grain on small devices
Karel Zak [Mon, 15 Feb 2010 15:46:05 +0000 (16:46 +0100)]
fdisk: don't use 1MiB grain on small devices

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: update fdisk tests
Karel Zak [Mon, 15 Feb 2010 15:07:44 +0000 (16:07 +0100)]
tests: update fdisk tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: use 1MiB offset and grain always when possible
Karel Zak [Mon, 15 Feb 2010 14:55:22 +0000 (15:55 +0100)]
fdisk: use 1MiB offset and grain always when possible

It would be nice to minimize dependence between the disk layout and
disk topology. We have to follow disk topology for alignment_offset
and huge (> 1MiB) I/O sizes only. For all others disks we can use 1MiB
grain and 1MiB offset.

Reported-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: add -c option (switch off DOS mode)
Karel Zak [Mon, 15 Feb 2010 13:39:30 +0000 (14:39 +0100)]
fdisk: add -c option (switch off DOS mode)

 * add -c to allows to switch off DOS mode from command line

 * recommend sectors (command 'u' or option -u)

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fix ALIGN_UP
Karel Zak [Mon, 15 Feb 2010 13:06:56 +0000 (14:06 +0100)]
fdisk: fix ALIGN_UP

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fallback for topology values
Karel Zak [Mon, 15 Feb 2010 12:29:04 +0000 (13:29 +0100)]
fdisk: fallback for topology values

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: cleanup help, add -h option
Karel Zak [Mon, 15 Feb 2010 09:08:03 +0000 (10:08 +0100)]
fdisk: cleanup help, add -h option

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: update fdisk tests
Karel Zak [Fri, 12 Feb 2010 21:10:52 +0000 (22:10 +0100)]
tests: update fdisk tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: use more elegant way to count and check alignment
Karel Zak [Fri, 12 Feb 2010 20:43:03 +0000 (21:43 +0100)]
fdisk: use more elegant way to count and check alignment

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoinclude: add min/max macros
Karel Zak [Fri, 12 Feb 2010 20:42:46 +0000 (21:42 +0100)]
include: add min/max macros

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: advise users to use "modprobe", not "insmod"
Karel Zak [Fri, 12 Feb 2010 18:58:45 +0000 (19:58 +0100)]
mount: advise users to use "modprobe", not "insmod"

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=562394
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocfdisk: set '[New]' as default item on menu for non allocated space instead of '...
Francesco Cosoleto [Fri, 12 Feb 2010 17:51:29 +0000 (18:51 +0100)]
cfdisk: set '[New]' as default item on menu for non allocated space instead of '[Help]'.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agobuild-sys: add missing tests for libuuid and libblkid
Karel Zak [Fri, 12 Feb 2010 11:43:07 +0000 (12:43 +0100)]
build-sys: add missing tests for libuuid and libblkid

$ make checkconfig
misc-utils/blkid.c : HAVE_TERMIO_H
misc-utils/blkid.c : HAVE_TERMIOS_H
shlibs/blkid/src/getsize.c : HAVE_FSTAT64
shlibs/blkid/src/llseek.c : HAVE_LLSEEK_PROTOTYPE
shlibs/blkid/src/llseek.c : HAVE_LSEEK64_PROTOTYPE
shlibs/uuid/src/gen_uuid.c : HAVE_SA_LEN*/
shlibs/uuid/src/gen_uuid.c : HAVE_SYS_SOCKET_H
shlibs/uuid/src/gen_uuid.c : HAVE_SYS_SYSCALL_H

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoblkid: fix #ifdef HAVE_TERMIO[S]_H
Karel Zak [Fri, 12 Feb 2010 09:32:34 +0000 (10:32 +0100)]
blkid: fix #ifdef HAVE_TERMIO[S]_H

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agobuild-sys: remove duplicate #includes
Karel Zak [Fri, 12 Feb 2010 09:21:05 +0000 (10:21 +0100)]
build-sys: remove duplicate #includes

$ make checkincludes
fsck/fsck.c: errno.h is included more than once.
lib/canonicalize.c: string.h is included more than once.
shlibs/blkid/src/blkidP.h: stdio.h is included more than once.
shlibs/blkid/src/devname.c: string.h is included more than once.
shlibs/blkid/src/devno.c: string.h is included more than once.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocal: fix first day of the week calculation on BE systems
Karel Zak [Thu, 11 Feb 2010 15:29:05 +0000 (16:29 +0100)]
cal: fix first day of the week calculation on BE systems

This reverts commit dcb54fafb128ab41772ae217afc6a7612e2cc446,
"cal: remove gcc-ism from nl_langinfo() call".

The code:

int wfd = (int)(intptr_t) nl_langinfo(_NL_TIME_WEEK_1STDAY);

does not work on big-endian machines. The original solution based on
union is better.

Note that the "type punning" is not gcc-ism any more, it's allowed
by C99 (6.5.2.3).

Reported-by: Joseph Jezak <josejx@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agocfdisk: set '[Quit]' as default menu item on first run instead of '[Bootable]'.
Francesco Cosoleto [Wed, 10 Feb 2010 11:42:26 +0000 (12:42 +0100)]
cfdisk: set '[Quit]' as default menu item on first run instead of '[Bootable]'.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
14 years agomount: warn users that mtab is read-only
Karel Zak [Thu, 11 Feb 2010 12:54:06 +0000 (13:54 +0100)]
mount: warn users that mtab is read-only

In repair mode the root filesystem is read-only and mtab file is not
up to date.

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=427183
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: fix and update old fdisk tests
Karel Zak [Tue, 9 Feb 2010 15:24:51 +0000 (16:24 +0100)]
tests: fix and update old fdisk tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: add fdisk alignment tests
Karel Zak [Tue, 9 Feb 2010 14:47:32 +0000 (15:47 +0100)]
tests: add fdisk alignment tests

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: cleanup warnings
Karel Zak [Thu, 4 Feb 2010 14:02:16 +0000 (15:02 +0100)]
fdisk: cleanup warnings

* don't print:

The number of cylinders for this disk is set to 12161.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

  we really don't care about MS-DOS or extremely old LILO.

* inform users that DOS-compatible mode is bad and deprecated thing
  (It's difficult to use 2048 sectors grain or 4KiB sectors or
   alignment_offset in DOS mode where all is based on cylinders...)

* don't check for cylinders boundary in non-DOS mode

* inform about sector and I/O sizes

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fix default first sector
Karel Zak [Tue, 9 Feb 2010 10:06:42 +0000 (11:06 +0100)]
fdisk: fix default first sector

The previous release 2.17 introduces aligned defaults for the first
and last sectors on the partition. Unfortunately, there is endless
loop when the code looks for first unused aligned sector.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: cleanup alignment, default to 1MiB offset
Karel Zak [Thu, 4 Feb 2010 12:43:37 +0000 (13:43 +0100)]
fdisk: cleanup alignment, default to 1MiB offset

* add heuristic to detect that the device does not provide
  topology information. We can use topology if:

- alignment_offset is not 0
- or optimal_io_size is not 0
- or minimal_io_size is not power of 2

* default to 1MiB offset for the start of the first partition
  if topology is unknown. This (2048 512-byte sectors)
  is Windows Vista default.

* use optimal_io_size, minimal_io_size or 1MiB as a grain for
  partitions alignment

Note that this all is used when DOS-compatible mode is disabled.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: fix check_alignment()
Karel Zak [Tue, 9 Feb 2010 09:32:29 +0000 (10:32 +0100)]
fdisk: fix check_alignment()

The old version of check_alignment() does not work with extended
partitions.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: don't check alignment_offset against geometry
Karel Zak [Mon, 8 Feb 2010 16:45:42 +0000 (17:45 +0100)]
fdisk: don't check alignment_offset against geometry

The alignment_offset is compensation for DOS compatible partitioning.

It usually matches with disk geometry (e.g. 63 sectors), but the
offset is also exported from phy.disks to RAIDs there the geometry
don't match with the offset. So.. don't print unnecessary warning.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: don't return error on empty files
Karel Zak [Thu, 4 Feb 2010 21:19:38 +0000 (22:19 +0100)]
libblkid: don't return error on empty files

Currently, the library does not allow to initialize blkid_probe if the
file (or block device) is empty. The empty file is reported as an
error. That's wrong. The empty file should be interpreted as a file
without any FS or PT. It means that

blkid_do_{probe,safeprobe,fullprobe}()

have to return 1 ("nothing").

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agowipefs: ignore devices with partition table
Karel Zak [Thu, 4 Feb 2010 20:18:34 +0000 (21:18 +0100)]
wipefs: ignore devices with partition table

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: use "optimal I/O size" in warnings
Karel Zak [Thu, 28 Jan 2010 22:34:05 +0000 (23:34 +0100)]
fdisk: use "optimal I/O size" in warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agofdisk: use optimal_io_size
Karel Zak [Thu, 28 Jan 2010 18:42:04 +0000 (19:42 +0100)]
fdisk: use optimal_io_size

 * rename the minimum_io_size variable to io_size
 * use blkid_topology_get_optimal_io_size() for io_size initialization
 * use blkid_topology_get_minimum_io_size() as a fallback solution for
   io_size initialization

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agologin: check that after tty reopen we still work with a terminal
Karel Zak [Thu, 28 Jan 2010 15:25:52 +0000 (16:25 +0100)]
login: check that after tty reopen we still work with a terminal

 * the login code assumes that stdin is a terminal, it's better to
   check (by isatty()) that after tty reopen we still have a terminal

 * this patch also removes very old obscure fallback for situations where
   ttyname() returns nothing (then ttyn = "/dev/tty??"). I guess that the
   fake string was originally for utmp records or so. Currently (in last 10
   years...) code requires that the tty name is a real open-able file.
   It means the fake tty name is completely useless.

Reported-by: Yann Droneaud <yann@droneaud.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agologin: use fd instead of pathname for update tty's owner and permissions
Yann Droneaud [Mon, 25 Jan 2010 22:12:09 +0000 (23:12 +0100)]
login: use fd instead of pathname for update tty's owner and permissions

To avoid some nasty races, use the only true tty:
the one already opened, don't use the path.

Signed-off-by: Yann Droneaud <yann@droneaud.fr>
14 years agoblkid: add newline when only one value is printed
Karel Zak [Wed, 27 Jan 2010 17:16:06 +0000 (18:16 +0100)]
blkid: add newline when only one value is printed

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: more robust minix probing
Karel Zak [Wed, 27 Jan 2010 14:01:13 +0000 (15:01 +0100)]
libblkid: more robust minix probing

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agologin: don't link PAMed version with libcrypt
Karel Zak [Wed, 27 Jan 2010 12:31:16 +0000 (13:31 +0100)]
login: don't link PAMed version with libcrypt

The login, chsh and chfn utils don't need to be linked against libcrypt.
The libcrypt library is necessary only when login utils are not liked
with PAM.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=559196
Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agomount: update documentation about barrier mount options
Jan Kara [Wed, 13 Jan 2010 17:07:33 +0000 (18:07 +0100)]
mount: update documentation about barrier mount options

Signed-off-by: Jan Kara <jack@suse.cz>
14 years agonamei: fix man page formatting
Vladimir Brednikov [Sun, 10 Jan 2010 21:01:26 +0000 (00:01 +0300)]
namei: fix man page formatting

14 years agolibblkid: fix segfault in drdb
Matthias König [Tue, 12 Jan 2010 12:58:28 +0000 (13:58 +0100)]
libblkid: fix segfault in drdb

Check if blkid_probe_get_buffer() returns NULL to avoid dereferencing
a zero pointer resulting in a segfault.

Signed-off-by: Matthias König <mk@phasorlab.de>
14 years agolibblkid: don't probe for GPT and Unixware PT on floppies
Karel Zak [Wed, 20 Jan 2010 22:51:13 +0000 (23:51 +0100)]
libblkid: don't probe for GPT and Unixware PT on floppies

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: add sanity checks for FAT to DOS PT parser
Karel Zak [Wed, 20 Jan 2010 22:30:20 +0000 (23:30 +0100)]
libblkid: add sanity checks for FAT to DOS PT parser

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agoblkid: probe for PT, don't probe for FS on small whole-disks
Karel Zak [Wed, 20 Jan 2010 20:18:15 +0000 (21:18 +0100)]
blkid: probe for PT, don't probe for FS on small whole-disks

 * blkid(8) in low-level mode probes for PT now (blkid is replacement
   for devkit-disks-part-id)

 * add ID_PART_TABLE_TYPE=<name> to blkid(8) udev output

 * don't probe for FS/RAIDs on small devices when PT is detected

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agolibblkid: rewrite blkid_probe_get_buffer()
Karel Zak [Wed, 20 Jan 2010 19:01:59 +0000 (20:01 +0100)]
libblkid: rewrite blkid_probe_get_buffer()

The library does not use any buffer with fixed size any more. The new
version calls read() for necessary data only.

Signed-off-by: Karel Zak <kzak@redhat.com>
14 years agotests: update FS test images
Karel Zak [Tue, 19 Jan 2010 15:46:08 +0000 (16:46 +0100)]
tests: update FS test images

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