Commit Graph

15325 Commits

Author SHA1 Message Date
Karel Zak e37babc0ec lsirq: fix resources leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 12:13:00 +01:00
Karel Zak 645577c755 meson: add irq utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 12:12:11 +01:00
Karel Zak a887d587bf fstrim: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 11:53:02 +01:00
Karel Zak 903f812d0b libmount: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 11:03:03 +01:00
Karel Zak 23b9caa1fc libmount: add assert() to umount lookup code
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 10:51:54 +01:00
Karel Zak fe7ef272d0 libfdisk: make labels allocations readable for analysers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 10:43:20 +01:00
Karel Zak 8207f99b7a sfdisk: fix resources leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-25 10:25:12 +01:00
Mario Blättermann d9a67eb510 Add missing backslash to Makefile.am 2021-03-24 20:28:08 +01:00
Mario Blättermann 62fde24f47 Asciidoc: Review login-utils man pages 2021-03-24 20:01:34 +01:00
Mario Blättermann 299604dd0b Asciidoc: Review disk-utils man pages 2021-03-24 18:53:27 +01:00
Mario Blättermann ea81716d0c Asciidoc: Review terminal-colors.d.5.adoc 2021-03-24 17:37:34 +01:00
Karel Zak 1630e65371 Merge branch 'topic/rfkill' 2021-03-24 12:54:41 +01:00
Karel Zak 529b51706e libsmartcols: introduce default sort column
* add default sort column, set by scols_sort_table()

* sort tree according to default sort column also in scols_sort_table_by_tree()

The function scols_sort_table() does not sort tree branches if tree
is not enabled. The function scols_sort_table_by_tree() does not care
if tree is enabled and it always follows parent->child relations. For
scols_sort_table_by_tree() we need to follow order in branches if
previously scols_sort_table() has been called.

For example lsblk calls

	scols_sort_table(tb, cl);
	scols_sort_table_by_tree(tb);

for list-like output (for example lsblk -P) and users assume the
same order as for tree (lsblk --tree).

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1940607
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-24 12:43:17 +01:00
Karel Zak c59d442809 libsmartcols: add sort sunction to the sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-24 12:42:58 +01:00
Mario Blättermann fc394b5b02 Define the asciidoctor command in configure.ac 2021-03-23 21:09:22 +01:00
Mario Blättermann 5a52459e0f Asciidoc: Review schedutils man pages 2021-03-23 20:43:52 +01:00
Mario Blättermann 925a9b5d72 Asciidoc: Incorporate latest change in findmnt.8 2021-03-23 20:10:02 +01:00
Mario Blättermann 2c646c80d8 Asciidoc: Review misc-utils man pages 2021-03-23 20:07:15 +01:00
Karel Zak 20fae1bde2 rfkill: add "toggle" command
Addresses: https://github.com/karelzak/util-linux/issues/1269
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-23 15:20:44 +01:00
Karel Zak d928b9afe2 tests: make it compatible with meson
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-22 15:15:52 +01:00
Karel Zak 3ab4ef3ca9 findmnt: add --shadowed
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-22 15:00:47 +01:00
Karel Zak 1c81dfff1a libmount: mnt_table_over_fs() make child optional
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-22 15:00:47 +01:00
Karel Zak 667c87c50c findmnt: sort columns
Let's make "Available columns" in --help more readable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-22 15:00:38 +01:00
Karel Zak e2f6c9eaa2 umount: support over-mounts for --recursive
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>
2021-03-22 11:29:28 +01:00
Karel Zak a605568281 libmount: add mnt_table_over_fs()
The function returns the first over-mount for specified filesystem.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-22 11:24:49 +01:00
Mario Blättermann f37298c2c2 Asciidoc: Yet another formatting fix 2021-03-21 18:24:47 +01:00
Mario Blättermann 99157f44da Asciidoc: Formatting cleanup 2021-03-21 13:02:56 +01:00
Mario Blättermann 78fec3e5ba Asciidoc: Remove already imported text-utils *roff man pages 2021-03-21 12:50:16 +01:00
Mario Blättermann f42ed8190c Asciidoc: Unify spelling of »User Commands« 2021-03-21 10:00:16 +01:00
Mario Blättermann 295b3979d9 Asciidoc: Add Po4a hint to file headers 2021-03-20 16:42:47 +01:00
Mario Blättermann b4e57a8a90 Asciidoc: Small fix in nsenter.1.adoc 2021-03-20 15:23:32 +01:00
Mario Blättermann 5723eae791 Asciidoc: Some more man page formatting improvements
Besides some formatting tweaks, I've changed »lsblk(1)« into »lsblk(8)«
in the SEE ALSO section of mount.8.adoc. At least Archlinux and Debian
ship lsblk as a system administration command.
2021-03-20 09:45:23 +01:00
Mario Blättermann d315cc4d96 Asciidoc: Re-add empty lines to man pages 2021-03-19 20:52:00 +01:00
Mario Blättermann 4d29743519 Asciidoc: Some formatting cleanup in man pages 2021-03-19 18:25:50 +01:00
Mario Blättermann d7f0a0dfff Asciidoc: Remove already imported misc-utils *roff man pages 2021-03-19 17:16:40 +01:00
Mario Blättermann 6c64d12d13 Asciidoc: Import misc-utils man pages 2021-03-19 17:12:57 +01:00
Karel Zak 7f8b777407 findmnt: add PARENT column
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-19 16:39:27 +01:00
Karel Zak 93737ad351 libfdisk: (gpt) returns location of the backup header too
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-19 14:54:34 +01:00
Karel Zak 1ad8db5521 prlimit: fix optional arguments parsing
$ prlimit -f=100:100
 failed to parse FSIZE limit

Fixes: https://github.com/karelzak/util-linux/issues/1265
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-18 10:23:36 +01:00
Hannes Müller e899168a1d more: fix ARROW_DOWN and PAGE_DOWN behaviour to not skip lines
Currently ARROW_DOWN and PAGE_DOWN is bound to command 's' (skip lines).
But this behaviour is not what the user expects, since at least one line
is always missing! Furthermore at the end of the file there is typically
this skipping lines message, if the remainder does not fit in a
complete screen. This conflicts also with e.g. less and man PAGE_DOWN
behaviour. The 'natural' behaviour is binding to
more_kc_jump_lines_per_screen.
If more is extended to also jump only a specific number of lines forward,
this would be even a better binding for ARROW_DOWN.
2021-03-17 20:42:11 +01:00
Hannes Müller 9f303a2bf4 more: fix command 'f' (screen forward) behaviour
Currently 'f' behaves like 's', which is not correct according to
man page.
Bug was introduced with 1f861935a7
2021-03-17 20:39:31 +01:00
Mario Blättermann a48b5068a7 Asciidoc: Remove already imported login-utils *roff man pages 2021-03-17 20:00:15 +01:00
Mario Blättermann a7574d8878 Asciidoc: Import login-utils man pages 2021-03-17 19:57:15 +01:00
Karel Zak 6e13cfed58 meson: add missing HAVE_ definitions
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 15:52:08 +01:00
Karel Zak bdaed0cde4 meson: update for new hardlink
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 15:42:26 +01:00
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