From 077c22ac75be6324d87b3beadbe2d119d24f0c4c Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Wed, 15 Jul 2026 16:33:21 -0700 Subject: [PATCH 1/3] Always run snapshot_hook_* as root When not run as root, this produces errors like ``` + /system/bin/cmd nfc status + grep -q disabled /vendor/bin/snapshot_hook_pre_suspend[40]: grep: inaccessible or not found + sleep 0.1 /vendor/bin/snapshot_hook_pre_suspend[40]: sleep: inaccessible or not found ``` This may have worked intermittently before depending on whether the runtime environment was also using `adb root`. Bug: b/534832487 --- .../host/commands/run_cvd/boot_state_machine.cc | 6 ++++-- .../host/commands/run_cvd/server_loop_impl_snapshot.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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 {}; } From 7ce91803aefeb49d268ad9f99b75d0ed2fa38363 Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Thu, 6 Aug 2026 14:57:58 +0000 Subject: [PATCH 2/3] Immediately address bazelbuild/bazel#30604. We curl this URL, which is now broken. #2981 is considering using bazelisk, but the scripts and presubmits are broken now, so we should fix this now. --- tools/buildutils/installbazel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From efcf9466aad8821292c02ff9cdb0ae95f756d7dd Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Fri, 7 Aug 2026 10:20:50 -0700 Subject: [PATCH 3/3] Empty commit to trigger github actions