Add option to wipe userdata
Test: th
Change-Id: Ib8e47bf1d7ddd7f329edbf1ae5bc06aa2390030c
diff --git a/scripts/update_device.py b/scripts/update_device.py
index db653dc..72cee49 100755
--- a/scripts/update_device.py
+++ b/scripts/update_device.py
@@ -442,6 +442,8 @@
help='Perform slot switch for this OTA package')
parser.add_argument('--perform-reset-slot-switch', action='store_true',
help='Perform reset slot switch for this OTA package')
+ parser.add_argument('--wipe-user-data', action='store_true',
+ help='Wipe userdata after installing OTA')
args = parser.parse_args()
logging.basicConfig(
level=logging.WARNING if args.no_verbose else logging.INFO)
@@ -493,6 +495,8 @@
args.extra_headers += "\nSWITCH_SLOT_ON_REBOOT=0"
if args.no_postinstall:
args.extra_headers += "\nRUN_POST_INSTALL=0"
+ if args.wipe_user_data:
+ args.extra_headers += "\nPOWERWASH=1"
with zipfile.ZipFile(args.otafile) as zfp:
CARE_MAP_ENTRY_NAME = "care_map.pb"