summaryrefslogtreecommitdiff
path: root/rust/rust.go
diff options
context:
space:
mode:
author Matthew Maurer <mmaurer@google.com> 2021-02-11 12:31:46 -0800
committer Matthew Maurer <mmaurer@google.com> 2021-08-17 15:08:49 -0700
commit460ee9429edf27dbac2d308ecc18354c8df9ab73 (patch)
tree0fe750939cee2f57a9370acd5318a4d177b0ba32 /rust/rust.go
parent0dd067d30908d1cc6d4bfa5e68d6c1c197ecd1d7 (diff)
Support Rust in Recovery
Bug: 178565008 Bug: 165791368 Test: Build and link a Rust library into a recovery binary Change-Id: I1c76e6204019443c567082730a4cf680f4a2a74a
Diffstat (limited to 'rust/rust.go')
-rw-r--r--rust/rust.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/rust/rust.go b/rust/rust.go
index 4ceeef1d1..79a5febf0 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -84,6 +84,7 @@ type BaseProperties struct {
// Set by imageMutator
CoreVariantNeeded bool `blueprint:"mutated"`
VendorRamdiskVariantNeeded bool `blueprint:"mutated"`
+ RecoveryVariantNeeded bool `blueprint:"mutated"`
ExtraVariants []string `blueprint:"mutated"`
// Allows this module to use non-APEX version of libraries. Useful
@@ -98,7 +99,7 @@ type BaseProperties struct {
// On device without a dedicated recovery partition, the module is only
// available after switching root into
// /first_stage_ramdisk. To expose the module before switching root, install
- // the recovery variant instead (TODO(b/165791368) recovery not yet supported)
+ // the recovery variant instead
Vendor_ramdisk_available *bool
// Normally Soong uses the directory structure to decide which modules
@@ -115,6 +116,9 @@ type BaseProperties struct {
// framework module from the recovery snapshot.
Exclude_from_recovery_snapshot *bool
+ // Make this module available when building for recovery
+ Recovery_available *bool
+
// Minimum sdk version that the artifact should support when it runs as part of mainline modules(APEX).
Min_sdk_version *string
@@ -807,6 +811,8 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
mod.Properties.SubName += cc.VendorSuffix
} else if mod.InVendorRamdisk() && !mod.OnlyInVendorRamdisk() {
mod.Properties.SubName += cc.VendorRamdiskSuffix
+ } else if mod.InRecovery() && !mod.OnlyInRecovery() {
+ mod.Properties.SubName += cc.RecoverySuffix
}
if !toolchain.Supported() {