Do not install init.rc for (vendor_)ramdisk variants.
Previously, the vendor_ramdisk variant of a module installs the
init.rc file to /vendor/etc/init.
In first stage init, no init rc files are read, so no init rc files
should be installed to any ramdisks.
This change removes LOCAL_INIT_RC for the (vendor_)ramdisk variant
of a module, so that init rc file is not installed for (vendor_)ramdisk
variant of a module.
Test: m snapuserd snapuserd.vendor_ramdisk
and manually inspect the out directory
Fixes: 174587489
Change-Id: I71227d807244b6538be0d6acce5e94f129a86065
diff --git a/android/androidmk.go b/android/androidmk.go
index cfd7c91..e0312e8 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -333,7 +333,9 @@
}
}
- a.AddStrings("LOCAL_INIT_RC", amod.commonProperties.Init_rc...)
+ if !amod.InRamdisk() && !amod.InVendorRamdisk() {
+ a.AddStrings("LOCAL_INIT_RC", amod.commonProperties.Init_rc...)
+ }
a.AddStrings("LOCAL_VINTF_FRAGMENTS", amod.commonProperties.Vintf_fragments...)
a.SetBoolIfTrue("LOCAL_PROPRIETARY_MODULE", Bool(amod.commonProperties.Proprietary))
if Bool(amod.commonProperties.Vendor) || Bool(amod.commonProperties.Soc_specific) {