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>
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>
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>
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
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
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>
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>
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.
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.
Karel Zak [Thu, 26 Feb 2009 11:31:07 +0000 (12:31 +0100)]
addpart: 512-byte sectors in code, bytes in man-page
The addpart.c code uses 512-byte sectors for partition start and
length, but in the addpart.8 man page is "in bytes". The code (and
this code is pretty old) is always right... the man page has to be
fixed.
Karel Zak [Mon, 16 Feb 2009 09:40:25 +0000 (10:40 +0100)]
build-sys: add temporary libtool *.m4 stuff
We require libtool-2 (because old 1.5.x is crap). Unfortunately,
libtool-2 is still not available in many Linux distributions -- now I
see it in unstable distributions only. The painless way how to resolve
this problem is to __temporary__ commit generated libtool-2 stuff to
our repository.
Karel Zak [Tue, 10 Feb 2009 16:20:11 +0000 (17:20 +0100)]
blkid: start to use ABI versioning
The library ABI and API is backwardly compatible, so it does not
make sense to change the library SONAME. This patch adds a symbol
versioning, naming paradigm is:
BLKID_<maj>.<min>
The original libblkid from e2fsprogs uses "1.0" as a .so version and
"libblkid.1" as a SONAME for all time (at least according to stuff in
/lib/libblkid*)
And the original library is without symbols versioning. It means that
many private functions are exported to applications ;-(
Note that the original blkid_get_library_version() returns
E2FSPROGS_VERSION. The version in util-linux-ng returns BLKID_VERSION
which is <maj>.<min>.<rel>. The <maj>.<min> is the same version as we
use for ABI. This concept seems less confusing than mix a library
version and package version.
Summary:
OLD (e2fsprogs):
ABI versioning: -none-
SONAME: libblkid.1
.so version: libblkid.so.1.0
blkid_get_library_version(): @E2FSPROGS_VERSION@ (e.g. 1.41.1)
NEW (util-linux-ng):
ABI versioning: BLKID_<maj>.<min>
SONAME: libblkid.1
.so version: libblkid.so.<maj.<min> (e.g. 1.41)
blkid_get_library_version(): @BLKID_VERSION@ (e.g. 1.41.1)
Karel Zak [Tue, 27 Jan 2009 16:25:06 +0000 (17:25 +0100)]
blkid: add blkid_do_safeprobe()
The function blkid_do_probe() is able to detect more filesystems on
the device
while(blkid_do_probe(pr) == 0)
...
but in many cases we need only one exact answer, and we also need to
be sure that there is not any other FS on the device.
For example it's possible to create valid LUKS (or vfat, ...) header
and valid linux swap header on the same device -- in such case the
device can be interpreted (by mount/swapon) in two completely
different ways. An ambivalent result is always error -- the library
never returns such result.