Add vendor-ramdisk image to Soong.
Add vendor_ramdisk_available and vendor_ramdisk attribute to various rules. When a vendor_ramdisk variant of a module is generated, it is installed to $OUT/vendor-ramdisk. It is similar to a ramdisk image. Test: m nothing -j Change-Id: Ib2d16459f3094dbe21c3bdb7c016cb4b2bf62765
This commit is contained in:
@@ -61,6 +61,9 @@ type prebuiltEtcProperties struct {
|
||||
// Make this module available when building for ramdisk.
|
||||
Ramdisk_available *bool
|
||||
|
||||
// Make this module available when building for vendor ramdisk.
|
||||
Vendor_ramdisk_available *bool
|
||||
|
||||
// Make this module available when building for recovery.
|
||||
Recovery_available *bool
|
||||
|
||||
@@ -105,6 +108,18 @@ func (p *PrebuiltEtc) InstallInRamdisk() bool {
|
||||
return p.inRamdisk()
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) inVendorRamdisk() bool {
|
||||
return p.ModuleBase.InVendorRamdisk() || p.ModuleBase.InstallInVendorRamdisk()
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) onlyInVendorRamdisk() bool {
|
||||
return p.ModuleBase.InstallInVendorRamdisk()
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) InstallInVendorRamdisk() bool {
|
||||
return p.inVendorRamdisk()
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) inRecovery() bool {
|
||||
return p.ModuleBase.InRecovery() || p.ModuleBase.InstallInRecovery()
|
||||
}
|
||||
@@ -122,13 +137,18 @@ var _ android.ImageInterface = (*PrebuiltEtc)(nil)
|
||||
func (p *PrebuiltEtc) ImageMutatorBegin(ctx android.BaseModuleContext) {}
|
||||
|
||||
func (p *PrebuiltEtc) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
|
||||
return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk()
|
||||
return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk() &&
|
||||
!p.ModuleBase.InstallInVendorRamdisk()
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
|
||||
return proptools.Bool(p.properties.Ramdisk_available) || p.ModuleBase.InstallInRamdisk()
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
|
||||
return proptools.Bool(p.properties.Vendor_ramdisk_available) || p.ModuleBase.InstallInVendorRamdisk()
|
||||
}
|
||||
|
||||
func (p *PrebuiltEtc) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
|
||||
return proptools.Bool(p.properties.Recovery_available) || p.ModuleBase.InstallInRecovery()
|
||||
}
|
||||
@@ -228,6 +248,9 @@ func (p *PrebuiltEtc) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
if p.inRamdisk() && !p.onlyInRamdisk() {
|
||||
nameSuffix = ".ramdisk"
|
||||
}
|
||||
if p.inVendorRamdisk() && !p.onlyInVendorRamdisk() {
|
||||
nameSuffix = ".vendor_ramdisk"
|
||||
}
|
||||
if p.inRecovery() && !p.onlyInRecovery() {
|
||||
nameSuffix = ".recovery"
|
||||
}
|
||||
|
Reference in New Issue
Block a user