summaryrefslogtreecommitdiff
path: root/scripts/update_device.py
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-10-25 21:13:07 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-10-25 21:13:07 +0000
commit3b5668f4aebc1ee7a09e6612a2f9c931f4e9127d (patch)
tree03955220412b2bb73fa38a0f2546df7ab4ab8624 /scripts/update_device.py
parent083fb1a12f669fdcd21d12589323225850ec0eb1 (diff)
parentabb45a5542fedd2a7c587aa91402b21f606bc259 (diff)
update_device.py: Handle the package push without 'adb root'.
am: abb45a5542 Change-Id: I292ac50e5f77971c6c6ab4ed3bedcbfab506e89c
Diffstat (limited to 'scripts/update_device.py')
-rwxr-xr-xscripts/update_device.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/update_device.py b/scripts/update_device.py
index b2452ac9..49de7a15 100755
--- a/scripts/update_device.py
+++ b/scripts/update_device.py
@@ -382,7 +382,12 @@ def main():
device_ota_file = os.path.join(OTA_PACKAGE_PATH, 'debug.zip')
payload_url = 'file://' + device_ota_file
if not args.no_push:
- cmds.append(['push', args.otafile, device_ota_file])
+ data_local_tmp_file = '/data/local/tmp/debug.zip'
+ cmds.append(['push', args.otafile, data_local_tmp_file])
+ cmds.append(['shell', 'su', '0', 'mv', data_local_tmp_file,
+ device_ota_file])
+ cmds.append(['shell', 'su', '0', 'chcon',
+ 'u:object_r:ota_package_file:s0', device_ota_file])
cmds.append(['shell', 'su', '0', 'chown', 'system:cache', device_ota_file])
cmds.append(['shell', 'su', '0', 'chmod', '0660', device_ota_file])
else: