diff options
| author | Liz Prucka <lizprucka@google.com> | 2022-08-31 20:05:37 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2022-09-02 12:30:43 +0200 |
| commit | b66bf060edd28ff43a7a61e99fd0c879861bca33 (patch) | |
| tree | fb70e5cab3b35a10b64cd96becbac1b50bf3c3cf /vm/cuttlefish | |
| parent | a577205ebe1f58124fc8b58e3ccc2ac2d690e89d (diff) | |
vm/cuttlefish: run commands from deviceRoot
Create the the deviceRoot directory, then
run adb commands from deviceRoot (data/fuzz).
Additionally, added quotes in adb shell mounting
command; commands should be run inside shell.
Diffstat (limited to 'vm/cuttlefish')
| -rw-r--r-- | vm/cuttlefish/cuttlefish.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vm/cuttlefish/cuttlefish.go b/vm/cuttlefish/cuttlefish.go index f1e0b88ea..dd2a0e898 100644 --- a/vm/cuttlefish/cuttlefish.go +++ b/vm/cuttlefish/cuttlefish.go @@ -81,8 +81,12 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) { return nil, fmt.Errorf("failed to get root access to device: %s", err) } - if err := inst.runOnHost(5*time.Minute, fmt.Sprintf("adb shell setprop persist.dbg.keep_debugfs_mounted 1;"+ - "mount -t debugfs debugfs /sys/kernel/debug; chmod 0755 /sys/kernel/debug")); err != nil { + if err := inst.runOnHost(5*time.Minute, fmt.Sprintf("adb shell '"+ + "setprop persist.dbg.keep_debugfs_mounted 1;"+ + "mount -t debugfs debugfs /sys/kernel/debug;"+ + "chmod 0755 /sys/kernel/debug;"+ + "mkdir %s;"+ + "'", deviceRoot)); err != nil { return nil, fmt.Errorf("failed to mount debugfs to /sys/kernel/debug: %s", err) } @@ -154,7 +158,7 @@ func (inst *instance) Close() { func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( <-chan []byte, <-chan error, error) { - return inst.gceInst.Run(timeout, stop, fmt.Sprintf("adb shell %s", command)) + return inst.gceInst.Run(timeout, stop, fmt.Sprintf("adb shell 'cd %s; %s'", deviceRoot, command)) } func (inst *instance) Diagnose(rep *report.Report) ([]byte, bool) { |
