Karel Zak [Wed, 30 Jun 2021 10:07:50 +0000 (12:07 +0200)]
Merge branch 'kill' of https://github.com/rossburton/util-linux
* 'kill' of https://github.com/rossburton/util-linux:
tests: check correct log file for errors in blkdiscard test
tests: don't hardcode /bin/kill in the kill tests
Huang Shijie [Thu, 17 Jun 2021 12:41:16 +0000 (12:41 +0000)]
lscpu: remove the old code
The file "/sys/firmware/dmi/tables/DMI" always exists.
The dmi_decode_cputype() can provide more information then arm_smbios_decode().
So remove it to tidy the code.
Before this patch, we can get the output from Centos 7.9 who has
"/sys/firmware/dmi/entries/4-0/raw" and "/sys/firmware/dmi/tables/DMI":
----------------------------------------------------
BIOS Vendor ID: Ampere(TM)
Model name: Neoverse-N1
BIOS Model name: Ampere(TM) Altra(TM) Processor
----------------------------------------------------
After this patch which uses "/sys/firmware/dmi/tables/DMI", in Centos 7.9, we get:
----------------------------------------------------
BIOS Vendor ID: Ampere(TM)
Model name: Neoverse-N1
BIOS Model name: Ampere(TM) Altra(TM) Processor Q00-00 CPU @ 2.8GHz
BIOS CPU family: 257
----------------------------------------------------
Ross Burton [Tue, 29 Jun 2021 15:34:20 +0000 (16:34 +0100)]
tests: don't hardcode /bin/kill in the kill tests
If the 'kill' test is executed with --use-system-commands, it calls
/bin/kill to avoid the shell's own kill command being invoked.
However, this doesn't work if the kill we want to test isn't in fact in
/bin. Instead, use $(which kill) to find a kill on the PATH and call
that directly.
Karel Zak [Wed, 23 Jun 2021 09:37:31 +0000 (11:37 +0200)]
more: fix null-pointer dereference
The command allows executing arbitrary shell commands while viewing a file by
entering '!' followed by the command. Entering a command that contains a '%',
'!', or '\' causes a segmentation violation.
The same more(1) function has a problem when not file is specified (cat
/etc/passwd | more) on command line.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1975153 Signed-off-by: Karel Zak <kzak@redhat.com>
The exclusivity between the {fscontext, defcontext} and context options
was removed in kernel 2.6.25[1]. No specific verification on these
options is done in mount(8)[2].
Tj [Thu, 17 Jun 2021 12:13:22 +0000 (13:13 +0100)]
mount: man-page; add all overlayfs options
The section in man (8) mount for overlay is missing nine options which
aren't documented elsewhere either and are useful features to be aware
of and use.
Alex Xu [Wed, 16 Jun 2021 13:58:25 +0000 (13:58 +0000)]
build-sys: Update configure.ac
1. the test incorrectly used AC_COMPILE_IFELSE instead of
AC_LINK_IFELSE, defeating the purpose of checking -lcrypt.
2. the test did not properly restore LIBS, causing later checks to all
fail if libcrypt wasn't found.
3. HAVE_LIBCRYPT only controls whether to use -lcrypt, it is not
needed or used in any source files.
[kzak@redhat.com: - improve commit message
- use UL_{SET,RESTORE}_FLAGS() rather than directly
modify $LIBS]
Karel Zak [Thu, 17 Jun 2021 11:28:32 +0000 (13:28 +0200)]
lib/path: improve ul_path_readlink() to be more robust
According to POSIX, readlink() makes no effort to null-terminate buffer
with the result. It seems better to hide this disadvantage in the
ul_path_...() API rather than assume buf[sz] = '\0' everywhere.
Reported-by: Reported-by: Jan Pazdziora <jpazdziora@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Huang Shijie [Tue, 15 Jun 2021 10:06:39 +0000 (10:06 +0000)]
lscpu: add bios_family
In the arm platform, we do not have the "CPU family" as X86.
In the linux kernel, it is hardcode to set the "CPU architecuture:8"
which should be changed for arm v9 in future.
This patch adds "bios_family" field, which we can get from the DMI table.
In the ampere Altra platform, we can get the new lscpu output:
----------------------------------------------------------------
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 160
On-line CPU(s) list: 0-159
Vendor ID: ARM
BIOS Vendor ID: Ampere(R)
Model name: Neoverse-N1
BIOS Model name: Ampere(R) Altra(R) Processor Q00-00 CPU @ 3.0GHz
BIOS CPU family: 257
Model: 1
Thread(s) per core: 1
----------------------------------------------------------------
[kzak@redhat.com: - s/sprintf/snprintf/]
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Huang Shijie [Tue, 15 Jun 2021 10:06:38 +0000 (10:06 +0000)]
lscpu: get the processor information by DMI
The patch :367c85c47286 ("lscpu: use SMBIOS tables on ARM for lscpu")
relies on the existence of "/sys/firmware/dmi/entries/4-0/raw",
which may not exist in standard linux kernel.
But "/sys/firmware/dmi/tables/DMI" should exist and can provide the required
processor information.
This patch uses "/sys/firmware/dmi/tables/DMI"
to get the processor information:
Before this patch, in Ampere Altra platform, the lscpu output is:
---------------------------------------------
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 160
On-line CPU(s) list: 0-159
Vendor ID: ARM
Model name: Neoverse-N1
Model: 1
Thread(s) per core: 1
Core(s) per socket: 80
Socket(s): 2
........................................
---------------------------------------------
After this patch, we can use get the lscpu output
in Ampere Altra platform:
---------------------------------------------
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 160
On-line CPU(s) list: 0-159
Vendor ID: ARM
BIOS Vendor ID: Ampere(R)
Model name: Neoverse-N1
BIOS Model name: Ampere(R) Altra(R) Processor Q00-00 CPU @ 3.0GHz
Model: 1
Thread(s) per core: 1
Core(s) per socket: 80
Socket(s): 2
........................................
---------------------------------------------
[kzak@redhat.com: - s/sprintf/snprintf/]
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Reported-by: Brian Lane <bcl@redhat.com>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1971877
Fix: https://github.com/karelzak/util-linux/issues/1348 Signed-off-by: Karel Zak <kzak@redhat.com>
Platon Pronko [Fri, 11 Jun 2021 18:20:58 +0000 (21:20 +0300)]
dmesg: fix indentation in man page
Double-semicolon at the end of the option line results in description
being indented extra tab to the right. Replacing them with double-colons
allows all options to be displayed at the same indent level.
Karel Zak [Wed, 9 Jun 2021 14:12:13 +0000 (16:12 +0200)]
libblkid: check for ioctl macro rather than for header file
libblkid/src/probe.c:1012:22: error: ‘BLKGETZONESZ’ undeclared (first use in this function)
1012 | if (!ioctl(pr->fd, BLKGETZONESZ, &zone_size_sector))
| ^~~~~~~~~~~~