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 04AB1158083 for ; Tue, 17 Sep 2024 11:58:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2E000E29A5; Tue, 17 Sep 2024 11:58:15 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 18B94E29A5 for ; Tue, 17 Sep 2024 11:58:15 +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 5B236342FA3 for ; Tue, 17 Sep 2024 11:58:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A5E8916EF for ; Tue, 17 Sep 2024 11:58:12 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1726573882.d50ed41dd6702054d5c8fd7ae86722e9c410f84c.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/kernel-install.eclass X-VCS-Directories: eclass/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: d50ed41dd6702054d5c8fd7ae86722e9c410f84c X-VCS-Branch: master Date: Tue, 17 Sep 2024 11:58:12 +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: 999fbeef-1541-4a1e-a510-847f0f222864 X-Archives-Hash: 00b312c205002bcb70036a21ddff34a9 commit: d50ed41dd6702054d5c8fd7ae86722e9c410f84c Author: Andrew Ammerlaan gentoo org> AuthorDate: Tue Sep 17 10:45:55 2024 +0000 Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue Sep 17 11:51:22 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d50ed41d kernel-install.eclass: fix gentoo-kernel-bin with llvm-objcopy We ship the kernel in gentoo-kernel-bin in the form of an UKI, using objcopy we extract from this the kernel image (and if desired the generic initramfs). However, llvm-objcopy does not properly handle the -O argument and as a result the extracted kernel image is of the same file type as the UKI (i.e. a PE32+ executable) instead of a regular kernel image. This causes issues in bootloader such as grub which differentiate between loading a normal kernel image and loading an EFI executable (such as an UKI). And also causes the signature verification to fail since the kernel image is bigger then it should be due to the additional headers. Using the --dump-section argument instead resolves this problem. See-also: https://github.com/llvm/llvm-project/issues/108946 Signed-off-by: Andrew Ammerlaan gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/38643 Signed-off-by: Andrew Ammerlaan gentoo.org> eclass/kernel-install.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index 930640188c26..dc337c7862fd 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -650,7 +650,7 @@ kernel-install_extract_from_uki() { local uki=${2} local out=${3} - $(tc-getOBJCOPY) -O binary "-j.${extract_type}" "${uki}" "${out}" || + $(tc-getOBJCOPY) "${uki}" --dump-section ".${extract_type}=${out}" || die "Failed to extract ${extract_type}" chmod 644 "${out}" || die }