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).
Signed-off-by: Karel Zak <kzak@redhat.com>
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.
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)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
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.
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.
Anyway, for more details:
$ cat a.c
#include <ctype.h>
#include <stdio.h>
#include <locale.h>
int main(void)
{
int in, out;
setlocale(LC_ALL, "");
in ='I';
out = tolower(in);
printf("%1$c [%1$d] --> %2$c [%2$d]\n", in, out);
return 0;
}
$ make a
cc a.c -o a
$ LANG=en_US.utf8 ./a
I [73] --> i [105]
$ LANG=tr_TR.UTF-8 ./a
I [73] --> I [73]
Fixes: https://github.com/karelzak/util-linux/issues/1302
Signed-off-by: Karel Zak <kzak@redhat.com>
The code should be able to keep track about previous content and print
JSON objects separator automatically.
Signed-off-by: Karel Zak <kzak@redhat.com>
* `RFKILL_EVENT_SIZE_V1` is defined as sizeof(struct rfkill_event), so let's use %zu
* cast `len` to size_t to make it usable with %zu
Signed-off-by: Karel Zak <kzak@redhat.com>