diff options
author | 2021-01-08 18:00:19 +0900 | |
---|---|---|
committer | 2021-01-25 17:08:44 +0900 | |
commit | ebcf0c5e15069629c3141c863866a32ee3f0e43b (patch) | |
tree | 3a911eec2d23bd8ac7617f5d7fca8d853761f467 /cc/genrule.go | |
parent | f17b07fc52b49896d0a357f3deeba7177180907c (diff) |
Define odm_available property to install a vendor variant to odm
'vendor_available: true' creates a vendor variant from a system
module. The vendor variant of the module is installed to /vendor.
However, we may want to install the vendor variant to /odm, instead.
'device_specific: true' does not work for this purpose because
'vendor_available: true' is allowed only for the system or product
modules to create a vendor variant. But 'device_specific: true'
itself creates a vendor variant that may not work with
'vendor_available: true'.
To install the vendor variant to /odm, we define a new property
'odm_available'. 'odm_available' is exactly the same as the
'vendor_available' except the install path of the vendor variant.
By defining 'odm_available: true', the vendor variant of the module
will be installed to /odm or /vendor/odm instead of /vendor.
Bug: 176147321
Bug: 176079978
Test: check if a module with 'odm_available: true' is installed to
/vendor/odm
Change-Id: I2d16bd2c515796597b2fbd1eb66f7c2736434697
Diffstat (limited to 'cc/genrule.go')
-rw-r--r-- | cc/genrule.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cc/genrule.go b/cc/genrule.go index 1ce216989..ca4fda7e2 100644 --- a/cc/genrule.go +++ b/cc/genrule.go @@ -25,6 +25,7 @@ func init() { type GenruleExtraProperties struct { Vendor_available *bool + Odm_available *bool Product_available *bool Ramdisk_available *bool Vendor_ramdisk_available *bool @@ -63,7 +64,7 @@ func (g *GenruleExtraProperties) CoreVariantNeeded(ctx android.BaseModuleContext return false } - return Bool(g.Vendor_available) || Bool(g.Product_available) || !(ctx.SocSpecific() || ctx.DeviceSpecific()) + return !(ctx.SocSpecific() || ctx.DeviceSpecific()) } func (g *GenruleExtraProperties) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool { @@ -92,7 +93,7 @@ func (g *GenruleExtraProperties) ExtraImageVariations(ctx android.BaseModuleCont } var variants []string - if Bool(g.Vendor_available) || ctx.SocSpecific() || ctx.DeviceSpecific() { + if Bool(g.Vendor_available) || Bool(g.Odm_available) || ctx.SocSpecific() || ctx.DeviceSpecific() { vndkVersion := ctx.DeviceConfig().VndkVersion() // If vndkVersion is current, we can always use PlatformVndkVersion. // If not, we assume modules under proprietary paths are compatible for |