For example for hierarchy:
$ findmnt -oTARGET,ID,PARENT
TARGET ID PARENT
/mnt/A 802 62
└─/mnt/A/B 937 802
├─/mnt/A/B/C 964 937
│ └─/mnt/A/B/C 991 964
└─/mnt/A/B 1018 937
└─/mnt/A/B 1045 1018
we need umount in order (id): 1045, 1018, 991, 964, 937, 802. The current
code first tries 991 in 937 branch.
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
The whole thing is complicated by the fact that we have two layers
of libraries: e.g. libmount also needs libblkid. If we just tell meson
to make libmount static, this is not enough, because we also need it
to link to a static libblkid. Hence in the case of libs that link to
other libs internally, we need to create a different object with a
a different set of link_with items.
To avoid building the libraries twice, libfdisk and libmount are first
built into an internal "convenience" library, which is then linked into
the static and shared versions as appropriate.
To build: meson build && ninja -C build
To run tests: ninja -C build check
To install for packaging: DESTDIR=/var/tmp/inst ninja -C build install
To install for realz: sudo ninja -C build install
v2:
- Optional items are now based on the 'feature' feature in meson.
Built libraries which are disabled turn into disabler() objects
and also poison any executables which link to them.
What is there:
- building of the binaries and libs and the python module
- installation of binaries, libs, python module, localization files,
man pages, pkgconfig files
- running of tests
- most options to configure build equivalently to the
./configure settings
Partially implemented:
- disabling of stuff when things missing. In the C code, the defines
are all used, so that should be fine. In the build system, some
files should be skipped, but that is probably not always done properly.
Getting this right might require some testing of various build option
combinations to get the details right.
Not implemented:
- static builds of fdisk and other binaries
- things marked with XXX or FIXME
- ???
Differences:
- .la files are not created. They are useless and everybody hates them.
- Requires.private in pkgconfig files are not present in the
autogenerated .pc file. Not sure if they should be there or not. If
necessary, they can be added by hand.
- man pages and systemd units are installed by the install target. Not
sure why 'make install' doesn't do that.
- the split between / and /usr is probably wrong. But it's all pointless
anyway, so maybe we could simplify things but not implementing it at
all under meson?
The test would occasionally fail with
tests/run.sh: line 241: /home/fedora/util-linux/build/tests/failures: No such file or directory
I don't quite understand why the file does not get created... The outupt directory
missing seems the most likely explanation.
Update as usually before release to see differences (on Fedora 33).
- static programs are not enabled by tools/config-gen.d/all.conf
anymore (see 63f4e19928)
- add new uclampset
- libdl and libpython3 seems unnecessary
- fdformat disabled by default
- new hardlink uses libpcre2-posix
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'extra_ltlibraries' of https://github.com/bluca/util-linux:
Automake: install uuidgen bash completion only if it is built
Automake: use EXTRA_LTLIBRARIES instead of noinst_LTLIBRARIES
noinst_LTLIBRARIES causes the libraries to be always built
unconditionally. EXTRA_LTLIBRARIES causes them to be built
only if other build target needs them.
In other words, avoid building libcommon.a and libtcolors.a
unless they are needed by another library/executable and
save some build time.
https://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html
The following usages of utmpdump result in no output being flushed to the specified file because the default output buffering is fully buffered:
$ utmpdump --follow --output myOutputFile /var/log/utmp
$ utmpdump --follow /var/log/utmp > myOutputFile
This change configures line buffering for these scenarios so that output will be flushed after each log event.
Signed-off-by: Andrew Shapiro <anshapiro@gmail.com>
The function read_buffer() implements read and clear functionally, but
we do not differentiate between these actions in main() for error
messages, and one generic "dmesg: read kernel buffer failed" is used
in all cases. That's a bug.
This patch removes the "clear" action from read_buffer() and keeps it
for buffer reading only. The "clear" action is implemented in main()
by separate klogctl(SYSLOG_ACTION_CLEAR) for cases. It means also for
"dmesg --read-clear"; we do not use SYSLOG_ACTION_READ_CLEAR anymore.
Now "clear+read" is:
* syslog: SYSLOG_ACTION_READ_ALL + SYSLOG_ACTION_CLEAR
* kmsg: /dev/kmsg read() + SYSLOG_ACTION_CLEAR
In old versions "dmesg --syslog --read-clear" (syalog backed) was
implemented by logctl(SYSLOG_ACTION_READ_CLEAR) and it returns no
data for non-root users (due to EPERM), "dmesg --read-clear" (kmsg)
returns data and EPERM for the "clear" action.
Now the command "dmesg --syslog --read-clear" and "dmesg --read-clear"
behaves in the same way -- returns data and EPERM for the "clear"
action.
Fixes: https://github.com/karelzak/util-linux/issues/1255
Signed-off-by: Karel Zak <kzak@redhat.com>