Add install_in_root to cc_binary

To support init_first_stage, install_in_root property is added to
cc_binary. The output is installed to {partition}, rather than
{partition}/{mount_point}/bin.

Bug: 187196593
Test: build init_first_stage
Change-Id: Ibc351645308676ed188f748972eb6312c9cbd64f
This commit is contained in:
Inseob Kim
2021-06-14 12:03:51 +09:00
parent 94b2e705d1
commit 800d114003
3 changed files with 28 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ func init() {
AddNeverAllowRules(createCcSdkVariantRules()...)
AddNeverAllowRules(createUncompressDexRules()...)
AddNeverAllowRules(createMakefileGoalRules()...)
AddNeverAllowRules(createInitFirstStageRules()...)
}
// Add a NeverAllow rule to the set of rules to apply.
@@ -216,6 +217,15 @@ func createMakefileGoalRules() []Rule {
}
}
func createInitFirstStageRules() []Rule {
return []Rule{
NeverAllow().
Without("name", "init_first_stage").
With("install_in_root", "true").
Because("install_in_root is only for init_first_stage."),
}
}
func neverallowMutator(ctx BottomUpMutatorContext) {
m, ok := ctx.Module().(Module)
if !ok {