[botanist] Fastboot continue back to fuchsia
If fastboot is set, continue back to fuchsia after booting.
Change-Id: I29f686672705359d82b9aba487edfd93fecdfc3d
diff --git a/cmd/botanist/run.go b/cmd/botanist/run.go
index d3aeceb..a099089 100644
--- a/cmd/botanist/run.go
+++ b/cmd/botanist/run.go
@@ -16,6 +16,7 @@
"time"
"fuchsia.googlesource.com/tools/botanist"
+ "fuchsia.googlesource.com/tools/fastboot"
"fuchsia.googlesource.com/tools/netboot"
"fuchsia.googlesource.com/tools/pdu"
"fuchsia.googlesource.com/tools/retry"
@@ -125,6 +126,16 @@
return err
}
+ // TODO(IN-892): Necessary to continue back to fuchsia after rebooting.
+ if r.fastboot != "" {
+ ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
+ defer cancel()
+ f := fastboot.Fastboot{r.fastboot}
+ if _, err := f.Continue(ctx); err != nil {
+ return err
+ }
+ }
+
// Run command.
// The subcommand is put in its own process group so that no subprocesses it spins up
// are orphaned on cancelation.
diff --git a/cmd/botanist/zedboot.go b/cmd/botanist/zedboot.go
index eda0cbe..7b9960d 100644
--- a/cmd/botanist/zedboot.go
+++ b/cmd/botanist/zedboot.go
@@ -24,6 +24,7 @@
"time"
"fuchsia.googlesource.com/tools/botanist"
+ "fuchsia.googlesource.com/tools/fastboot"
"fuchsia.googlesource.com/tools/netboot"
"fuchsia.googlesource.com/tools/pdu"
"fuchsia.googlesource.com/tools/retry"
@@ -258,6 +259,16 @@
return err
}
+ // TODO(IN-892): Necessary to continue back to fuchsia after rebooting.
+ if cmd.fastboot != "" {
+ ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
+ defer cancel()
+ f := fastboot.Fastboot{cmd.fastboot}
+ if _, err := f.Continue(ctx); err != nil {
+ return err
+ }
+ }
+
// Handle host commands
// TODO(IN-831): Remove when host-target-interaction infra is ready
if cmd.hostCmd != "" {