Merge "fs_mgr: overlayfs: fsck scratch filesystem"

This commit is contained in:
Treehugger Robot 2019-10-04 16:13:06 +00:00 committed by Gerrit Code Review
commit db11fdcca3
2 changed files with 38 additions and 16 deletions

View file

@ -782,6 +782,7 @@ bool fs_mgr_overlayfs_mount_scratch(const std::string& device_path, const std::s
} else {
fs_mgr_set_blk_ro(device_path, false);
}
entry.fs_mgr_flags.check = true;
auto save_errno = errno;
auto mounted = fs_mgr_do_mount_one(entry) == 0;
if (!mounted) {

View file

@ -38,6 +38,8 @@ Conditions:
EMPTY=""
SPACE=" "
# Line up wrap to [ XXXXXXX ] messages.
INDENT=" "
# A _real_ embedded tab character
TAB="`echo | tr '\n' '\t'`"
# A _real_ embedded escape character
@ -159,8 +161,7 @@ avc_check() {
return
fi
echo "${ORANGE}[ WARNING ]${NORMAL} unlabeled sepolicy violations:" >&2
echo "${L}" |
sed 's/^/ /' >&2
echo "${L}" | sed "s/^/${INDENT}/" >&2
}
[ "USAGE: get_property <prop>
@ -639,10 +640,10 @@ EXPECT_EQ() {
*}" ]; then
echo "${prefix} expected \"${lval}\""
echo "${prefix} got \"${rval}\"" |
sed ': again
sed ": again
N
s/\(\n\)\([^ ]\)/\1 \2/
t again'
s/\(\n\)\([^ ]\)/\1${INDENT}\2/
t again"
if [ -n "${*}" ] ; then
echo "${prefix} ${*}"
fi
@ -657,10 +658,10 @@ EXPECT_EQ() {
if [ `echo ${lval}${rval}${*} | wc -c` -gt 60 -o "${rval}" != "${rval% *}" ]; then
echo "${prefix} ok \"${lval}\""
echo " = \"${rval}\"" |
sed ': again
sed ": again
N
s/\(\n\)\([^ ]\)/\1 \2/
t again'
s/\(\n\)\([^ ]\)/\1${INDENT}\2/
t again"
if [ -n "${*}" ] ; then
echo "${prefix} ${*}"
fi
@ -955,13 +956,24 @@ else
echo "${GREEN}[ RUN ]${NORMAL} Testing adb shell su root remount -R command" >&2
avc_check
adb_su remount -R system </dev/null || true
T=`adb_date`
adb_su remount -R system </dev/null
err=${?}
if [ "${err}" != 0 ]; then
echo "${ORANGE}[ WARNING ]${NORMAL} adb shell su root remount -R system = ${err}, likely did not reboot!" >&2
T="-t ${T}"
else
# Rebooted, logcat will be meaningless, and last logcat will likely be clear
T=""
fi
sleep 2
adb_wait ${ADB_WAIT} ||
die "waiting for device after remount -R `usb_status`"
die "waiting for device after adb shell su root remount -R system `usb_status`"
if [ "orange" != "`get_property ro.boot.verifiedbootstate`" -o \
"2" = "`get_property partition.system.verified`" ]; then
die "remount -R command failed"
die ${T} "remount -R command failed
${INDENT}ro.boot.verifiedbootstate=\"`get_property ro.boot.verifiedbootstate`\"
${INDENT}partition.system.verified=\"`get_property partition.system.verified`\""
fi
echo "${GREEN}[ OK ]${NORMAL} adb shell su root remount -R command" >&2
@ -1643,15 +1655,24 @@ err=0
if ${overlayfs_supported}; then
echo "${GREEN}[ RUN ]${NORMAL} test 'adb remount -R'" >&2
avc_check
adb_root &&
adb remount -R &&
adb_wait ${ADB_WAIT} ||
die "adb remount -R"
adb_root ||
die "adb root in preparation for adb remount -R"
T=`adb_date`
adb remount -R
err=${?}
if [ "${err}" != 0 ]; then
die -t ${T} "adb remount -R = ${err}"
fi
sleep 2
adb_wait ${ADB_WAIT} ||
die "waiting for device after adb remount -R `usb_status`"
if [ "orange" != "`get_property ro.boot.verifiedbootstate`" -o \
"2" = "`get_property partition.system.verified`" ] &&
[ -n "`get_property ro.boot.verifiedbootstate`" -o \
-n "`get_property partition.system.verified`" ]; then
die "remount -R command failed to disable verity"
die "remount -R command failed to disable verity
${INDENT}ro.boot.verifiedbootstate=\"`get_property ro.boot.verifiedbootstate`\"
${INDENT}partition.system.verified=\"`get_property partition.system.verified`\""
fi
echo "${GREEN}[ OK ]${NORMAL} 'adb remount -R' command" >&2