aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCeleste <20312-Celeste@users.gitlab.alpinelinux.org>2024-05-07 01:22:58 +0000
committerCeleste <20312-Celeste@users.gitlab.alpinelinux.org>2024-05-07 01:22:58 +0000
commit7f37facb972382fa46e80956e60720b0e6693d62 (patch)
treeb0a61cc1959466d2a761276e29d46384a51dc77b
parent7198dc7cb172ebde804b75535af2ce14e8d5a46a (diff)
community/kexec-tools: fix implicit basename & 64bit mode not supportedHEADmaster
-rw-r--r--community/kexec-tools/APKBUILD6
-rw-r--r--community/kexec-tools/fix-basename.patch12
-rw-r--r--community/kexec-tools/fix-build-with-binutils-2.41.patch94
3 files changed, 111 insertions, 1 deletions
diff --git a/community/kexec-tools/APKBUILD b/community/kexec-tools/APKBUILD
index edd3531265b..1fb0b3167bd 100644
--- a/community/kexec-tools/APKBUILD
+++ b/community/kexec-tools/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=kexec-tools
pkgver=2.0.28
-pkgrel=0
+pkgrel=1
pkgdesc="Directly boot into a new kernel over a currently running one"
url="https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/"
arch="all !riscv64" # not supported on riscv64 yet
@@ -10,7 +10,9 @@ license="GPL-2.0-only"
makedepends="zlib-dev xz-dev linux-headers"
subpackages="$pkgname-doc"
source="https://www.kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-$pkgver.tar.xz
+ fix-basename.patch
fix-build-on-Alpine-linux.patch
+ fix-build-with-binutils-2.41.patch
"
options="!check"
@@ -33,5 +35,7 @@ package() {
sha512sums="
889a7bf1d26bb309e4ff7ce1c8dbcf48c01e47221ea3acf1c4ef2a98a652c496e31bddcdb627d3adebd85f7541d1fb9122c60e741e10b3726e31a9733cadc753 kexec-tools-2.0.28.tar.xz
+0a58a3919cca937657d5f768103b6c7197a662401c2d892c8a4b9e0cfbcdebc8b1f20f9613dff651df88e467a6c3872f743908e13afb1b6ec8c8c1009e5534f4 fix-basename.patch
228166102bfc48f81c04f3b13fbf29d6edf2e66918a967f243c8d2652f40c27af565f1db6b1a58783bd12d67184a70e6b00b1ab82e0f0d195dd51009260c3329 fix-build-on-Alpine-linux.patch
+ecf09e3e64dd29bfc2cd201ee51c5e587f2b3963b41d4b838f64f6772d82cc9d24fc3e9838ad5f7729ef75b871e45eaa0cefa434fdd241a5850e46641cfd2fdb fix-build-with-binutils-2.41.patch
"
diff --git a/community/kexec-tools/fix-basename.patch b/community/kexec-tools/fix-basename.patch
new file mode 100644
index 00000000000..0da50e22faf
--- /dev/null
+++ b/community/kexec-tools/fix-basename.patch
@@ -0,0 +1,12 @@
+--- a/kexec/arch/i386/x86-linux-setup.c
++++ b/kexec/arch/i386/x86-linux-setup.c
+@@ -42,6 +42,9 @@
+ #define VIDEO_CAPABILITY_64BIT_BASE (1 << 1) /* Frame buffer base is 64-bit */
+ #endif
+
++#define basename(dev) \
++ (strrchr((dev),'/') ? strrchr((dev),'/')+1 : (dev))
++
+ void init_linux_parameters(struct x86_linux_param_header *real_mode)
+ {
+ /* Fill in the values that are usually provided by the kernel. */
diff --git a/community/kexec-tools/fix-build-with-binutils-2.41.patch b/community/kexec-tools/fix-build-with-binutils-2.41.patch
new file mode 100644
index 00000000000..3025eafcb63
--- /dev/null
+++ b/community/kexec-tools/fix-build-with-binutils-2.41.patch
@@ -0,0 +1,94 @@
+Patch-Source: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/patch/?id=328de8e00e298f00d7ba6b25dc3950147e9642e6
+--
+From 328de8e00e298f00d7ba6b25dc3950147e9642e6 Mon Sep 17 00:00:00 2001
+From: Michel Lind <salimma@fedoraproject.org>
+Date: Tue, 30 Jan 2024 04:14:31 -0600
+Subject: Fix building on x86_64 with binutils 2.41
+
+Newer versions of the GNU assembler (observed with binutils 2.41) will
+complain about the ".arch i386" in files assembled with "as --64",
+with the message "Error: 64bit mode not supported on 'i386'".
+
+Fix by moving ".arch i386" below the relevant ".code32" directive, so
+that the assembler is no longer expecting 64-bit instructions to be used
+by the time that the ".arch i386" directive is encountered.
+
+Based on similar iPXE fix:
+https://github.com/ipxe/ipxe/commit/6ca597eee
+
+Signed-off-by: Michel Lind <michel@michel-slm.name>
+Signed-off-by: Simon Horman <horms@kernel.org>
+---
+ purgatory/arch/i386/entry32-16-debug.S | 2 +-
+ purgatory/arch/i386/entry32-16.S | 2 +-
+ purgatory/arch/i386/entry32.S | 2 +-
+ purgatory/arch/i386/setup-x86.S | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S
+index 5167944d..12e11649 100644
+--- a/purgatory/arch/i386/entry32-16-debug.S
++++ b/purgatory/arch/i386/entry32-16-debug.S
+@@ -25,10 +25,10 @@
+ .globl entry16_debug_pre32
+ .globl entry16_debug_first32
+ .globl entry16_debug_old_first32
+- .arch i386
+ .balign 16
+ entry16_debug:
+ .code32
++ .arch i386
+ /* Compute where I am running at (assumes esp valid) */
+ call 1f
+ 1: popl %ebx
+diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S
+index c051aab0..eace0958 100644
+--- a/purgatory/arch/i386/entry32-16.S
++++ b/purgatory/arch/i386/entry32-16.S
+@@ -20,10 +20,10 @@
+ #undef i386
+ .text
+ .globl entry16, entry16_regs
+- .arch i386
+ .balign 16
+ entry16:
+ .code32
++ .arch i386
+ /* Compute where I am running at (assumes esp valid) */
+ call 1f
+ 1: popl %ebx
+diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S
+index f7a494f1..8ce9e316 100644
+--- a/purgatory/arch/i386/entry32.S
++++ b/purgatory/arch/i386/entry32.S
+@@ -20,10 +20,10 @@
+ #undef i386
+
+ .text
+- .arch i386
+ .globl entry32, entry32_regs
+ entry32:
+ .code32
++ .arch i386
+
+ /* Setup a gdt that should that is generally usefully */
+ lgdt %cs:gdt
+diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S
+index 201bb2cb..a212eed4 100644
+--- a/purgatory/arch/i386/setup-x86.S
++++ b/purgatory/arch/i386/setup-x86.S
+@@ -21,10 +21,10 @@
+ #undef i386
+
+ .text
+- .arch i386
+ .globl purgatory_start
+ purgatory_start:
+ .code32
++ .arch i386
+
+ /* Load a gdt so I know what the segment registers are */
+ lgdt %cs:gdt
+--
+cgit 1.2.3-korg
+