Merge "Populate only emulator specific properties into ro.kernel." am: 7787e70417 am: 7cf1c09c6c am: 917c6e0daa

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1625179

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic5cadcc08201136e3918acd073e85ef752f875f5
This commit is contained in:
Roman Kiryanov 2021-03-12 07:33:56 +00:00 committed by Automerger Merge Worker
commit 2f45ab60f7

View file

@ -1166,21 +1166,13 @@ static void ProcessKernelDt() {
constexpr auto ANDROIDBOOT_PREFIX = "androidboot."sv;
static void ProcessKernelCmdline() {
bool for_emulator = false;
ImportKernelCmdline([&](const std::string& key, const std::string& value) {
if (key == "qemu") {
for_emulator = true;
} else if (StartsWith(key, ANDROIDBOOT_PREFIX)) {
if (StartsWith(key, ANDROIDBOOT_PREFIX)) {
InitPropertySet("ro.boot." + key.substr(ANDROIDBOOT_PREFIX.size()), value);
} else if (StartsWith(key, "qemu."sv) || (key == "qemu")) {
InitPropertySet("ro.kernel." + key, value);
}
});
if (for_emulator) {
ImportKernelCmdline([&](const std::string& key, const std::string& value) {
// In the emulator, export any kernel option with the "ro.kernel." prefix.
InitPropertySet("ro.kernel." + key, value);
});
}
}
static void ProcessBootconfig() {