Merge "Allow a kernel bootconfig to set the qemu key" am: 6cbc7e01b2 am: 0d13e9370c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1690216 Change-Id: I9a665f6d6bc7e1ffc90ca3875c0a1906897511d1
This commit is contained in:
commit
57f01c51e5
1 changed files with 10 additions and 3 deletions
|
|
@ -1218,13 +1218,20 @@ 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 (key == "hardware") {
|
||||
// "hardware" in bootconfig replaces "androidboot.hardware" kernel
|
||||
// cmdline parameter
|
||||
} else if (IsAllowedBootconfigKey(key)) {
|
||||
InitPropertySet("ro.boot." + key, value);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue