mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
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>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user