aboutsummaryrefslogtreecommitdiffstats
path: root/vm/adb
diff options
context:
space:
mode:
authorMax Spector <mspector@google.com>2021-05-25 11:56:52 -0700
committerAleksandr Nogikh <wp32pw@gmail.com>2021-08-31 16:02:10 +0200
commit3b5941f9d0482cc32dd1c4763d0672090d22c45f (patch)
tree18ddb74458d93a84c5eb8abe503cc61ffbcc0de2 /vm/adb
parent8f58a0efbf867526a0adee8d9a5cb38e2ebf1ee4 (diff)
vm/adb: mount debugfs on Android if it is not mounted
On Android 12+ debugfs gets unmounted after boot. This remounts it as part of reset.
Diffstat (limited to 'vm/adb')
-rw-r--r--vm/adb/adb.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go
index dc415cced..aeaa8d0c2 100644
--- a/vm/adb/adb.go
+++ b/vm/adb/adb.go
@@ -291,6 +291,17 @@ func (inst *instance) repair() error {
}
// Switch to root for userdebug builds.
inst.adb("root")
+
+ // Mount debugfs.
+ if _, err := inst.adb("shell", "ls /sys/kernel/debug/kcov"); err != nil {
+ log.Logf(2, "debugfs was unmounted mounting")
+ // This prop only exist on Android 12+
+ inst.adb("shell", "setprop persist.dbg.keep_debugfs_mounted 1")
+ if _, err := inst.adb("shell", "mount -t debugfs debugfs /sys/kernel/debug "+
+ "&& chmod 0755 /sys/kernel/debug"); err != nil {
+ return err
+ }
+ }
inst.waitForSSH()
if inst.cfg.StartupScript != "" {
if err := inst.runScript(inst.cfg.StartupScript); err != nil {