From 7505599ea0b2199806615fe04ae3b96cbfdef849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=8B=E9=A1=B5?= <31466456+canyie@users.noreply.github.com> Date: Tue, 10 May 2022 11:57:14 +0800 Subject: [PATCH] Skip invalid slot_suffix argument Many Amlogic devices (e.g. FireTV 2nd gen Cube, Vero 4k+, MI Smart Speaker, etc.) are A-only with androidboot.slot_suffix=normal argument. I think "normal" actually means A-only in this case so just ignore it. Fix topjohnwu#5806 --- native/jni/init/getinfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/native/jni/init/getinfo.cpp b/native/jni/init/getinfo.cpp index 67afb81e6..10e570777 100644 --- a/native/jni/init/getinfo.cpp +++ b/native/jni/init/getinfo.cpp @@ -163,6 +163,11 @@ void setup_klog() { void BootConfig::set(const kv_pairs &kv) { for (const auto &[key, value] : kv) { if (key == "androidboot.slot_suffix") { + // Many Amlogic devices are A-only but have slot_suffix... + if (value == "normal") { + LOGW("Skip invalid androidboot.slot_suffix=[normal]\n"); + continue; + } strlcpy(slot, value.data(), sizeof(slot)); } else if (key == "androidboot.slot") { slot[0] = '_';