2626#include " absl/log/log.h"
2727#include " absl/strings/numbers.h"
2828
29- #include " cuttlefish/common/libs/utils/contains.h"
3029#include " cuttlefish/common/libs/utils/json.h"
3130#include " cuttlefish/host/libs/config/config_constants.h"
3231#include " cuttlefish/host/libs/config/cuttlefish_config.h"
@@ -41,23 +40,6 @@ using vm_manager::QemuManager;
4140
4241namespace {
4342
44- static constexpr std::string_view kLegacyBoardBootconfigKeysShared [] = {
45- " androidboot.hardware" ,
46- " androidboot.vendor.apex.com.google.emulated.camera.provider.hal" ,
47- " kernel.vmw_vsock_virtio_transport_common.virtio_transport_max_vsock_pkt_buf_size" ,
48- };
49-
50- static constexpr std::string_view kLegacyBoardBootconfigKeysAuto [] = {
51- " androidboot.cuttlefish_service_bluetooth_checker" ,
52- " androidboot.hibernation_resume_device" ,
53- };
54-
55- static constexpr std::string_view kLegacyBoardBootconfigKeysMinidroid [] = {
56- " androidboot.adb.enabled" ,
57- " androidboot.init_rc" ,
58- " androidboot.microdroid.debuggable" ,
59- };
60-
6143template <typename T>
6244void AppendMapWithReplacement (T* destination, const T& source) {
6345 for (const auto & [k, v] : source) {
@@ -90,32 +72,10 @@ Result<std::unordered_map<std::string, std::string>> ConsoleBootconfig(
9072
9173} // namespace
9274
93- // Bootconfing args should be added to the launcher and no longer via the build system variable
94- // `BOARD_BOOTCONFIG`. Allow legacy keys for backward compatibility.
95- Result<void > ValidateBoardBootconfigKeys (
96- const cuttlefish::DeviceType type,
97- const std::map<std::string, std::string, std::less<void >> args) {
98- std::vector<std::string> allowed_args (std::begin (kLegacyBoardBootconfigKeysShared ), std::end (kLegacyBoardBootconfigKeysShared ));
99- if (type == cuttlefish::DeviceType::Auto) {
100- allowed_args.insert (allowed_args.end (), std::begin (kLegacyBoardBootconfigKeysAuto ), std::end (kLegacyBoardBootconfigKeysAuto ));
101- } else if (type == cuttlefish::DeviceType::Minidroid) {
102- allowed_args.insert (allowed_args.end (), std::begin (kLegacyBoardBootconfigKeysMinidroid ), std::end (kLegacyBoardBootconfigKeysMinidroid ));
103- }
104-
105- for (auto iter = args.begin (); iter != args.end (); iter++) {
106- CF_EXPECTF (Contains (allowed_args, iter->first ),
107- " Error: detected new `BOARD_BOOTCONFIG` key: \" {}\" !!! Please add new bootconfig args to the `cvd` launcher." , iter->first );
108- }
109-
110- return {};
111- }
112-
11375Result<std::unordered_map<std::string, std::string>> BootconfigArgsFromConfig (
11476 const CuttlefishConfig& config,
11577 const CuttlefishConfig::InstanceSpecific& instance,
11678 const std::map<std::string, std::string, std::less<void >> builtin_bootconfig_args) {
117- CF_EXPECT (ValidateBoardBootconfigKeys (instance.device_type (), builtin_bootconfig_args));
118-
11979 std::unordered_map<std::string, std::string> bootconfig_args;
12080
12181 AppendMapWithReplacement (&bootconfig_args,
0 commit comments