The "blkockdev --getsize" returns negative numbers on i386
for 1Tb devices. The BLKGETSIZE and BLKGETSIZE64 have to
use unsigned long and unsigned long long.
$ blockdev --getsize /dev/mapper/huge
-2147483648
Signed-off-by: Karel Zak <kzak@redhat.com>
The "blockdev --getsz" command doesn't try to use BLKGETSIZE64 when
previous BLKGETSIZE failed with EFBIG. This patch fixes this problem.
Signed-off-by: Karel Zak <kzak@redhat.com>
When creating the "/etc/mtab~" lockfile (specifically 'linktargetfile' in the
lock_mtab function), the file is created with incorrect permissions ('000')
which necessitates root to leverage CAP_DAC_OVERRIDE. If proper file modes (it
would appear 0600 would be sufficient) were used in the open this would
function properly with CAP_DAC_OVERRIDE revoked.
$ sysctl -w kernel.cap-bound=0xf7fd7df5
$ mount -t tmpfs /dev/swap /mnt
can't open lock file /etc/mtab~: Permission denied (use -n flag to override)
Signed-off-by: Flávio Leitner <fleitner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Let mkswap, mkfs.bfs, mkfs.minix open with O_EXCL if
used on block devices to prevent writing to the device
even if they are busy (mounted).
Unfortunately, O_EXCL has zero effect for 2.4 kernels where
in-kernel code doesn't use O_EXCL-like access locks. (Tested
on RHEL3.)
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
We have PACKAGE_STRING in config.h that includes package name and
version. It's better to use this macro that hardcoded strings.
Signed-off-by: Karel Zak <kzak@redhat.com>
With this patch, you can define autotool options when you
need to generate build-system. For example:
$ AM_OPTS="--copy" ./autogen.sh
Signed-off-by: Karel Zak <kzak@redhat.com>
8 bit characters on the Linux console lead to input corruption (e.g.
German umlauts). This is easily reproducable by inserting a login name with
umlaut and typing backspace afterwards.
agetty supports tty parity, which leads to getty treating these characters
as a 7bit char with set parity.
This patch by Samuel Thibault adds a new option -8 which disables parity
detection for ttys not used for serial logins.
| Note: With this patch, 8bit characters are just silently dropped (that's
| the expected getty behavior), this is quite neat since you then don't
| even need to backspace your 8bit characters :)
Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
The idle class has no class data. It will print a warning if
a prio argument is given for it, since this will be ignored.
Output for idle class will not contain prio data.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
script(1) is not consistent and writes "Script started on.." to
scriptfile, although the others messages are ignored when running
with '-q'.
Signed-off-by: Karel Zak <kzak@redhat.com>
mkswap(8) enforces to use v0 swap format when pagesize > 16kB.
(use case might be ppc64 with CONFIG_PPC_64K_PAGES).
As version 0 swap is not supported anymore by recent kernels, the
behaviour in this case is rather strange.
Here is a testcase:
for i in 4 8 16 32 64; do mkswap -p `expr $i \* 1024` ./swap.file; done
Setting up swapspace version 1, size = 4294963 kB
Using user-specified page size 8192, instead of the system values
4096/4096
Setting up swapspace version 1, size = 4294959 kB
Using user-specified page size 16384, instead of the system values
4096/4096
Setting up swapspace version 1, size = 4294950 kB
Using user-specified page size 32768, instead of the system values
4096/4096
Setting up swapspace version 0, size = 4294934 kB
Using user-specified page size 65536, instead of the system values
4096/4096
Setting up swapspace version 0, size = 4294901 kB
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Fix inconsistency between kernel profiling and readprofile.
The range of kernel profiling is between _stext and _etext,
and readprofile tries to extract profiling for all the symbols in
/boot/System.map-2.6.16.11-7-ppc64 from /proc/profile, but there
are more symbols in /boot/System.map-2.6.16.11-7-ppc64 than those
between _stext and _etext.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
The previous "gplv2-only" was copy&past mistake. This re-licensing is
correct -- there is not any other contributor to this code.
Signed-off-by: Karel Zak <kzak@redhat.com>
The previous "gplv2-only" was copy&past mistake. This re-licensing is
correct -- there is not any other contributor to this code.
Signed-off-by: Karel Zak <kzak@redhat.com>
Compiling utils fail when disable NLS with the --disable-nls switch.
"mkfs.c:46: error: 'LC_ALL' undeclared (first use in this function)"
It is due to a missing locale.h header : When enabling NLS, nls.h
includes libintl.h, which in turn includes locale.h. When disabling NLS,
libintl.h isn't anymore included nor locale.h, which is needed for the
setlocale() calls.
Signed-off-by: Gabriel Barazer <gabriel@oxeva.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
The "." command will search $PATH before $PWD if the argument
specified contains no path qualifiers which can cause problems if
you happen to have something in $PATH named the same. The
attached patch changes all of the ". <foo>" in the tests subdir.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
currently the code in fdisk which changes partition types is a bit fragile ...
it assumes the partition type succeeded instead of checking the user input or
for errors. ive tweaked the sub functions to return a value indicative of the
functions' success and fdisk now checks/reports based on that.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
It's better to use glibc SYS_ioprio_{set,get} definitions rather than an
incomplete (not all archs) and hardcoded version from ionice.c.
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch add arch(1) back to util-linux source code tree, but the
command is not installed by defautl.
For more details see "./configure --help".
The arch command is deprecated in favor of "uname -m" (coreutils). The
latest (6.9+) version of coreutils also supports arch(1) as an alias
to "uname -a". Please, if you need arch(1) use the coreutils
implementation.
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch allows to override the time() and define a different time by
TEST_TIME env. variable. The code has to be compiled with -DTEST_CAL.
Signed-off-by: Karel Zak <kzak@redhat.com>