diff options
Diffstat (limited to 'user')
-rw-r--r-- | user/grub/0001-unmerged-usr.patch | 36 | ||||
-rw-r--r-- | user/grub/0002-revert-gawk.patch | 2 | ||||
-rw-r--r-- | user/grub/0003-spcr-revision.patch | 42 | ||||
-rw-r--r-- | user/grub/0004-videoinfo-no-reinit.patch | 49 | ||||
-rw-r--r-- | user/grub/0005-vsnprintf.patch | 35 | ||||
-rw-r--r-- | user/grub/0006-cryptodisk-retval.patch | 37 | ||||
-rw-r--r-- | user/grub/0007-efi_gop-shadow.patch | 37 | ||||
-rw-r--r-- | user/grub/0008-efi-pure64.patch | 110 | ||||
-rw-r--r-- | user/grub/0009-linux-mixed-mode.patch | 79 | ||||
-rw-r--r-- | user/grub/0010-fix-gcc-no-pie-specs.patch | 2 | ||||
-rw-r--r-- | user/grub/APKBUILD | 34 | ||||
-rw-r--r-- | user/grub/grub2-accept-empty-module.patch | 2 | ||||
-rw-r--r-- | user/grub/xfs.patch | 56 |
13 files changed, 70 insertions, 451 deletions
diff --git a/user/grub/0001-unmerged-usr.patch b/user/grub/0001-unmerged-usr.patch deleted file mode 100644 index 93dd838c3..000000000 --- a/user/grub/0001-unmerged-usr.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e641b4ab32f1724005ec8bf58214df86de7e81d9 Mon Sep 17 00:00:00 2001 -From: Oskari Pirhonen <xxc3ncoredxx@gmail.com> -Date: Mon, 10 Jul 2023 23:55:43 -0500 -Subject: util/grub.d/25_bli.in: Fix shebang on unmerged-usr - -On an unmerged-usr system, grub-mkconfig errors out with the following -error due to /usr/bin/sh not existing: - - /usr/sbin/grub-mkconfig: /etc/grub.d/25_bli: /usr/bin/sh: bad interpreter: No such file or directory - -Use a /bin/sh shebang to fix the error as well as match the other -existing files. - -Fixes: 158a6583e (util/grub.d/25_bli.in: Activate bli module on EFI) - -Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com> -Reviewed-by: Glenn Washburn <development@efficientek.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> -Reviewed-by: Oliver Steffen <osteffen@redhat.com> ---- - util/grub.d/25_bli.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/util/grub.d/25_bli.in b/util/grub.d/25_bli.in -index 6e45387..26e27a0 100644 ---- a/util/grub.d/25_bli.in -+++ b/util/grub.d/25_bli.in -@@ -1,4 +1,4 @@ --#!/usr/bin/sh -+#! /bin/sh - set -e - - # grub-mkconfig helper script. --- -cgit v1.1 - diff --git a/user/grub/0002-revert-gawk.patch b/user/grub/0002-revert-gawk.patch index 565e22d6a..93ed3448d 100644 --- a/user/grub/0002-revert-gawk.patch +++ b/user/grub/0002-revert-gawk.patch @@ -6,7 +6,7 @@ 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 -@@ -59,9 +59,7 @@ +@@ -63,9 +63,7 @@ } modlist = "" depcount[mod] = 0 diff --git a/user/grub/0003-spcr-revision.patch b/user/grub/0003-spcr-revision.patch deleted file mode 100644 index 48b5e2f48..000000000 --- a/user/grub/0003-spcr-revision.patch +++ /dev/null @@ -1,42 +0,0 @@ -From b0890d371ca1e49877c45d696deb9102f1b605c3 Mon Sep 17 00:00:00 2001 -From: Glenn Washburn <development@efficientek.com> -Date: Wed, 26 Jul 2023 16:02:36 -0500 -Subject: term/ns8250-spcr: Continue processing SPCR table even if revision is - < 2 - -According to commit 0231d00082 (ACPI: SPCR: Make SPCR available to x86) -to the Linux kernel, "On x86, many systems have a valid SPCR table but the -table version is not 2 so the table version check must be a warning." - -Signed-off-by: Glenn Washburn <development@efficientek.com> -Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/term/ns8250-spcr.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/grub-core/term/ns8250-spcr.c b/grub-core/term/ns8250-spcr.c -index d101bff..d52b52c 100644 ---- a/grub-core/term/ns8250-spcr.c -+++ b/grub-core/term/ns8250-spcr.c -@@ -18,6 +18,7 @@ - - #if !defined(GRUB_MACHINE_IEEE1275) && !defined(GRUB_MACHINE_QEMU) - -+#include <grub/misc.h> - #include <grub/serial.h> - #include <grub/ns8250.h> - #include <grub/types.h> -@@ -34,7 +35,8 @@ grub_ns8250_spcr_init (void) - if (spcr == NULL) - return NULL; - if (spcr->hdr.revision < 2) -- return NULL; -+ grub_dprintf ("serial", "SPCR table revision %d < 2, continuing anyway\n", -+ (int) spcr->hdr.revision); - if (spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550 && - spcr->intf_type != GRUB_ACPI_SPCR_INTF_TYPE_16550X) - return NULL; --- -cgit v1.1 - diff --git a/user/grub/0004-videoinfo-no-reinit.patch b/user/grub/0004-videoinfo-no-reinit.patch deleted file mode 100644 index c3877bf07..000000000 --- a/user/grub/0004-videoinfo-no-reinit.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 1de58326994b0045ccfb28017d05fc1ddecdb92d Mon Sep 17 00:00:00 2001 -From: Glenn Washburn <development@efficientek.com> -Date: Fri, 11 Aug 2023 16:30:04 -0500 -Subject: commands/videoinfo: Prevent crash when run while video driver already - active - -The videoinfo command will initialize all non-active video adapters. Video -drivers tend to zero out the global framebuffer object on initialization. -This is not a problem when there is no active video adapter. However, when -there is, then outputting to the video adapter will cause a crash because -methods in the framebuffer object are reinitialized. For example, this -command sequence will cause a crash. - - terminal_output --append gfxterm; videoinfo - -When running in a QEMU headless with GRUB built for the x86_64-efi target, -the first command initializes the Bochs video adapter, which, among -other things, sets the set_page() member function. Then when videoinfo is -run, all non-Bochs video adapters will be initialized, each one wiping -the framebuffer and thus setting set_page to NULL. Soon after the videoinfo -command finishes there will be a call to grub_refresh(), which will -ultimately call the framebuffer's set_page which will be NULL and cause -a crash when called. - -Signed-off-by: Glenn Washburn <development@efficientek.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/commands/videoinfo.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/grub-core/commands/videoinfo.c b/grub-core/commands/videoinfo.c -index 5eb9697..205ba78 100644 ---- a/grub-core/commands/videoinfo.c -+++ b/grub-core/commands/videoinfo.c -@@ -191,6 +191,11 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), - /* Don't worry about errors. */ - grub_errno = GRUB_ERR_NONE; - } -+ else if (id != GRUB_VIDEO_DRIVER_NONE) -+ { -+ grub_puts_ (N_(" A video driver is active, cannot initialize this driver until it is deactivated\n")); -+ continue; -+ } - else - { - if (adapter->init ()) --- -cgit v1.1 - diff --git a/user/grub/0005-vsnprintf.patch b/user/grub/0005-vsnprintf.patch deleted file mode 100644 index 88c3e0f09..000000000 --- a/user/grub/0005-vsnprintf.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 14c95e57fddb6c826bee7755232de62efc8eb45b Mon Sep 17 00:00:00 2001 -From: Glenn Washburn <development@efficientek.com> -Date: Fri, 18 Aug 2023 12:15:27 -0500 -Subject: kern/misc: Make grub_vsnprintf() C99/POSIX conformant - -To comply with C99 and POSIX standards, snprintf() should return the -number of bytes that would be written to the string (excluding the -terminating NUL byte) if the buffer size was big enough. Before this -change, the return value was the minimum of the standard return and the -length of the buffer. Rarely is the return value of grub_snprintf() or -grub_vsnprintf() used with current code, and the few places where it is -used do not need to be changed. - -Signed-off-by: Glenn Washburn <development@efficientek.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/kern/misc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 2890aad..b57249a 100644 ---- a/grub-core/kern/misc.c -+++ b/grub-core/kern/misc.c -@@ -1201,7 +1201,7 @@ grub_vsnprintf (char *str, grub_size_t n, const char *fmt, va_list ap) - - free_printf_args (&args); - -- return ret < n ? ret : n; -+ return ret; - } - - int --- -cgit v1.1 - diff --git a/user/grub/0006-cryptodisk-retval.patch b/user/grub/0006-cryptodisk-retval.patch deleted file mode 100644 index 9db7f8434..000000000 --- a/user/grub/0006-cryptodisk-retval.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 296d3ec835ed6e3b90d740e497bb534f14fe4b79 Mon Sep 17 00:00:00 2001 -From: Glenn Washburn <development@efficientek.com> -Date: Fri, 18 Aug 2023 12:27:22 -0500 -Subject: disk/cryptodisk: Fix missing change when updating to use - grub_uuidcasecmp() - -This was causing the cryptomount command to return failure even though -the crypto device was successfully added. Of course, this meant that any -script using the return code would behave unexpectedly. - -Fixes: 3cf2e848bc03 (disk/cryptodisk: Allows UUIDs to be compared in a dash-insensitive manner) - -Suggested-by: Olaf Hering <olaf@aepfle.de> -Signed-off-by: Glenn Washburn <development@efficientek.com> -Reviewed-by: Patrich Steinhardt <ps@pks.im> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/disk/cryptodisk.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c -index 34b67a7..fb807e2 100644 ---- a/grub-core/disk/cryptodisk.c -+++ b/grub-core/disk/cryptodisk.c -@@ -1236,7 +1236,8 @@ grub_cryptodisk_scan_device (const char *name, - dev = grub_cryptodisk_scan_device_real (name, source, cargs); - if (dev) - { -- ret = (cargs->search_uuid != NULL && grub_strcasecmp (cargs->search_uuid, dev->uuid) == 0); -+ ret = (cargs->search_uuid != NULL -+ && grub_uuidcasecmp (cargs->search_uuid, dev->uuid, sizeof (dev->uuid)) == 0); - goto cleanup; - } - --- -cgit v1.1 - diff --git a/user/grub/0007-efi_gop-shadow.patch b/user/grub/0007-efi_gop-shadow.patch deleted file mode 100644 index 7709641cd..000000000 --- a/user/grub/0007-efi_gop-shadow.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 34a3adff822a6d136430e631d0a93448b27fac4e Mon Sep 17 00:00:00 2001 -From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> -Date: Mon, 28 Aug 2023 23:50:09 +0200 -Subject: video/efi_gop: Require shadow if PixelBltOnly - -If the EFI graphics pixel format is PixelBltOnly, we cannot write directly -to the frame buffer. We need the shadow frame buffer which we copy via -the BitBlt operation to the hardware. - -If the pixel format is PixelBltOnly and allocation of the shadow frame -buffer fails, we must raise an error to signal that the EFI GOP protocol -is not usable. - -Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/video/efi_gop.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c -index 7247aee..9452f5e 100644 ---- a/grub-core/video/efi_gop.c -+++ b/grub-core/video/efi_gop.c -@@ -480,6 +480,10 @@ grub_video_gop_setup (unsigned int width, unsigned int height, - if (!buffer) - { - grub_dprintf ("video", "GOP: couldn't allocate shadow\n"); -+ -+ if (info->pixel_format == GRUB_EFI_GOT_BLT_ONLY) -+ return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); -+ - grub_errno = 0; - grub_video_gop_fill_mode_info (gop->mode->mode, info, - &framebuffer.mode_info); --- -cgit v1.1 - diff --git a/user/grub/0008-efi-pure64.patch b/user/grub/0008-efi-pure64.patch deleted file mode 100644 index e07323c63..000000000 --- a/user/grub/0008-efi-pure64.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 67ae3981dc5113e5af3a0539174bcd7eab8f7722 Mon Sep 17 00:00:00 2001 -From: Ard Biesheuvel <ardb@kernel.org> -Date: Thu, 3 Aug 2023 15:24:09 +0200 -Subject: loader/i386/linux: Prefer entry in long mode when booting via EFI - -The x86_64 Linux kernel can be booted in 32-bit mode, in which case the -startup code creates a set of preliminary page tables that map the first -4 GiB of physical memory 1:1 and enables paging. This is a prerequisite -for 64-bit execution and can therefore only be implemented in 32-bit code. - -The x86_64 Linux kernel can also be booted in 64-bit mode directly: this -implies that paging is already enabled and it is the responsibility of -the bootloader to ensure that the active page tables cover the entire -loaded image, including its BSS space, the size of which is described in -the image's setup header. - -Given that the EFI spec mandates execution in long mode for x86_64 and -stipulates that all system memory is mapped 1:1, the Linux/x86 -requirements for 64-bit entry can be met trivially when booting on -x86_64 via EFI. So, enter via the 64-bit entry point in this case. - -This involves inspecting the xloadflags field in the setup header to -check whether the 64-bit entry point is supported. This field was -introduced in Linux version v3.8 (early 2013). - -This change ensures that all EFI firmware tables and other assets passed -by the firmware or bootloader in memory remain mapped and accessible -throughout the early startup code. - -Avoiding the drop out of long mode will also be needed to support -upcoming CPU designs that no longer implement 32-bit mode at all -(as recently announced by Intel [0]). - -[0] https://www.intel.com/content/www/us/en/developer/articles/technical/envisioning-future-simplified-architecture.html - -Cc: Daniel Kiper <daniel.kiper@oracle.com> -Cc: Julian Andres Klode <julian.klode@canonical.com> -Signed-off-by: Ard Biesheuvel <ardb@kernel.org> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/loader/i386/linux.c | 12 ++++++++++++ - include/grub/i386/linux.h | 15 +++++++++++++-- - 2 files changed, 25 insertions(+), 2 deletions(-) - -diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 997647a..977757f 100644 ---- a/grub-core/loader/i386/linux.c -+++ b/grub-core/loader/i386/linux.c -@@ -624,6 +624,18 @@ grub_linux_boot (void) - } - #endif - -+#if defined (__x86_64__) && defined (GRUB_MACHINE_EFI) -+ if (grub_le_to_cpu16 (ctx.params->version) >= 0x020c && -+ (linux_params.xloadflags & LINUX_X86_XLF_KERNEL_64) != 0) -+ { -+ struct grub_relocator64_efi_state state64; -+ -+ state64.rsi = ctx.real_mode_target; -+ state64.rip = ctx.params->code32_start + LINUX_X86_STARTUP64_OFFSET; -+ return grub_relocator64_efi_boot (relocator, state64); -+ } -+#endif -+ - /* FIXME. */ - /* asm volatile ("lidt %0" : : "m" (idt_desc)); */ - state.ebp = state.edi = state.ebx = 0; -diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index 0fd6e12..d4b5508 100644 ---- a/include/grub/i386/linux.h -+++ b/include/grub/i386/linux.h -@@ -69,6 +69,16 @@ - #define GRUB_LINUX_OFW_SIGNATURE \ - (' ' << 24 | 'W' << 16 | 'F' << 8 | 'O') - -+#define LINUX_X86_XLF_KERNEL_64 (1<<0) -+#define LINUX_X86_XLF_CAN_BE_LOADED_ABOVE_4G (1<<1) -+#define LINUX_X86_XLF_EFI_HANDOVER_32 (1<<2) -+#define LINUX_X86_XLF_EFI_HANDOVER_64 (1<<3) -+#define LINUX_X86_XLF_EFI_KEXEC (1<<4) -+#define LINUX_X86_XLF_5LEVEL (1<<5) -+#define LINUX_X86_XLF_5LEVEL_ENABLED (1<<6) -+ -+#define LINUX_X86_STARTUP64_OFFSET 0x200 -+ - #ifndef ASM_FILE - - #define GRUB_E820_RAM 1 -@@ -138,7 +148,7 @@ struct linux_i386_kernel_header - grub_uint32_t kernel_alignment; - grub_uint8_t relocatable; - grub_uint8_t min_alignment; -- grub_uint8_t pad[2]; -+ grub_uint16_t xloadflags; - grub_uint32_t cmdline_size; - grub_uint32_t hardware_subarch; - grub_uint64_t hardware_subarch_data; -@@ -315,7 +325,8 @@ struct linux_kernel_params - grub_uint32_t initrd_addr_max; /* Maximum initrd address */ - grub_uint32_t kernel_alignment; /* Alignment of the kernel */ - grub_uint8_t relocatable_kernel; /* Is the kernel relocatable */ -- grub_uint8_t pad1[3]; -+ grub_uint8_t min_alignment; -+ grub_uint16_t xloadflags; - grub_uint32_t cmdline_size; /* Size of the kernel command line */ - grub_uint32_t hardware_subarch; - grub_uint64_t hardware_subarch_data; --- -cgit v1.1 - diff --git a/user/grub/0009-linux-mixed-mode.patch b/user/grub/0009-linux-mixed-mode.patch deleted file mode 100644 index d3b2135f2..000000000 --- a/user/grub/0009-linux-mixed-mode.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 1f5b180742ff2706bc3a696d115ddbc677ec75b9 Mon Sep 17 00:00:00 2001 -From: Ard Biesheuvel <ardb@kernel.org> -Date: Mon, 7 Aug 2023 14:21:51 +0200 -Subject: loader/efi/linux: Implement x86 mixed mode using legacy boot - -Recent mixed-mode Linux kernels, i.e., v4.0 or newer, can access EFI -runtime services at OS runtime even when the OS was not entered via the -EFI stub. This is because, instead of reverting back to the firmware's -segment selectors, GDTs and IDTs, the 64-bit kernel simply calls 32-bit -runtime services using compatibility mode, i.e., the same mode used for -32-bit user space, without taking down all interrupt handling, exception -handling, etc. - -This means that GRUB's legacy x86 boot mode is sufficient to make use of -this: 32-bit i686 builds of GRUB can already boot 64-bit kernels in EFI -enlightened mode, but without going via the EFI stub, and provide all -the metadata that the OS needs to map the EFI runtime regions and call -EFI runtime services successfully. - -It does mean that GRUB should not attempt to invoke the firmware's -LoadImage()/StartImage() methods on kernel builds that it knows cannot -be started natively. So, add a check for this in the native EFI boot -path and fall back to legacy x86 mode in such cases. - -Note that in the general case, booting non-native images of the same -native word size, e.g., x64 EFI apps on arm64 firmware, might be -supported by means of emulation. So, let's only disallow images that use -a non-native word size. This will also permit booting i686 kernels on -x86_64 builds, although without access to runtime services, as this is -not supported by Linux. - -This change on top of 2.12-rc1 is sufficient to boot ordinary Linux -mixed mode builds and get full access to the EFI runtime services. - -Cc: Daniel Kiper <daniel.kiper@oracle.com> -Cc: Steve McIntyre <steve@einval.com> -Cc: Julian Andres Klode <julian.klode@canonical.com> -Signed-off-by: Ard Biesheuvel <ardb@kernel.org> -Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com> -Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> ---- - grub-core/loader/efi/linux.c | 3 +++ - include/grub/efi/pe32.h | 6 ++++++ - 2 files changed, 9 insertions(+) - -diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index ab8fb35..bfbd95a 100644 ---- a/grub-core/loader/efi/linux.c -+++ b/grub-core/loader/efi/linux.c -@@ -117,6 +117,9 @@ grub_arch_efi_linux_load_image_header (grub_file_t file, - return grub_error (GRUB_ERR_FILE_READ_ERROR, "failed to read COFF image header"); - } - -+ if (lh->pe_image_header.optional_header.magic != GRUB_PE32_NATIVE_MAGIC) -+ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "non-native image not supported"); -+ - /* - * Linux kernels built for any architecture are guaranteed to support the - * LoadFile2 based initrd loading protocol if the image version is >= 1. -diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h -index 101859a..4e6e9d2 100644 ---- a/include/grub/efi/pe32.h -+++ b/include/grub/efi/pe32.h -@@ -267,6 +267,12 @@ struct grub_pe32_section_table - - #define GRUB_PE32_SIGNATURE_SIZE 4 - -+#if GRUB_TARGET_SIZEOF_VOID_P == 8 -+#define GRUB_PE32_NATIVE_MAGIC GRUB_PE32_PE64_MAGIC -+#else -+#define GRUB_PE32_NATIVE_MAGIC GRUB_PE32_PE32_MAGIC -+#endif -+ - struct grub_pe_image_header - { - /* This is always PE\0\0. */ --- -cgit v1.1 - diff --git a/user/grub/0010-fix-gcc-no-pie-specs.patch b/user/grub/0010-fix-gcc-no-pie-specs.patch index ecd59d24d..74b76f29e 100644 --- a/user/grub/0010-fix-gcc-no-pie-specs.patch +++ b/user/grub/0010-fix-gcc-no-pie-specs.patch @@ -1,7 +1,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 -@@ -37616,7 +37616,7 @@ +@@ -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 82605a4c9..ecc2b60bb 100644 --- a/user/grub/APKBUILD +++ b/user/grub/APKBUILD @@ -1,9 +1,9 @@ # Contributor: Carlo Landmeter <clandmeter@gmail.com> # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=grub -pkgver=2.12_rc1 +pkgver=2.12 _pkgver=$(printf '%s' "$pkgver" | tr _ \~) -pkgrel=2 +pkgrel=0 pkgdesc="Boot loader with support for Linux, Multiboot and more" url="https://www.gnu.org/software/grub/" arch="all" @@ -34,19 +34,12 @@ done install="$pkgname.post-upgrade" -source="https://alpha.gnu.org/gnu/$pkgname/$pkgname-$_pkgver.tar.xz +source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$_pkgver.tar.xz adelie-branding.patch grub2-accept-empty-module.patch - 0001-unmerged-usr.patch 0002-revert-gawk.patch - 0003-spcr-revision.patch - 0004-videoinfo-no-reinit.patch - 0005-vsnprintf.patch - 0006-cryptodisk-retval.patch - 0007-efi_gop-shadow.patch - 0008-efi-pure64.patch - 0009-linux-mixed-mode.patch 0010-fix-gcc-no-pie-specs.patch + xfs.patch grub-xen-host_grub.cfg default-grub update-grub @@ -81,6 +74,8 @@ _build_flavor() { } build() { + # 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 @@ -189,19 +184,12 @@ mount() { mv "$pkgdir"/usr/bin/grub-mount "$subpkgdir"/usr/bin/ } -sha512sums="6f1fbce004b6dccf58e203bf6a6eeb771bac5ecc54b503265e56a97e9adce0221677bb3e64328144ec921f327a099f0345e7a9952be41cd8808f7635cded52cb grub-2.12~rc1.tar.xz +sha512sums="761c060a4c3da9c0e810b0ea967e3ebc66baa4ddd682a503ae3d30a83707626bccaf49359304a16b3a26fc4435fe6bea1ee90be910c84de3c2b5485a31a15be3 grub-2.12.tar.xz 4a6c909a1150b057fb0563f7a0646db33e16f84d6a8c443ef7db4003efd56c211a52f87699c5c95a6ccde65f6db46a8711a5b784f38479db804938dfe3115439 adelie-branding.patch -6e001762f7f562f2fafed56118079122e7602c731c70723241276f523e0882a3930d720fd847143d379ffd85626d2d7d3fa914590c0de1f0903a293695e71c41 grub2-accept-empty-module.patch -de798c8907ab5c3f00b42bf10a63a5666af2076932a46ec6e484c67303bef0509e7787910392f75b3e4ccb9aa17d67f2ef5f5fc1eed3dcdf96f598dc2400ade4 0001-unmerged-usr.patch -60e299ef0677dbd4e1e60623353be3dd8fbb1a795cbf24a9e1a2511f6a7322033254daf71116e95e93335d5e76a7a85488d66f357779a9f589f04119df8f0aea 0002-revert-gawk.patch -d7f22e5f02dfbebad5e9122a01a9d6e5fffd0bb4731790c97e5184c148a5e1e8f4d5d3d49b09b26a7768648b147b134c3b316649608d2ac8390ab63b7f278a07 0003-spcr-revision.patch -1daba1b4857c45f4e729d24cd800eb6f6b659ea5c8399394487f75817b4f7092e5972676fc8c28b6289e04f0fe41d4ca54dc4523db1393cdb65751d377a06d8a 0004-videoinfo-no-reinit.patch -0a69b2f9cb178b8ae4a7b96f1cb801ef6d6d7942a842346de5017b6fdb5a8bd6db1ad55fdd9cc41a6c4660be9985621008d1da1dc45510d6ffed425f0f4997d1 0005-vsnprintf.patch -9b444c596c3c7387c18f3d6747ce4000d8e1ac89a07d919f3c648b07a3492911a6b7a84764c7f953a8a7873f26dedf10549a46008bc23e38d1da3eeb6d1850e3 0006-cryptodisk-retval.patch -a16569a037b29a669d5bd68f6130b1c59870f8bb660bf98b318f0dac39bb9a0026d76e2d47298e2b22a91f75aa34c234785149b61e699dfdde27020210023e84 0007-efi_gop-shadow.patch -13a819813b82ed13752dff2bf2ddaf47e1c369f10148a988a2517d51f33c11ee187f3c6909c08a1b922440aebebe1f3178fe8f63f85055129b74893885e0db1f 0008-efi-pure64.patch -911a28fa28f966369039e14062deaf90c81818c06fb3f44add27c395a3074b8c1b858a47c1a97909e07b813a87633bf244e5ee4db23f9d429edd9a05f5b5d72a 0009-linux-mixed-mode.patch -1552f56c17c55aabae26c64beeb9ed507623331794d4b590721fa0f22b658831bbef3475dfb8c125ab05e8ec62939d5928416c32d2c968a4a2a98bee0744c1fd 0010-fix-gcc-no-pie-specs.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 1cb675fa0af9a1fd8d1a868e3e9de3bfef7eada66c5df0cfef23eca33e93e676eed6e1f67c679690f3e581565b350a9f3ba01aa9b89de66c970ea61ca21bcd65 default-grub 8e5f1cf91da9fd956695438509bb26e45f38170ca90d99a996e859053d72c82b7e4b02cb8979f047fc53498036f47b5400bf54687c390793995a05ded4216d55 update-grub diff --git a/user/grub/grub2-accept-empty-module.patch b/user/grub/grub2-accept-empty-module.patch index f4f62d433..b6def4f94 100644 --- a/user/grub/grub2-accept-empty-module.patch +++ b/user/grub/grub2-accept-empty-module.patch @@ -10,7 +10,7 @@ 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 -@@ -225,7 +225,8 @@ check_symbols (const struct grub_module_ +@@ -305,7 +305,8 @@ check_symbols (const struct grub_module_ s = find_section (arch, e, ".moddeps"); if (!s) 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 + |