From 86ec18bca5c069e0e963730c74f1110f5a30f53b Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Fri, 18 Jun 2021 09:43:56 -0700 Subject: [PATCH] Revert "Handle "hardware" bootconfig parameter as "androidboot.hardware"" This reverts commit 0a799bdfd607b729e94796e414d406839d6ad6ad. Now that the kernel bootconfig feature has been to updated to handle mixed subkeys and values, androidboot.hardware parameter is supported. Test: build and boot Cuttlefish with "androidboot.hardware=cutf_vm" Bug: 191502832 Change-Id: I0e436a27730d20689bc6974562c3e88d744385db --- fs_mgr/fs_mgr_boot_config.cpp | 6 ------ fs_mgr/tests/fs_mgr_test.cpp | 4 ++-- init/property_service.cpp | 10 ---------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/fs_mgr/fs_mgr_boot_config.cpp b/fs_mgr/fs_mgr_boot_config.cpp index e3ef2321a..75d1e0db6 100644 --- a/fs_mgr/fs_mgr_boot_config.cpp +++ b/fs_mgr/fs_mgr_boot_config.cpp @@ -91,12 +91,6 @@ bool fs_mgr_get_boot_config_from_bootconfig(const std::string& bootconfig, if (key == bootconfig_key) { *out_val = value; return true; - } else if (android_key == "hardware" && android_key == key) { - // bootconfig doesn't allow subkeys and values to coexist, so - // "androidboot.hardware" cannot be used. It is replaced in - // bootconfig with "hardware" - *out_val = value; - return true; } } diff --git a/fs_mgr/tests/fs_mgr_test.cpp b/fs_mgr/tests/fs_mgr_test.cpp index a1b020aa4..94e1abb47 100644 --- a/fs_mgr/tests/fs_mgr_test.cpp +++ b/fs_mgr/tests/fs_mgr_test.cpp @@ -127,7 +127,7 @@ const std::string bootconfig = "androidboot.serialno = \"BLAHBLAHBLAH\"\n" "androidboot.slot_suffix = \"_a\"\n" "androidboot.hardware.platform = \"sdw813\"\n" - "hardware = \"foo\"\n" + "androidboot.hardware = \"foo\"\n" "androidboot.revision = \"EVT1.0\"\n" "androidboot.bootloader = \"burp-0.1-7521\"\n" "androidboot.hardware.sku = \"mary\"\n" @@ -159,7 +159,7 @@ const std::vector> bootconfig_result_space = {"androidboot.serialno", "BLAHBLAHBLAH"}, {"androidboot.slot_suffix", "_a"}, {"androidboot.hardware.platform", "sdw813"}, - {"hardware", "foo"}, + {"androidboot.hardware", "foo"}, {"androidboot.revision", "EVT1.0"}, {"androidboot.bootloader", "burp-0.1-7521"}, {"androidboot.hardware.sku", "mary"}, diff --git a/init/property_service.cpp b/init/property_service.cpp index ff9da4227..2d67bf5d7 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -1238,21 +1238,11 @@ static void ProcessKernelCmdline() { }); } -// bootconfig does not allow to populate `key=value` simultaneously with -// `key.subkey=value` which does not work with the existing code for -// `hardware` (e.g. we want both `ro.boot.hardware=value` and -// `ro.boot.hardware.sku=value`) and for `qemu` (Android Stidio Emulator -// specific). -static bool IsAllowedBootconfigKey(const std::string_view key) { - return (key == "hardware"sv) || (key == "qemu"sv); -} static void ProcessBootconfig() { ImportBootconfig([&](const std::string& key, const std::string& value) { if (StartsWith(key, ANDROIDBOOT_PREFIX)) { InitPropertySet("ro.boot." + key.substr(ANDROIDBOOT_PREFIX.size()), value); - } else if (IsAllowedBootconfigKey(key)) { - InitPropertySet("ro.boot." + key, value); } }); }