summaryrefslogtreecommitdiffstats
path: root/sys-utils/Makemodule.am
Commit message (Collapse)AuthorAgeFilesLines
* hwclock: use CMOS clock only if availableCarlos Santos2019-07-151-2/+5
| | | | | | | | | | | | - Add --disable-hwclock-cmos configuration argument - Add USE_HWCLOCK_CMOS (enabled by default for i386/x86_64) - Add define(USE_HWCLOCK_CMOS) - Compile hwclock-cmos.c only if USE_HWCLOCK_CMOS is true - Remove all unnecessary #ifdefs from hwclock-cmos.c - Add #ifdef USE_HWCLOCK_CMOS around the determine_clock_access_method() call in hwclock.c Signed-off-by: Carlos Santos <unixmania@gmail.com>
* build-sys: use REALTIME_LIBS for hwclock due to monotonic.cKarel Zak2019-01-141-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: use monotonic time to measure how long setting time takesSami Kerola2019-01-121-1/+3
| | | | | | | | | Earlier gettimeofday() was affected by discontinuous jumps. Measuring how long time it takes to set time using function that effected by the very thing being measured makes head spin. Lets make this less confusing with monotonic clock that ticks on without jumps. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: fix typo in man installKarel Zak2018-08-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: add adjtime_config(5) man pageKarel Zak2018-08-141-1/+3
| | | | | | The file is pretty common, but undocumented by individual man page. Signed-off-by: Karel Zak <kzak@redhat.com>
* choom: fix build, remove unnecessary includeKarel Zak2018-04-161-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* choom: new command to adjust OOM-killer score valueKarel Zak2018-04-161-0/+7
| | | | | | | | | Let's provide command line tool, man page with OOM description and bash-completion. It seems better than force end-users to use "echo" to /proc. Addresses: https://github.com/karelzak/util-linux/issues/609 Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: move ARM decoding to lscpu-arm.cKarel Zak2018-01-221-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: Decode ARM CPUsRiku Voipio2018-01-191-0/+1
| | | | | | | | Since the kernel developers have refused to make /proc/cpuinfo user understandable, implement mapping in userspace. lscpu is available for most users via util-linux, so store the information here. Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* lsns: add nsfs columnMasatake YAMATO2017-11-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nsfs provides kernel level interface for assigning logical name to a namespace. Following message is quoted from git log of linux kernel: commit 0226f4923f6c9b40cfa1c1c1b19a6ac6b3924ead Author: Al Viro <viro@zeniv.linux.org.uk> Date: Tue Dec 6 12:21:54 2011 -0500 vfs: take /proc/*/mounts and friends to fs/proc_namespace.c rationale: that stuff is far tighter bound to fs/namespace.c than to the guts of procfs proper. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> /proc/self/mountinfo lists the logical names for namespaces: ... 652 81 0:3 net:[4026532579] /tmp/XYZ rw shared:192 - nsfs nsfs rw,seclabel ... In the lines /tmp/XYZ is a logical name for 4026532579 of net namespace. This patch adds nsfs column. It seems that the logical name is used only in "ip netns" now. So the column is disabled by default. Use '--type=net' or '-o NSFS' options to enable it. This feature and the way to implementation using multi lines in a column is Suggested by Karel Zak. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
* build-sys: move rfkill to /usr/sbinKarel Zak2017-10-201-1/+1
| | | | | | The original implementation uses sbin, let's do it too. Signed-off-by: Karel Zak <kzak@redhat.com>
* rfkill: use libsmartcols outputSami Kerola2017-08-301-1/+2
| | | | | | | This also makes the rfkill to output status when executed without arguments. That is believed ot be more useful than usage() output. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rfkill: make programming style to match util-linux projectSami Kerola2017-08-301-0/+1
| | | | | | | | Use the usual facilities, add translation strings, move global variables at the beginning of the file, make usage() look as expected, add standard command-line option parsing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rfkill: make command to build in util-linux projectSami Kerola2017-08-301-0/+6
| | | | | | | After this commit the command merely builds, but does not confirm style used in util-linux project. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tunelp: use linux headerSami Kerola2017-07-311-1/+1
| | | | | | | | | Remove use of LPTRUSTIRQ in same go. The LPTRUSTIRQ provided --trust-irq option, but it has not worked in nearly 20 years. Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/include/linux/lp.h Reference: http://repo.or.cz/davej-history.git/blobdiff/1f58336fe0515bc929e4de227eb44b12a4a18998..ac5579c68db87bc21630676c167ee8224267f32c:/drivers/char/lp.c Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: make chown usage more robustKarel Zak2017-06-211-2/+8
| | | | | | | | * add --disable-makeinstall-chown to travis non-root mode * use "if MAKEINSTALL_DO_SETUID" for chown root:root Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: chown before chmod for SUIDsKarel Zak2017-06-201-0/+2
| | | | | | | Make sure SUIDs are really owned by root. Reported-by: L A Walsh <lkml@tlinx.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* blkreport, blkreset: remove in favour of blkzoneKarel Zak2017-02-231-14/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzone: add new command (merge blkreport and blkreset)Karel Zak2017-02-231-0/+7
| | | | | | | This new command is based on the original implementation of blkreport and blkreset command. Signed-off-by: Karel Zak <kzak@redhat.com>
* blkzonecmd, blkreport: Add new commands for ZAC/ZBC drivesShaun Tancheff2017-02-091-0/+14
| | | | | | | | | | | | | | | This patch adds: - blkreset to issue Reset (Write Pointer) zone commands - blkreport to retrieve drive zone information [kzak@redhat.com: - cleanup man page and usage() - remove command line options aliases, - use strtosize_or_err() - remove unnecessary -ludev - use blkdev.h stuff] Signed-off-by: Shaun Tancheff <shaun@tancheff.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: remove FLOOR macro in favour of floor(3)Sami Kerola2017-02-051-1/+1
| | | | | Reviewed-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: use MATH_LIBS for hwclockKarel Zak2017-01-191-1/+1
| | | | | Reported-by: Bert van Hall <bert.vanhall@avionic-design.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* chmem: new toolHeiko Carstens2016-11-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the s390 specific chmem tool to util-linux. The chmem tool was originally written in perl and is part of the s390-tools package which can be found here: https://www.ibm.com/developerworks/linux/linux390/s390-tools.html Given that the tool is architecture independent, there is no reason to keep it in an s390 specific repository. It seems to be useful for other architectures as well. This patch converts the tool to C and adds it to util-linux, while the command line options stay compatible. The only exception is the option "-v" which used to be the short form of "--version". That got changed to "-V" so it behaves like most other tools contained within util-linux. The chmem tool can be used to set memory online or offline. This can be achieved by specifying a memory range: Memory Block 19 (0x0000000130000000-0x000000013fffffff) disabled or by specifying a size where chmem will automatically select memory blocks: Memory Block 21 (0x0000000150000000-0x000000015fffffff) disable failed Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled or by specifying memory block numbers instead of address ranges: Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled This is based on a patch from Clemens von Mann. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* lsmem: new toolHeiko Carstens2016-11-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the s390 specific lsmem tool to util-linux. The lsmem tool was originally written in perl and is part of the s390-tools package which can be found here: https://www.ibm.com/developerworks/linux/linux390/s390-tools.html Given that the tool is architecture independent, there is no reason to keep it in an s390 specific repository. It seems to be useful for other architectures as well. This patch converts the tool to C and adds it to util-linux, while the command line options stay compatible. The only exception is the option "-v" which used to be the short form of "--version". That got changed to "-V" so it behaves like most other tools contained within util-linux. The lsmem tool inspect the contents of /sys/devices/system/memory and prints a summary output similar to what lscpu does: RANGE SIZE STATE REMOVABLE BLOCK 0x0000000000000000-0x000000005fffffff 1,5G online yes 0-5 0x0000000060000000-0x000000007fffffff 512M online no 6-7 0x0000000080000000-0x000000013fffffff 3G online yes 8-19 0x0000000140000000-0x000000014fffffff 256M offline - 20 0x0000000150000000-0x000000017fffffff 768M online no 21-23 Memory block size : 256M Total online memory : 5,8G Total offline memory: 256M In order to keep the output small the tool merges subsequent address ranges where the attributes are identical. To avoid merging of line the "-a" option can be used. The lsmem tool also has "--extendend" and "--parsable" option which can be used to customize the output, e.g. limit the output to specified columns. This is quite similar to what the lscpu tool does. This is based on a patch from Clemens von Mann. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* build-sys: remove obsolete commentKarel Zak2016-04-131-4/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use AC_PROG_MKDIR_P and remove a few gnuismsRuediger Meier2016-03-131-1/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lscpu: Print physical cpu informationSukadev Bhattiprolu2015-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lsns: add man pageKarel Zak2015-12-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsns: new commandKarel Zak2015-11-261-0/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ctrlaltdel: use path.h to read /procKarel Zak2015-10-271-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use REALTIME_LIBSKarel Zak2015-10-091-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: new command to list IPC facilitiesKarel Zak2015-07-201-0/+10
| | | | | | Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* build-sys: support unshare.staticGeorg Schiesser2015-05-181-0/+8
| | | | | | | | | | This patch adds support for building a static version of unshare. We need to add unshare to the list of possible static programs, and provide build flags for the compiler and linker, which are equivalent to the flags of the non-static program, except additional static linking. See also: commit 2fa60c5 build-sys: support nsenter.static Signed-off-by: Georg Schiesser <georg.schiesser@opentech.at>
* build-sys: fix parallel builds w/setarch linksMike Frysinger2015-05-051-0/+1
| | | | | | | | | | | | | | The symlink generation tries to write to the sys-utils/ subdir but does not make sure that dir exists. This can sometimes lead to parallel build failures when building out-of-tree like: ... echo ".so man8/setarch.8" > sys-utils/linux64.8 /bin/bash: sys-utils/linux64.8: No such file or directory Makefile:11503: recipe for target 'sys-utils/linux64.8' failed make: *** [sys-utils/linux64.8] Error 1 References: https://bugs.gentoo.org/511812 Signed-off-by: Mike Frysinger <vapier@chromium.org>
* tests: add test_dmesg that has fixed boot timeSami Kerola2015-03-231-0/+4
| | | | | | This allows testing time stamp formats. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* nsenter: add -Z to set selinux contextKarel Zak2015-03-201-1/+1
| | | | | | | | The new context is copied from --target <PID>. This solution allows to keep SELinux happy when you enter container by nsenter(1). Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1116100 Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup realtime lib usageKarel Zak2015-03-061-3/+3
| | | | | | | | * check for timer_create() * define dependence on timer_create() for flock * rename CLOCKGETTIME_LIBS to REALTIME_LIBS Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/timer: use separate file for timersKarel Zak2015-03-061-1/+1
| | | | | | | | It seems that static builds require -lpthread for timer_* functions. It's better to keep it out of our libs (e.g. libmount) to avoid unnecessary dependence. Signed-off-by: Karel Zak <kzak@redhat.com>
* flock: improve timeout handlingSami Kerola2015-03-051-1/+1
| | | | | | | | | | | | Signal ALRM raised by the timer, and the timer only, will be considered as a timeout criteria. Secondly time interval is made to use monotonic clock. Documentation of ITIMER_REAL is unclear whether that time is affected various sources of clock skew, or does it even tick when system is suspended. Reviewed-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* flock: add --verbose optionSami Kerola2015-03-031-2/+2
| | | | | | | | | Jenkins script jobs using flock are a great example of a situation in which one may want an automation to be verbose, so that when unexpected events happen there is more hints in logs. Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib/colors: use libtinfo to check terminal capabilityKarel Zak2015-02-271-1/+2
| | | | | | | | | | | | | | | The current implementation assumes that all terminals supports colors and users are forcet to use terminal-colors.d/ to disable colors for some terminals. This patch checks for maximal supported colors for the current terminal and colors are automatically disabled for terminals like vt100. The patch moves lib/colors.c from libcommon.la to libtcolors.la to avoid collisions with another utils. Signed-off-by: Karel Zak <kzak@redhat.com>
* tunelp: remove get_val() in favour of strtol_or_err()Sami Kerola2015-02-241-0/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: support nsenter.staticKarel Zak2015-01-071-0/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: hwclock requires -lmCristian Rodríguez2014-12-091-1/+1
| | | | | hwclock uses fabs and therefore needs libm, otherwise a linking error ocurrs when building with -fno-builtin.
* build-sys: move all around clock_gettime() to monotonic.cKarel Zak2014-11-191-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use CLOCKGETTIME_LIBSKarel Zak2014-11-191-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swapoff: swapoff swap files by LABEL and UUIDKarel Zak2014-11-071-3/+10
| | | | | | | | | | | | | # swapon --show=NAME,UUID NAME UUID /dev/sda3 8d52fca3-bf48-41d6-b826-2315e518a305 /home/fs-images/2g.img 6fa72b96-b802-441f-a31c-091d65c0212c # swapoff UUID=6fa72b96-b802-441f-a31c-091d65c0212c swapoff: cannot find the device for UUID=6fa72b96-b802-441f-a31c-091d65c0212c Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: properly check for -lrtKarel Zak2014-10-271-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: old glibc requires -lrt clock_gettime()Karel Zak2014-10-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'misc' of git://github.com/kerolasa/lelux-utiliteetitKarel Zak2014-09-221-2/+1Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'misc' of git://github.com/kerolasa/lelux-utiliteetit: textual: share crypt() error message in sulogin and newgrp newgrp: avoid use of obsolete getpass() function newgrp: use libc function to read gshadow if it is available setarch: use personality() system call when it is available setarch: reindent code hwclock: remove referal to deprecated keyboard interface eject: make open_device() and select_speed() to use struct eject_control eject: add struct eject_control to remove global variables mountpoint: simplify if statement mkfs.minix: fix couple compiler warnings mountpoint: add struct mountpoint_control last: improve code readability by renaming variable names last: make is_phantom() when kernel config does not include audit support lib: remove xgetpass() include: simplify fputc_careful() in carefulputc.h libuuid: add extern qualifiers to uuid/uuid.h system header