summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-10-01 20:34:43 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-10-10 16:46:47 +0200
commitdec7ddaabb47c81ecddc603fb2819c4c4f5066ea (patch)
tree8fa08a2c6cb228cfe1b6590f07c64fd8561fc6b2 /eclass
parentnet-firewall/ipset: drop 7.22-r1 (diff)
downloadgentoo-dec7ddaabb47c81ecddc603fb2819c4c4f5066ea.tar.gz
gentoo-dec7ddaabb47c81ecddc603fb2819c4c4f5066ea.tar.bz2
gentoo-dec7ddaabb47c81ecddc603fb2819c4c4f5066ea.zip
kernel-install.eclass: fix objcopy overwriting uki
From the manual: If you do not specify outfile, objcopy creates a temporary file and destructively renames the result with the name of infile. We don't want that. Unfortunately we cannot use /dev/null as dump, objcopy complains, so we dump it in T instead. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/kernel-install.eclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index c5f218a46b91..29abb9b419e6 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -650,7 +650,10 @@ kernel-install_extract_from_uki() {
local uki=${2}
local out=${3}
- $(tc-getOBJCOPY) "${uki}" --dump-section ".${extract_type}=${out}" ||
+ # objcopy overwrites input if there is no output, dump the output in T.
+ # We unfortunately cannot use /dev/null here
+ $(tc-getOBJCOPY) "${uki}" "${T}/dump.efi" \
+ --dump-section ".${extract_type}=${out}" ||
die "Failed to extract ${extract_type}"
chmod 644 "${out}" || die
}