build_library: avoid a SIGPIPE while building arm64 UEFI firmware

This just sets the code file size to the var file size, so it gets
zero-padding without having to pipe commands together.

From: David Michael <david.michael@coreos.com>
[Rebased]
Signed-off-by: Geoff Levand <geoff@infradead.org>
This commit is contained in:
David Michael 2017-07-26 14:15:08 -07:00 committed by Geoff Levand
parent 1761d9d071
commit 71ebc66065

View File

@ -721,11 +721,13 @@ _write_qemu_uefi_conf() {
info "Updating edk2 in /build/${BOARD}"
emerge-${BOARD} --nodeps --select -qugKN sys-firmware/edk2
# Create 64MiB flash device image files.
cat "/build/${BOARD}/usr/share/edk2/QEMU_EFI.fd" /dev/zero | \
dd iflag=fullblock bs=1M count=64 of="$(_dst_dir)/${flash_ro}" \
status=none
dd if=/dev/zero bs=1M count=64 of="$(_dst_dir)/${flash_rw}" \
status=none
cp "/build/${BOARD}/usr/share/edk2/QEMU_EFI.fd" \
"$(_dst_dir)/${flash_ro}.work"
truncate --reference="$(_dst_dir)/${flash_rw}" \
"$(_dst_dir)/${flash_ro}.work"
mv "$(_dst_dir)/${flash_ro}.work" "$(_dst_dir)/${flash_ro}"
;;
esac