adb-remount-test: do not brick devices that support overlayfs but do not use it

restore() should not run adb enable-verity if device does not
use overlayfs even though it supports it.

Test: adb-remount-test
Bug: 132070014
Change-Id: I55d0e1a87eca9c5f258a1587c844f2a6e4b13b29
This commit is contained in:
Mark Salyzyn 2019-05-24 09:46:09 -07:00
parent d07ab7e544
commit cfe658a04e

View file

@ -963,6 +963,15 @@ D=`adb_sh df -k ${D} </dev/null |
echo "${D}"
if [ X"${D}" = X"${D##* 100[%] }" ] && ${no_dedupe} ; then
overlayfs_needed=false
# if device does not need overlays, then adb enable-verity will brick device
restore() {
${overlayfs_supported} || return 0
inFastboot &&
fastboot reboot &&
adb_wait ${ADB_WAIT}
inAdb &&
adb_wait ${ADB_WAIT}
}
elif ! ${overlayfs_supported}; then
die "need overlayfs, but do not have it"
fi