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

Commit 370aac75 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Gerrit Code Review
Browse files

Merge changes I55d0e1a8,I4d9a8776

* changes:
  adb-remount-test: do not brick devices that support overlayfs but do not use it
  adb-remount-test: provide additional mount details
parents 842cac88 cfe658a0
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -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
@@ -1509,16 +1518,23 @@ adb_sh grep " /vendor .* rw," /proc/mounts >/dev/null </dev/null &&
  die "/vendor is not read-only"
adb_su remount vendor </dev/null ||
  die "remount command"
adb_su df -k </dev/null | skip_unrelated_mounts
adb_sh grep " /vendor .* rw," /proc/mounts >/dev/null </dev/null ||
  die "/vendor is not read-write"
adb_sh grep " /system .* rw," /proc/mounts >/dev/null </dev/null &&
adb_sh grep " \(/system\|/\) .* rw," /proc/mounts >/dev/null </dev/null &&
  die "/system is not read-only"
echo "${GREEN}[       OK ]${NORMAL} remount command works from scratch" >&2

restore
err=${?}
if ! restore; then
  restore() {
    true
  }
  die "failed to restore verity after remount from scratch test"
fi

if [ ${err} = 0 ] && ${overlayfs_supported}; then
err=0

if ${overlayfs_supported}; then
  echo "${GREEN}[ RUN      ]${NORMAL} test 'adb remount -R'" >&2
  avc_check
  adb_root &&
@@ -1541,7 +1557,7 @@ restore() {
}

[ ${err} = 0 ] ||
  die "failed to restore verity" >&2
  die "failed to restore verity"

echo "${GREEN}[  PASSED  ]${NORMAL} adb remount" >&2