From: Andreas Gampe Date: Sat, 13 Aug 2016 02:35:57 +0000 (-0700) Subject: otapreopt: Collect and print size of artifacts X-Git-Tag: android-x86-7.1-r1~70^2~10 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e7d555267725ca050ddd5e891267a61a55c9e16a;p=android-x86%2Fframeworks-native.git otapreopt: Collect and print size of artifacts Collect and print the size of artifacts when moving after a reboot. This helps in diagnosing issues after the fact. Bug: 30832951 Change-Id: Iee410adf59dcbb74fa4b49edb27d028025cd8bf9 --- diff --git a/cmds/installd/otapreopt_slot.sh b/cmds/installd/otapreopt_slot.sh index d51ab706e6..b5786e9a28 100644 --- a/cmds/installd/otapreopt_slot.sh +++ b/cmds/installd/otapreopt_slot.sh @@ -22,10 +22,13 @@ SLOT_SUFFIX=$(getprop ro.boot.slot_suffix) if test -n "$SLOT_SUFFIX" ; then if test -d /data/ota/$SLOT_SUFFIX/dalvik-cache ; then log -p i -t otapreopt_slot "Moving A/B artifacts for slot ${SLOT_SUFFIX}." + OLD_SIZE=$(du -h -s /data/dalvik-cache) rm -rf /data/dalvik-cache/* + NEW_SIZE=$(du -h -s /data/ota/$SLOT_SUFFIX/dalvik-cache) mv /data/ota/$SLOT_SUFFIX/dalvik-cache/* /data/dalvik-cache/ rmdir /data/ota/$SLOT_SUFFIX/dalvik-cache rmdir /data/ota/$SLOT_SUFFIX + log -p i -t otapreopt_slot "Moved ${NEW_SIZE} over ${OLD_SIZE}" else log -p i -t otapreopt_slot "No A/B artifacts found for slot ${SLOT_SUFFIX}." fi