summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmin Hassani <ahassani@google.com>2018-01-02 18:03:31 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-01-11 08:23:13 +0000
commit0ac5d4c357bf68a13bfbb7b3dc72b40f5300f231 (patch)
tree0d1a3a11a1cf7142b8576df4da785e7ef8f01c94
parentc45fc1f9094d7e993ed0314bb350951fd7254050 (diff)
downloadvboot-0ac5d4c357bf68a13bfbb7b3dc72b40f5300f231.tar.gz
image_signing: fix zeroing free space
We are not zeroing the free space properly before signing official images. This patch fixes it by using fstrim instead of dd. More info can be found in CL:751809. BRANCH=none BUG=chromium:780291 TEST=used sign_official_build.sh to sign two recovery images (these images produced <zero-space> file) with dev keys. Then generated delta update between the two new images. This time there was no <zero-space> file between the two images. Change-Id: Ib97fb206f5c8bcfd97c43d075990c7fcdaad6f7e Reviewed-on: https://chromium-review.googlesource.com/848237 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> (cherry picked from commit 2de354af77fe2737374845afe20f963a24f68cb4) Reviewed-on: https://chromium-review.googlesource.com/861603 Reviewed-by: Shelley Chen <shchen@chromium.org> Commit-Queue: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org>
-rwxr-xr-xscripts/image_signing/strip_boot_from_image.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/scripts/image_signing/strip_boot_from_image.sh b/scripts/image_signing/strip_boot_from_image.sh
index 5e650af6..2ff85e0a 100755
--- a/scripts/image_signing/strip_boot_from_image.sh
+++ b/scripts/image_signing/strip_boot_from_image.sh
@@ -31,11 +31,7 @@ zero_free_space() {
local rootfs="$1"
info "Zeroing freespace in ${rootfs}"
- # dd is a silly thing and will produce a "No space left on device" message
- # that cannot be turned off and is confusing to unsuspecting victims.
- ( sudo dd if=/dev/zero of="${rootfs}/filler" bs=4096 conv=fdatasync \
- status=noxfer || true ) 2>&1 | grep -v "No space left on device"
- sudo rm "${rootfs}/filler"
+ sudo fstrim -v "${rootfs}"
}