!122 Add sw64 architecture
From: @zhang-yao-2022 Reviewed-by: @overweight Signed-off-by: @overweight
This commit is contained in:
commit
68f1531685
326
util-linux-Add-sw64-architecture.patch
Normal file
326
util-linux-Add-sw64-architecture.patch
Normal file
@ -0,0 +1,326 @@
|
||||
From f59cfb87a948b2fb9c18ab059b74b9141419643a Mon Sep 17 00:00:00 2001
|
||||
From: wzx <wuzx1226@qq.com>
|
||||
Date: Wed, 26 Oct 2022 09:53:14 +0800
|
||||
Subject: [PATCH] Add sw64 architecture
|
||||
|
||||
Signed-off-by: wzx <wuzx1226@qq.com>
|
||||
---
|
||||
configure | 2 ++
|
||||
configure.ac | 2 ++
|
||||
include/pt-bsd.h | 4 ++--
|
||||
libblkid/src/partitions/bsd.c | 1 +
|
||||
libfdisk/src/bsd.c | 16 ++++++++--------
|
||||
sys-utils/hwclock-rtc.c | 2 +-
|
||||
sys-utils/hwclock.c | 12 ++++++------
|
||||
sys-utils/hwclock.h | 6 +++---
|
||||
sys-utils/lscpu-cputype.c | 2 +-
|
||||
sys-utils/setarch.c | 4 ++++
|
||||
tests/ts/fdisk/bsd | 5 ++++-
|
||||
11 files changed, 34 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 57b830a..48d3a36 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -36071,6 +36071,7 @@ else
|
||||
case $host_cpu in
|
||||
#(
|
||||
alpha) syscall="442" ;; #(
|
||||
+ sw_64) syscall="442" ;; #(
|
||||
i*86) syscall="289" ;; #(
|
||||
ia64*) syscall="1274" ;; #(
|
||||
powerpc*) syscall="273" ;; #(
|
||||
@@ -36175,6 +36176,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 b12b48c..bf405da 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2218,6 +2218,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],
|
||||
@@ -2230,6 +2231,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..c524c44 100644
|
||||
--- a/include/pt-bsd.h
|
||||
+++ b/include/pt-bsd.h
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#define BSD_LINUX_BOOTDIR "/usr/ucb/mdec"
|
||||
|
||||
-#if defined (__alpha__) || defined (__powerpc__) || \
|
||||
+#if defined (__alpha__) || defined (__sw_64__) || defined (__powerpc__) || \
|
||||
defined (__ia64__) || defined (__hppa__)
|
||||
# define BSD_LABELSECTOR 0
|
||||
# define BSD_LABELOFFSET 64
|
||||
@@ -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/libblkid/src/partitions/bsd.c b/libblkid/src/partitions/bsd.c
|
||||
index c745173..ad2bfda 100644
|
||||
--- a/libblkid/src/partitions/bsd.c
|
||||
+++ b/libblkid/src/partitions/bsd.c
|
||||
@@ -166,6 +166,7 @@ nothing:
|
||||
* ------------------------+-------------+------------
|
||||
* alpha luna88k mac68k | 0 | 64
|
||||
* sparc(OpenBSD) vax | |
|
||||
+ * sw_64 | |
|
||||
* ------------------------+-------------+------------
|
||||
* sparc64 sparc(NetBSD) | 0 | 128
|
||||
* ------------------------+-------------+------------
|
||||
diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
|
||||
index 313ae5a..875fa11 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;
|
||||
@@ -606,7 +606,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 (__sw_64__) || defined (__ia64__)
|
||||
if (fdisk_ask_number(cxt, DEFAULT_SECTOR_SIZE, d->d_secsize,
|
||||
UINT32_MAX, _("bytes/sector"), &res) == 0)
|
||||
d->d_secsize = res;
|
||||
@@ -712,7 +712,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) {
|
||||
@@ -769,7 +769,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;
|
||||
@@ -893,7 +893,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
|
||||
@@ -929,7 +929,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 07af9c8..885ca1e 100644
|
||||
--- a/sys-utils/hwclock-rtc.c
|
||||
+++ b/sys-utils/hwclock-rtc.c
|
||||
@@ -390,7 +390,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 3609814..37ec0d0 100644
|
||||
--- a/sys-utils/hwclock.c
|
||||
+++ b/sys-utils/hwclock.c
|
||||
@@ -1129,7 +1129,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)
|
||||
{
|
||||
@@ -1172,7 +1172,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
|
||||
@@ -1188,7 +1188,7 @@ usage(void)
|
||||
" --directisa use the ISA bus instead of %1$s access\n"), _PATH_RTC_DEV);
|
||||
puts(_(" --date <time> date/time input for --set and --predict"));
|
||||
puts(_(" --delay <sec> delay used when set new RTC time"));
|
||||
-#if defined(__linux__) && defined(__alpha__)
|
||||
+#if defined(__linux__) && (defined(__alpha__) || defined(__sw_64__))
|
||||
puts(_(" --epoch <year> epoch input for --setepoch"));
|
||||
#endif
|
||||
puts(_(" --update-drift update the RTC drift factor"));
|
||||
@@ -1250,7 +1250,7 @@ int main(int argc, char **argv)
|
||||
{ "ul-debug", required_argument, NULL, 'd' },
|
||||
{ "verbose", no_argument, NULL, 'v' },
|
||||
{ "set", no_argument, NULL, OPT_SET },
|
||||
-#if defined(__linux__) && defined(__alpha__)
|
||||
+#if defined(__linux__) && (defined(__alpha__) || defined(__sw_64__))
|
||||
{ "getepoch", no_argument, NULL, OPT_GETEPOCH },
|
||||
{ "setepoch", no_argument, NULL, OPT_SETEPOCH },
|
||||
{ "epoch", required_argument, NULL, OPT_EPOCH },
|
||||
@@ -1354,7 +1354,7 @@ int main(int argc, char **argv)
|
||||
ctl.show = 0;
|
||||
ctl.hwaudit_on = 1;
|
||||
break;
|
||||
-#if defined(__linux__) && defined(__alpha__)
|
||||
+#if defined(__linux__) && (defined(__alpha__) || defined(__sw_64__))
|
||||
case OPT_GETEPOCH:
|
||||
ctl.getepoch = 1;
|
||||
ctl.show = 0;
|
||||
@@ -1461,7 +1461,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
-#if defined(__linux__) && defined(__alpha__)
|
||||
+#if defined(__linux__) && (defined(__alpha__) || defined(__sw_64__))
|
||||
if (ctl.getepoch || ctl.setepoch) {
|
||||
manipulate_epoch(&ctl);
|
||||
hwclock_exit(&ctl, EXIT_SUCCESS);
|
||||
diff --git a/sys-utils/hwclock.h b/sys-utils/hwclock.h
|
||||
index 627cf51..2c88181 100644
|
||||
--- a/sys-utils/hwclock.h
|
||||
+++ b/sys-utils/hwclock.h
|
||||
@@ -23,7 +23,7 @@ struct hwclock_control {
|
||||
char *date_opt;
|
||||
char *adj_file_name;
|
||||
double rtc_delay; /* --delay <seconds> */
|
||||
-#if defined(__linux__) && defined(__alpha__)
|
||||
+#if defined(__linux__) && (defined(__alpha__) || defined(__sw_64__))
|
||||
char *epoch_option;
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
@@ -36,7 +36,7 @@ struct hwclock_control {
|
||||
hctosys:1,
|
||||
utc:1,
|
||||
systohc:1,
|
||||
-#if defined(__linux__) && defined(__alpha__)
|
||||
+#if defined(__linux__) && (defined(__alpha__) || defined(__sw_64__))
|
||||
getepoch:1,
|
||||
setepoch:1,
|
||||
#endif
|
||||
@@ -69,7 +69,7 @@ extern struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl);
|
||||
extern double time_diff(struct timeval subtrahend, struct timeval subtractor);
|
||||
|
||||
/* rtc.c */
|
||||
-#if defined(__linux__) && defined(__alpha__)
|
||||
+#if defined(__linux__) && (defined(__alpha__) || defined(__sw_64__))
|
||||
extern int get_epoch_rtc(const struct hwclock_control *ctl, unsigned long *epoch);
|
||||
extern int set_epoch_rtc(const struct hwclock_control *ctl);
|
||||
#endif
|
||||
diff --git a/sys-utils/lscpu-cputype.c b/sys-utils/lscpu-cputype.c
|
||||
index 7b5b109..4492a08 100644
|
||||
--- a/sys-utils/lscpu-cputype.c
|
||||
+++ b/sys-utils/lscpu-cputype.c
|
||||
@@ -596,7 +596,7 @@ struct lscpu_arch *lscpu_read_architecture(struct lscpu_cxt *cxt)
|
||||
* information about our real CPU */
|
||||
;
|
||||
else {
|
||||
-#if defined(__alpha__) || defined(__ia64__)
|
||||
+#if defined(__alpha__) || defined(__sw_64__) || defined(__ia64__)
|
||||
ar->bit64 = 1; /* 64bit platforms only */
|
||||
#endif
|
||||
/* platforms with 64bit flag in /proc/cpuinfo, define
|
||||
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
|
||||
index b86be1e..f25a763 100644
|
||||
--- a/sys-utils/setarch.c
|
||||
+++ b/sys-utils/setarch.c
|
||||
@@ -187,6 +187,10 @@ static struct arch_domain *init_arch_domains(void)
|
||||
{PER_LINUX32, "mips", "mips"},
|
||||
{PER_LINUX, "mips64", "mips64"},
|
||||
#endif
|
||||
+#if defined(__sw_64__)
|
||||
+ {PER_LINUX, "sw_64", "sw_64"},
|
||||
+ {PER_LINUX, "sw_64sw6b", "sw_64"},
|
||||
+#endif
|
||||
#if defined(__alpha__)
|
||||
{PER_LINUX, "alpha", "alpha"},
|
||||
{PER_LINUX, "alphaev5", "alpha"},
|
||||
diff --git a/tests/ts/fdisk/bsd b/tests/ts/fdisk/bsd
|
||||
index 675468d..bce8706 100755
|
||||
--- a/tests/ts/fdisk/bsd
|
||||
+++ b/tests/ts/fdisk/bsd
|
||||
@@ -48,7 +48,7 @@ BYTE_ORDER=$($TS_HELPER_SYSINFO byte-order)
|
||||
ARCH=$(uname -m)
|
||||
case $ARCH in
|
||||
# see include/pt-bsd.h
|
||||
- *alpha* | *ppc* | *ia64* | *hppa* | *parisc* )
|
||||
+ *sw_64* | *alpha* | *ppc* | *ia64* | *hppa* | *parisc* )
|
||||
BSD_LABELSECTOR=0
|
||||
BSD_LABELOFFSET=64
|
||||
;;
|
||||
@@ -61,6 +61,9 @@ esac
|
||||
# and contains extra options for alpha
|
||||
BSD_EXTRA=""
|
||||
case $ARCH in
|
||||
+ *sw_64*)
|
||||
+ BSD_EXTRA="_sw_64"
|
||||
+ ;;
|
||||
*alpha*)
|
||||
BSD_EXTRA="_alpha"
|
||||
;;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
Name: util-linux
|
||||
Version: 2.37.2
|
||||
Release: 9
|
||||
Release: 10
|
||||
Summary: A random collection of Linux utilities
|
||||
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
|
||||
URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
|
||||
@ -36,12 +36,14 @@ Patch6014: backport-libfdisk-check-calloc-return-gcc-analyzer.patch
|
||||
Patch6015: backport-mcookie-fix-infinite-loop-when-use-f.patch
|
||||
Patch6016: backport-sfdisk-write-empty-label-also-when-only-ignored-part.patch
|
||||
Patch6017: backport-fstat-dir-itself.patch
|
||||
|
||||
Patch6018: backport-libblkid-src-topology-dm-close-redundant-write-file-.patch
|
||||
Patch6019: backport-libblkid-topology-init-variables-for-DM.patch
|
||||
|
||||
Patch9000: Add-check-to-resolve-uname26-version-test-failed.patch
|
||||
Patch9001: SKIPPED-no-root-permissions-test.patch
|
||||
%ifarch sw_64
|
||||
Patch9002: util-linux-Add-sw64-architecture.patch
|
||||
%endif
|
||||
|
||||
BuildRequires: audit-libs-devel >= 1.0.6 gettext-devel libselinux-devel ncurses-devel pam-devel zlib-devel popt-devel
|
||||
BuildRequires: libutempter-devel systemd-devel systemd libuser-devel libcap-ng-devel python3-devel gcc
|
||||
@ -407,7 +409,7 @@ fi
|
||||
%{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*}
|
||||
|
||||
%changelog
|
||||
* Wed Nov 2 2022 January <1398871225@qq.com> - 2.37.2-9
|
||||
* Wed Nov 2 2022 January <1398871225@qq.com> - 2.37.2-10
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
@ -415,6 +417,12 @@ fi
|
||||
[add]backport-libblkid-src-topology-dm-close-redundant-write-file-.patch
|
||||
backport-libblkid-topology-init-variables-for-DM.patch
|
||||
|
||||
* Wed Oct 26 2022 wuzx<wuzx1226@qq.com> - 2.37.2-9
|
||||
- Type:feature
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:Add sw64 architecture
|
||||
|
||||
* Sat Jul 30 2022 zhangyao<zhangyao108@hhuawei.com> - 2.37.2-8
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user