import CS util-linux-2.37.4-15.el9

This commit is contained in:
eabdullin 2023-09-21 20:38:01 +00:00
parent 10a861ba0c
commit ab7442d252
12 changed files with 889 additions and 1 deletions

View File

@ -0,0 +1,47 @@
From 5285f83b77df9e206f4904eba92c741eb42acc93 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Mon, 13 Dec 2021 13:19:18 +0100
Subject: include/c: add cmp_timespec() and cmp_stat_mtime()
It's like timercmp() in libc, but for timespec and for stat.st_mtim
(or stat.st_mtime for old struct stat versions).
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2180414
Upstream: http://github.com/util-linux/util-linux/commit/0cfb8c5c3205a92ae81def278cdded63ea47094f
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/c.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/include/c.h b/include/c.h
index 354b59e29..01f0fa507 100644
--- a/include/c.h
+++ b/include/c.h
@@ -167,6 +167,24 @@
_a == _b ? 0 : _a > _b ? 1 : -1; })
#endif
+
+#ifndef cmp_timespec
+# define cmp_timespec(a, b, CMP) \
+ (((a)->tv_sec == (b)->tv_sec) \
+ ? ((a)->tv_nsec CMP (b)->tv_nsec) \
+ : ((a)->tv_sec CMP (b)->tv_sec))
+#endif
+
+
+#ifndef cmp_stat_mtime
+# ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+# define cmp_stat_mtime(_a, _b, CMP) cmp_timespec(&(_a)->st_mtim, &(_b)->st_mtim, CMP)
+# else
+# define cmp_stat_mtime(_a, _b, CMP) ((_a)->st_mtime CMP (_b)->st_mtime)
+# endif
+#endif
+
+
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
--
2.39.2

View File

@ -0,0 +1,86 @@
From 5d150964f0b2fbcaa9f9d11809eede9255159a5d Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Mon, 13 Dec 2021 13:22:56 +0100
Subject: mount: add hint about systemctl daemon-reload
This commit implements an extra hint for systemd based distros to
inform users that units currently used by systemd are older than
fstab. This situation is usually unwanted, and 'systemctl
daemon-reload' is recommended.
The message is printed only on terminal to avoid extra messages in
logs, etc.
Addresses: https://github.com/systemd/systemd/pull/20476
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2180414
Upstream: http://github.com/util-linux/util-linux/commit/1db0715169954a8f3898f7ca9d3902cd6c27084d
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/pathnames.h | 2 ++
sys-utils/mount.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/include/pathnames.h b/include/pathnames.h
index 7e7d9053f..8c3c36477 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -82,6 +82,8 @@
#define _PATH_NUMLOCK_ON _PATH_RUNSTATEDIR "/numlock-on"
#define _PATH_LOGINDEFS "/etc/login.defs"
+#define _PATH_SD_UNITSLOAD _PATH_RUNSTATEDIR "/systemd/systemd-units-load"
+
/* misc paths */
#define _PATH_WORDS "/usr/share/dict/words"
#define _PATH_WORDS_ALT "/usr/share/dict/web2"
diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index ce1de16dc..90a0331c3 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -38,6 +38,7 @@
#include "strutils.h"
#include "closestream.h"
#include "canonicalize.h"
+#include "pathnames.h"
#define XALLOC_EXIT_CODE MNT_EX_SYSERR
#include "xalloc.h"
@@ -336,6 +337,25 @@ static void selinux_warning(struct libmnt_context *cxt, const char *tgt)
# define selinux_warning(_x, _y)
#endif
+static void systemd_hint(void)
+{
+ static int fstab_check_done = 0;
+
+ if (fstab_check_done == 0) {
+ struct stat a, b;
+
+ if (isatty(STDERR_FILENO) &&
+ stat(_PATH_SD_UNITSLOAD, &a) == 0 &&
+ stat(_PATH_MNTTAB, &b) == 0 &&
+ cmp_stat_mtime(&a, &b, <))
+ printf(_(
+ "mount: (hint) your fstab has been modified, but systemd still uses\n"
+ " the old version; use 'systemctl daemon-reload' to reload.\n"));
+
+ fstab_check_done = 1;
+ }
+}
+
/*
* Returns exit status (MNT_EX_*) and/or prints error message.
*/
@@ -359,6 +379,9 @@ static int mk_exit_code(struct libmnt_context *cxt, int rc)
if (rc == MNT_EX_SUCCESS && mnt_context_get_status(cxt) == 1) {
selinux_warning(cxt, tgt);
}
+
+ systemd_hint();
+
return rc;
}
--
2.39.2

View File

