Commit Graph

15380 Commits

Author SHA1 Message Date
Karel Zak ec98fc6b1a meson: port localstatedir and sysconfdir
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 15:07:27 +01:00
Karel Zak 308a097968 meson: update sources and dependencies
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 15:07:27 +01:00
Karel Zak 6e92db54cf meson: update configuration
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 15:07:27 +01:00
Zbigniew Jędrzejewski-Szmek 69939195bd meson: implement building of static programs
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.
2021-03-17 15:07:27 +01:00
Zbigniew Jędrzejewski-Szmek d4c880d5a4 meson: add second build system
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?
2021-03-17 15:07:27 +01:00
Zbigniew Jędrzejewski-Szmek 9fb5486c27 tests/run: create failure directory
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.
2021-03-17 15:07:27 +01:00
Karel Zak d246854aa8 tests: update build test results
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>
2021-03-17 14:58:26 +01:00
Karel Zak e86e30b89c tools: use libcryptsetup in config-gen.d/all.conf
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 12:45:40 +01:00
Mario Blättermann 4251413a14 Asciidoc: add missing bugreports section to libblkid and some cleanup 2021-03-16 21:17:50 +01:00
Mario Blättermann 47a2685b44 Asciidoc: Remove already imported disk-utils *roff man pages 2021-03-16 21:13:57 +01:00
Mario Blättermann c6a568fccb Asciidoc: Import disk-utils man pages 2021-03-16 21:08:43 +01:00
Mario Blättermann ef63c72a33 Asciidoc: Fix man pages with variables to use the same value as in previous *.in files 2021-03-16 19:41:23 +01:00
Mario Blättermann b366e6fc6b Asciidoc: Remove already imported *roff man pages 2021-03-16 19:35:37 +01:00
Mario Blättermann 34455501de Asciidoc: Adapt Makefiles to new asciidoc man pages 2021-03-16 19:34:59 +01:00
Łukasz Stelmach c8650db343 hwclock: fix indentation
Fixes: 042f62dfc ("[clang-tidy] do not use else after return")
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
2021-03-16 14:23:48 +01:00
Karel Zak 075e9f9cbd build-sys: add EXTRA_LTLIBRARIES beween CLEANFILES
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-16 12:32:21 +01:00
Karel Zak f823700f61 pylibmount: PyEval_Call* is deprecate, use PyObject_Call*
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-15 16:37:47 +01:00
Karel Zak ff3a3c3c49 Merge branch 'extra_ltlibraries' of https://github.com/bluca/util-linux
* '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
2021-03-15 16:22:20 +01:00
Karel Zak ef7e258b3d libsmratcols: print title color only when wanted
Reference: 676fb001d6.
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-15 16:19:23 +01:00
Luca Boccassi e18f057b56 Automake: install uuidgen bash completion only if it is built
Check for BUILD_UUIDGEN instead of BUILD_LIBUUID
2021-03-15 12:26:27 +00:00
Luca Boccassi c65953d72b 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
2021-03-15 12:17:31 +00:00
Mario Blättermann 056fc17478 Asciidoc: Import libuuid man pages 2021-03-14 14:29:44 +01:00
Mario Blättermann 6cac37e3c1 Asciidoc: Import term-utils man pages 2021-03-14 10:48:27 +01:00
Mario Blättermann 84851dc21f Asciidoc: Import hwclock.8.in 2021-03-14 08:58:13 +01:00
Mario Blättermann fd8c150483 Asciidoc: Import rtcwake.8.in 2021-03-13 22:55:02 +01:00
Mario Blättermann b9d2ddfbb1 Asciidoc: Import sys-utils man pages, part 3 2021-03-13 22:33:34 +01:00
Mario Blättermann a09649ca89 Asciidoc: Use correct ':man manual:' for man pages from section 8 2021-03-13 12:49:26 +01:00
Mario Blättermann 1417968285 Asciidoc: Import sys-utils man pages, part 2 2021-03-13 12:22:34 +01:00
Mario Blättermann 6d5b69483a Asciidoc: Import sys-utils man pages, part 1 2021-03-12 21:10:37 +01:00
Karel Zak 676fb001d6 libsmartcols: fix colors use
* use color for all cell
* always switch back to line color

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-12 16:15:16 +01:00
Mario Blättermann aad107b6d7 Asciidoc: Import textutils man pages 2021-03-12 14:16:26 +01:00
Mario Blättermann 1b73028b89 libblikid.3.adoc: Add missing SYNOPSIS section 2021-03-12 13:34:59 +01:00
Karel Zak b09ed927d7 tests: update mountpoint return code chack
This is necessary due to e0ecd19641.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-12 11:39:23 +01:00
Karel Zak 4e9be5a439 findmnt: (man) add more info about --target
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-12 11:00:56 +01:00
Mario Blättermann da67bcf938 Remove no longer valid part of man/common/README 2021-03-11 18:48:13 +01:00
Mario Blättermann e2db4d9410 Add asciidoc man pages and some include files 2021-03-11 18:38:46 +01:00
Karel Zak 70a7b61a84 tests: update mountpoint tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-11 10:52:11 +01:00
Karel Zak e0ecd19641 mountpoint: different exit status for errors and non-mountpoint situation
Fixes: https://github.com/karelzak/util-linux/issues/1260
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-11 10:48:36 +01:00
Karel Zak 6b6dbcbae6 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-10 16:15:30 +01:00
Karel Zak c173ba11ec libsmartcols: add comments to private header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-10 11:30:53 +01:00
Karel Zak 2b1322f478 docs: update TODO
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-10 10:21:57 +01:00
Karel Zak b4f6006209 lscpu: use size_t for ncolumns
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-09 15:55:33 +01:00
Karel Zak 1242c3fde7 lscpu: support +list for -e, -p and -C
For example "lscpu -e=+MHZ" to list the default columns and MHZ. We
use the same in other tools.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-09 10:37:36 +01:00
Karel Zak 0b83e26373 lscpu: add info that caches sizes are sum
Addresses: https://github.com/karelzak/util-linux/issues/1258
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-08 11:25:15 +01:00
Karel Zak 347332796f fdisk: (man) add info about order for -l
Reported-by: Dan Jacobson <jidanni@jidanni.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-08 10:56:47 +01:00
Karel Zak 81329c8d1c hwclock: use pointer to adjtime data
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-04 11:27:47 +01:00
Andrew Shapiro f3a7b057ac utmpdup: Ensure flushing when using follow flag
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>
2021-03-02 10:49:53 +01:00
Karel Zak 50cc633257 dmesg: fix and cleanup --read-clear
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>
2021-03-01 16:50:20 +01:00
Karel Zak 66134b5c2b lsblk: update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-01 14:51:28 +01:00
Karel Zak 7de3b2ce59 Merge branch 'master' of https://github.com/adigitoleo/util-linux 2021-03-01 14:46:50 +01:00