Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03860d54 authored by Devin Moore's avatar Devin Moore Committed by Automerger Merge Worker
Browse files

Merge changes from topic "bootconfig_args" am: 7c98b898 am: 9273df5b

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie83ff24fa2115a2f9da2a25ec4e3805dd3cf9dc0
parents 2bdd018b 9273df5b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2203,7 +2203,8 @@ std::string fs_mgr_get_super_partition_name(int slot) {
    // Devices upgrading to dynamic partitions are allowed to specify a super
    // partition name. This includes cuttlefish, which is a non-A/B device.
    std::string super_partition;
    if (fs_mgr_get_boot_config_from_kernel_cmdline("super_partition", &super_partition)) {
    if (fs_mgr_get_boot_config_from_bootconfig_source("super_partition", &super_partition) ||
        fs_mgr_get_boot_config_from_kernel_cmdline("super_partition", &super_partition)) {
        if (fs_mgr_get_slot_suffix().empty()) {
            return super_partition;
        }
+16 −2
Original line number Diff line number Diff line
@@ -299,7 +299,8 @@ void ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) {
std::string InitAndroidDtDir() {
    std::string android_dt_dir;
    // The platform may specify a custom Android DT path in kernel cmdline
    if (!fs_mgr_get_boot_config_from_kernel_cmdline("android_dt_dir", &android_dt_dir)) {
    if (!fs_mgr_get_boot_config_from_bootconfig_source("android_dt_dir", &android_dt_dir) &&
        !fs_mgr_get_boot_config_from_kernel_cmdline("android_dt_dir", &android_dt_dir)) {
        // Fall back to the standard procfs-based path
        android_dt_dir = kDefaultAndroidDtDir;
    }
@@ -842,9 +843,22 @@ std::vector<FstabEntry*> GetEntriesForMountPoint(Fstab* fstab, const std::string
}

std::set<std::string> GetBootDevices() {
    // First check the kernel commandline, then try the device tree otherwise
    // First check bootconfig, then kernel commandline, then the device tree
    std::string dt_file_name = get_android_dt_dir() + "/boot_devices";
    std::string value;
    if (fs_mgr_get_boot_config_from_bootconfig_source("boot_devices", &value) ||
        fs_mgr_get_boot_config_from_bootconfig_source("boot_device", &value)) {
        std::set<std::string> boot_devices;
        // remove quotes and split by spaces
        auto boot_device_strings = base::Split(base::StringReplace(value, "\"", "", true), " ");
        for (std::string_view device : boot_device_strings) {
            // trim the trailing comma, keep the rest.
            base::ConsumeSuffix(&device, ",");
            boot_devices.emplace(device);
        }
        return boot_devices;
    }

    if (fs_mgr_get_boot_config_from_kernel_cmdline("boot_devices", &value) ||
        ReadDtFile(dt_file_name, &value)) {
        auto boot_devices = Split(value, ",");
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ const std::vector<std::pair<std::string, std::string>> result_space = {

const std::string bootconfig =
        "androidboot.bootdevice  = \" \"1d84000.ufshc\"\n"
        "androidboot.boot_devices = \"dev1\", \"dev2,withcomma\", \"dev3\"\n"
        "androidboot.baseband = \"sdy\"\n"
        "androidboot.keymaster = \"1\"\n"
        "androidboot.serialno = \"BLAHBLAHBLAH\"\n"
@@ -152,6 +153,7 @@ const std::string bootconfig =

const std::vector<std::pair<std::string, std::string>> bootconfig_result_space = {
        {"androidboot.bootdevice", "1d84000.ufshc"},
        {"androidboot.boot_devices", "dev1, dev2,withcomma, dev3"},
        {"androidboot.baseband", "sdy"},
        {"androidboot.keymaster", "1"},
        {"androidboot.serialno", "BLAHBLAHBLAH"},