Commit Graph

15030 Commits

Author SHA1 Message Date
Qais Yousef f59654bb06 uclampset: Plump into the build system
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef 9dd95bea42 uclampset: Add man page
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef 5407f89782 Add uclampset schedutil
Utilization clamping is a new kernel feature that got merged in 5.3. It
allows controlling the performance of a process by manipulating the
utilization such that the task appears bigger or smaller than what it
really is.

There's a system-wide control to to restrict what maximum values the
process are allowed to use.

Man page added in a later patch attempts to explain the usage in more
detail.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef ee3f4a3dfc Move sched_attr struct and syscall definitions into header file
So that we can re-use them in other files.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-01-30 17:13:17 +00:00
Roberto Bergantinos Corpas ff21f476f8 findmnt: add option to list all fs-independent flags
It might be useful for security auditing purposes list all possible
mount flags/options including default set which are normally not listed.

This patch adds "--vfs-all" option to list all fs-independent flags
on VFS-OPTIONS column, as well as libmount funcionality to accomplish
it.

i.e.:

$ findmnt -o VFS-OPTIONS
VFS-OPTIONS
rw,relatime
rw,nosuid,nodev,noexec,relatime
rw,nosuid,nodev,noexec,relatime
ro,nosuid,nodev,noexec
...

$ findmnt --vfs-all -o VFS-OPTIONS
VFS-OPTIONS
rw,exec,suid,dev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
rw,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
rw,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,relatime,nostrictatime,nolazytime,symfollow
ro,noexec,nosuid,nodev,async,loud,nomand,atime,noiversion,diratime,norelatime,nostrictatime,nolazytime,symfollow
...

