Updates
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PawletOS <pawletos@pawlet.me>
|
||||
Date: Mon, 01 Jan 2025 00:00:00 +0000
|
||||
Subject: [PATCH] update_engine: use ro.pawlet.ota.reboot_reason for reboot
|
||||
|
||||
On devices that use RPi firmware's tryboot mechanism for A/B slot
|
||||
switching, the reboot that activates slot B must include the "tryboot"
|
||||
reason so the firmware reads the [tryboot] section of config.txt and
|
||||
boots from partition 2 (boot_b) for one attempt.
|
||||
|
||||
This patch reads ro.pawlet.ota.reboot_reason from the vendor properties.
|
||||
If the property is not set, the behaviour is unchanged (plain "reboot").
|
||||
|
||||
RPi devices set this in vendor.prop:
|
||||
ro.pawlet.ota.reboot_reason=reboot,tryboot
|
||||
|
||||
Signed-off-by: PawletOS <pawletos@pawlet.me>
|
||||
---
|
||||
aosp/update_attempter_android.cc | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/aosp/update_attempter_android.cc b/aosp/update_attempter_android.cc
|
||||
index 0000000..0000001 100644
|
||||
--- a/aosp/update_attempter_android.cc
|
||||
+++ b/aosp/update_attempter_android.cc
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/parseint.h>
|
||||
#include <android-base/properties.h>
|
||||
+#include <android-base/strings.h>
|
||||
#include <android-base/unique_fd.h>
|
||||
#include <base/bind.h>
|
||||
#include <brillo/message_loops/message_loop.h>
|
||||
@@ -1,6 +1,15 @@
|
||||
-bool UpdateAttempterAndroid::RebootDevice() {
|
||||
- LOG(INFO) << "Rebooting device to update the system.";
|
||||
- return android::base::SetProperty("sys.powerctl", "reboot");
|
||||
-}
|
||||
+bool UpdateAttempterAndroid::RebootDevice() {
|
||||
+ // Allow device-specific reboot reasons via a vendor property.
|
||||
+ // RPi devices set ro.pawlet.ota.reboot_reason=reboot,tryboot to trigger
|
||||
+ // the RPi firmware's tryboot mechanism which boots from slot B (boot_b /
|
||||
+ // partition 2) for a single attempt.
|
||||
+ const std::string reboot_reason =
|
||||
+ android::base::GetProperty("ro.pawlet.ota.reboot_reason", "reboot");
|
||||
+
|
||||
+ LOG(INFO) << "Rebooting device to update the system"
|
||||
+ << " (reason: " << reboot_reason << ")";
|
||||
+
|
||||
+ return android::base::SetProperty("sys.powerctl", reboot_reason);
|
||||
+}
|
||||
Reference in New Issue
Block a user