Let's follow only $enable_ variables. In this case the MASTERNAME
(e.g. [schedutils] for --enable-schedutils) has to be without
UL_BUILD_INIT.
Signed-off-by: Karel Zak <kzak@redhat.com>
* add UL_ENABLE_ALIAS(NAME, MASTERNAME) to initialize $enable_<name>
according to MASTERNAME. Note that we have to use $build_<mastername>,
the $enable_<mastername> is just AC_ARG_ENABLE() stuff only. The
$build_ is evaluated and modified by our UL_...() functions.
* add enable-schedutils.conf to have build-system regression test for
this use-case
Addresses: https://github.com/karelzak/util-linux/issues/415
Signed-off-by: Karel Zak <kzak@redhat.com>
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-jwp-reviewed' of git://github.com/kerolasa/lelux-utiliteetit: (25 commits)
hwclock: remove --compare option
hwclock: remove trailing dot from messages that include system error message
hwclock: make --date=argument less prone to injection
hwclock: fix rtc atexit registration
hwclock: clarify cmos inb and outb preprocessor directives
hwclock: try RTCGET and RTCSET only when normal rtc fails
hwclock: stream line synchronize_to_clock_tick_rtc()
hwclock: improve coding style
hwclock: remove division by zero [asan]
hwclock: add debugging to open_rtc()
hwclock: remove magic constants from interpret_date_string()
hwclock: use symbolic magic values passed in between functions
hwclock: initialize struct adjtime members
hwclock: alloate date_resp parsing buffer in interpret_date_string()
hwclock: simplify save_adjtime() execution flow
hwclock: remove dead code and other minor fixes
hwclock: move error messages to determine_clock_access_method()
hwclock: clarify set_cmos_epoch() code
hwclock: move command-line options to control structure
hwclock: remove unnecessary type casts
...
Local timegm() is a replacement function in cases it is missing from libc
implementation. Hopefully the replacement is never, or very rarely, used.
CC: Ruediger Meier <ruediger.meier@ga-group.nl>
Reviewed-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
System call getrandom(2) is relatively new, available since kernel 3.17 but
not supported by glibc 2.24. That in mind autotools is made to check
availability of this function and keep old code as fallback. It is
reasonable assume it will take years before the syscall(2) and fallback are
unproblematic to remove.
One might ask why bother using getrandom(2). Main reason is to avoid
unnecessary system calls to achieve exactly same end result. That
demonstrated with 'strace -c ./mcookie' showing 36 calls before, and 32
after this change. Secondly the getrandom(2) function got to kernel with
promise it can be used to avoid file descriptor run down, and since uuidd
uses random_get_bytes() it should fulfill it's promise here.
Reference: http://man7.org/linux/man-pages/man2/getrandom.2.html
Reference: https://lwn.net/Articles/606141/
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Let's hope this is last change necessary to cleanup x-* usage:
x-* persistent option, stored in utab, available for umount, etc.
X-* fstab comment only
mount(8) supports x-mount.mkdir= as well as newly recommended X-mount.mkdir=
Advantages:
* less invasive
* does not require exception for x-systemd
* does not require rename x-initrd to X-initrd
The systemd and dracut users will get the new (=fixed) functionality without a
change in fstab configuration. This is the primary goal.
Disadvantages:
* not 100% compatible libmount behavior, x-* options have not been
previously stored in utab. The API is the same, options will be still
available, but on x-* libmount will write to /run/mount/utab. For now
it seems only systemd uses x-*, and they like this behavior, so...
Addresses: https://github.com/systemd/systemd/pull/4515
Signed-off-by: Karel Zak <kzak@redhat.com>
The previous patch introduces X-* options namespace for options
that have to be maintained in user space.
Unfortunately, systemd users already use mount options that are
necessary by umount or another operations. The conclusion from
discussion with systemd guys is to store all the systemd options
in userspace.
It seems better to add one line exception to libmount than force all
fstab users to rename x-systemd to X-systemd.
Addresses: https://github.com/systemd/systemd/pull/3904
Signed-off-by: Karel Zak <kzak@redhat.com>
We simply check for utmpxname and updwtmpx functions to disable
all programs which are not POSIX utmpx compatible, even though
last(1) and utmpdump(1) does not use them, see below.
utmpx.h is used in:
login agetty write lslogins last runuser su utmpdump wall
Non-Posix utmpx usage:
utmpxname -> login agetty write lslogins
updwtmpx -> login agetty runuser su
_PATH_.TMP -> login agetty write lslogins last runuser su
utmpx.ut_addr_v6 -> login last utmpdump
POSIX utmpx usage:
wall
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Now the build will fail on many non-Linux systems because
utmpx.h is available everywhere but we still use non-POSIX
features. We'll fix this next commit.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This include was removed in a365953a but we will need it again
when we move from utmp.h to utmpx.h.
On Linux (glibc, musl) the struct lastlog is defined in utmp.h
and lastlog.h just includes utmp.h.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Conflicts:
login-utils/login.c
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Now we use
v2.29-5-g8ffab30 -> 2.29.5-8ffa (libblkid 2.29.5)
instead of
v2.29-5-g8ffab30 -> 2.29.5-8ffa (libblkid 2.29.0)
otherwise the bugfix releases (2.29.1) would look newer that latest HEAD.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Was broken for major releases since b0e6b25e:
$ blkid -V
blkid from util-linux 2.28 (libblkid 2.28., 12-Apr-2016)
Now we also set 0 in this case, like:
$ blkid -V
blkid from util-linux 2.30 (libblkid 2.30.0, 12-Apr-2016)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
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>
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>
It's painful, but ncurses upstream does not distribute .pc files by
default and it seems that ncurses{6,5}-config is the preferred solution.
For better compatibility lets use ncurses-config.
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch add libseccomp based syscalls filter to disable TIOCSTI
ioctl in su/runuser children.
IMHO it is not elegant solution due to dependence on libseccomp
(--without-seccomp if hate it)... but there is nothing better for now.
Addresses: CVE-2016-2779
Signed-off-by: Karel Zak <kzak@redhat.com>
The pg command is marked deprecated in POSIX since 1997, and this project
has thought the same since Feb 2013. Time has come to stop shipping this
binary by default.
Reference: 956e582874
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
It seems that globally defined dependence between ncursesw and
wide-char support is overkill, because in some cases (e.g. cal(1)) we
can use ncurses independently on wide-char support.
It would be better to care about relation between wide-char and
ncurses individually (per util).
Signed-off-by: Karel Zak <kzak@redhat.com>
* error if wide-char enabled/supported, but (non-wide) ncurses
explicitly requested
* disable ncurses at all if widechar enabled/supported, but ncursesw
not found
Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
* don't use UL_CHECK_LIB(), only use pkg-config to avoid complexity
* split --with-ncursesw and --with-ncurses; ncurses (widechar) is the
default, check for ncurses only if ncursesw disabled/unavailabled
* don't use generic placeholders, just have_ncursesw and have_ncurses
Signed-off-by: Karel Zak <kzak@redhat.com>
uClibc-ng tries to be compatible with GNU libc and defines
__GLIBC__ and pretend to be version 2.2.
We once changed it to 2.10, but then some hard to fix problems
in different software packages (gcc) occured.
It would be better if we disable the special GNU libc checks
for uClibc-ng here. uClibc-ng implements the required scanf
functionality.
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
The UL_DEFAULT_ENABLE modifies $enable_<name> according to the global
--enable-all-programs. This makes sense only for programs, but not for
any built-in code.
Signed-off-by: Karel Zak <kzak@redhat.com>
The plymouth support depends on Linux specific SOCK_* flags and all
the feature is probably unnecessary in some cases (non-plymouth
distros, etc.)
Signed-off-by: Karel Zak <kzak@redhat.com>
The file mtab is evil and already unused by mainstream distributions.
Now libmount is able to detect mtab->/proc/mounts and use
/proc/self/mountinfo if necessary. This heuristic seems overkill in
many cases. It's also dangerous on systems where mountinfo is strongly
required (systemd based distros).
This patch #ifdefs mtab code and forces libmount to always use
/proc/self/mountinfo.
The new configure option --enable-libmount-support-mtab is necessary
to enable old behavior to support mtab.
Signed-off-by: Karel Zak <kzak@redhat.com>