The HiFive Unleashed SBC's bootloader seeks for GPT partitions with
specific UUID for loading the next stage bootloader (ZSBL loads FSBL,
and FSBL loads BBL).
Karel Zak [Mon, 4 Feb 2019 13:16:11 +0000 (14:16 +0100)]
cal: use standout mode on monochrome terminals
The function colors_init() checks for colors, it means it fails
on monochrome terminals, but cal(1) in this case still need to
highlight the current day.
Reported-by: Nuno Silva <nunojsilva@ist.utl.pt> Signed-off-by: Karel Zak <kzak@redhat.com>
Peter Wu [Fri, 1 Feb 2019 14:40:53 +0000 (15:40 +0100)]
mount.8: clarify (no)suid behavior on file capabilities
Clarify that the nosuid option also affects file capabilities and that
it only limits execution of programs. (setgid on directories still
inherit the group regardless of the nosuid option.) The new text is
taken from the mount(2) manual page from the man-pages project.
Addresses: https://github.com/karelzak/util-linux/issues/482 Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Karel Zak [Wed, 23 Jan 2019 10:41:43 +0000 (11:41 +0100)]
logger: concatenate multiple lines of MESSAGE into a single field.
this is deemed a useful special case since journalctl will only show
either the first or last element of the message array if the field
appears multiple times.
Based on patch from: Kjetil Torgrim Homme <kjetil.homme@redpill-linpro.com>
https://github.com/karelzak/util-linux/pull/743
Addresses: https://github.com/karelzak/util-linux/issues/742 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 22 Jan 2019 11:33:19 +0000 (12:33 +0100)]
libblkid: remove dependence on libuuid
Currently we use libuuid to print UUID only. This code is possible to replace
by one snprintf(). It seems better to duplicate this one snprintf than force
all distros to keep libuuid together with libblkid.
Note, this scenario has been already supported on --disable-libuuid.
Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Andreas Schwab [Sat, 19 Jan 2019 22:18:16 +0000 (23:18 +0100)]
setarch: don't return address of automatic variable
On architectures without special personalities setarch uses the contents
of a local variable with automatic storage duration after return from
the function, causing it to report a spurious error.
$ setarch m68k
setarch: Kernel cannot set architecture to m68k
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Karel Zak [Tue, 22 Jan 2019 10:50:20 +0000 (11:50 +0100)]
losetup: properly use --sector-size when create a new device
The --partscan functionality depends on sector size. Make sure
sector size is set before we force kernel to scan the device for
partitions. For example:
Karel Zak [Tue, 22 Jan 2019 10:12:42 +0000 (11:12 +0100)]
lib/loopdev: differentiate between setter()s and ioctl calls
Now the internal API uses loopcxt_set_...() to set context variables
as well as to call ioctls. This patch introduces loopcxt_ioctl_...()
to makes things more obvious to readers.
Karel Zak [Tue, 22 Jan 2019 09:13:54 +0000 (10:13 +0100)]
swapon: be more explicit about BTRFS
It seems nocow and nodatasum attributes are required.
See btrfs_swap_activate() in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed46ff3d423780fa5173b38a844bf0fdb210a2a7
Addresses: https://github.com/karelzak/util-linux/issues/633 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 14 Jan 2019 11:04:04 +0000 (12:04 +0100)]
Merge branch 'time-fixes' of https://github.com/kerolasa/util-linux
* 'time-fixes' of https://github.com/kerolasa/util-linux:
fsck.cramfs: use utimes() instead of utime() that is obsolete
hwclock: use monotonic time to measure how long setting time takes
include: add indirect monotonic clock id specifier
timeutils: match today day and this year correctly
Sami Kerola [Mon, 7 Jan 2019 21:34:11 +0000 (21:34 +0000)]
hwclock: use monotonic time to measure how long setting time takes
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.
Sami Kerola [Sat, 5 Jan 2019 21:32:23 +0000 (21:32 +0000)]
timeutils: match today day and this year correctly
Assumption all years since 1970 have been exactly 365 days long has it's
problems when leap years happen. Lets use struct tm fields that are
provided by localtime_r(), making year and day to be correctly compared even
when it's late new years eve somewhere else than UTC-0.
Stanislav Brabec [Thu, 10 Jan 2019 00:28:54 +0000 (01:28 +0100)]
su-common.c: prefer ENV_SUPATH over ENV_ROOTPATH
ENV_SUPATH and ENV_ROOTPATH are equivalent and ENV_ROOTPATH takes
precedence in both login and su. It makes no sense. More logical would be
precedence of ENV_SUPATH in su and ENV_ROOTPATH in login.
Stanislav Brabec [Thu, 10 Jan 2019 00:28:53 +0000 (01:28 +0100)]
su-common.c: prefer /etc/default/su over login.defs
su(1) documentation says:
/etc/default/su command specific logindef config file
/etc/login.defs global logindef config file
It indirectly indicates that /etc/default/su should take precedence
over /etc/login.defs.
But the reverse is true. It is not possible to define ENV_PATH in
/etc/login.defs and then make su specific customization in
/etc/default/su. We need to change read order to match the documented
behavior.
Karel Zak [Tue, 8 Jan 2019 11:07:18 +0000 (12:07 +0100)]
libblkid: improve whole-disk detection when read /proc/partitions
blkid(8) in high-level mode checks partitions and unpartitioned
whole-disk devices from the file /proc/partitions.
The current heuristic assumes that partition name ends with a digit.
Unfortunately, this is not correct -- for example md0 or nvme0n1 are
whole-disk devices.
This commit uses sysfs_devno_is_wholedisk() to make sure the device is
a partition (according to kernel or DM). It's probably more expensive,
because this way requires more syscalls (to read stuff from /sys etc.).
The patch also adds more information to the blkid(8) man page.
Addresses: https://github.com/karelzak/util-linux/issues/728 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 2 Jan 2019 13:20:21 +0000 (14:20 +0100)]
Merge branch 'master' of https://github.com/kvanals/util-linux
* 'master' of https://github.com/kvanals/util-linux:
Removed BlueStore VERSION information as it is gibberish
Updated BlueStore expected result
Added BlueStore test image
dmesg: correct "-n, --console-level level" example in manual page
When providing an abbreviation of the level name with the option "-n, --console-level level",
it corresponds to the level (included) up to which messages are displayed on the console.
If a level number is given, this level is excluded.
So in the given example, "-n 1" is equivalent to "-n emerg".
Karel Zak [Wed, 12 Dec 2018 11:14:39 +0000 (12:14 +0100)]
mkswap: use dd(1) in example rather than fallocate(1)
The man page warns against fallocate on some filesystems and recommends
dd(1) as the most portable solution. So, let's use dd(1) also in the
example used in the same man page.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1203378 Signed-off-by: Karel Zak <kzak@redhat.com>
Jeremy Linton [Tue, 11 Dec 2018 18:27:29 +0000 (12:27 -0600)]
lscpu: Add aarch32 detection on aarch64
aarch32 support is an optional feature of ARMv8, as CPUs
which don't support aarch32 become more common, lets make
sure that lscpu can tell a user quickly if they are on a
machine that only supports 64-bit.
Signed-off-by: Jeremy Linton <lintonrjeremy@gmail.com>
First three fixes on lines 133, 151, and 280 are cosmetic. Because there
was unobvious null check compiler thought variable might be null, and warned
when after pointer adjustment it was followed without null check. Perhaps
this will not happen sometime in future when compiler is made more smart,
meanwhile lets give better hints to avoid false positive.
The last change addresses issue that is possible, at least in theory.
Sami Kerola [Mon, 10 Dec 2018 20:41:18 +0000 (20:41 +0000)]
lslogins: remove duplicate NULL check
Having this excess NULL check in place causes small performance penalty, and
makes compiler to guess wrong if a null should be checked. To me getting
rid of false positive warning is more useful.
Sami Kerola [Mon, 10 Dec 2018 20:30:59 +0000 (20:30 +0000)]
libsmartcols: fix variable shadowing
libsmartcols/src/grouping.c:115:26: warning: declaration of ‘ln’ shadows a
previous local [-Wshadow]
libsmartcols/src/grouping.c:108:24: note: shadowed declaration is here
Karel Zak [Mon, 10 Dec 2018 10:45:03 +0000 (11:45 +0100)]
fstrim: trim also root FS on --fstab
The root fs ("/") is optional in many case in /etc/fstab. This patch
forces fstrim to read kernel command line for the root= option to get
root FS if the entry is missing in your fstab.
Addresses: https://github.com/karelzak/util-linux/issues/719 Signed-off-by: Karel Zak <kzak@redhat.com>
In this example two line (test-thin-metadata and test-thin-data) are
parents for another line (test-thin-pool). The new API uses term "group"
for parental line -- the number of group members is unlimited and every
group has at least one child.
It's possible that group's child is member of another group:
For now multi-group relation is unsupported and one line can be member
of one group only. The library API and printing code is ready to
support this feature, but not sure if we really need it. All what is
necessary is to create array of groups in the line struct.
Note that grouping is independent on standard parent->child relations
between lines and grouping can connect arbitrary lines. The
restriction is only that group child cannot be child of another line
or child of another group. These cross reference are (and probably
will be) impossible.
The patch is relative large, but easy to review. Changes:
* add new UTF symbols
* add scols_symbols_set_group_* public API to modify new symbols
* add struct libscols_group, used only internally
* add "grpset" array to table struct -- the array is used to keep
position of the group in the output. Every active group uses three
items in the grpset. If there is more overlapping groups than bigger
grpset is allocated.