Add ramdisk image.

It is similar to recovery image.
Test: m nothing -j

Change-Id: I11389777c6bfb0c0d73bbb4c70091c1e70f44077
This commit is contained in:
Yifan Hong
2020-01-21 15:53:22 -08:00
parent 0c9c0f045f
commit 1b3348d50a
16 changed files with 145 additions and 20 deletions

View File

@@ -167,6 +167,7 @@ type ModuleContext interface {
InstallInData() bool
InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRamdisk() bool
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
@@ -207,6 +208,7 @@ type Module interface {
InstallInData() bool
InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRamdisk() bool
InstallInRecovery() bool
InstallInRoot() bool
InstallBypassMake() bool
@@ -384,6 +386,9 @@ type commonProperties struct {
// Whether this module is installed to recovery partition
Recovery *bool
// Whether this module is installed to ramdisk
Ramdisk *bool
// Whether this module is built for non-native architecures (also known as native bridge binary)
Native_bridge_supported *bool `android:"arch_variant"`
@@ -867,6 +872,10 @@ func (m *ModuleBase) InstallInSanitizerDir() bool {
return false
}
func (m *ModuleBase) InstallInRamdisk() bool {
return Bool(m.commonProperties.Ramdisk)
}
func (m *ModuleBase) InstallInRecovery() bool {
return Bool(m.commonProperties.Recovery)
}
@@ -898,6 +907,10 @@ func (m *ModuleBase) ImageVariation() blueprint.Variation {
}
}
func (m *ModuleBase) InRamdisk() bool {
return m.base().commonProperties.ImageVariation == RamdiskVariation
}
func (m *ModuleBase) InRecovery() bool {
return m.base().commonProperties.ImageVariation == RecoveryVariation
}
@@ -1649,6 +1662,10 @@ func (m *moduleContext) InstallInSanitizerDir() bool {
return m.module.InstallInSanitizerDir()
}
func (m *moduleContext) InstallInRamdisk() bool {
return m.module.InstallInRamdisk()
}
func (m *moduleContext) InstallInRecovery() bool {
return m.module.InstallInRecovery()
}