summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-09-17 12:45:55 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-09-17 13:51:22 +0200
commitd50ed41dd6702054d5c8fd7ae86722e9c410f84c (patch)
treef16f3071de0813679c55194f36232b8a91d7b53f /eclass/kernel-install.eclass
parentmetadata/stabilization-groups: new libnice.group (diff)
downloadgentoo-d50ed41dd6702054d5c8fd7ae86722e9c410f84c.tar.gz
gentoo-d50ed41dd6702054d5c8fd7ae86722e9c410f84c.tar.bz2
gentoo-d50ed41dd6702054d5c8fd7ae86722e9c410f84c.zip
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 <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/38643 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r--eclass/kernel-install.eclass2
1 files changed, 1 insertions, 1 deletions
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
}