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

Commit 32277d09 authored by Yi-Yo Chiang's avatar Yi-Yo Chiang
Browse files

adb-remount-test: Reduce noise from initial overlayfs diagnostics

There's quite a lot of noise from running "Checking current overlayfs
status". Improve the test output by filtering uninteresting df lines.

* "/apex/..." mounts not interesting.
* "rw" mounts not interesting.
* "fuse" devices not interesting.

Bug: 243116800
Test: adb-remount-test
Change-Id: Id15844d853aaf3f7ed86f1a83544494b697b5b39
parent 659c96b1
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -721,7 +721,7 @@ skip_administrative_mounts() {
  local exclude_filesystems=(
  local exclude_filesystems=(
    "overlay" "tmpfs" "none" "sysfs" "proc" "selinuxfs" "debugfs" "bpf"
    "overlay" "tmpfs" "none" "sysfs" "proc" "selinuxfs" "debugfs" "bpf"
    "binfmt_misc" "cg2_bpf" "pstore" "tracefs" "adb" "mtp" "ptp" "devpts"
    "binfmt_misc" "cg2_bpf" "pstore" "tracefs" "adb" "mtp" "ptp" "devpts"
    "ramdumpfs" "binder" "securityfs" "functionfs" "rootfs"
    "ramdumpfs" "binder" "securityfs" "functionfs" "rootfs" "fuse"
  )
  )
  local exclude_devices=(
  local exclude_devices=(
    "\/sys\/kernel\/debug" "\/data\/media" "\/dev\/block\/loop[0-9]*"
    "\/sys\/kernel\/debug" "\/data\/media" "\/dev\/block\/loop[0-9]*"
@@ -746,8 +746,10 @@ or output from df
Filters out all apex and vendor override administrative overlay mounts
Filters out all apex and vendor override administrative overlay mounts
uninteresting to the test" ]
uninteresting to the test" ]
skip_unrelated_mounts() {
skip_unrelated_mounts() {
    grep -v "^overlay.* /\(apex\|bionic\|system\|vendor\)/[^ ]" |
  grep -vE \
      grep -v "[%] /\(data_mirror\|apex\|bionic\|system\|vendor\)/[^ ][^ ]*$"
      -e "^overlay.* /(apex|bionic|system|vendor)/[^ ]" \
      -e "^[^ ]+ /apex/[^ ]" \
      -e "[%] /(data_mirror|apex|bionic|system|vendor)/[^ ]+$"
}
}


[ "USAGE: surgically_wipe_overlayfs
[ "USAGE: surgically_wipe_overlayfs
@@ -1077,21 +1079,19 @@ is_overlayfs_mounted &&
  die "overlay takeover unexpected at this phase"
  die "overlay takeover unexpected at this phase"


overlayfs_needed=true
overlayfs_needed=true
D=`adb_sh cat /proc/mounts </dev/null |
D=$(adb_sh grep " ro," /proc/mounts </dev/null |
   skip_administrative_mounts data`
    skip_administrative_mounts data |
if echo "${D}" | grep /dev/root >/dev/null; then
    skip_unrelated_mounts |
  D=`echo / /
    awk '{ print $1 }' |
     echo "${D}" | grep -v /dev/root`
    sed 's|/dev/root|/|' |
fi
    sort -u)
D=`echo "${D}" | cut -s -d' ' -f1 | sort -u`
no_dedupe=true
no_dedupe=true
for d in ${D}; do
for d in ${D}; do
  adb_sh tune2fs -l $d </dev/null 2>&1 |
  adb_sh tune2fs -l $d </dev/null 2>&1 |
    grep "Filesystem features:.*shared_blocks" >/dev/null &&
    grep "Filesystem features:.*shared_blocks" >/dev/null &&
  no_dedupe=false
  no_dedupe=false
done
done
D=`adb_sh df -k ${D} </dev/null |
D=$(adb_sh df -k ${D} </dev/null)
   sed 's@\([%] /\)\(apex\|bionic\|system\|vendor\)/[^ ][^ ]*$@\1@'`
echo "${D}" >&2
echo "${D}" >&2
if [ X"${D}" = X"${D##* 100[%] }" ] && ${no_dedupe} ; then
if [ X"${D}" = X"${D##* 100[%] }" ] && ${no_dedupe} ; then
  overlayfs_needed=false
  overlayfs_needed=false