diff options
author | Yi-Yo Chiang <yochiang@google.com> | 2021-05-04 10:44:40 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-04 10:44:40 +0000 |
commit | 9fc414c8d7cd4168c97cf74986cf3738fed9d606 (patch) | |
tree | 83be484c7ef9311da42053b92e36b497ccbca73e | |
parent | db5515fea919102ffda9f61a590cdcbb3a64a85b (diff) | |
parent | e1d8f615364c7958c530c8459c369837c77f2982 (diff) | |
download | mkbootimg-9fc414c8d7cd4168c97cf74986cf3738fed9d606.tar.gz |
repack_bootimg: Update cpio command arguments am: 186e549e76 am: c00759d02f am: e1d8f61536
Original change: https://android-review.googlesource.com/c/platform/system/tools/mkbootimg/+/1693669
Change-Id: Id53b19f730a37a304708590c328877775ffee4a3
-rwxr-xr-x | repack_bootimg.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/repack_bootimg.py b/repack_bootimg.py index 3e07707..cad6058 100755 --- a/repack_bootimg.py +++ b/repack_bootimg.py @@ -115,18 +115,10 @@ class RamdiskImage: # toybox cpio arguments: # -i: extract files from stdin # -d: create directories if needed - cpio_result = subprocess.run( - ['toybox', 'cpio', '-id'], check=False, - input=decompressed_result.stdout, capture_output=True, - cwd=self._ramdisk_dir) - - # toybox cpio command might return a non-zero code, e.g., found - # duplicated files in the ramdisk. Treat it as non-fatal with - # check=False and only print the error message here. - if cpio_result.returncode != 0: - print('\n' - 'WARNNING: cpio command error:\n' + - cpio_result.stderr.decode('utf-8').strip() + '\n') + # -u: override existing files + subprocess.run( + ['toybox', 'cpio', '-idu'], check=True, + input=decompressed_result.stdout, cwd=self._ramdisk_dir) print("=== Unpacked ramdisk: '{}' ===".format( self._ramdisk_img)) |