diff --git a/util-linux-2.39.1-support-sw.patch b/util-linux-2.39.1-support-sw.patch new file mode 100644 index 0000000000000000000000000000000000000000..e8343bbbb786bab9923dadb73a700dd5a568f1d9 --- /dev/null +++ b/util-linux-2.39.1-support-sw.patch @@ -0,0 +1,292 @@ +diff -Nur a/configure b/configure +--- a/configure 2025-04-17 15:45:23.340666075 +0800 ++++ b/configure 2025-04-17 15:46:34.581478379 +0800 +@@ -39881,6 +39881,7 @@ + case $host_cpu in + #( + alpha) syscall="442" ;; #( ++ sw_64) syscall="442" ;; #( + i*86) syscall="289" ;; #( + ia64*) syscall="1274" ;; #( + powerpc*) syscall="273" ;; #( +@@ -39986,6 +39987,7 @@ + case $host_cpu in + #( + alpha) syscall="443" ;; #( ++ sw_64) syscall="443" ;; #( + i*86) syscall="290" ;; #( + ia64*) syscall="1275" ;; #( + powerpc*) syscall="274" ;; #( +diff -Nur a/configure.ac b/configure.ac +--- a/configure.ac 2025-04-17 15:45:23.336666029 +0800 ++++ b/configure.ac 2025-04-17 15:46:52.053677601 +0800 +@@ -2392,6 +2392,7 @@ + UL_REQUIRES_SYSCALL_CHECK([ionice], + [UL_CHECK_SYSCALL([ioprio_set], + [alpha], [442], ++ [sw_64], [442], + [i*86], [289], + [ia64*], [1274], + [powerpc*], [273], +@@ -2404,6 +2405,7 @@ + UL_REQUIRES_SYSCALL_CHECK([ionice], + [UL_CHECK_SYSCALL([ioprio_get], + [alpha], [443], ++ [sw_64], [443], + [i*86], [290], + [ia64*], [1275], + [powerpc*], [274], +diff -Nur a/include/pt-bsd.h b/include/pt-bsd.h +--- a/include/pt-bsd.h 2025-04-17 15:45:23.340666075 +0800 ++++ b/include/pt-bsd.h 2025-04-17 15:47:36.002178712 +0800 +@@ -14,7 +14,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 +@@ -141,7 +141,7 @@ + #define BSD_FS_ADVFS 16 /* Digital Unix AdvFS */ + + /* this is annoying, but it's also the way it is :-( */ +-#ifdef __alpha__ ++#ifdef __alpha__ || defined __sw_64__ + #define BSD_FS_EXT2 8 /* ext2 file system */ + #else + #define BSD_FS_MSDOS 8 /* MS-DOS file system */ +diff -Nur a/libblkid/src/partitions/bsd.c b/libblkid/src/partitions/bsd.c +--- a/libblkid/src/partitions/bsd.c 2025-04-17 15:45:23.344666120 +0800 ++++ b/libblkid/src/partitions/bsd.c 2025-04-17 15:48:00.658459849 +0800 +@@ -182,6 +182,7 @@ + * sgi, aviion, sh, socppc | | + * ------------------------+-------------+------------ + * alpha luna88k mac68k | 0 | 64 ++ * sw_64 | | + * sparc(OpenBSD) vax | | + * ------------------------+-------------+------------ + * sparc64 sparc(NetBSD) | 0 | 128 +diff -Nur a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c +--- a/libfdisk/src/bsd.c 2025-04-17 15:45:23.388666621 +0800 ++++ b/libfdisk/src/bsd.c 2025-04-17 15:50:36.748239580 +0800 +@@ -55,7 +55,7 @@ + {BSD_FS_V71K, "4.1BSD"}, + {BSD_FS_V8, "Eighth Edition"}, + {BSD_FS_BSDFFS, "4.2BSD"}, +-#ifdef __alpha__ ++#ifdef __alpha__ || defined __sw_64__ + {BSD_FS_EXT2, "ext2"}, + #else + {BSD_FS_MSDOS, "MS-DOS"}, +@@ -80,7 +80,7 @@ + + 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 @@ + } + + +-#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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 @@ + 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 -Nur a/sys-utils/hwclock.c b/sys-utils/hwclock.c +--- a/sys-utils/hwclock.c 2025-04-17 15:45:23.388666621 +0800 ++++ b/sys-utils/hwclock.c 2025-04-17 15:53:06.005941447 +0800 +@@ -1133,7 +1133,7 @@ + * 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) + { +@@ -1208,7 +1208,7 @@ + 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 +@@ -1228,7 +1228,7 @@ + " --directisa use the ISA bus instead of %1$s access\n"), _PATH_RTC_DEV); + puts(_(" --date