@ -0,0 +1,73 @@
From 3dc40e180aaf653bc76fc0097a8bb112f48af5ae Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 2 Mar 2022 11:34:06 +0100
Subject: tests: improve cramfs tests
* make GID and mode use more robust (already used in tests/ts/cramfs/mkfs)
* mark cramfs fsck/mkfs tests as TS_KNOWN_FAIL, the tests are based on
image checksums and it produces a different binary image on s390
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2133396
Addresses: https://github.com/util-linux/util-linux/issues/1613
Signed-off-by: Karel Zak <kzak@redhat.com>
---
tests/ts/cramfs/doubles | 9 ++++++++-
tests/ts/cramfs/fsck-endianness | 3 +++
tests/ts/cramfs/mkfs-endianness | 3 +++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/tests/ts/cramfs/doubles b/tests/ts/cramfs/doubles
index 8a1b7bb88..eb2c7fa0f 100755
--- a/tests/ts/cramfs/doubles
+++ b/tests/ts/cramfs/doubles
@@ -36,10 +36,17 @@ IMAGE_SRC="$TS_OUTDIR/${TS_TESTNAME}-data"
ts_log "create mountpoint dir"
[ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT
-mkdir -p $IMAGE_SRC
+rm -rf "$IMAGE_SRC"
+mkdir -m 755 -p $IMAGE_SRC
+
+umask 133
+
echo hello > $IMAGE_SRC/a
echo hello > $IMAGE_SRC/b
+# sudo may use whatever group
+chgrp -R 0 "$IMAGE_SRC"
+
ts_log "create cramfs image"
$TS_CMD_MKCRAMFS $IMAGE_SRC $IMAGE_PATH >> $TS_OUTPUT 2>> $TS_ERRLOG
[ -s "$IMAGE_PATH" ] || ts_die "Cannot create $IMAGE_PATH"
diff --git a/tests/ts/cramfs/fsck-endianness b/tests/ts/cramfs/fsck-endianness
index bcfb46c90..222ea3fd3 100755
--- a/tests/ts/cramfs/fsck-endianness
+++ b/tests/ts/cramfs/fsck-endianness
@@ -27,6 +27,9 @@ ts_check_test_command "$TS_HELPER_MD5"
ts_skip_nonroot
+# does not work on s390
+TS_KNOWN_FAIL="yes"
+
IMAGE_LITTLE="$TS_SELF/cramfs-little.img" #Known good little endian image
IMAGE_BIG="$TS_SELF/cramfs-big.img" #Known good big endian image
diff --git a/tests/ts/cramfs/mkfs-endianness b/tests/ts/cramfs/mkfs-endianness
index 91d476579..5f0ff714d 100755
--- a/tests/ts/cramfs/mkfs-endianness
+++ b/tests/ts/cramfs/mkfs-endianness
@@ -26,6 +26,9 @@ ts_check_test_command "$TS_CMD_HEXDUMP"
ts_skip_nonroot
+# does not work on s390
+TS_KNOWN_FAIL="yes"
+
IMAGE_DATA="$TS_OUTDIR/${TS_TESTNAME}-data"
IMAGE_CREATED="$TS_OUTDIR/${TS_TESTNAME}-cramfs.img" #Image created during the test and compared against the known images.
--
2.40.1

View File

@ -0,0 +1,33 @@
From f0f4fe8901462ca335d89267037ffe99096bac72 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 9 Aug 2023 12:56:42 +0200
Subject: uuidd: improve man page for -cont-clock
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2174748
Signed-off-by: Karel Zak <kzak@redhat.com>
---
misc-utils/uuidd.8.adoc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/misc-utils/uuidd.8.adoc b/misc-utils/uuidd.8.adoc
index c87125901..38ef39598 100644
--- a/misc-utils/uuidd.8.adoc
+++ b/misc-utils/uuidd.8.adoc
@@ -24,8 +24,12 @@ The *uuidd* daemon is used by the UUID library to generate universally unique id
== OPTIONS
-*-C*, *--cont-clock* _opt_arg_::
-Activate continuous clock handling for time based UUIDs. *uuidd* could use all possible clock values, beginning with the daemon's start time. The optional argument can be used to set a value for the max_clock_offset. This gurantees, that a clock value of a UUID will always be within the range of the max_clock_offset. '-C' or '--cont-clock' enables the feature with a default max_clock_offset of 2 hours. '-C<NUM>[hd]' or '--cont-clock=<NUM>[hd]' enables the feature with a max_clock_offset of NUM seconds. In case of an appended h or d, the NUM value is read in hours or days. The minimum value is 60 seconds, the maximum value is 365 days.
+*-C*, *--cont-clock*[=_time_]::
+Activate continuous clock handling for time based UUIDs. *uuidd* could use all possible clock values, beginning with the daemon's start time. The optional argument can be used to set a value for the max_clock_offset. This gurantees, that a clock value of a UUID will always be within the range of the max_clock_offset.
++
+The option '-C' or '--cont-clock' enables the feature with a default max_clock_offset of 2 hours.
++
+The option '-C<NUM>[hd]' or '--cont-clock=<NUM>[hd]' enables the feature with a max_clock_offset of NUM seconds. In case of an appended h or d, the NUM value is read in hours or days. The minimum value is 60 seconds, the maximum value is 365 days.
*-d*, *--debug*::
Run uuidd in debugging mode. This prevents uuidd from running as a daemon.
--
2.40.1

View File

@ -0,0 +1,27 @@
From 9d5e7c1357b8f4745d28b5a1aa8726b58666ad59 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 9 Aug 2023 13:12:34 +0200
Subject: uuidd: enable cont-clock in service file
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2174748
Signed-off-by: Karel Zak <kzak@redhat.com>
---
misc-utils/uuidd.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc-utils/uuidd.service.in b/misc-utils/uuidd.service.in
index 4ad6d97c9..330f1ab9b 100644
--- a/misc-utils/uuidd.service.in
+++ b/misc-utils/uuidd.service.in
@@ -4,7 +4,7 @@ Documentation=man:uuidd(8)
Requires=uuidd.socket
[Service]
-ExecStart=@usrsbin_execdir@/uuidd --socket-activation
+ExecStart=@usrsbin_execdir@/uuidd --socket-activation --cont-clock
Restart=no
User=uuidd
Group=uuidd
--
2.40.1

View File

@ -0,0 +1,205 @@
From 5f44ec9a0096a0c220666d5586618fd718a9a40d Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 9 Aug 2023 13:21:02 +0200
Subject: lscpu: backport ARM human-readable names from upstream
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2182169
Signed-off-by: Karel Zak <kzak@redhat.com>
---
sys-utils/lscpu-arm.c | 109 +++++++++++++++++++++++++++++++++++++-----
1 file changed, 96 insertions(+), 13 deletions(-)
diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c
index 79b8e3aa5..5716f6c51 100644
--- a/sys-utils/lscpu-arm.c
+++ b/sys-utils/lscpu-arm.c
@@ -64,6 +64,7 @@ static const struct id_part arm_part[] = {
{ 0xc27, "Cortex-M7" },
{ 0xc60, "Cortex-M0+" },
{ 0xd01, "Cortex-A32" },
+ { 0xd02, "Cortex-A34" },
{ 0xd03, "Cortex-A53" },
{ 0xd04, "Cortex-A35" },
{ 0xd05, "Cortex-A55" },
@@ -77,18 +78,36 @@ static const struct id_part arm_part[] = {
{ 0xd0d, "Cortex-A77" },
{ 0xd0e, "Cortex-A76AE" },
{ 0xd13, "Cortex-R52" },
+ { 0xd15, "Cortex-R82" },
+ { 0xd16, "Cortex-R52+" },
{ 0xd20, "Cortex-M23" },
{ 0xd21, "Cortex-M33" },
+ { 0xd22, "Cortex-M55" },
+ { 0xd23, "Cortex-M85" },
+ { 0xd40, "Neoverse-V1" },
{ 0xd41, "Cortex-A78" },
{ 0xd42, "Cortex-A78AE" },
+ { 0xd43, "Cortex-A65AE" },
+ { 0xd44, "Cortex-X1" },
+ { 0xd46, "Cortex-A510" },
+ { 0xd47, "Cortex-A710" },
+ { 0xd48, "Cortex-X2" },
+ { 0xd49, "Neoverse-N2" },
{ 0xd4a, "Neoverse-E1" },
{ 0xd4b, "Cortex-A78C" },
+ { 0xd4c, "Cortex-X1C" },
+ { 0xd4d, "Cortex-A715" },
+ { 0xd4e, "Cortex-X3" },
+ { 0xd4f, "Neoverse-V2" },
+ { 0xd80, "Cortex-A520" },
+ { 0xd81, "Cortex-A720" },
+ { 0xd82, "Cortex-X4" },
{ -1, "unknown" },
};
static const struct id_part brcm_part[] = {
- { 0x0f, "Brahma B15" },
- { 0x100, "Brahma B53" },
+ { 0x0f, "Brahma-B15" },
+ { 0x100, "Brahma-B53" },
{ 0x516, "ThunderX2" },
{ -1, "unknown" },
};
@@ -101,10 +120,18 @@ static const struct id_part dec_part[] = {
static const struct id_part cavium_part[] = {
{ 0x0a0, "ThunderX" },
- { 0x0a1, "ThunderX 88XX" },
- { 0x0a2, "ThunderX 81XX" },
- { 0x0a3, "ThunderX 83XX" },
- { 0x0af, "ThunderX2 99xx" },
+ { 0x0a1, "ThunderX-88XX" },
+ { 0x0a2, "ThunderX-81XX" },
+ { 0x0a3, "ThunderX-83XX" },
+ { 0x0af, "ThunderX2-99xx" },
+ { 0x0b0, "OcteonTX2" },
+ { 0x0b1, "OcteonTX2-98XX" },
+ { 0x0b2, "OcteonTX2-96XX" },
+ { 0x0b3, "OcteonTX2-95XX" },
+ { 0x0b4, "OcteonTX2-95XXN" },
+ { 0x0b5, "OcteonTX2-95XXMM" },
+ { 0x0b6, "OcteonTX2-95XXO" },
+ { 0x0b8, "ThunderX3-T110" },
{ -1, "unknown" },
};
@@ -121,8 +148,12 @@ static const struct id_part qcom_part[] = {
{ 0x201, "Kryo" },
{ 0x205, "Kryo" },
{ 0x211, "Kryo" },
- { 0x800, "Falkor V1/Kryo" },
- { 0x801, "Kryo V2" },
+ { 0x800, "Falkor-V1/Kryo" },
+ { 0x801, "Kryo-V2" },
+ { 0x802, "Kryo-3XX-Gold" },
+ { 0x803, "Kryo-3XX-Silver" },
+ { 0x804, "Kryo-4XX-Gold" },
+ { 0x805, "Kryo-4XX-Silver" },
{ 0xc00, "Falkor" },
{ 0xc01, "Saphira" },
{ -1, "unknown" },
@@ -130,6 +161,9 @@ static const struct id_part qcom_part[] = {
static const struct id_part samsung_part[] = {
{ 0x001, "exynos-m1" },
+ { 0x002, "exynos-m3" },
+ { 0x003, "exynos-m4" },
+ { 0x004, "exynos-m5" },
{ -1, "unknown" },
};
@@ -141,12 +175,52 @@ static const struct id_part nvidia_part[] = {
};
static const struct id_part marvell_part[] = {
- { 0x131, "Feroceon 88FR131" },
+ { 0x131, "Feroceon-88FR131" },
{ 0x581, "PJ4/PJ4b" },
{ 0x584, "PJ4B-MP" },
{ -1, "unknown" },
};
+static const struct id_part apple_part[] = {
+ { 0x000, "Swift" },
+ { 0x001, "Cyclone" },
+ { 0x002, "Typhoon" },
+ { 0x003, "Typhoon/Capri" },
+ { 0x004, "Twister" },
+ { 0x005, "Twister/Elba/Malta" },
+ { 0x006, "Hurricane" },
+ { 0x007, "Hurricane/Myst" },
+ { 0x008, "Monsoon" },
+ { 0x009, "Mistral" },
+ { 0x00b, "Vortex" },
+ { 0x00c, "Tempest" },
+ { 0x00f, "Tempest-M9" },
+ { 0x010, "Vortex/Aruba" },
+ { 0x011, "Tempest/Aruba" },
+ { 0x012, "Lightning" },
+ { 0x013, "Thunder" },
+ { 0x020, "Icestorm-A14" },
+ { 0x021, "Firestorm-A14" },
+ { 0x022, "Icestorm-M1" },
+ { 0x023, "Firestorm-M1" },
+ { 0x024, "Icestorm-M1-Pro" },
+ { 0x025, "Firestorm-M1-Pro" },
+ { 0x026, "Thunder-M10" },
+ { 0x028, "Icestorm-M1-Max" },
+ { 0x029, "Firestorm-M1-Max" },
+ { 0x030, "Blizzard-A15" },
+ { 0x031, "Avalanche-A15" },
+ { 0x032, "Blizzard-M2" },
+ { 0x033, "Avalanche-M2" },
+ { 0x034, "Blizzard-M2-Pro" },
+ { 0x035, "Avalanche-M2-Pro" },
+ { 0x036, "Sawtooth-A16" },
+ { 0x037, "Everest-A16" },
+ { 0x038, "Blizzard-M2-Max" },
+ { 0x039, "Avalanche-M2-Max" },
+ { -1, "unknown" },
+};
+
static const struct id_part faraday_part[] = {
{ 0x526, "FA526" },
{ 0x626, "FA626" },
@@ -185,12 +259,21 @@ static const struct id_part fujitsu_part[] = {
static const struct id_part hisi_part[] = {
{ 0xd01, "Kunpeng-920" }, /* aka tsv110 */
+ { 0xd40, "Cortex-A76" }, /* HiSilicon uses this ID though advertises A76 */
+ { -1, "unknown" },
+};
+
+static const struct id_part ampere_part[] = {
+ { 0xac3, "Ampere-1" },
+ { 0xac4, "Ampere-1a" },
{ -1, "unknown" },
};
static const struct id_part ft_part[] = {
- { 0x662, "FT-2000+" },
- { 0x663, "S2500" },
+ { 0x660, "FTC660" },
+ { 0x661, "FTC661" },
+ { 0x662, "FTC662" },
+ { 0x663, "FTC663" },
{ -1, "unknown" },
};
@@ -218,11 +301,11 @@ static const struct hw_impl hw_implementer[] = {
{ 0x51, qcom_part, "Qualcomm" },
{ 0x53, samsung_part, "Samsung" },
{ 0x56, marvell_part, "Marvell" },
- { 0x61, unknown_part, "Apple" },
+ { 0x61, apple_part, "Apple" },
{ 0x66, faraday_part, "Faraday" },
{ 0x69, intel_part, "Intel" },
{ 0x70, ft_part, "Phytium" },
- { 0xc0, unknown_part, "Ampere" },
+ { 0xc0, ampere_part, "Ampere" },
{ -1, unknown_part, "unknown" },
};
--
2.40.1

View File

@ -0,0 +1,84 @@
From 6275861012e63828a3c43b3acacb4dd623af848d Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 9 Aug 2023 13:30:49 +0200
Subject: libuuid: backport cache handling from upstream
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2189947
Upstream: http://github.com/util-linux/util-linux/commit/104dc2e092058489a4be17d5b15902e58ca56804
Upstream: http://github.com/util-linux/util-linux/commit/2fa4168c8bc9d5438bc1dfadda293c7c21b6fa59
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libuuid/src/gen_uuid.c | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c
index f05db467e..619ef0131 100644
--- a/libuuid/src/gen_uuid.c
+++ b/libuuid/src/gen_uuid.c
@@ -528,18 +528,37 @@ int __uuid_generate_time_cont(uuid_t out, int *num, uint32_t cont_offset)
*/
static int uuid_generate_time_generic(uuid_t out) {
#ifdef HAVE_TLS
+ /* thread local cache for uuidd based requests */
+ const int cs_min = (1<<6);
+ const int cs_max = (1<<18);
+ const int cs_factor = 2;
THREAD_LOCAL int num = 0;
+ THREAD_LOCAL int cache_size = cs_min;
+ THREAD_LOCAL int last_used = 0;
THREAD_LOCAL struct uuid uu;
THREAD_LOCAL time_t last_time = 0;
time_t now;
- if (num > 0) {
+ if (num > 0) { /* expire cache */
now = time(NULL);
- if (now > last_time+1)
+ if (now > last_time+1) {
+ last_used = cache_size - num;
num = 0;
+ }
}
- if (num <= 0) {
- num = 1000;
+ if (num <= 0) { /* fill cache */
+ /*
+ * num + OP_BULK provides a local cache in each application.
+ * Start with a small cache size to cover short running applications
+ * and adjust the cache size over the runntime.
+ */
+ if ((last_used == cache_size) && (cache_size < cs_max))
+ cache_size *= cs_factor;
+ else if ((last_used < (cache_size / cs_factor)) && (cache_size > cs_min))
+ cache_size /= cs_factor;
+
+ num = cache_size;
+
if (get_uuid_via_daemon(UUIDD_OP_BULK_TIME_UUID,
out, &num) == 0) {
last_time = time(NULL);
@@ -547,9 +566,11 @@ static int uuid_generate_time_generic(uuid_t out) {
num--;
return 0;
}
+ /* request to daemon failed, reset cache */
num = 0;
+ cache_size = cs_min;
}
- if (num > 0) {
+ if (num > 0) { /* serve uuid from cache */
uu.time_low++;
if (uu.time_low == 0) {
uu.time_mid++;
@@ -558,6 +579,8 @@ static int uuid_generate_time_generic(uuid_t out) {
}
num--;
uuid_pack(&uu, out);
+ if (num == 0)
+ last_used = cache_size;
return 0;
}
#else
--
2.40.1

View File

@ -0,0 +1,60 @@
From 3c494ecb0ed4c49b5843d458c0b487aee5d25963 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 9 Aug 2023 13:39:32 +0200
Subject: zramctl: add hint about supported algorithms
It seems the current list of the algorithms is confusing for
end-users, because it's inaccurate in many cases. Let's explain why
the list cannot be "perfect".
Upstream: http://github.com/util-linux/util-linux/commit/2d7549b79f2b32f33cec3a5b518cddfe9a63506b
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2203324
Signed-off-by: Karel Zak <kzak@redhat.com>
---
sys-utils/zramctl.8.adoc | 4 +++-
sys-utils/zramctl.c | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/sys-utils/zramctl.8.adoc b/sys-utils/zramctl.8.adoc
index 7b684ed44..ff83b6ec9 100644
--- a/sys-utils/zramctl.8.adoc
+++ b/sys-utils/zramctl.8.adoc
@@ -38,8 +38,10 @@ Note that _zramdev_ node specified on command line has to already exist. The com
== OPTIONS
-*-a*, **--algorithm lzo**|**lz4**|**lz4hc**|**deflate**|*842*::
+*-a*, **--algorithm lzo**|**lz4**|**lz4hc**|**deflate**|**842**|**zstd**::
Set the compression algorithm to be used for compressing data in the zram device.
++
+The *list of supported algorithms could be inaccurate* as it depends on the current kernel configuration. A basic overview can be obtained by using the command "cat /sys/block/zram0/comp_algorithm"; however, please note that this list might also be incomplete. This is due to the fact that ZRAM utilizes the Crypto API, and if certain algorithms were built as modules, it becomes impossible to enumerate all of them.
*-f*, *--find*::
Find the first unused zram device. If a *--size* argument is present, then initialize the device.
diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c
index 64d5fcd81..a84ce665b 100644
--- a/sys-utils/zramctl.c
+++ b/sys-utils/zramctl.c
@@ -547,7 +547,7 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_("Set up and control zram devices.\n"), out);
fputs(USAGE_OPTIONS, out);
- fputs(_(" -a, --algorithm lzo|lz4|lz4hc|deflate|842 compression algorithm to use\n"), out);
+ fputs(_(" -a, --algorithm <alg> compression algorithm to use\n"), out);
fputs(_(" -b, --bytes print sizes in bytes rather than in human readable format\n"), out);
fputs(_(" -f, --find find a free device\n"), out);
fputs(_(" -n, --noheadings don't print headings\n"), out);
@@ -564,6 +564,10 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(USAGE_ARGUMENTS, out);
printf(USAGE_ARG_SIZE(_("<size>")));
+ fputs(_(" <alg> specify algorithm, supported are:\n"), out);
+ fputs(_(" lzo, lz4, lz4hc, deflate, 842 and zstd\n"), out);
+ fputs(_(" (List may be inaccurate, consult man page.)\n"), out);
+
fputs(USAGE_COLUMNS, out);
for (i = 0; i < ARRAY_SIZE(infos); i++)
fprintf(out, " %11s %s\n", infos[i].name, _(infos[i].help));
--
2.40.1

View File

@ -0,0 +1,28 @@
From 71e5eb4208ff6692e6bf93c74f1737ce26ea9ef0 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 23 May 2023 11:34:19 +0200
Subject: fstab: add hint about systemd reload
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2209267
Upstream: http://github.com/util-linux/util-linux/commit/9105d3cdd819a499f5029d1009952acf6f51b7d9
Signed-off-by: Karel Zak <kzak@redhat.com>
---
sys-utils/fstab.5.adoc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys-utils/fstab.5.adoc b/sys-utils/fstab.5.adoc
index 332d74611..f3647fc6e 100644
--- a/sys-utils/fstab.5.adoc
+++ b/sys-utils/fstab.5.adoc
@@ -52,6 +52,8 @@ _/etc/fstab_
The file *fstab* contains descriptive information about the filesystems the system can mount. *fstab* is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file. The order of records in *fstab* is important because *fsck*(8), *mount*(8), and *umount*(8) sequentially iterate through *fstab* doing their thing.
+The file is not read by *mount*(8) only but often is used by many other tools and daemons, and proper functionality may require additional steps. For example, on systemd-based systems, it's recommended to use 'systemctl daemon-reload' after *fstab* modification.
+
Each filesystem is described on a separate line. Fields on each line are separated by tabs or spaces. Lines starting with '#' are comments. Blank lines are ignored.
The following is a typical example of an *fstab* entry:
--
2.40.1

View File

@ -0,0 +1,39 @@
From 2ab525d0cf6f4043e49e070040ec2fb67274ffe8 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 9 Aug 2023 13:51:03 +0200
Subject: sfdisk: add hint about duplicate UUIDs when use dump
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2215082
Upstream: http://github.com/util-linux/util-linux/commit/60c81b3272d03959dfee465f1ecaf40ba3e70cb3
Signed-off-by: Karel Zak <kzak@redhat.com>
---
disk-utils/sfdisk.8.adoc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/disk-utils/sfdisk.8.adoc b/disk-utils/sfdisk.8.adoc
index 091e59120..8a457c969 100644
--- a/disk-utils/sfdisk.8.adoc
+++ b/disk-utils/sfdisk.8.adoc
@@ -342,6 +342,8 @@ creates empty GPT partition table. Note that the *--append* disables this featur
It is recommended to save the layout of your devices. *sfdisk* supports two ways.
+=== Dump in sfdisk compatible format
+
Use the *--dump* option to save a description of the device layout to a text file. The dump format is suitable for later *sfdisk* input. For example:
____
@@ -354,6 +356,10 @@ ____
*sfdisk /dev/sda < sda.dump*
____
+Note that sfdisk completely restores partition types and partition UUIDs. This could potentially become problematic if you duplicate the same layout to different disks, as it may result in duplicate UUIDs within your system.
+
+=== Full binary backup
+
If you want to do a full (binary) backup of all sectors where the partition table is stored, then use the *--backup* option. It writes the sectors to _~/sfdisk-<device>-<offset>.bak_ files. The default name of the backup file can be changed with the *--backup-file* option. The backup files contain only raw data from the _device_. Note that the same concept of backup files is used by *wipefs*(8). For example:
____
--
2.40.1

View File

@ -0,0 +1,162 @@
From fe0b5c21d440ec00c5cba9b1c862aa189edc4446 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 10 Aug 2023 11:15:29 +0200
Subject: tests: don't write mount hint to terminal
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2180414
Upstream: http://github.com/util-linux/util-linux/commit/4b9e3937966f7ddf90e6013c87f73c260963b0ea
Upstream: http://github.com/util-linux/util-linux/commit/ebbb108c5d1cb7c6a28671f2973fb706a35eacae
Signed-off-by: Karel Zak <kzak@redhat.com>
---
tests/ts/eject/umount | 10 +++++-----
tests/ts/mount/fstab-btrfs | 2 +-
tests/ts/mount/move | 2 +-
tests/ts/mount/remount | 9 +++++----
tests/ts/mount/shared-subtree | 2 +-
tests/ts/mount/umount-alltargets | 6 +++---
tests/ts/mount/umount-recursive | 4 ++--
7 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/tests/ts/eject/umount b/tests/ts/eject/umount
index 04f53ed99..6cbf12671 100755
--- a/tests/ts/eject/umount
+++ b/tests/ts/eject/umount
@@ -82,7 +82,7 @@ init_device
mkfs.ext2 -q -F $TS_DEVICE
udevadm settle
mkdir -p $TS_MOUNTPOINT
-$TS_CMD_MOUNT $TS_DEVICE $TS_MOUNTPOINT
+$TS_CMD_MOUNT $TS_DEVICE $TS_MOUNTPOINT &> /dev/null
udevadm settle
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
deinit_device
@@ -94,8 +94,8 @@ init_device
init_partitions $TS_DEVICE
mkdir -p ${TS_MOUNTPOINT}1
mkdir -p ${TS_MOUNTPOINT}2
-$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
-$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
+$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1 &> /dev/null
+$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2 &> /dev/null
udevadm settle
$TS_CMD_EJECT --force $TS_DEVICE && ts_log "Success"
deinit_device
@@ -115,8 +115,8 @@ init_device
init_partitions $TS_DEVICE
mkdir -p ${TS_MOUNTPOINT}1
mkdir -p ${TS_MOUNTPOINT}2
-$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1
-$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2
+$TS_CMD_MOUNT ${TS_DEVICE}1 ${TS_MOUNTPOINT}1 &> /dev/null
+$TS_CMD_MOUNT ${TS_DEVICE}2 ${TS_MOUNTPOINT}2 &> /dev/null
udevadm settle
$TS_CMD_EJECT --force ${TS_DEVICE}1 && ts_log "Success"
deinit_device
diff --git a/tests/ts/mount/fstab-btrfs b/tests/ts/mount/fstab-btrfs
index 0003b5d65..dff707047 100755
--- a/tests/ts/mount/fstab-btrfs
+++ b/tests/ts/mount/fstab-btrfs
@@ -51,7 +51,7 @@ DEVICE=$TS_LODEV
[ -d "$TS_MOUNTPOINT_BIND" ] || mkdir -p "$TS_MOUNTPOINT_BIND"
mkfs.btrfs -d single -m single $DEVICE &> /dev/null || ts_die "Cannot make btrfs on $DEVICE"
-$TS_CMD_MOUNT -o loop "$DEVICE" "$TS_MOUNTPOINT_CREATE"
+$TS_CMD_MOUNT -o loop "$DEVICE" "$TS_MOUNTPOINT_CREATE" &> /dev/null
pushd . >/dev/null
cd "$TS_MOUNTPOINT_CREATE"
mkdir -p d0/dd0/ddd0
diff --git a/tests/ts/mount/move b/tests/ts/mount/move
index 9d2723a75..198732c4e 100755
--- a/tests/ts/mount/move
+++ b/tests/ts/mount/move
@@ -32,7 +32,7 @@ function mount_and_check {
# last arg must be an existing or to-be-mounted mountpoint
local mountpoint="${@: -1}"
- $TS_CMD_MOUNT "$@" \
+ $TS_CMD_MOUNT "$@" &> /dev/null \
|| ts_die "error: mount $*"
$TS_CMD_MOUNTPOINT -q "$mountpoint" \
diff --git a/tests/ts/mount/remount b/tests/ts/mount/remount
index 38db9bf9f..69fbf1815 100755
--- a/tests/ts/mount/remount
+++ b/tests/ts/mount/remount
@@ -43,15 +43,16 @@ fi
mkfs.ext2 $DEVICE &> /dev/null || ts_die "Cannot make ext2 on $DEVICE"
# mount read-write
-$TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT || ts_die "Cannot mount $TS_MOUNTPOINT"
+$TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT &> /dev/null \
+ || ts_die "Cannot mount $TS_MOUNTPOINT"
# check the mount
egrep -q "^$DEVICE $TS_MOUNTPOINT" $MTAB_FILE \
- || ts_die "Cannot find $TS_MOUNTPOINT in $MTAB_FILE"
+ || ts_die "Cannot find $TS_MOUNTPOINT in $MTAB_FILE"
# remount
-$TS_CMD_MOUNT -o remount,ro $TS_MOUNTPOINT \
- || ts_die "Cannot remount $TS_MOUNTPOINT"
+$TS_CMD_MOUNT -o remount,ro $TS_MOUNTPOINT &> /dev/null \
+ || ts_die "Cannot remount $TS_MOUNTPOINT"
# check the remount
$TS_CMD_FINDMNT --kernel --mountpoint "$TS_MOUNTPOINT" --options "ro" &> /dev/null
diff --git a/tests/ts/mount/shared-subtree b/tests/ts/mount/shared-subtree
index 44b460b57..cb43ade57 100755
--- a/tests/ts/mount/shared-subtree
+++ b/tests/ts/mount/shared-subtree
@@ -17,7 +17,7 @@ ts_check_prog "mkfs.ext2"
[ -d $TS_MOUNTPOINT ] || mkdir -p $TS_MOUNTPOINT
# bind
-$TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT
+$TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT &> /dev/null
[ "$?" = "0" ] || ts_die "error: mount --bind"
# check the bind
diff --git a/tests/ts/mount/umount-alltargets b/tests/ts/mount/umount-alltargets
index 37a163d87..83a04bafe 100755
--- a/tests/ts/mount/umount-alltargets
+++ b/tests/ts/mount/umount-alltargets
@@ -112,11 +112,11 @@ ts_finalize_subtest
ts_init_subtest "all-targets-recursive"
multi_mount ${TS_DEVICE}1 $MOUNTPOINT
[ -d "${MOUNTPOINT}1/subA" ] || mkdir -p ${MOUNTPOINT}1/subA
-$TS_CMD_MOUNT ${TS_DEVICE}2 ${MOUNTPOINT}1/subA
+$TS_CMD_MOUNT ${TS_DEVICE}2 ${MOUNTPOINT}1/subA &> /dev/null
[ -d "${MOUNTPOINT}1/subA/subAB" ] || mkdir -p ${MOUNTPOINT}1/subA/subAB
-$TS_CMD_MOUNT ${TS_DEVICE}3 ${MOUNTPOINT}1/subA/subAB
+$TS_CMD_MOUNT ${TS_DEVICE}3 ${MOUNTPOINT}1/subA/subAB &> /dev/null
[ -d "${MOUNTPOINT}1/subB" ] || mkdir -p ${MOUNTPOINT}1/subB
-$TS_CMD_MOUNT ${TS_DEVICE}4 ${MOUNTPOINT}1/subB
+$TS_CMD_MOUNT ${TS_DEVICE}4 ${MOUNTPOINT}1/subB &> /dev/null
$TS_CMD_UMOUNT --recursive --all-targets ${TS_DEVICE}1 >> $TS_OUTPUT 2>> $TS_ERRLOG
[ $? == 0 ] || ts_log "umount failed"
ts_finalize_subtest
diff --git a/tests/ts/mount/umount-recursive b/tests/ts/mount/umount-recursive
index 700c58c12..3e1d66327 100755
--- a/tests/ts/mount/umount-recursive
+++ b/tests/ts/mount/umount-recursive
@@ -67,7 +67,7 @@ ts_log "Do tests..."
ts_log "A) Mount root"
$TS_CMD_MOUNT ${TS_DEVICE}1 $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
-$TS_CMD_MOUNT --make-shared $TS_MOUNTPOINT
+$TS_CMD_MOUNT --make-shared $TS_MOUNTPOINT &> /dev/null
ts_log "B) Mount child"
mkdir -p $TS_MOUNTPOINT/mntB
@@ -86,7 +86,7 @@ $TS_CMD_MOUNT ${TS_DEVICE}4 $TS_MOUNTPOINT/mntB/mntD >> $TS_OUTPUT 2>> $TS_ERRLO
ts_log "E) Mount child-bind"
mkdir -p $TS_MOUNTPOINT/bindC
-$TS_CMD_MOUNT --bind $TS_MOUNTPOINT/mntB/mntC $TS_MOUNTPOINT/bindC
+$TS_CMD_MOUNT --bind $TS_MOUNTPOINT/mntB/mntC $TS_MOUNTPOINT/bindC &> /dev/null
udevadm settle
$TS_CMD_UMOUNT --recursive $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG
--
2.40.1

View File

@ -2,7 +2,7 @@
Summary: A collection of basic system utilities
Name: util-linux
Version: 2.37.4
Release: 10%{?dist}
Release: 15%{?dist}
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
URL: http://en.wikipedia.org/wiki/Util-linux
@ -166,6 +166,29 @@ Patch43: 0043-agetty-resolve-tty-name-even-if-stdin-is-specified.patch
# 2166653 - last(1) should be more robust with work with strings
Patch44: 0044-last-use-snprintf-rather-than-sprintf.patch
### RHEL-9.3.0
#
# 2180414 - Backport hint about systemd daemon-reload
Patch45: 0045-include-c-add-cmp_timespec-and-cmp_stat_mtime.patch
Patch46: 0046-mount-add-hint-about-systemctl-daemon-reload.patch
# 2133396 - Internal testsuite for cramfs fails on s390x
Patch47: 0047-tests-improve-cramfs-tests.patch
# 2174748 - enable uuidd cont-clock by default
Patch48: 0048-uuidd-improve-man-page-for-cont-clock.patch
Patch49: 0049-uuidd-enable-cont-clock-in-service-file.patch
# 2182169 - lscpu: backport ARM human-readable names from upstream
Patch50: 0050-lscpu-backport-ARM-human-readable-names-from-upstrea.patch
# 2189947 - libuuid - downport cache related patch
Patch51: 0051-libuuid-backport-cache-handling-from-upstream.patch
# 2203324 - zram module does not have algorithms mentioned in zramctl command
Patch52: 0052-zramctl-add-hint-about-supported-algorithms.patch
# 2209267 - Add additional documentation on devices being auto-mounted if a device exists within fstab.
Patch53: 0053-fstab-add-hint-about-systemd-reload.patch
# 2215082 - For the 'sfdisk' man page to further clarify the expected behavior and intended use of the -d option
Patch54: 0054-sfdisk-add-hint-about-duplicate-UUIDs-when-use-dump.patch
# 2180414 - Backport hint about systemd daemon-reload
Patch55: 0055-tests-don-t-write-mount-hint-to-terminal.patch
%description
The util-linux package contains a large variety of low-level system
@ -1000,6 +1023,27 @@ fi
%{_libdir}/python*/site-packages/libmount/
%changelog
* Thu Aug 24 2023 Karel Zak <kzak@redhat.com> 2.37.4-15
- fix typo in patch for #2133396
* Wed Aug 23 2023 Karel Zak <kzak@redhat.com> 2.37.4-14
- improve fix #2133396 - Internal testsuite for cramfs fails on s390x
* Thu Aug 10 2023 Karel Zak <kzak@redhat.com> 2.37.4-13
- improve fix #2180414 - Backport hint about systemd daemon-reload
* Wed Aug 09 2023 Karel Zak <kzak@redhat.com> 2.37.4-12
- fix #2133396 - Internal testsuite for cramfs fails on s390x
- fix #2174748 - enable uuidd cont-clock by default
- fix #2182169 - lscpu: backport ARM human-readable names from upstream
- fix #2189947 - libuuid - downport cache related patch
- fix #2203324 - zram module does not have algorithms mentioned in zramctl command
- fix #2209267 - Add additional documentation on devices being auto-mounted if a device exists within fstab.
- fix #2215082 - For the 'sfdisk' man page to further clarify the expected behavior and intended use of the -d option
* Tue Mar 28 2023 Karel Zak <kzak@redhat.com> 2.37.4-11
- fix #2180414 - Backport hint about systemd daemon-reload
* Tue Feb 07 2023 Karel Zak <kzak@redhat.com> 2.37.4-10
- fix #2165981 - fstrim -av fails to trim root filesystem on Red Hat Coreos
- fix #2141970 - add --cont-clock feature for libuuid and uuidd