[kzak@redhat.com: - cleanup coding style and comments]

Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-15 17:51:07 +01:00
Karel Zak 372ce5b74e libmount: do not canonicalize ZFS source dataset
Fixes: https://github.com/karelzak/util-linux/issues/1231
Addresses: https://github.com/systemd/systemd/issues/18188
Addresses: https://github.com/openzfs/zfs/pull/11295
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-14 13:45:20 +01:00
Karel Zak 0735d0efe1 lib/selinux-utils: tiny cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 15:04:02 +01:00
Karel Zak b105446e69 mkswap: remove deprecated SELinux matchpathcon()
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 14:58:43 +01:00
Karel Zak e1de70b3c3 chfs-chfn: remove deprecated selinux_check_passwd_access()
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 14:27:15 +01:00
Karel Zak b5debf7105 lib/selinux-utils: cleanup function names
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 13:33:41 +01:00
Karel Zak 68f4aa2a2f build-sys: move selinux_utils.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 13:30:31 +01:00
Karel Zak ca27216aa6 build-sys: remove fallback for security_context_t
It seems like overkill to provide this #ifdef. For example coreutils
use "char *" for all selinux contexts (since 2014).

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 13:12:19 +01:00
Karel Zak 3d725afab4 libblkid: fix comment block
The command block with /** triggers gtkdoc; don't use it for regular
comments.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 11:00:34 +01:00
Karel Zak 4301ba768a Merge branch 'autoconf-2.70' of https://github.com/kerolasa/util-linux
* 'autoconf-2.70' of https://github.com/kerolasa/util-linux:
  build-sys: silence non-POSIX variable name warning
  build-sys: update to autoconf 2.70
2021-01-12 11:53:36 +01:00
Karel Zak fbc2fe824d lib/loopdev: make is_loopdev() more robust
It seems the current kernel can create a loop devices with a different
major number. For example

  # losetup /dev/loop12345678 file.img
  # lsblk /dev/loop12345678
  NAME          MAJ:MIN    RM SIZE RO TYPE MOUNTPOINT
  loop12345678   15:811342  0   5M  0 loop

We need a way how to verify the device is loopdev also when the device is
not associated with any backing file -- in this case there is no "loop"
directory in /sys/dev/block/<maj:min>/, but we can cannonicalize this sysfs
symlink as it points to /sys/devices/virtual/block/loop<n> (see "loop" in
the path).

Note that without this change losetup is not able to list and delete
the loop device.

Addresses: https://github.com/karelzak/util-linux/issues/1202
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-12 11:43:31 +01:00
Sami Kerola a527a36019
build-sys: silence non-POSIX variable name warning
Easiest way to get rid of the following warning is to ignore the warning.
This might cause people who use non-GNU make to have hard time, but are
there such people compiling this project?

sys-utils/Makemodule.am:226: warning: addprefix sys-utils/,$(SETARCH_LINKS: non-POSIX variable name
sys-utils/Makemodule.am:226: (probably a GNU make extension)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2021-01-11 16:29:57 +00:00
Sami Kerola 4230b2d47a
build-sys: update to autoconf 2.70
Reference: https://lwn.net/Articles/839395/
Reviewed-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2021-01-11 16:29:56 +00:00
Karel Zak a7d5efbb9a libblkid: make gfs2 prober more extendible
The current GFS2 prober hard codes superblock constants, but these
constants are affected by GFS2 development.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1913844
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-11 11:58:16 +01:00
Karel Zak 3c9d13da63 lsblk: use MOUNTTARGETS in default output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-11 10:46:16 +01:00
Gaël PORTAY ecdfb2b767 libfdisk: (script) ignore empty values for start and size
Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
2021-01-09 05:23:41 -05:00
Karel Zak 62df539554 lsblk: use MOUNTPOINTS in --fs
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-08 13:45:14 +01:00
Karel Zak 37da403d57 lsblk: add FSROOTS column
It displays filesystem root attached to system, for example
btrfs with two mounted subvolumes:

	$ lsblk -oNAME,SIZE,MOUNTPOINTS,FSROOTS /dev/sdc1
	NAME SIZE MOUNTPOINTS FSROOTS
	sdc1  50M /mnt/A      /foo
		  /mnt/B      /bar

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-08 13:33:30 +01:00
Karel Zak c6648d2db1 lsblk: print all device mountpoints
* add libmount FS to struct lsblk_device

* add new column MOUNTPOINTS (pl.) with multi-line cells to display
  all mountpoints relevant for the device

* the old MOUNTPOINT is backwardly compatible and it (usually) displays the
  last device mountpoint from /proc/self/mountinfo

For example btrfs with more subvolumes:

 $ lsblk -o+MOUNTPOINTS /dev/sdc1
 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT MOUNTPOINTS
 sdc1   8:33   0  50M  0 part /mnt/test  /mnt/A
                                         /mnt/test
                                         /mnt/B

Note, in this case MOUNTPOINT displays mount point where is mounted
root of the filesystem.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-08 13:20:50 +01:00
Karel Zak 3c7355dd63 libsmartcols: support arrays for JSON output
This patch add support to format multi-line cells (columns with
SCOLS_FL_WRAP) to arrays in JSON output.

For example mountpoints[] in lsblk output:

Normal output:
	 $ lsblk -oNAME,FSTYPE,TYPE,MOUNTPOINTS /dev/sdc1
	 NAME FSTYPE TYPE MOUNTPOINTS
	 sdc1 btrfs  part /mnt/A
			  /mnt/test
			  /mnt/B

JSON output:
	$ lsblk -J -oNAME,FSTYPE,TYPE,MOUNTPOINTS /dev/sdc1
	{
	   "blockdevices": [
	      {
		 "name": "sdc1",
		 "fstype": "btrfs",
		 "type": "part",
		 "mountpoints": [
		     "/mnt/A",
		     "/mnt/test",
		     "/mnt/B"
		 ]
	      }
	   ]
	}

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-08 13:12:57 +01:00
Karel Zak f19295ad12 libmount: mark entries from /proc/swaps by MNT_FS_SWAP
The function mnt_fs_is_swaparea() does not return TRUE for entries
from /proc/swaps. This is pretty strange.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-08 12:00:59 +01:00
Karel Zak e7091237db Merge branch 'getopt-musl' of https://github.com/sgn/util-linux
* 'getopt-musl' of https://github.com/sgn/util-linux:
  getopt: explicitly ask for POSIX mode on POSIXLY_CORRECT
2021-01-07 12:09:57 +01:00
Karel Zak 79acb5bf1e docs: update TODO (add item about mnt_context_get_excode() )
- add item about https://github.com/karelzak/util-linux/issues/1208
- remove old CAP_SYS_ADMIN note (in last versions mount(8) drops suid if
  necessary).

Addresses: https://github.com/karelzak/util-linux/issues/1208
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-06 15:17:19 +01:00
Đoàn Trần Công Danh 27fd7278a1 getopt: explicitly ask for POSIX mode on POSIXLY_CORRECT
GNU libc's getopt_long(3) have the tradition of not shuffling arguments
to find options when either POSIXLY_CORRECT is defined in environment
variables or '+' prepended in short options. Hence, the current code
base is fine as is fine as is for util-linux built with GNU libc.

However, musl libc only honour POSIX convention when short options
prepended with '+'. musl libc doesn't care about POSIXLY_CORRECT.
Thus, the behaviour of util-linux's getopt(1) that linked with musl-libc
doesn't match with its own documentation.

Let's make sure a '+' is always prepended to short options if
POSIXLY_CORRECT is defined.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2021-01-06 20:57:57 +07:00
Karel Zak 215ff3ba6f docs: update TODO file (add item about libblkid ZFS)
Addresses: https://github.com/karelzak/util-linux/issues/1228
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-06 12:45:18 +01:00
Karel Zak 183ad4a7b1 Revert "fallocate: (man) add hint about off/len limitations"
This reverts commit b2db5a71b5.

We already have this note in the man page. Don't duplicate it.
2021-01-06 12:05:50 +01:00
Karel Zak 1161323b5a tests: update swaplabel.err
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-06 11:13:15 +01:00
Karel Zak 4b447adf50 Merge branch '2020wk47' of https://github.com/kerolasa/util-linux
* '2020wk47' of https://github.com/kerolasa/util-linux:
  build-sys: sort various lists in configure.ac
  mkswap: tell how to fix insecure permissions and owner in warning
  lsipc: make default output byte sizes to be in human units
  man: add missing backslash to caret printing macro
  lscpu: fix variable shadowing
  uuidgen: give hint in usage() what uuid namepaces can be used
  uuidgen: use errx() rather than fprintf() when priting errors
  libuuid: simplify uuid_is_null() check
  uuidparse: use uuid type definitions from libuuid header
  uuidparse: use libuuid function to test nil uuid
2021-01-05 15:20:50 +01:00
Karel Zak c15899c1cb cfdisk: (man) add info when cfdisk writes to the device
This is difference between (c)fdisk and GNU Parted, fdisks keep all
changes in memory until user explicitly ask for write operation.

Addresses: https://github.com/karelzak/util-linux/pull/1227
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-05 14:43:01 +01:00
Karel Zak 0257109c33 Merge branch 'disk-utils-document-resize' of https://github.com/vdmz/util-linux 2021-01-05 14:32:22 +01:00
Eric Biggers 432dfa0a20 sys-utils: mount.8: fix a typo
It should be "inode", not "i-node".

Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-01-05 14:28:48 +01:00
Heinrich Schuchardt 7d15611779 fstab.5: NTFS and FAT volume IDs use upper case
The man-page indicates that mount expects UUIDs to be lower case.

Mention that NTFS and FAT volume IDs are to be specified in upper case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-01-05 14:28:48 +01:00
Chris Hofstaedtler 45be288c8f cfdisk: show Q option when choosing label type
The new message is quite terse, but fits into 78 characters.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894555
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2021-01-05 12:53:51 +01:00
Karel Zak 54624b8f49 Merge branch 'ia64-cramfs' of https://github.com/mator/util-linux
* 'ia64-cramfs' of https://github.com/mator/util-linux:
  tests: add checksum for cramfs/mkfs for LE:16384 (ia64)
2021-01-05 12:37:23 +01:00
Karel Zak 803b4c344f Merge branch 'optimal-33553920' of https://github.com/rfinnie/util-linux
* 'optimal-33553920' of https://github.com/rfinnie/util-linux:
  libfdisk: ignore 33553920 byte optimal I/O size
2021-01-04 13:52:55 +01:00
Karel Zak 1b39cd7f63 Merge branch 'spelling' of https://github.com/scop/util-linux
* 'spelling' of https://github.com/scop/util-linux:
  *: spelling and grammar fixes
2021-01-04 13:42:08 +01:00
Karel Zak 40618e66f6 Merge branch 'posix-test-command' of https://github.com/concatime/util-linux
* 'posix-test-command' of https://github.com/concatime/util-linux:
  configure: test -a|o is not POSIX
2021-01-04 13:22:54 +01:00
Dmitriy Chestnykh 0d182490e3 cfdisk: Implemented cfdisk's opening in read-only mode
[kzak@redhat.com: - clean up the patch
                  - add note "Changes will remain in memory only."]

Addresses: https://github.com/karelzak/util-linux/issues/1209
Addresses: https://github.com/karelzak/util-linux/pull/1213
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-04 12:17:57 +01:00
Karel Zak b2db5a71b5 fallocate: (man) add hint about off/len limitations
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-04 10:50:24 +01:00
Vincent McIntyre c186e148ea Show the 'r' option in the help menu 2021-01-02 11:02:35 +11:00
Vincent McIntyre 3e01d4a24d Manual pages: document the 'resize' command
Reported in https://bugs.debian.org/906918, https://bugs.debian.org/915971.

Signed-off-by: Vincent McIntyre <vincent.mcintyre@csiro.au>
2021-01-01 13:37:52 +11:00
Sami Kerola c25b7d8a9b
build-sys: sort various lists in configure.ac
And convert spaces to tabs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-12-28 09:53:13 +00:00
Sami Kerola 8d6877239c
mkswap: tell how to fix insecure permissions and owner in warning
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-12-28 09:53:13 +00:00
Sami Kerola d0355b2e90
lsipc: make default output byte sizes to be in human units
Recent request to make ipcs(1) list sizes in human format caused the
observation lsipc(1) is not doing that either.  This commit changes sizes to
human format, assuming --bytes option is not used.

Reference: https://github.com/karelzak/util-linux/issues/1199
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-12-28 09:53:13 +00:00
Sami Kerola 186946b239
man: add missing backslash to caret printing macro
Fixes: 3ea54b843c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-12-28 09:53:13 +00:00
Sami Kerola 01258182bb
lscpu: fix variable shadowing
sys-utils/lscpu-virt.c: In function ‘lscpu_read_virtualization’:
    sys-utils/lscpu-virt.c:574:9: warning: declaration of ‘buf’ shadows a previous local [-Wshadow]
      574 |    char buf[256];
          |         ^~~
    sys-utils/lscpu-virt.c:506:7: note: shadowed declaration is here
      506 |  char buf[BUFSIZ];
          |       ^~~

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-12-28 09:53:12 +00:00