Karel Zak [Tue, 5 May 2009 19:40:19 +0000 (21:40 +0200)]
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
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
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>
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).
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.
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
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
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?
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