Commit Graph

9965 Commits

Author SHA1 Message Date
Karel Zak a6dc8dcd02 lsblk: allow to --sort by hidden column
For example:

	lsblk -o NAME --sort SIZE

prints NAMEs, but sort by SIZEs.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-10 13:03:46 +01:00
Karel Zak 6d6b6d185e libsmartcols: add SCOLS_FL_HIDDEN
Export "don't print this column" functionality by public API.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-10 13:02:03 +01:00
Karel Zak 0f1cbe9430 libmount: add comment, remove TODO item
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-10 11:45:31 +01:00
Karel Zak 96c6ccd554 Merge branch 'test-fixes' of https://github.com/rudimeier/util-linux
* 'test-fixes' of https://github.com/rudimeier/util-linux:
  tests: use xz instead of bzip2 for blkid images
  tests: add some line tests
  tests: avoid sed -E
2015-12-10 11:18:04 +01:00
Ruediger Meier fdc106a4eb tests: skip BLKDISCARD if unsupported
CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:30 +01:00
Ruediger Meier 45eb5b2917 tests: blkdiscard, check return values
CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:30 +01:00
Ruediger Meier eeae448805 blkdiscard: don't report "zero range" at the end
We want to address the case that we have printed the last useful
stats line already within the loop. Avoiding an additional line
"Discarded 0 bytes ..." at the end.

Note there is a behavior change now for the edge cases "-v -l 0" and
"-v -o blksize" where we don't print any stats line anymore. But actually
it's correct, we never make any BLKDISCARD syscall with zero range.
Perhaps we should return error in these cases to help people who always
want to parse stats output on success.

CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:29 +01:00
Ruediger Meier a3e91e2646 blkdiscard: fix stats reporting (off by one)
CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:29 +01:00
Ruediger Meier 0e76536579 blkdiscard: fix timeval comparison inclusive usecs
We will see if this makes our "--step" tests reliable.

CC: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 18:23:29 +01:00
Karel Zak 6589a1632b libmount: use fstatat(AT_NO_AUTOMOUNT) for mountpoints
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-09 10:26:16 +01:00
Ruediger Meier 84918ad0fc tests: use xz instead of bzip2 for blkid images
xz decompression creates sparse files if possible. This saves about 1G
disk space in build directory and a lot I/O and time.

BTW regarding compatibility ... CentOS 7 is the first system I've met
which does not install bzip2 but xz only by default.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-09 08:40:44 +01:00
Karel Zak 624996a950 libmount: add cgroup2 pseudo FS
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-08 12:16:27 +01:00
Karel Zak 24500575ac Merge branch 'patch-1' of https://github.com/frioux/util-linux
* 'patch-1' of https://github.com/frioux/util-linux:
  Fix subtle typo
2015-12-08 12:10:39 +01:00
Karel Zak f07a82c9d8 build-sys: fix typo and more all RT to the same place
typo : s/timer_createx/timer_create/

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-08 11:52:13 +01:00
fREW Schmidt 100a3ab516 Fix subtle typo 2015-12-07 14:16:30 -08:00
Karel Zak 96561604e2 libsmartcols: fix right-aligned logic for last column
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 15:10:23 +01:00
Karel Zak 717fff869e cfdisk: use new libsmartcols functionality to fix output
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 12:23:26 +01:00
Karel Zak 05c1123bc3 libsmartcols: don't use fprintf() when count cells
fprintf("%*s") is based on bytes, no cells.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 12:22:29 +01:00
Karel Zak df73852b6e libsmartcols: add scols_table_enable_nowrap()
This allows to use libsmartcols in ncurses programs without any
additional voodoo.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-07 12:03:52 +01:00
Karel Zak 86688c378b Revert "cfdisk: make sure that output fits to terminal width"
This reverts commit ed99eac0e2.
2015-12-07 10:42:15 +01:00
Benno Schulenberg 5330b97e94 lsns: improve formatting and wording of the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-12-04 11:20:00 +01:00
Karel Zak 28a2df8dc0 libblkid: fix buffers mapping on 32bit archs
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-03 12:24:22 +01:00
Ruediger Meier caad4ded12 tests: add some line tests
regarding e03f29b6 ...

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-03 01:56:53 +01:00
Ruediger Meier e2142701ac tests: avoid sed -E
GNU sed's -E option for BSD compatibility is relatively new (>=4.2) and
undocumented.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-03 01:54:33 +01:00
Karel Zak e03f29b694 line: keep stdin unbuiffered
$ printf 'a\nb\n' | echo $(./line) :: $(./line)

broken version:

 a ::

fixed version:

 a :: b

