From 71ebc66065e05d91ae95f8e4b8c55543c5e552ca Mon Sep 17 00:00:00 2001 From: David Michael Date: Wed, 26 Jul 2017 14:15:08 -0700 Subject: [PATCH] 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 [Rebased] Signed-off-by: Geoff Levand --- build_library/vm_image_util.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 053e9331b0..f1d3a50dd2 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -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