envsetup: syswrite - wait after rooting

adb root sometimes takes a second, and the next command
will fail.

Bug: N/A
Test: syswrite on device which isn't already rooted
Change-Id: I91754c31c74bf0589ea8cbae77c10e5a120bdce5
This commit is contained in:
Steven Moreland
2023-04-17 17:21:01 +00:00
parent 42bc8b9809
commit 7275a19b5f

View File

@@ -1096,12 +1096,12 @@ function qpid() {
#
# Easy way to make system.img/etc writable
function syswrite() {
adb wait-for-device && adb root || return 1
adb wait-for-device && adb root && adb wait-for-device || return 1
if [[ $(adb disable-verity | grep -i "reboot") ]]; then
echo "rebooting"
adb reboot && adb wait-for-device && adb root || return 1
adb reboot && adb wait-for-device && adb root && adb wait-for-device || return 1
fi
adb wait-for-device && adb remount || return 1
adb remount || return 1
}
# coredump_setup - enable core dumps globally for any process