Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80bd6d73 authored by Andreas Gampe's avatar Andreas Gampe Committed by android-build-merger
Browse files

otapreopt: Collect and print size of artifacts am: e7d55526 am: 14db1889

am: 3d786efd

Change-Id: Ie1f44bff28e577a2c44fb077f03cbd2d06aa9cb5
parents 3c13a41a 3d786efd
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -22,10 +22,13 @@ SLOT_SUFFIX=$(getprop ro.boot.slot_suffix)
if test -n "$SLOT_SUFFIX" ; then
if test -n "$SLOT_SUFFIX" ; then
  if test -d /data/ota/$SLOT_SUFFIX/dalvik-cache ; 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}."
    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/*
    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/
    mv /data/ota/$SLOT_SUFFIX/dalvik-cache/* /data/dalvik-cache/
    rmdir /data/ota/$SLOT_SUFFIX/dalvik-cache
    rmdir /data/ota/$SLOT_SUFFIX/dalvik-cache
    rmdir /data/ota/$SLOT_SUFFIX
    rmdir /data/ota/$SLOT_SUFFIX
    log -p i -t otapreopt_slot "Moved ${NEW_SIZE} over ${OLD_SIZE}"
  else
  else
    log -p i -t otapreopt_slot "No A/B artifacts found for slot ${SLOT_SUFFIX}."
    log -p i -t otapreopt_slot "No A/B artifacts found for slot ${SLOT_SUFFIX}."
  fi
  fi