Karel Zak [Mon, 31 May 2021 15:44:10 +0000 (17:44 +0200)]
build-sys: remove with-cryptsetup from tools/config-gen.d/all.conf
Unfortunately libtools is not smart enough to link libblkid
dynamically if we link in-tree static libmount.a for libmount tests.
In this case libtools always uses also libblkid.a, but it's problem
for libcryptsetup which requires versioned symbols from libblkid.so
This is no problem for normal binaries, but for libmount tests only
(where we need static library to by-pass public library API).
I'm working on building initramfs images directly from normal
packages, which means that the pristine system rpms should behave
correctly as much as possible also in the initrd. There usually isn't
enough time for the timer to actually fire, but starting it gives a
line on the console and generally looks confusing and sloppy. So let's
skip the timer if it ever ends up being enabled in the initrd.
Checking for /etc/initrd-release is the standard condition that
systemd's initrd units use.
Sami Kerola [Wed, 19 May 2021 19:23:48 +0000 (20:23 +0100)]
more: fix floating point exception core dump
Make the code avoid divided by zero. This can happen when file has content
but is zero in size. Such files can be found from procfs, possibly some
other pseudo-filesystems. To reproduce the issue run the following.
$ more /proc/crypto
...
Floating point exception (core dumped)
Karel Zak [Thu, 13 May 2021 08:34:14 +0000 (10:34 +0200)]
blkdiscard: do not probe for signatures on --force
The command-line option --force is defined as "disable all checks",
but the current code does not follow this idea. We need a way how to
disable read from the device (for example for dm-integrity devices).
Fixes: https://github.com/karelzak/util-linux/issues/1308 Signed-off-by: Karel Zak <kzak@redhat.com>
Johan Herland [Thu, 6 May 2021 22:53:29 +0000 (00:53 +0200)]
unshare: Fix error message when setting proc mount propagation
The mount() command associated with this error message is not about
unmounting the proc fs, but rather about changing the propagation
of mount events for the proc fs. Rewrite the error message to
reflect this.
Karel Zak [Thu, 6 May 2021 14:35:50 +0000 (16:35 +0200)]
lib/jsonwrt: don't use ctype.h for ASCII chars
tolower() does not work "as expected" for tr_TR.UTF-8 (Turkish).
Fortunately, we need to convert only objects and variables names in
JSON output, and this is always old good ASCII.
Karel Zak [Wed, 5 May 2021 11:35:30 +0000 (13:35 +0200)]
build-sys: keep adoc files in dist_noinst_DATA
* rename MANPAGES_EXTRA= to ADOCFILES_COMMON=
* keep track about individual adoc files by dist_noinst_DATA=
This variable is not effected by automake conditions, so the files
are always distributed.
Karel Zak [Fri, 30 Apr 2021 11:12:26 +0000 (13:12 +0200)]
Merge branch 'master' of https://github.com/arbego/util-linux
* 'master' of https://github.com/arbego/util-linux:
Fixed wrongful time_t=long assumptions in hwclock.c and timeutils.c
Changed int64_t casts to long long int casts
Fixed format strings and type casts in hwclock to work with 64-bit time_t on 32-bit linux
Karel Zak [Wed, 21 Apr 2021 17:55:27 +0000 (19:55 +0200)]
build-sys: add targets to generated translated man pages
* add --enable-poman (disabled by default)
* add po-man/Makefile.am for "make all" and "make install"
* install man pages to $mandir/$lang/man{1,3,5,8}
Karel Zak [Thu, 22 Apr 2021 13:23:27 +0000 (15:23 +0200)]
Merge branch 'topic/po4a' of https://github.com/mariobl/util-linux
* 'topic/po4a' of https://github.com/mariobl/util-linux:
mount.a.adoc: Fix markup
Asciidoc: Add missing macro definition in uclampset.1
Asciidoc: Fix markup in example man page
Asciidoc: Fix markup
Asciidoc: Remove artifact from merge conflict
Asciidoc: Convert man-common/README to Markdown
po-man: Fix the example man page
po-man: Fix typos in po-man/README.md
po-man: Update the example man page
po-man: Add po-man/README.md
po-man: Add (incomplete) de.po for testing purposes
po-man: Add (incomplete) de.po for testing purposes
po-man: Adjust paths in po4a.cfg and update .pot file
po-man: Move Po4a config file and translation template to po-man
Karel Zak [Tue, 20 Apr 2021 11:20:12 +0000 (13:20 +0200)]
lib/loopdev: fix is_loopdev() to be usable with partitions
The current implementation of the function does not care if the device
is whole-disk device or partition, all is loopdev. This is regression
as the original is_loopdev() version was based on whole-disk devices
major numbers only.
Fixes: https://github.com/karelzak/util-linux/issues/1202 Signed-off-by: Karel Zak <kzak@redhat.com>
swapon: Keep headings and fields aligned in summary output.
Because the headings are aligned with tabs the fields must
always be a multiple of 8 characters. Moreover if the field
values are shorter than 8 characters, extra tabs must be
inserted before the succeding field to keep alignment.
swapon parses /proc/swaps, generated by the Linux kernel in
mm/swapfile.c. Its function swap_show() and its recent fix in
commit 6f7939405f61de7d0da7f6c90182e96c4f5ff6c1 were used as
inspiration for this commit.
Additionally inform the translators about the requirements of
formatting and relationship between the heading and entry strings.
libfdisk: Include table-length in first-lba checks
Otherwise, sfdisk would error out on its own dump, as first-lba would be
earlier than "plausible" assuming the default table size.
This is because it did not look for `table-length` when using an sfdisk
script. This means that using `--dump` on a valid image, could not be
unserialized back into a valid image.
This is helpful in exotic situations, where a partition has to be
created earlier than the conventional "first-lba" (2048). For example,
on Allwinner A64 boards, where a firmware is stored at LBA16. With this
it is possible to ask for `first-lba` at or earlier than 16, by reducing
the number of entries to e.g. 48.
Karel Zak [Thu, 15 Apr 2021 13:11:44 +0000 (15:11 +0200)]
libfdisk: use open(O_EXCL) to detect if device is used
It's seems detection by BLKRRPART is broken in recent kernels
(probably regression), and it's also overkill to force kernel re-read
all and generate all the events. It seems more elegant to use O_EXCL.