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
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.