summaryrefslogtreecommitdiff
path: root/user/grub
diff options
context:
space:
mode:
Diffstat (limited to 'user/grub')
-rw-r--r--user/grub/0002-revert-gawk.patch19
-rw-r--r--user/grub/0010-fix-gcc-no-pie-specs.patch (renamed from user/grub/fix-gcc-no-pie-specs.patch)7
-rw-r--r--user/grub/APKBUILD111
-rw-r--r--user/grub/adelie-branding.patch25
-rw-r--r--user/grub/default-grub1
-rw-r--r--user/grub/grub.trigger2
-rw-r--r--user/grub/grub2-accept-empty-module.patch10
-rw-r--r--user/grub/the-arch-everyone-uses-and-nobody-loves.patch72
-rw-r--r--user/grub/update-grub1
-rw-r--r--user/grub/x86_64_asm.patch73
-rw-r--r--user/grub/xfs.patch56
11 files changed, 174 insertions, 203 deletions
diff --git a/user/grub/0002-revert-gawk.patch b/user/grub/0002-revert-gawk.patch
new file mode 100644
index 000000000..93ed3448d
--- /dev/null
+++ b/user/grub/0002-revert-gawk.patch
@@ -0,0 +1,19 @@
+Revert "grub-core/genmoddep.awk: Ensure output is deterministic"
+
+This reverts commit 87648e9c12a32bddb005b899edc44c2c9c63df82.
+
+We don't ship gawk, so we can't use asorti. The old way worked fine enough.
+
+--- grub-2.12-rc1/grub-core/genmoddep.awk.old 2023-07-10 15:43:48.000000000 +0000
++++ grub-2.12-rc1/grub-core/genmoddep.awk 2023-10-01 07:52:03.407286373 +0000
+@@ -63,9 +63,7 @@
+ }
+ modlist = ""
+ depcount[mod] = 0
+- n = asorti(uniqmods, w)
+- for (i = 1; i <= n; i++) {
+- depmod = w[i]
++ for (depmod in uniqmods) {
+ modlist = modlist " " depmod;
+ inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod
+ depcount[mod]++
diff --git a/user/grub/fix-gcc-no-pie-specs.patch b/user/grub/0010-fix-gcc-no-pie-specs.patch
index 273c9dbe3..74b76f29e 100644
--- a/user/grub/fix-gcc-no-pie-specs.patch
+++ b/user/grub/0010-fix-gcc-no-pie-specs.patch
@@ -1,6 +1,7 @@
---- ./configure.ac.orig
-+++ ./configure.ac
-@@ -1100,7 +1100,7 @@
+diff -ur a/configure b/configure
+--- a/configure 2023-10-03 12:10:39.434444137 -0500
++++ b/configure 2023-10-03 12:10:58.731025605 -0500
+@@ -37656,7 +37656,7 @@
if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then
efiemu_excuse="no suitable link format for efiemu64 found"
else
diff --git a/user/grub/APKBUILD b/user/grub/APKBUILD
index d571310e7..ecc2b60bb 100644
--- a/user/grub/APKBUILD
+++ b/user/grub/APKBUILD
@@ -1,59 +1,59 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=grub
-pkgver=2.02
-pkgrel=8
-pkgdesc="Bootloader with support for Linux, Multiboot and more"
+pkgver=2.12
+_pkgver=$(printf '%s' "$pkgver" | tr _ \~)
+pkgrel=0
+pkgdesc="Boot loader with support for Linux, Multiboot and more"
url="https://www.gnu.org/software/grub/"
-arch="all !s390x"
+arch="all"
# strip handled by grub Makefiles, abuild strip breaks xen pv-grub
options="!check !strip" # Cannot test boot loader.
license="GPL-3.0+"
depends=""
-makedepends="bison flex freetype-dev linux-headers lvm2-dev python3 xz unifont
- automake autoconf libtool"
+makedepends="bison flex freetype-dev fuse-dev linux-headers lvm2-dev python3
+ unifont xz"
# [22:02] <@awilfox> [[sroracle]]: grub breaks without its locale files present
# [22:02] <@awilfox> it cannot be split
-subpackages="$pkgname-dev $pkgname-doc"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-mount"
-# currently grub only builds on x86*, aarch64 and ppc* systems
flavors=""
case "$CARCH" in
-x86 | pmmx) flavors="efi bios";;
+x86|pmmx) flavors="efi bios";;
x86_64) flavors="efi bios xenhost";;
-aarch64|arm*) flavors="efi";;
+aarch64) flavors="efi";;
+arm*) flavors="efi uboot";;
ppc*) flavors="ieee1275"; makedepends="$makedepends powerpc-utils" ;;
-s390x) flavors="emu" ;;
+sparc*) flavors="ieee1275";;
+mips*) flavors="arc";;
+riscv*) flavors="efi";;
esac
for f in $flavors; do
subpackages="$subpackages $pkgname-$f"
done
install="$pkgname.post-upgrade"
-triggers="$pkgname.trigger=/boot"
-source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz
- fix-gcc-no-pie-specs.patch
+source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$_pkgver.tar.xz
+ adelie-branding.patch
grub2-accept-empty-module.patch
+ 0002-revert-gawk.patch
+ 0010-fix-gcc-no-pie-specs.patch
+ xfs.patch
grub-xen-host_grub.cfg
- the-arch-everyone-uses-and-nobody-loves.patch
- x86_64_asm.patch
default-grub
update-grub
quirk-01_radeon_agpmode
"
-
-prepare() {
- default_prepare
- autoreconf -vif
-}
+builddir="$srcdir/$pkgname-$_pkgver"
_build_flavor() {
- local flavor="$1"
+ flavor="$1"
shift
- local _configure="$@"
+ _configure="$@"
+ CFLAGS="${CFLAGS} -fno-reorder-functions" # Workaround for image#403
case $CTARGET_ARCH in
- ppc64) export CFLAGS="-O2 -ggdb -mcpu=970 -mno-altivec";; # Workaround for http://savannah.gnu.org/bugs/?52629
+ ppc64) export CFLAGS="${CFLAGS} -mno-altivec";; # Workaround for http://savannah.gnu.org/bugs/?52629
esac
msg "Building grub for platform $flavor"
@@ -74,7 +74,9 @@ _build_flavor() {
}
build() {
- local f
+ # missing from source tarball, will cause build error
+ printf "depends bli part_gpt\n" > "$builddir"/grub-core/extra_deps.lst
+ f=""
for f in $flavors; do
case "$f" in
bios) _build_flavor $f --with-platform=pc;;
@@ -109,7 +111,7 @@ _install_xen() {
}
_install_flavor() {
- local flavor="$1"
+ flavor="$1"
cd "$srcdir"/build-$flavor
case $flavor in
xenhost) _install_xen;;
@@ -134,48 +136,61 @@ package() {
install -Dm755 "$i" \
"$pkgdir"/etc/grub-quirks.d/"${i##"$srcdir"/quirk-}"
done
+
+ mkdir -p "$pkgdir"/etc/easy-boot.d
+ ln -s ../../usr/sbin/update-grub \
+ "$pkgdir"/etc/easy-boot.d/50-grub
}
bios() {
pkgdesc="$pkgdesc (BIOS version)"
depends="$pkgname"
- mkdir -p $subpkgdir/usr/lib/grub
- mv $pkgdir/usr/lib/grub/*-pc $subpkgdir/usr/lib/grub/
+ mkdir -p "$subpkgdir"/usr/lib/grub
+ mv "$pkgdir"/usr/lib/grub/*-pc "$subpkgdir"/usr/lib/grub/
}
efi() {
pkgdesc="$pkgdesc (EFI version)"
depends="$pkgname efibootmgr efivar"
- mkdir -p $subpkgdir/usr/lib/grub
- mv $pkgdir/usr/lib/grub/*-efi $subpkgdir/usr/lib/grub/
+ mkdir -p "$subpkgdir"/usr/lib/grub
+ mv "$pkgdir"/usr/lib/grub/*-efi "$subpkgdir"/usr/lib/grub/
}
xenhost() {
- pkgdesc="$pkgdesc (XEN host version)"
- mkdir -p $subpkgdir/usr/lib/grub-xen
- mv $pkgdir/*-xen.bin $subpkgdir/usr/lib/grub-xen/
+ pkgdesc="$pkgdesc (Xen host version)"
+ mkdir -p "$subpkgdir"/usr/lib/grub-xen
+ mv "$pkgdir"/*-xen.bin "$subpkgdir"/usr/lib/grub-xen/
}
ieee1275() {
- pkgdesc="$pkgdesc (IEEE1275 version)"
- depends="$pkgname powerpc-utils"
- mkdir -p $subpkgdir/usr/lib/grub
- mv $pkgdir/usr/lib/grub/*-ieee1275 $subpkgdir/usr/lib/grub/
+ pkgdesc="$pkgdesc (IEEE-1275 OpenFirmware version)"
+ case $CTARGET_ARCH in
+ ppc*) depends="$pkgname powerpc-utils"
+ esac
+ mkdir -p "$subpkgdir"/usr/lib/grub
+ mv "$pkgdir"/usr/lib/grub/*-ieee1275 "$subpkgdir"/usr/lib/grub/
+}
+
+uboot() {
+ pkgdesc="$pkgdesc (U-Boot version)"
+ mkdir -p "$subpkgdir"/usr/lib/grub
+ mv "$pkgdir"/usr/lib/grub/*-uboot "$subpkgdir"/usr/lib/grub/
}
-emu() {
- pkgdesc="$pkgdesc (EMU version)"
+mount() {
+ pkgdesc="Utility to mount filesystems using GRUB modules"
depends="$pkgname"
- mkdir -p $subpkgdir/usr/lib/grub
- mv $pkgdir/usr/lib/grub/*-emu $subpkgdir/usr/lib/grub/
+ mkdir -p "$subpkgdir"/usr/bin/
+ mv "$pkgdir"/usr/bin/grub-mount "$subpkgdir"/usr/bin/
}
-sha512sums="cc6eb0a42b5c8df2f671cc128ff725afb3ff1f8832a196022e433cf0d3b75decfca2316d0aa5fabea75747d55e88f3d021dd93508563f8ca80fd7b9e7fe1f088 grub-2.02.tar.xz
-f2a7d9ab6c445f4e402e790db56378cecd6631b5c367451aa6ce5c01cd95b95c83c3dd24d6d4b857f8f42601eba82c855607513eb6ce5b2af6bd6c71f046e288 fix-gcc-no-pie-specs.patch
-2fefc6d5c1388dba6d368451f47c216171136f03891e87777ee392884d7ef53c70b2a2565af676237216565f203f62b79aec0d1a82979b21aa29c4ebf87ac566 grub2-accept-empty-module.patch
+sha512sums="761c060a4c3da9c0e810b0ea967e3ebc66baa4ddd682a503ae3d30a83707626bccaf49359304a16b3a26fc4435fe6bea1ee90be910c84de3c2b5485a31a15be3 grub-2.12.tar.xz
+4a6c909a1150b057fb0563f7a0646db33e16f84d6a8c443ef7db4003efd56c211a52f87699c5c95a6ccde65f6db46a8711a5b784f38479db804938dfe3115439 adelie-branding.patch
+f1daae3015c84af94aeffce20de1068c3de272aff59f809e956a085cf289c371c61b64ad1d440765c98a4d674761ea67d2986cc4b1d0dfffcf71caaf94c6f600 grub2-accept-empty-module.patch
+18502c79128d88154885a6e595bb42d4167f4e08e89e5bd9471234d4e4ba0d6a6ab7dc50a324e9c71ee8a92f3dee8f1a800942adf62ac8bc4041c6a154b19beb 0002-revert-gawk.patch
+4b369af412a303464fb538f0f1d7c51dfba4481448409204290e7959397243cb544ecaa8bd9db096788e1eccae0c4c6fac1af9b7819c34f20d01a0eb6c5105ff 0010-fix-gcc-no-pie-specs.patch
+60f884595a713e52052eb1741bd2a9f42110736b689c045d9fb23d08970fb8475f25bfdf056552040a7b5559817289774f987c825ef006e556d79f718935376f xfs.patch
4e7394e0fff6772c89683039ccf81099ebbfe4f498e6df408977a1488fd59389b6e19afdbf0860ec271e2b2aea0df7216243dcc8235d1ca3af0e7f4d0a9d60a4 grub-xen-host_grub.cfg
-088455205f2f397d60e43eab19ed73994880ea1f442661f7975846cceaf2b112d92fd1341119d7dbfad3af2174dfd4d4721f31dead1ac35f4a3cb7c0d92f8a04 the-arch-everyone-uses-and-nobody-loves.patch
-8752b5e689ec3b7e1f438c7207adc517d7acb4f7d15fda2907bc9177883a686f23994c66641bfc0c7620365415972b5d8b74f511c13dd234f5f3461dda4bb445 x86_64_asm.patch
-1e6ae4a3884829864dbd789d3c3a0d43a5aa5f279c3ebb25f71775686e9236bc1c6295e5064ad32b384635987ee0814df95e9ca33bc57bc8e0aeb47bec34270e default-grub
-0907a810e9ba5be92d10dae38403d1e50fb9b324799df36d2241ff59f545dace37a65f2b1c8f07367220da4fd341d8f21dd9a4fab8da6c87ae52d7ffbca3dbd7 update-grub
+1cb675fa0af9a1fd8d1a868e3e9de3bfef7eada66c5df0cfef23eca33e93e676eed6e1f67c679690f3e581565b350a9f3ba01aa9b89de66c970ea61ca21bcd65 default-grub
+8e5f1cf91da9fd956695438509bb26e45f38170ca90d99a996e859053d72c82b7e4b02cb8979f047fc53498036f47b5400bf54687c390793995a05ded4216d55 update-grub
78b7ec141a364994c7de181e47fedca820add9960c56c7adf4c14ee11d5249a0887fd788ecd5d24b9bdd102b7c40395181e2f7c3fe5ab795dd7c0057ba1115c5 quirk-01_radeon_agpmode"
diff --git a/user/grub/adelie-branding.patch b/user/grub/adelie-branding.patch
new file mode 100644
index 000000000..463d4bcf5
--- /dev/null
+++ b/user/grub/adelie-branding.patch
@@ -0,0 +1,25 @@
+--- grub-2.04/util/grub.d/10_linux.in.old 2018-11-24 17:13:02.000000000 +0000
++++ grub-2.04/util/grub.d/10_linux.in 2019-10-03 01:22:34.593401423 +0000
+@@ -28,12 +28,16 @@
+
+ CLASS="--class gnu-linux --class gnu --class os"
+
+-if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
+- OS=GNU/Linux
+-else
+- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
+-fi
++case "x${GRUB_DISTRIBUTOR}" in
++ x)
++ OS=GNU/Linux;;
++ xAdélie|xAdelie|xadelie)
++ OS="Adélie Linux";
++ CLASS="--class adelie";;
++ *)
++ OS="${GRUB_DISTRIBUTOR} GNU/Linux";
++ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}";;
++esac
+
+ # loop-AES arranges things so that /dev/loop/X can be our root device, but
+ # the initrds that Linux uses don't like that.
diff --git a/user/grub/default-grub b/user/grub/default-grub
index 3fb754c7e..ca5656224 100644
--- a/user/grub/default-grub
+++ b/user/grub/default-grub
@@ -6,6 +6,7 @@ GRUB_DEFAULT="Adélie"
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Adélie"
GRUB_CMDLINE_LINUX_DEFAULT="ro"
+GRUB_DISABLE_LINUX_PARTUUID=false
# Uncomment the following line if you do *not* want /boot/grub/grub.cfg to be
# automatically regenerated when easy-kernel is upgraded.
diff --git a/user/grub/grub.trigger b/user/grub/grub.trigger
deleted file mode 100644
index eba13a458..000000000
--- a/user/grub/grub.trigger
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh -e
-exec update-grub
diff --git a/user/grub/grub2-accept-empty-module.patch b/user/grub/grub2-accept-empty-module.patch
index 16655b1a8..b6def4f94 100644
--- a/user/grub/grub2-accept-empty-module.patch
+++ b/user/grub/grub2-accept-empty-module.patch
@@ -10,13 +10,13 @@ also no relocations that's no problem (and that is checked
independendly).
--- grub-2.02~beta3/util/grub-module-verifierXX.c.mm 2016-02-11 10:57:41.000000000 +0000
+++ grub-2.02~beta3/util/grub-module-verifierXX.c 2016-08-31 15:26:36.000000000 +0000
-@@ -224,7 +224,8 @@ check_symbols (const struct grub_module_
- Elf_Shdr *s = find_section (arch, e, ".moddeps");
+@@ -305,7 +305,8 @@ check_symbols (const struct grub_module_
+ s = find_section (arch, e, ".moddeps");
if (!s)
-- grub_util_error ("no symbol table and no .moddeps section");
-+ /*grub_util_error ("no symbol table and no .moddeps section");*/
+- grub_util_error ("%s: no symbol table and no .moddeps section", modname);
++ /*grub_util_error ("%s: no symbol table and no .moddeps section", modname);*/
+ return; /* An empty module happens for all_video.module for Xen */
if (!s->sh_size)
- grub_util_error ("no symbol table and empty .moddeps section");
+ grub_util_error ("%s: no symbol table and empty .moddeps section", modname);
diff --git a/user/grub/the-arch-everyone-uses-and-nobody-loves.patch b/user/grub/the-arch-everyone-uses-and-nobody-loves.patch
deleted file mode 100644
index 2d09149f7..000000000
--- a/user/grub/the-arch-everyone-uses-and-nobody-loves.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001
-From: Michael Chang <mchang@suse.com>
-Date: Mon, 26 Mar 2018 16:52:34 +0800
-Subject: Fix packed-not-aligned error on GCC 8
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When building with GCC 8, there are several errors regarding packed-not-aligned.
-
-./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned]
-
-This patch fixes the build error by cleaning up the ambiguity of placing
-aligned structure in a packed one. In "struct grub_btrfs_time" and "struct
-grub_gpt_part_type", the aligned attribute seems to be superfluous, and also
-has to be packed, to ensure the structure is bit-to-bit mapped to the format
-laid on disk. I think we could blame to copy and paste error here for the
-mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as
-the name suggests. :)
-
-Signed-off-by: Michael Chang <mchang@suse.com>
-Tested-by: Michael Chang <mchang@suse.com>
-Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
-Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
----
- grub-core/fs/btrfs.c | 2 +-
- include/grub/efiemu/runtime.h | 2 +-
- include/grub/gpt_partition.h | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
-index 4849c1ceb..be195448d 100644
---- a/grub-core/fs/btrfs.c
-+++ b/grub-core/fs/btrfs.c
-@@ -175,7 +175,7 @@ struct grub_btrfs_time
- {
- grub_int64_t sec;
- grub_uint32_t nanosec;
--} __attribute__ ((aligned (4)));
-+} GRUB_PACKED;
-
- struct grub_btrfs_inode
- {
-diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h
-index 9b6b729f4..36d2dedf4 100644
---- a/include/grub/efiemu/runtime.h
-+++ b/include/grub/efiemu/runtime.h
-@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel
-
- struct efi_variable
- {
-- grub_efi_guid_t guid;
-+ grub_efi_packed_guid_t guid;
- grub_uint32_t namelen;
- grub_uint32_t size;
- grub_efi_uint32_t attributes;
-diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h
-index 1b32f6725..9668a68c3 100644
---- a/include/grub/gpt_partition.h
-+++ b/include/grub/gpt_partition.h
-@@ -28,7 +28,7 @@ struct grub_gpt_part_type
- grub_uint16_t data2;
- grub_uint16_t data3;
- grub_uint8_t data4[8];
--} __attribute__ ((aligned(8)));
-+} GRUB_PACKED;
- typedef struct grub_gpt_part_type grub_gpt_part_type_t;
-
- #define GRUB_GPT_PARTITION_TYPE_EMPTY \
---
-cgit v1.1-33-g03f6
-
diff --git a/user/grub/update-grub b/user/grub/update-grub
index d22930bd7..07b57a9c0 100644
--- a/user/grub/update-grub
+++ b/user/grub/update-grub
@@ -10,6 +10,7 @@ if [ "$ADELIE_MANUAL_CONFIG" = 1 ]; then
exit 0
fi
+mkdir -p /boot/grub
if [ -e /boot/grub/grub.cfg ]; then
cp -p /boot/grub/grub.cfg /boot/grub/grub.cfg.update-grub-old
fi
diff --git a/user/grub/x86_64_asm.patch b/user/grub/x86_64_asm.patch
deleted file mode 100644
index 67a0d833f..000000000
--- a/user/grub/x86_64_asm.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 842c390469e2c2e10b5aa36700324cd3bde25875 Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Sat, 17 Feb 2018 06:47:28 -0800
-Subject: [PATCH] x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32
-
-Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a:
-
-https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a
-
-x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for
-32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as
-R_X86_64_PC32.
-
-Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
-Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
----
- grub-core/efiemu/i386/loadcore64.c | 1 +
- grub-core/kern/x86_64/dl.c | 1 +
- util/grub-mkimagexx.c | 1 +
- util/grub-module-verifier.c | 1 +
- 4 files changed, 4 insertions(+)
-
-diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c
-index e49d0b6..18facf4 100644
---- a/grub-core/efiemu/i386/loadcore64.c
-+++ b/grub-core/efiemu/i386/loadcore64.c
-@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
- break;
-
- case R_X86_64_PC32:
-+ case R_X86_64_PLT32:
- err = grub_efiemu_write_value (addr,
- *addr32 + rel->r_addend
- + sym.off
-diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
-index 4406906..3a73e6e 100644
---- a/grub-core/kern/x86_64/dl.c
-+++ b/grub-core/kern/x86_64/dl.c
-@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
- break;
-
- case R_X86_64_PC32:
-+ case R_X86_64_PLT32:
- {
- grub_int64_t value;
- value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value -
-diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
-index a2bb054..39d7efb 100644
---- a/util/grub-mkimagexx.c
-+++ b/util/grub-mkimagexx.c
-@@ -832,6 +832,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
- break;
-
- case R_X86_64_PC32:
-+ case R_X86_64_PLT32:
- {
- grub_uint32_t *t32 = (grub_uint32_t *) target;
- *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32)
-diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c
-index 9179285..a79271f 100644
---- a/util/grub-module-verifier.c
-+++ b/util/grub-module-verifier.c
-@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = {
- -1
- }, (int[]){
- R_X86_64_PC32,
-+ R_X86_64_PLT32,
- -1
- }
- },
---
-1.9.1
-
diff --git a/user/grub/xfs.patch b/user/grub/xfs.patch
new file mode 100644
index 000000000..922c40923
--- /dev/null
+++ b/user/grub/xfs.patch
@@ -0,0 +1,56 @@
+From 68dd65cfdaad08b1f8ec01b84949b0bf88bc0d8c Mon Sep 17 00:00:00 2001
+From: Jon DeVree <nuxi@vault24.org>
+Date: Sun, 11 Feb 2024 10:34:58 -0500
+Subject: fs/xfs: Handle non-continuous data blocks in directory extents
+
+The directory extent list does not have to be a continuous list of data
+blocks. When GRUB tries to read a non-existant member of the list,
+grub_xfs_read_file() will return a block of zero'ed memory. Checking for
+a zero'ed magic number is sufficient to skip this non-existant data block.
+
+Prior to commit 07318ee7e (fs/xfs: Fix XFS directory extent parsing)
+this was handled as a subtle side effect of reading the (non-existant)
+tail data structure. Since the block was zero'ed the computation of the
+number of directory entries in the block would return 0 as well.
+
+Fixes: 07318ee7e (fs/xfs: Fix XFS directory extent parsing)
+Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2254370
+
+Signed-off-by: Jon DeVree <nuxi@vault24.org>
+Reviewed-By: Vladimir Serbinenko <phcoder@gmail.com>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+---
+ grub-core/fs/xfs.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
+index bc2224dbb..8e02ab4a3 100644
+--- a/grub-core/fs/xfs.c
++++ b/grub-core/fs/xfs.c
+@@ -902,6 +902,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
+ grub_xfs_first_de(dir->data, dirblock);
+ int entries = -1;
+ char *end = dirblock + dirblk_size;
++ grub_uint32_t magic;
+
+ numread = grub_xfs_read_file (dir, 0, 0,
+ blk << dirblk_log2,
+@@ -912,6 +913,15 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
+ return 0;
+ }
+
++ /*
++ * If this data block isn't actually part of the extent list then
++ * grub_xfs_read_file() returns a block of zeros. So, if the magic
++ * number field is all zeros then this block should be skipped.
++ */
++ magic = *(grub_uint32_t *)(void *) dirblock;
++ if (!magic)
++ continue;
++
+ /*
+ * Leaf and tail information are only in the data block if the number
+ * of extents is 1.
+--
+cgit v1.2.3-70-g09d2
+