From 889e1d114b66dcbcfbdab67ea2003651a9678bf4 Mon Sep 17 00:00:00 2001 From: Renbo Date: Thu, 18 Jul 2024 15:17:57 +0800 Subject: [PATCH 1/6] update to util-linux-2.32.1-46.src.rpm Signed-off-by: Renbo --- ...limit-fix-optional-arguments-parsing.patch | 31 -- ...ize-socket-credentials-control-union.patch | 29 ++ 0101-libblkid-hfs-fix-label-use-fuzzing.patch | 32 ++ ...d-bsd-fix-buffer-pointer-use-fuzzing.patch | 29 ++ ...ix-size-and-offset-overflows-fuzzing.patch | 56 +++ ...ch-today-day-and-this-year-correctly.patch | 89 +++++ 1001-hwclock-make-glibc-2.31-compatible.patch | 161 --------- ...eoverse-N2-to-ARM-identifiers-tables.patch | 24 -- ...-cpu-frequency-from-cpuinfo-on-arm64.patch | 24 -- 1004-util-linux-add-sw.patch | 322 ------------------ dist | 2 +- util-linux.spec | 39 ++- 12 files changed, 255 insertions(+), 583 deletions(-) delete mode 100644 0001-prlimit-fix-optional-arguments-parsing.patch create mode 100644 0100-logger-initialize-socket-credentials-control-union.patch create mode 100644 0101-libblkid-hfs-fix-label-use-fuzzing.patch create mode 100644 0102-libblkid-bsd-fix-buffer-pointer-use-fuzzing.patch create mode 100644 0103-libblkid-probe-fix-size-and-offset-overflows-fuzzing.patch create mode 100644 0104-timeutils-match-today-day-and-this-year-correctly.patch delete mode 100644 1001-hwclock-make-glibc-2.31-compatible.patch delete mode 100644 1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch delete mode 100644 1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch delete mode 100644 1004-util-linux-add-sw.patch diff --git a/0001-prlimit-fix-optional-arguments-parsing.patch b/0001-prlimit-fix-optional-arguments-parsing.patch deleted file mode 100644 index 1c91a50..0000000 --- a/0001-prlimit-fix-optional-arguments-parsing.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 1ad8db5521ec03d41a058674437f648d15ef8344 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 18 Mar 2021 10:23:36 +0100 -Subject: [PATCH] prlimit: fix optional arguments parsing - - $ prlimit -f=100:100 - failed to parse FSIZE limit - -Fixes: https://github.com/karelzak/util-linux/issues/1265 -Signed-off-by: Karel Zak ---- - sys-utils/prlimit.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c -index c8c7d5c42..18601efd3 100644 ---- a/sys-utils/prlimit.c -+++ b/sys-utils/prlimit.c -@@ -453,6 +453,9 @@ static int parse_prlim(struct rlimit *lim, char *ops, size_t id) - rlim_t soft, hard; - int found = 0; - -+ if (ops && *ops == '=') -+ ops++; -+ - if (get_range(ops, &soft, &hard, &found)) - errx(EXIT_FAILURE, _("failed to parse %s limit"), - prlimit_desc[id].name); --- -2.39.3 - diff --git a/0100-logger-initialize-socket-credentials-control-union.patch b/0100-logger-initialize-socket-credentials-control-union.patch new file mode 100644 index 0000000..21adfd2 --- /dev/null +++ b/0100-logger-initialize-socket-credentials-control-union.patch @@ -0,0 +1,29 @@ +From ca39305530067a55fb151167ba2a085a167c780e Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 26 Jun 2023 11:56:23 +0200 +Subject: logger: initialize socket credentials control union + +Addresses: https://issues.redhat.com/browse/RHEL-18451 +Upstream: http://github.com/util-linux/util-linux/commit/3a4d70419c97f64f60c0eda4720e64d17b3b071 +Addresses: https://github.com/util-linux/util-linux/issues/2336 +Signed-off-by: Karel Zak +--- + misc-utils/logger.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/misc-utils/logger.c b/misc-utils/logger.c +index c20ef05f1..3f7b05a44 100644 +--- a/misc-utils/logger.c ++++ b/misc-utils/logger.c +@@ -457,7 +457,7 @@ static void write_output(struct logger_ctl *ctl, const char *const msg) + union { + struct cmsghdr cmh; + char control[CMSG_SPACE(sizeof(struct ucred))]; +- } cbuf; ++ } cbuf = { .control = { 0 } }; + #endif + + /* 4) add extra \n to make sure message is terminated */ +-- +2.43.0 + diff --git a/0101-libblkid-hfs-fix-label-use-fuzzing.patch b/0101-libblkid-hfs-fix-label-use-fuzzing.patch new file mode 100644 index 0000000..e735932 --- /dev/null +++ b/0101-libblkid-hfs-fix-label-use-fuzzing.patch @@ -0,0 +1,32 @@ +From f16b5e8bb95471a27b52e46f2357168dabba67d5 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 2 Jun 2022 16:02:54 +0200 +Subject: libblkid: (hfs) fix label use [fuzzing] + +Addresses: https://issues.redhat.com/browse/RHEL-16070 +Upstream: http://github.com/util-linux/util-linux/commit/74e48269ee9a15e230e25d0e3d2e50f5b0ba2b04 +Reported-by: Thibault Guittet +Signed-off-by: Karel Zak +--- + libblkid/src/superblocks/hfs.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libblkid/src/superblocks/hfs.c b/libblkid/src/superblocks/hfs.c +index 185c42c92..4552c1e6a 100644 +--- a/libblkid/src/superblocks/hfs.c ++++ b/libblkid/src/superblocks/hfs.c +@@ -173,7 +173,10 @@ static int probe_hfs(blkid_probe pr, const struct blkid_idmag *mag) + + hfs_set_uuid(pr, hfs->finder_info.id, sizeof(hfs->finder_info.id)); + +- blkid_probe_set_label(pr, hfs->label, hfs->label_len); ++ size = hfs->label_len; ++ if ((size_t) size > sizeof(hfs->label)) ++ size = sizeof(hfs->label); ++ blkid_probe_set_label(pr, hfs->label, size); + return 0; + } + +-- +2.43.0 + diff --git a/0102-libblkid-bsd-fix-buffer-pointer-use-fuzzing.patch b/0102-libblkid-bsd-fix-buffer-pointer-use-fuzzing.patch new file mode 100644 index 0000000..5c00834 --- /dev/null +++ b/0102-libblkid-bsd-fix-buffer-pointer-use-fuzzing.patch @@ -0,0 +1,29 @@ +From ba63ed8d306b5d1fa5ced1b13fa59d575e345ebf Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 2 Jun 2022 16:02:54 +0200 +Subject: libblkid: (bsd) fix buffer pointer use [fuzzing] + +Addresses: https://issues.redhat.com/browse/RHEL-16070 +Upstream: http://github.com/util-linux/util-linux/commit/0a0630133055c3b3daa3072a3fd9944a1a149401 +Reported-by: Thibault Guittet +Signed-off-by: Karel Zak +--- + libblkid/src/partitions/bsd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libblkid/src/partitions/bsd.c b/libblkid/src/partitions/bsd.c +index c74517334..7a0b23195 100644 +--- a/libblkid/src/partitions/bsd.c ++++ b/libblkid/src/partitions/bsd.c +@@ -50,7 +50,7 @@ static int probe_bsd_pt(blkid_probe pr, const struct blkid_idmag *mag) + goto nothing; + } + +- l = (struct bsd_disklabel *) data + BLKID_MAG_LASTOFFSET(mag); ++ l = (struct bsd_disklabel *) (data + BLKID_MAG_LASTOFFSET(mag)); + + ls = blkid_probe_get_partlist(pr); + if (!ls) +-- +2.43.0 + diff --git a/0103-libblkid-probe-fix-size-and-offset-overflows-fuzzing.patch b/0103-libblkid-probe-fix-size-and-offset-overflows-fuzzing.patch new file mode 100644 index 0000000..f61c6b4 --- /dev/null +++ b/0103-libblkid-probe-fix-size-and-offset-overflows-fuzzing.patch @@ -0,0 +1,56 @@ +From fb4a413e67e0d4f24ad23ece37f206d198601741 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 2 Jun 2022 16:02:54 +0200 +Subject: libblkid: (probe) fix size and offset overflows [fuzzing] + +Addresses: https://issues.redhat.com/browse/RHEL-16070 +Upstream: http://github.com/util-linux/util-linux/commit/106de261469e1001243d5b81ed895762fb34b2ba +Reported-by: Thibault Guittet +Signed-off-by: Karel Zak +--- + libblkid/src/probe.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c +index 49a62c47f..d36dce4c9 100644 +--- a/libblkid/src/probe.c ++++ b/libblkid/src/probe.c +@@ -613,6 +613,11 @@ static int hide_buffer(blkid_probe pr, uint64_t off, uint64_t len) + struct list_head *p; + int ct = 0; + ++ if (UINT64_MAX - len < off) { ++ DBG(BUFFER, ul_debug("\t hide-buffer overflow (ignore)")); ++ return -EINVAL; ++ } ++ + list_for_each(p, &pr->buffers) { + struct blkid_bufinfo *x = + list_entry(p, struct blkid_bufinfo, bufs); +@@ -648,14 +653,20 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr, uint64_t off, uint64_t len + DBG(BUFFER, ul_debug("\t>>>> off=%ju, real-off=%ju (probe <%ju..%ju>, len=%ju", + off, real_off, pr->off, pr->off + pr->size, len)); + */ +- + if (pr->size == 0) { + errno = EINVAL; + return NULL; + } + +- if (len == 0 || (!S_ISCHR(pr->mode) && pr->off + pr->size < real_off + len)) { +- DBG(BUFFER, ul_debug("\t ignore: request out of probing area")); ++ if (UINT64_MAX - len < off || UINT64_MAX - len < real_off) { ++ DBG(BUFFER, ul_debug("\t read-buffer overflow (ignore)")); ++ return NULL; ++ } ++ ++ if (len == 0 ++ || (!S_ISCHR(pr->mode) && (pr->size < off || pr->size < len)) ++ || (!S_ISCHR(pr->mode) && (pr->off + pr->size < real_off + len))) { ++ DBG(BUFFER, ul_debug("\t read-buffer out of probing area (ignore)")); + errno = 0; + return NULL; + } +-- +2.43.0 + diff --git a/0104-timeutils-match-today-day-and-this-year-correctly.patch b/0104-timeutils-match-today-day-and-this-year-correctly.patch new file mode 100644 index 0000000..d087979 --- /dev/null +++ b/0104-timeutils-match-today-day-and-this-year-correctly.patch @@ -0,0 +1,89 @@ +From db254673510a49c1ad2ac154f72687bc5ff3ece3 Mon Sep 17 00:00:00 2001 +From: Sami Kerola +Date: Sat, 5 Jan 2019 21:32:23 +0000 +Subject: 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. + +Addresses: https://issues.redhat.com/browse/RHEL-6274 +Upstream: http://github.com/util-linux/util-linux/commit/d393c00c6cd57ef7f122f4e1730b3c410b6084cb +Signed-off-by: Sami Kerola +--- + include/timeutils.h | 3 --- + lib/timeutils.c | 27 +++++++++++++++------------ + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/include/timeutils.h b/include/timeutils.h +index f1540a183..eec840085 100644 +--- a/include/timeutils.h ++++ b/include/timeutils.h +@@ -83,9 +83,6 @@ int strtime_iso(const time_t *t, int flags, char *buf, size_t bufsz); + + #define UL_SHORTTIME_THISYEAR_HHMM (1 << 1) + +-int time_is_today(const time_t *t, struct timeval *now); +-int time_is_thisyear(const time_t *t, struct timeval *now); +- + int strtime_short(const time_t *t, struct timeval *now, int flags, char *buf, size_t bufsz); + + #ifndef HAVE_TIMEGM +diff --git a/lib/timeutils.c b/lib/timeutils.c +index 9c286aebc..d403ced90 100644 +--- a/lib/timeutils.c ++++ b/lib/timeutils.c +@@ -503,34 +503,37 @@ int strtime_iso(const time_t *t, int flags, char *buf, size_t bufsz) + } + + /* relative time functions */ +-int time_is_today(const time_t *t, struct timeval *now) ++static inline int time_is_thisyear(struct tm const *const tm, ++ struct tm const *const tmnow) + { +- if (now->tv_sec == 0) +- gettimeofday(now, NULL); +- return *t / (3600 * 24) == now->tv_sec / (3600 * 24); ++ return tm->tm_year == tmnow->tm_year; + } + +-int time_is_thisyear(const time_t *t, struct timeval *now) ++static inline int time_is_today(struct tm const *const tm, ++ struct tm const *const tmnow) + { +- if (now->tv_sec == 0) +- gettimeofday(now, NULL); +- return *t / (3600 * 24 * 365) == now->tv_sec / (3600 * 24 * 365); ++ return (tm->tm_yday == tmnow->tm_yday && ++ time_is_thisyear(tm, tmnow)); + } + + int strtime_short(const time_t *t, struct timeval *now, int flags, char *buf, size_t bufsz) + { +- struct tm tm; ++ struct tm tm, tmnow; + int rc = 0; + +- localtime_r(t, &tm); ++ if (now->tv_sec == 0) ++ gettimeofday(now, NULL); ++ ++ localtime_r(t, &tm); ++ localtime_r(&now->tv_sec, &tmnow); + +- if (time_is_today(t, now)) { ++ if (time_is_today(&tm, &tmnow)) { + rc = snprintf(buf, bufsz, "%02d:%02d", tm.tm_hour, tm.tm_min); + if (rc < 0 || (size_t) rc > bufsz) + return -1; + rc = 1; + +- } else if (time_is_thisyear(t, now)) { ++ } else if (time_is_thisyear(&tm, &tmnow)) { + if (flags & UL_SHORTTIME_THISYEAR_HHMM) + rc = strftime(buf, bufsz, "%b%d/%H:%M", &tm); + else +-- +2.43.0 + diff --git a/1001-hwclock-make-glibc-2.31-compatible.patch b/1001-hwclock-make-glibc-2.31-compatible.patch deleted file mode 100644 index d4908a6..0000000 --- a/1001-hwclock-make-glibc-2.31-compatible.patch +++ /dev/null @@ -1,161 +0,0 @@ -From e42f9f05a96c9e0129722b15fc638d4133ac1ecb Mon Sep 17 00:00:00 2001 -From: J William Piggott -Date: Tue, 19 Apr 2022 23:22:11 -0400 -Subject: [PATCH] hwclock: make glibc 2.31 compatible -______________________________________________________ -GNU C Library NEWS -- history of user-visible changes. -Version 2.31 -Deprecated and removed features, and other changes affecting compatibility: - -* The settimeofday function can still be used to set a system-wide time - zone when the operating system supports it. This is because the Linux - kernel reused the API, on some architectures, to describe a system-wide - time-zone-like offset between the software clock maintained by the kernel, - and the "RTC" clock that keeps time when the system is shut down. - - However, to reduce the odds of this offset being set by accident, - settimeofday can no longer be used to set the time and the offset - simultaneously. If both of its two arguments are non-null, the call - will fail (setting errno to EINVAL). - - Callers attempting to set this offset should also be prepared for the call - to fail and set errno to ENOSYS; this already happens on the Hurd and on - some Linux architectures. The Linux kernel maintainers are discussing a - more principled replacement for the reused API. After a replacement - becomes available, we will change settimeofday to fail with ENOSYS on all - platforms when its 'tzp' argument is not a null pointer. - - settimeofday itself is obsolescent according to POSIX. Programs that set - the system time should use clock_settime and/or the adjtime family of - functions instead. We may cease to make settimeofday available to newly - linked binaries after there is a replacement for Linux's time-zone-like - offset API. -______________________________________________________ - -hwclock(8) had one settimeofday(2) call where both args were set for ---hctosys when the RTC was ticking UTC. This allowed setting the system -time, timezone, and locking the warp_clock function with a single call. -That operation now takes 3 calls of settimeofday(2). - -Although this common operation now takes three calls, the overall logic -for the set_system_clock() function was simplified. - -Co-Author: Karel Zak -Signed-off-by: J William Piggott ---- - sys-utils/hwclock.c | 70 ++++++++++++++++++++++----------------------- - 1 file changed, 35 insertions(+), 35 deletions(-) - -diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c -index b83e710..19e7410 100644 ---- a/sys-utils/hwclock.c -+++ b/sys-utils/hwclock.c -@@ -583,28 +583,28 @@ display_time(struct timeval hwctime) - * tz.tz_minuteswest argument and sets PCIL (see below). At boot settimeofday(2) - * has one-shot access to this function as shown in the table below. - * -- * +-------------------------------------------------------------------+ -- * | settimeofday(tv, tz) | -- * |-------------------------------------------------------------------| -- * | Arguments | System Time | PCIL | | warp_clock | -- * | tv | tz | set | warped | set | firsttime | locked | -- * |---------|---------|---------------|------|-----------|------------| -- * | pointer | NULL | yes | no | no | 1 | no | -- * | pointer | pointer | yes | no | no | 0 | yes | -- * | NULL | ptr2utc | no | no | no | 0 | yes | -- * | NULL | pointer | no | yes | yes | 0 | yes | -- * +-------------------------------------------------------------------+ -+ * +-------------------------------------------------------------------------+ -+ * | settimeofday(tv, tz) | -+ * |-------------------------------------------------------------------------| -+ * | Arguments | System Time | TZ | PCIL | | warp_clock | -+ * | tv | tz | set | warped | set | set | firsttime | locked | -+ * |---------|---------|---------------|-----|------|-----------|------------| -+ * | pointer | NULL | yes | no | no | no | 1 | no | -+ * | NULL | ptr2utc | no | no | yes | no | 0 | yes | -+ * | NULL | pointer | no | yes | yes | yes | 0 | yes | -+ * +-------------------------------------------------------------------------+ - * ptr2utc: tz.tz_minuteswest is zero (UTC). - * PCIL: persistent_clock_is_local, sets the "11 minute mode" timescale. - * firsttime: locks the warp_clock function (initialized to 1 at boot). -+ * Since glibc v2.31 settimeofday() will fail if both args are non NULL - * - * +---------------------------------------------------------------------------+ - * | op | RTC scale | settimeofday calls | - * |---------|-----------|-----------------------------------------------------| - * | systz | Local | 1) warps system time*, sets PCIL* and kernel tz | - * | systz | UTC | 1st) locks warp_clock* 2nd) sets kernel tz | -- * | hctosys | Local | 1st) sets PCIL* 2nd) sets system time and kernel tz | -- * | hctosys | UTC | 1) sets system time and kernel tz | -+ * | hctosys | Local | 1st) sets PCIL* & kernel tz 2nd) sets system time | -+ * | hctosys | UTC | 1st) locks warp* 2nd) sets tz 3rd) sets system time | - * +---------------------------------------------------------------------------+ - * * only on first call after boot - */ -@@ -615,41 +615,41 @@ set_system_clock(const struct hwclock_control *ctl, - struct tm broken; - int minuteswest; - int rc = 0; -- const struct timezone tz_utc = { 0 }; - - localtime_r(&newtime.tv_sec, &broken); - minuteswest = -get_gmtoff(&broken) / 60; - - if (ctl->verbose) { -- if (ctl->hctosys && !ctl->universal) -- printf(_("Calling settimeofday(NULL, %d) to set " -- "persistent_clock_is_local.\n"), minuteswest); -- if (ctl->systz && ctl->universal) -+ if (ctl->universal) { - puts(_("Calling settimeofday(NULL, 0) " -- "to lock the warp function.")); -+ "to lock the warp_clock function.")); -+ if (!( ctl->universal && !minuteswest )) -+ printf(_("Calling settimeofday(NULL, %d) " -+ "to set the kernel timezone.\n"), -+ minuteswest); -+ } else -+ printf(_("Calling settimeofday(NULL, %d) to warp " -+ "System time, set PCIL and the kernel tz.\n"), -+ minuteswest); -+ - if (ctl->hctosys) -- printf(_("Calling settimeofday(%ld.%06ld, %d)\n"), -- newtime.tv_sec, newtime.tv_usec, minuteswest); -- else { -- printf(_("Calling settimeofday(NULL, %d) "), minuteswest); -- if (ctl->universal) -- puts(_("to set the kernel timezone.")); -- else -- puts(_("to warp System time.")); -- } -+ printf(_("Calling settimeofday(%ld.%06ld, NULL) " -+ "to set the System time.\n"), -+ newtime.tv_sec, newtime.tv_usec); - } - - if (!ctl->testing) { -+ const struct timezone tz_utc = { 0 }; - const struct timezone tz = { minuteswest }; -- -- if (ctl->hctosys && !ctl->universal) /* set PCIL */ -- rc = settimeofday(NULL, &tz); -- if (ctl->systz && ctl->universal) /* lock warp_clock */ -+ /* If UTC RTC: lock warp_clock and PCIL */ -+ if (ctl->universal) - rc = settimeofday(NULL, &tz_utc); -- if (!rc && ctl->hctosys) -- rc = settimeofday(&newtime, &tz); -- else if (!rc) -+ /* Set kernel tz; if localtime RTC: warp_clock and set PCIL */ -+ if (!rc && !( ctl->universal && !minuteswest )) - rc = settimeofday(NULL, &tz); -+ /* Set the System Clock */ -+ if ((!rc || errno == ENOSYS) && ctl->hctosys) -+ rc = settimeofday(&newtime, NULL); - - if (rc) { - warn(_("settimeofday() failed")); --- -2.27.0 - diff --git a/1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch b/1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch deleted file mode 100644 index 9b6afb1..0000000 --- a/1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch +++ /dev/null @@ -1,24 +0,0 @@ -From dc11290085e49ec47be148447104f50ce3e7244b Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 27 Sep 2022 11:21:16 +0800 -Subject: [PATCH] add Neoverse-N2 to ARM identifiers tables - ---- - sys-utils/lscpu-arm.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c -index 2b178a7..697a4b2 100644 ---- a/sys-utils/lscpu-arm.c -+++ b/sys-utils/lscpu-arm.c -@@ -80,6 +80,7 @@ static const struct id_part arm_part[] = { - { 0xd21, "Cortex-M33" }, - { 0xd41, "Cortex-A78" }, - { 0xd42, "Cortex-A78AE" }, -+ { 0xd49, "Neoverse-N2" }, - { 0xd4a, "Neoverse-E1" }, - { 0xd4b, "Cortex-A78C" }, - { -1, "unknown" }, --- -2.31.1 - diff --git a/1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch b/1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch deleted file mode 100644 index 1893c87..0000000 --- a/1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 117b51eb538673be49bf0e619d2307a65963d1dd Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 27 Sep 2022 15:31:51 +0800 -Subject: [PATCH] fix lscpu to get cpu frequency from cpuinfo on arm64 - ---- - sys-utils/lscpu.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c -index 70a797d..a7014a0 100644 ---- a/sys-utils/lscpu.c -+++ b/sys-utils/lscpu.c -@@ -433,6 +433,7 @@ read_basicinfo(struct lscpu_desc *desc, struct lscpu_modifier *mod) - else if (lookup(buf, "stepping", &desc->stepping)) ; - else if (lookup(buf, "CPU variant", &desc->stepping)) ; /* aarch64 */ - else if (lookup(buf, "cpu MHz", &desc->mhz)) ; -+ else if (lookup(buf, "CPU MHz", &desc->mhz)) ; /* aarch64 */ - else if (lookup(buf, "cpu MHz dynamic", &desc->dynamic_mhz)) ; /* s390 */ - else if (lookup(buf, "cpu MHz static", &desc->static_mhz)) ; /* s390 */ - else if (lookup(buf, "flags", &desc->flags)) ; /* x86 */ --- -2.31.1 - diff --git a/1004-util-linux-add-sw.patch b/1004-util-linux-add-sw.patch deleted file mode 100644 index be7097a..0000000 --- a/1004-util-linux-add-sw.patch +++ /dev/null @@ -1,322 +0,0 @@ -From 0cea5b507f643f9159b3074236571faf3ed60c34 Mon Sep 17 00:00:00 2001 -From: wxiat -Date: Wed, 14 Jun 2023 15:03:54 +0800 -Subject: [PATCH] add sw - -Signed-off-by: rpm-build ---- - configure | 2 ++ - configure.ac | 2 ++ - include/pt-bsd.h | 4 ++-- - libfdisk/src/bsd.c | 16 ++++++++-------- - sys-utils/hwclock-rtc.c | 4 ++-- - sys-utils/hwclock.c | 12 ++++++------ - sys-utils/hwclock.h | 6 +++--- - sys-utils/lscpu.c | 2 +- - sys-utils/setarch.c | 4 ++++ - tests/ts/fdisk/bsd | 5 ++++- - 10 files changed, 34 insertions(+), 23 deletions(-) - -diff --git a/configure b/configure -index 2865523..a2ab58e 100755 ---- a/configure -+++ b/configure -@@ -30068,6 +30068,7 @@ else - case $host_cpu in - #( - alpha) syscall="442" ;; #( -+ sw_64) syscall="442" ;; #( - i*86) syscall="289" ;; #( - ia64*) syscall="1274" ;; #( - powerpc*) syscall="273" ;; #( -@@ -30172,6 +30173,7 @@ else - case $host_cpu in - #( - alpha) syscall="443" ;; #( -+ sw_64) syscall="443" ;; #( - i*86) syscall="290" ;; #( - ia64*) syscall="1275" ;; #( - powerpc*) syscall="274" ;; #( -diff --git a/configure.ac b/configure.ac -index 2450048..869b6e0 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2024,6 +2024,7 @@ UL_BUILD_INIT([ionice]) - UL_REQUIRES_SYSCALL_CHECK([ionice], - [UL_CHECK_SYSCALL([ioprio_set], - [alpha], [442], -+ [sw_64], [442], - [i*86], [289], - [ia64*], [1274], - [powerpc*], [273], -@@ -2036,6 +2037,7 @@ UL_REQUIRES_SYSCALL_CHECK([ionice], - UL_REQUIRES_SYSCALL_CHECK([ionice], - [UL_CHECK_SYSCALL([ioprio_get], - [alpha], [443], -+ [sw_64], [443], - [i*86], [290], - [ia64*], [1275], - [powerpc*], [274], -diff --git a/include/pt-bsd.h b/include/pt-bsd.h -index 9bf47a5..8538a2c 100644 ---- a/include/pt-bsd.h -+++ b/include/pt-bsd.h -@@ -11,7 +11,7 @@ - #define BSD_LINUX_BOOTDIR "/usr/ucb/mdec" - - #if defined (__alpha__) || defined (__powerpc__) || \ -- defined (__ia64__) || defined (__hppa__) -+ defined (__ia64__) || defined (__hppa__) || defined (__sw_64__) - # define BSD_LABELSECTOR 0 - # define BSD_LABELOFFSET 64 - #else -@@ -137,7 +137,7 @@ struct bsd_disklabel { - #define BSD_FS_ADVFS 16 /* Digital Unix AdvFS */ - - /* this is annoying, but it's also the way it is :-( */ --#ifdef __alpha__ -+#if defined __alpha__ || defined __sw_64__ - #define BSD_FS_EXT2 8 /* ext2 file system */ - #else - #define BSD_FS_MSDOS 8 /* MS-DOS file system */ -diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c -index 9ba3140..8d9668f 100644 ---- a/libfdisk/src/bsd.c -+++ b/libfdisk/src/bsd.c -@@ -55,7 +55,7 @@ static struct fdisk_parttype bsd_fstypes[] = { - {BSD_FS_V71K, "4.1BSD"}, - {BSD_FS_V8, "Eighth Edition"}, - {BSD_FS_BSDFFS, "4.2BSD"}, --#ifdef __alpha__ -+#if defined __alpha__ || defined __sw_64__ - {BSD_FS_EXT2, "ext2"}, - #else - {BSD_FS_MSDOS, "MS-DOS"}, -@@ -80,7 +80,7 @@ struct fdisk_bsd_label { - - struct dos_partition *dos_part; /* parent */ - struct bsd_disklabel bsd; /* on disk label */ --#if defined (__alpha__) -+#if defined (__alpha__) || defined (__sw_64__) - /* We access this through a u_int64_t * when checksumming */ - char bsdbuffer[BSD_BBSIZE] __attribute__((aligned(8))); - #else -@@ -120,7 +120,7 @@ static struct fdisk_parttype *bsd_partition_parttype( - } - - --#if defined (__alpha__) -+#if defined (__alpha__) || defined (__sw_64__) - static void alpha_bootblock_checksum (char *boot) - { - uint64_t *dp = (uint64_t *) boot, sum = 0; -@@ -605,7 +605,7 @@ int fdisk_bsd_edit_disklabel(struct fdisk_context *cxt) - struct bsd_disklabel *d = self_disklabel(cxt); - uintmax_t res; - --#if defined (__alpha__) || defined (__ia64__) -+#if defined (__alpha__) || defined (__ia64__) || defined (__sw_64__) - if (fdisk_ask_number(cxt, DEFAULT_SECTOR_SIZE, d->d_secsize, - UINT32_MAX, _("bytes/sector"), &res) == 0) - d->d_secsize = res; -@@ -710,7 +710,7 @@ int fdisk_bsd_write_bootstrap(struct fdisk_context *cxt) - sector = 0; - if (l->dos_part) - sector = dos_partition_get_start(l->dos_part); --#if defined (__alpha__) -+#if defined (__alpha__) || defined (__sw_64__) - alpha_bootblock_checksum(l->bsdbuffer); - #endif - if (lseek(cxt->dev_fd, (off_t) sector * DEFAULT_SECTOR_SIZE, SEEK_SET) == -1) { -@@ -760,7 +760,7 @@ static int bsd_initlabel (struct fdisk_context *cxt) - else - d -> d_type = BSD_DTYPE_ST506; - --#if !defined (__alpha__) -+#if !defined (__alpha__) && !defined (__sw_64__) - d -> d_flags = BSD_D_DOSPART; - #else - d -> d_flags = 0; -@@ -884,7 +884,7 @@ static int bsd_write_disklabel(struct fdisk_context *cxt) - memmove(&l->bsdbuffer[BSD_LABELSECTOR * DEFAULT_SECTOR_SIZE - + BSD_LABELOFFSET], d, sizeof(*d)); - --#if defined (__alpha__) && BSD_LABELSECTOR == 0 -+#if (defined (__alpha__) || defined (__sw_64__)) && BSD_LABELSECTOR == 0 - /* Write the checksum to the end of the first sector. */ - alpha_bootblock_checksum(l->bsdbuffer); - #endif -@@ -920,7 +920,7 @@ static int bsd_translate_fstype (int linux_type) - case 0x06: /* DOS 16-bit >=32M */ - case 0xe1: /* DOS access */ - case 0xe3: /* DOS R/O */ --#if !defined (__alpha__) -+#if !defined (__alpha__) && !defined (__sw_64__) - case 0xf2: /* DOS secondary */ - return BSD_FS_MSDOS; - #endif -diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c -index ef95d98..ec612f5 100644 ---- a/sys-utils/hwclock-rtc.c -+++ b/sys-utils/hwclock-rtc.c -@@ -255,7 +255,7 @@ static int synchronize_to_clock_tick_rtc(const struct hwclock_control *ctl) - } else { - int rc; /* Return code from ioctl */ - /* Turn on update interrupts (one per second) */ --#if defined(__alpha__) || defined(__sparc__) -+#if defined(__alpha__) || defined(__sw_64__) || defined(__sparc__) - /* - * Not all alpha kernels reject RTC_UIE_ON, but probably - * they should. -@@ -387,7 +387,7 @@ struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl) - return &rtc_interface; - } - --#ifdef __alpha__ -+#if defined __alpha__ || defined __sw_64__ - /* - * Get the Hardware Clock epoch setting from the kernel. - */ -diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c -index 19e7410..47aee63 100644 ---- a/sys-utils/hwclock.c -+++ b/sys-utils/hwclock.c -@@ -1024,7 +1024,7 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time, - * Get or set the kernel RTC driver's epoch on Alpha machines. - * ISA machines are hard coded for 1900. - */ --#if defined(__linux__) && defined(__alpha__) -+#if defined(__linux__) && defined(__alpha__) || defined(__sw_64__) - static void - manipulate_epoch(const struct hwclock_control *ctl) - { -@@ -1067,7 +1067,7 @@ usage(void) - puts(_(" -w, --systohc set the RTC from the system time")); - puts(_(" --systz send timescale configurations to the kernel")); - puts(_(" -a, --adjust adjust the RTC to account for systematic drift")); --#if defined(__linux__) && defined(__alpha__) -+#if defined(__linux__) && defined(__alpha__) || defined(__sw_64__) - puts(_(" --getepoch display the RTC epoch")); - puts(_(" --setepoch set the RTC epoch according to --epoch")); - #endif -@@ -1082,7 +1082,7 @@ usage(void) - printf(_( - " --directisa use the ISA bus instead of %1$s access\n"), _PATH_RTC_DEV); - puts(_(" --date