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

Commit ce09cdff authored by JW Wang's avatar JW Wang Committed by Chun-Wei Wang
Browse files

Export active dsu slot to system prop

The prop can be consumed by init scripts to do customized setup:

on property:ro.gsid.dsu_slot=oemtest
    # Do setup for test
on property:ro.gsid.dsu_slot=oemdemo
    # Do setup for demo

Bug: 277691885
Test: m
Change-Id: I7bd78b9ba31021b27d57c6f092dad5d7ebf6e59b
Merged-In: I7bd78b9ba31021b27d57c6f092dad5d7ebf6e59b
Cherry-picked from aosp/2588465
parent 301026fa
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1043,6 +1043,12 @@ int SecondStageMain(int argc, char** argv) {
    SetProperty(gsi::kGsiBootedProp, is_running);
    auto is_installed = android::gsi::IsGsiInstalled() ? "1" : "0";
    SetProperty(gsi::kGsiInstalledProp, is_installed);
    if (android::gsi::IsGsiRunning()) {
        std::string dsu_slot;
        if (android::gsi::GetActiveDsu(&dsu_slot)) {
            SetProperty(gsi::kDsuSlotProp, dsu_slot);
        }
    }

    am.QueueBuiltinAction(SetupCgroupsAction, "SetupCgroups");
    am.QueueBuiltinAction(SetKptrRestrictAction, "SetKptrRestrict");