From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D7157158089 for ; Mon, 11 Sep 2023 01:49:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DB6AE2BC037; Mon, 11 Sep 2023 01:49:29 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C20782BC037 for ; Mon, 11 Sep 2023 01:49:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C0636335C56 for ; Mon, 11 Sep 2023 01:49:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2BE9E1139 for ; Mon, 11 Sep 2023 01:49:27 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1694396899.070361537d8ace58dd617b3520c0e2751e1f5574.floppym@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/files/, sys-boot/grub/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-boot/grub/files/grub-2.06-arm64-linux-Remove-magic-number.patch sys-boot/grub/grub-2.06-r7.ebuild sys-boot/grub/grub-2.06-r8.ebuild X-VCS-Directories: sys-boot/grub/files/ sys-boot/grub/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 070361537d8ace58dd617b3520c0e2751e1f5574 X-VCS-Branch: master Date: Mon, 11 Sep 2023 01:49:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c9afbb16-572b-4220-b505-0bacfb077736 X-Archives-Hash: 8f114396512e8b7224bbb2a5e1a1976c commit: 070361537d8ace58dd617b3520c0e2751e1f5574 Author: Mike Gilbert gentoo org> AuthorDate: Mon Sep 11 01:48:19 2023 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Mon Sep 11 01:48:19 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07036153 sys-boot/grub: backport fix for arm64 Closes: https://bugs.gentoo.org/913935 Signed-off-by: Mike Gilbert gentoo.org> ...grub-2.06-arm64-linux-Remove-magic-number.patch | 45 ++++++++++++++++++++++ .../{grub-2.06-r7.ebuild => grub-2.06-r8.ebuild} | 1 + 2 files changed, 46 insertions(+) diff --git a/sys-boot/grub/files/grub-2.06-arm64-linux-Remove-magic-number.patch b/sys-boot/grub/files/grub-2.06-arm64-linux-Remove-magic-number.patch new file mode 100644 index 000000000000..eed3bf0ca93d --- /dev/null +++ b/sys-boot/grub/files/grub-2.06-arm64-linux-Remove-magic-number.patch @@ -0,0 +1,45 @@ +https://git.savannah.gnu.org/cgit/grub.git/patch/?id=69edb31205602c29293a8c6e67363bba2a4a1e66 +https://bugs.gentoo.org/913935 + +From 69edb31205602c29293a8c6e67363bba2a4a1e66 Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Thu, 11 Aug 2022 16:51:57 +0200 +Subject: loader/arm64/linux: Remove magic number header field check + +The "ARM\x64" magic number in the file header identifies an image as one +that implements the bare metal boot protocol, allowing the loader to +simply move the file to a suitably aligned address in memory, with +sufficient headroom for the trailing .bss segment (the required memory +size is described in the header as well). + +Note of this matters for GRUB, as it only supports EFI boot. EFI does +not care about this magic number, and nor should GRUB: this prevents us +from booting other PE linux images, such as the generic EFI zboot +decompressor, which is a pure PE/COFF image, and does not implement the +bare metal boot protocol. + +So drop the magic number check. + +Signed-off-by: Ard Biesheuvel +Reviewed-by: Daniel Kiper +--- + grub-core/loader/arm64/linux.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index ef3e9f9..4c92e48 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -51,9 +51,6 @@ static grub_addr_t initrd_end; + grub_err_t + grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh) + { +- if (lh->magic != GRUB_LINUX_ARMXX_MAGIC_SIGNATURE) +- return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); +- + if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); +-- +cgit v1.1 + diff --git a/sys-boot/grub/grub-2.06-r7.ebuild b/sys-boot/grub/grub-2.06-r8.ebuild similarity index 99% rename from sys-boot/grub/grub-2.06-r7.ebuild rename to sys-boot/grub/grub-2.06-r8.ebuild index c56c06edbcba..98de90a6d4a3 100644 --- a/sys-boot/grub/grub-2.06-r7.ebuild +++ b/sys-boot/grub/grub-2.06-r8.ebuild @@ -72,6 +72,7 @@ PATCHES=( "${FILESDIR}"/grub-2.06-fs-ext2-ignore-checksum-seed.patch "${FILESDIR}"/grub-2.06-riscv.patch "${FILESDIR}"/grub-2.06-locale.patch + "${FILESDIR}"/grub-2.06-arm64-linux-Remove-magic-number.patch ) DEJAVU=dejavu-sans-ttf-2.37