image_signing: use sparse copying when creating the signed image

This should speed up the copies significantly by using less disk
storage & I/O when the unpacked file is not sparse already.  This
option has been in cp for a long time, and works in Ubuntu Precise
(coreutils-8.13) & Trusty (coreutils-8.21).

BUG=chromium:530730
TEST=`./signing_unittests.py` passes
BRANCH=None

Change-Id: I82192455a623eabf96abf4f25296f3dc0c129ca2
Reviewed-on: https://chromium-review.googlesource.com/299440
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Reviewed-by: Amey Deshpande <ameyd@google.com>
This commit is contained in:
Mike Frysinger
2015-09-09 17:00:57 -04:00
committed by chrome-bot
parent afb07f4967
commit df9bf4eef3

View File

@@ -691,7 +691,7 @@ sign_image_file() {
local kernB_keyblock="$7"
local kernB_privkey="$8"
echo "Preparing ${image_type} image..."
cp "${input}" "${output}"
cp --sparse=always "${input}" "${output}"
resign_firmware_payload "${output}"
# We do NOT strip /boot for factory installer, since some devices need it to
# boot EFI. crbug.com/260512 would obsolete this requirement.