Support Rust in Ramdisk
Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a ramdisk binary
Change-Id: I9682b978936624133e5a62e94caace0e8958fd0f
diff --git a/rust/image.go b/rust/image.go
index 0061cb3..5d7c027 100644
--- a/rust/image.go
+++ b/rust/image.go
@@ -38,7 +38,7 @@
}
func (mod *Module) RamdiskAvailable() bool {
- return false
+ return Bool(mod.Properties.Ramdisk_available)
}
func (mod *Module) VendorRamdiskAvailable() bool {
@@ -62,9 +62,7 @@
}
func (mod *Module) SetRamdiskVariantNeeded(b bool) {
- if b {
- panic("Setting ramdisk variant needed for Rust module is unsupported: " + mod.BaseModuleName())
- }
+ mod.Properties.RamdiskVariantNeeded = b
}
func (mod *Module) SetVendorRamdiskVariantNeeded(b bool) {
@@ -97,7 +95,7 @@
}
func (mod *Module) RamdiskVariantNeeded(android.BaseModuleContext) bool {
- return mod.InRamdisk()
+ return mod.Properties.RamdiskVariantNeeded
}
func (mod *Module) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {