From 96a913e7f4eceb705b4e6862068117670ce31b79 Mon Sep 17 00:00:00 2001 From: Chirayu Desai Date: Fri, 27 Mar 2020 03:49:31 +0530 Subject: [PATCH] releasetools: Use du -b * When $OUT is on a compressed disk, `du -k -s` might not return the correct sizes. * Adding `-b` gets us close to the actual size. toybox commit: https://github.com/landley/toybox/pull/177 Test: m, builds and boots. Devices: crosshatch blueline bonito sargo (anything with dynamic partitions) --- tools/releasetools/build_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index 54bb857ac1..f30f7876ab 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -57,7 +57,7 @@ def GetDiskUsage(path): Returns: The number of bytes based on a 1K block_size. """ - cmd = ["du", "-k", "-s", path] + cmd = ["du", "-b", "-k", "-s", path] output = common.RunAndCheckOutput(cmd, verbose=False) return int(output.split()[0]) * 1024