diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc b/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc index 4939db6888c..ed30260313b 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc +++ b/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc @@ -423,9 +423,11 @@ class CvdBootStateMachine : public SetupFeature, public KernelLogPipeConsumer { instance_.adb_ip_and_port()); adb_command.AddParameter("wait-for-device"); adb_command.AddParameter("shell"); - adb_command.AddParameter("/vendor/bin/snapshot_hook_post_resume"); + adb_command.AddParameter( + "su root /vendor/bin/snapshot_hook_post_resume"); CHECK_EQ(adb_command.Start().Wait(), 0) - << "Failed to run /vendor/bin/snapshot_hook_post_resume"; + << "Failed to run su root " + "/vendor/bin/snapshot_hook_post_resume"; // Done last so that adb is more likely to be ready. CHECK(cuttlefish::WriteAll(restore_complete_pipe_write, "1") == 1) << "Error writing to restore complete pipe: " diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/server_loop_impl_snapshot.cpp b/base/cvd/cuttlefish/host/commands/run_cvd/server_loop_impl_snapshot.cpp index af69d812ef9..23744d8f0d0 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/server_loop_impl_snapshot.cpp +++ b/base/cvd/cuttlefish/host/commands/run_cvd/server_loop_impl_snapshot.cpp @@ -190,8 +190,8 @@ static Result RunAdbShellCommand( Result ServerLoopImpl::HandleSuspend(ProcessMonitor& process_monitor) { // right order: guest -> host VLOG(0) << "Suspending the guest.."; - CF_EXPECT( - RunAdbShellCommand(instance_, {"/vendor/bin/snapshot_hook_pre_suspend"})); + CF_EXPECT(RunAdbShellCommand( + instance_, {"su", "root", "/vendor/bin/snapshot_hook_pre_suspend"})); CF_EXPECT(SuspendGuest()); VLOG(0) << "The guest is suspended."; CF_EXPECT(process_monitor.SuspendMonitoredProcesses(), @@ -207,8 +207,8 @@ Result ServerLoopImpl::HandleResume(ProcessMonitor& process_monitor) { VLOG(0) << "The host processes are resumed."; VLOG(0) << "Resuming the guest.."; CF_EXPECT(ResumeGuest()); - CF_EXPECT( - RunAdbShellCommand(instance_, {"/vendor/bin/snapshot_hook_post_resume"})); + CF_EXPECT(RunAdbShellCommand( + instance_, {"su", "root", "/vendor/bin/snapshot_hook_post_resume"})); VLOG(0) << "The guest resumed."; return {}; } diff --git a/tools/buildutils/installbazel.sh b/tools/buildutils/installbazel.sh index bd769a970d7..486efef6b39 100755 --- a/tools/buildutils/installbazel.sh +++ b/tools/buildutils/installbazel.sh @@ -21,7 +21,7 @@ set -e function install_bazel_x86_64() { echo "Installing bazel" apt install apt-transport-https curl gnupg -y - curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg + curl -fsSL https://releases.bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg mv bazel-archive-keyring.gpg /usr/share/keyrings echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list # bazel needs the zip command to gather test outputs but doesn't depend on it