Addresses: https://github.com/karelzak/util-linux/issues/236
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-02 15:01:23 +01:00
Karel Zak 352740e88e libmount: fix is-mounted check for btrfs
fstab:
  /dev/sdc        /mnt/test       btrfs   subvol=/anydir
  /mnt/test       /mnt/test2      auto    bind

and "mount -a" does not detect that /mnt/test2 is already mounted.

Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-02 13:38:51 +01:00
Sukadev Bhattiprolu bd9b94d12a lscpu: Print physical cpu information
lscpu currently prints information for CPUs configured in the system.
In case of KVM or other virtualized guest operating systems, this
refers to the virtual system, and bears no relation to the physical
topology of the system.

It would be useful if lscpu could also display the physical topology
info when available:

	$ ./lscpu
	Architecture:          ppc64le
	Byte Order:            Little Endian
	CPU(s):                16
	On-line CPU(s) list:   0-15
	Thread(s) per core:    1
	Core(s) per socket:    1
	Socket(s):             16
	NUMA node(s):          1
	Model:                 IBM pSeries (emulated by qemu)
	Hypervisor vendor:     KVM
	Virtualization type:   para
	L1d cache:             64K
	L1i cache:             32K
	NUMA node0 CPU(s):     0-15
	Physical sockets:      2		<<< New
	Physical chips:        4		<<< New
	Physical cores/chip:   4		<<< New

For now, physical topology information is available on platforms that
support the following RTAS (Real time abstraction service) call provided
by librtas:

	rtas_get_sysparm(PROCESSOR_MODULE_INFO).

Currently this call is available to the PowerVM (pHYP) guests on PowerPC.
With a patch propoosed to PowerKVM, this RTAS call would also be available
to PowerKVM guests.

Based on input from Nishanth Aravamudan and Karel Zak.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
2015-12-02 11:33:58 +01:00
Karel Zak 4ba2a6e515 Merge branch 'races' of git://github.com/kerolasa/lelux-utiliteetit 2015-12-02 10:27:43 +01:00
Karel Zak 0e4f6b2a26 lsns: improve man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 17:27:22 +01:00
Karel Zak e069296ed8 include: add missing header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 15:44:26 +01:00
Karel Zak 8ff3d5d077 lsns: fix usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 13:50:51 +01:00
Karel Zak 635493655e lsns: add details to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 13:00:14 +01:00
Karel Zak 1880a5781f lsns: sort namespaces, avoid duplicate entries in tree output
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 12:31:40 +01:00
Karel Zak 82a437c79d lsns: remove unwanted comment
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 11:45:11 +01:00
Karel Zak 1bb4fe24e3 lsns: add man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 11:40:51 +01:00
Karel Zak 304fbe8b3c lsns: filter by NS type
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 15:55:31 +01:00
Karel Zak 969d3d15aa lsln: allows to list namespace processes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 14:06:05 +01:00
Karel Zak c600d82a3a libsmartcols: make sure we have space for ascii art
* more verbose output about columns width counting
* strlen_line() does not care about space between columns and extra
  tree ASCII art. Let's assume that all termwith is possible to use
  for this extra stuff, it means that maximal buffer size is
  biggest_line + termwidth.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 12:53:42 +01:00
Karel Zak 440f73b7bc libsmartcols: allow to reduce tree columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 11:43:05 +01:00
Karel Zak 9dfd601976 lsns: read all processes when --task specified
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 14:24:09 +01:00
Karel Zak 13f6b9db1e build-sys: add lsns to gitignore
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:57:22 +01:00
Karel Zak a52852d37a lsns: add USER and UID
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:56:31 +01:00
Karel Zak 04a5cb58b6 namei: move icache to lib/
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:56:01 +01:00
Karel Zak 8a2045620e lsns: new command
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-26 14:09:45 +01:00
Karel Zak 0e756daeb6 lslocks: use stuff from lib/procutils
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-25 14:17:22 +01:00
Karel Zak 5184d93630 agetty: don't ignore netlink on select()
agetty uses NETLINK_ROUTE to be notified about network interface
changes. Unfortunately, the code that monitor the netlink FD does not
increment number of the monitored file descriptors when call
select(2), so the netlink notifications are invisible for agetty.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1278906
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-24 17:44:38 +01:00
Sami Kerola 010d5a670b
mesg: fix multiple races
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:39 +00:00
Sami Kerola f5320b483c
fdformat: fix block device open race
This fix makes fdformat also to detect if block device is busy, and warn if
the device is misaligned.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 80c320fac1
mkswap: fix block device open race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00
Sami Kerola 8a4eb983d8
mkfs.minix: fix block device open race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-22 20:56:38 +00:00