Karel Zak [Wed, 28 Jan 2015 07:30:17 +0000 (08:30 +0100)]
Merge branch 'fix-tests-ppc' of https://github.com/rudimeier/util-linux
* 'fix-tests-ppc' of https://github.com/rudimeier/util-linux:
tests: fix fdisk/bsd again for big endian
tests: fix swaplabel test for 9a83b03c
Revert "tests: simplify and update swaplabel test"
Sami Kerola [Tue, 27 Jan 2015 22:28:57 +0000 (22:28 +0000)]
more: fix repeat search crash
Repeating a search for a pattern that did not found made more(1) to
crash. To reproduce 'more /etc/services' and search for 'doom'; you will
find a service in port 666 - pressing '.' after that result used to cause
core dump.
Karel Zak [Tue, 27 Jan 2015 11:58:19 +0000 (12:58 +0100)]
libblkid: improve MBR vs. FAT + boot sector detection
It seems that some systems are able to produce boot sector + MBR with
almost valid FAT superblock. The libblkid already checks for FAT magic
string, media, correct sector and dir size, etc. -- but all this is
not enough.
The patch add to FAT prober also MBR detection to make sure that there
is no MBR with usable first partition. All this is enabled for
whole-disk devices only.
Ruediger Meier [Mon, 26 Jan 2015 13:14:07 +0000 (14:14 +0100)]
Revert "tests: simplify and update swaplabel test"
After mkswap refactoring we have still a "minimal swap size"
wich depend on PAGE_SIZE. Next commit will fix the test for
output changes made in 9a83b03c.
cfdisk: shorten the help screen to make it fit within 25 lines
When the terminal has less than 32 lines, the new cfdisk ignored the
fact that the help-screen text was longer and just skipped printing
the remaining lines. Instead of introducing a minipager for the help
screen, just condense its text and remove unneeded lines. Now the
text occupies just 25 lines, which should fit on most terminals.
cfdisk: don't mess up the help screen by printing the PO file header
Asking for the translation of the empty string ("") produces the header
of the PO file corresponding to the current locale, which messes up the
help screen. So, don't use empty strings in the array of help strings
but (arbitrary) double spaces.
Ingo Brückl [Wed, 14 Jan 2015 18:36:55 +0000 (19:36 +0100)]
dmesg: Enable proper indent for messages containing line breaks
Messages containing line breaks somehow look broken when additional time,
facility or level information is displayed, because they partly appear in
time/facility/level column.
Ruediger Meier [Tue, 20 Jan 2015 14:49:21 +0000 (15:49 +0100)]
build: fix printf warnings for icc (-Wformat-security)
Intel compiler complains about printf style function calls with trivial
format string and no other arguments. Like this one:
../sys-utils/ipcrm.c(117): warning #2279: printf/scanf format not a string literal and no format arguments
err(EXIT_FAILURE, iskey ? _("key failed") : _("id failed"));
Ruediger Meier [Tue, 20 Jan 2015 11:22:35 +0000 (12:22 +0100)]
tests: python tests should not remove user's LD_LIBRARY_PATH
LD_LIBRARY_PATH must be preserved like it's done in libtool's
temporary wrapper scripts.
This problem was noticed when building with Intel's icc (15.0.0):
$ make check TS_OPTS="libmount"
$ tail tests/diff/libmount/tabfiles-py-parse-mtab
[...]
+Traceback (most recent call last):
+ File "/tmp/util-linux/libmount/python/test_mount_tab.py", line 8, in <module>
+ import pylibmount as mnt
+ImportError: libimf.so: cannot open shared object file: No such file or directory
... although libimf.so was in LD_LIBRARY_PATH.
NOTE 1:
When running root checks "sudo -E" is not enough to preserve
LD_LIBRARY_PATH because glibc already removes is. This would work:
$ sudo -E env LD_LIBRARY_PATH=$LD_LIBRARY_PATH make check TS_OPTS="--parallel=1"
NOTE 2:
We also preserve PYTHONPATH which could bring us similar problems if
the user has a customized python installation.
Karel Zak [Fri, 16 Jan 2015 11:24:57 +0000 (12:24 +0100)]
libmount: revert "read mtab on remount" idea
It's backwardly incompatible nonsense to prefer mtab on remount.
mount -o remount /foo
has to read mount options from fstab otherwise the remount has no
effect. (The ideal solution would be to read both mtab, then modify
the options according to fstab -- but for now more important is to be
backwardly compatible.)
References: https://bugzilla.redhat.com/show_bug.cgi?id=1182778 Signed-off-by: Karel Zak <kzak@redhat.com>
The old behavior when hwclock was unable to access
the rtc device was to fallback to direct ISA I/O.
This was sometimes allowing two processes to access
the Hardware Clock at the same time and hanging the
system. This is the reason the rtc device driver
only allows one process to open it.
Now hwclock defaults to using the rtc device and only
uses direct ISA when that option is given.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Karel Zak [Mon, 12 Jan 2015 11:19:54 +0000 (12:19 +0100)]
setarch: cleanup options usage
* call --help, --verbose and --list from one place only
* add 'archwrapper' variable to detect when called by symplink
* make --list available only got setchar(8) (but no for symlinks)
Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
setarch: differentiate between "unrecognized" and "cannot set"
When the provided string does not match any architecture that
setarch knows about, the response stays "Unrecognized architecture",
but when trying to set the specified architecture does not have any
effect, then respond with "Kernel cannot set architecture to...".
Karel Zak [Fri, 9 Jan 2015 12:05:49 +0000 (13:05 +0100)]
libfdisk: (gpt) cleanup header size usage
Kay reported that Windows 8.1 installed does not recognize GPT created
by libfdisk, but parted works as expected.
It seems (according to the header hexdump) that the problem is
HeaderSize GPT field where libfdisk uses 512 (header + reserved area),
but parted uses 92. The both is pretty valid according to the current
EFI standard, but 92 is probably more backwardly compatible.
I also found places in code where libfdisk gpt driver is inconsistent
and uses sometimes all sector and simetimes sizeof(gpt_header) only.
The right solution is to read all sector (into zeroized memory) and
later write again all sector to the device.
Reported-by: Kay Sievers <kay@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Fri, 9 Jan 2015 09:54:56 +0000 (10:54 +0100)]
Merge branch 'master' of https://github.com/pali/util-linux
* 'master' of https://github.com/pali/util-linux:
tests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.7)
tests: Add UDF hdd image created by NetBSD newfs_udf (from UDFclient 0.7.5)
tests: Add UDF hdd image created by Linux mkudffs with custom params
tests: Add UDF hdd image created by Linux mkudffs
tests: Add UDF hdd image created by Windows 7