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

Commit d3518cf4 authored by Tri Vo's avatar Tri Vo
Browse files

init: support loading /product/etc/selinux/product_sepolicy.cil

Bug: 119305624
Test: boot aosp_taimen with product_sepolicy.cil
Change-Id: I2124275de7ffc0058c48f5d5ef16644d5d39da3b
parent 010a85af
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -306,6 +306,11 @@ bool LoadSplitPolicy() {
    }
    std::string mapping_file("/system/etc/selinux/mapping/" + vend_plat_vers + ".cil");

    std::string product_policy_cil_file("/product/etc/selinux/product_sepolicy.cil");
    if (access(product_policy_cil_file.c_str(), F_OK) == -1) {
        product_policy_cil_file.clear();
    }

    // vendor_sepolicy.cil and plat_pub_versioned.cil are the new design to replace
    // nonplat_sepolicy.cil.
    std::string plat_pub_versioned_cil_file("/vendor/etc/selinux/plat_pub_versioned.cil");
@@ -342,6 +347,9 @@ bool LoadSplitPolicy() {
    };
    // clang-format on

    if (!product_policy_cil_file.empty()) {
        compile_args.push_back(product_policy_cil_file.c_str());
    }
    if (!plat_pub_versioned_cil_file.empty()) {
        compile_args.push_back(plat_pub_versioned_cil_file.c_str());
    }