Loading etc/prebuilt_etc.go +14 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory) ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory) ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory) ctx.RegisterModuleType("prebuilt_rfsa", PrebuiltRFSAFactory) } var PrepareForTestWithPrebuiltEtc = android.FixtureRegisterWithContext(RegisterPrebuiltEtcBuildComponents) Loading Loading @@ -431,3 +432,16 @@ func PrebuiltDSPFactory() android.Module { android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) return module } // prebuilt_rfsa installs a firmware file that will be available through Qualcomm's RFSA // to the <partition>/lib/rfsa directory. func PrebuiltRFSAFactory() android.Module { module := &PrebuiltEtc{} // Ideally these would go in /vendor/dsp, but the /vendor/lib/rfsa paths are hardcoded in too // many places outside of the application processor. They could be moved to /vendor/dsp once // that is cleaned up. InitPrebuiltEtcModule(module, "lib/rfsa") // This module is device-only android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) return module } etc/prebuilt_etc_test.go +34 −0 Original line number Diff line number Diff line Loading @@ -312,3 +312,37 @@ func TestPrebuiltDSPDirPath(t *testing.T) { }) } } func TestPrebuiltRFSADirPath(t *testing.T) { targetPath := "out/soong/target/product/test_device" tests := []struct { description string config string expectedPath string }{{ description: "prebuilt: system rfsa", config: ` prebuilt_rfsa { name: "foo.conf", src: "foo.conf", }`, expectedPath: filepath.Join(targetPath, "system/lib/rfsa"), }, { description: "prebuilt: vendor rfsa", config: ` prebuilt_rfsa { name: "foo.conf", src: "foo.conf", soc_specific: true, sub_dir: "sub_dir", }`, expectedPath: filepath.Join(targetPath, "vendor/lib/rfsa/sub_dir"), }} for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { result := prepareForPrebuiltEtcTest.RunTestWithBp(t, tt.config) p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) android.AssertPathRelativeToTopEquals(t, "install dir", tt.expectedPath, p.installDirPath) }) } } Loading
etc/prebuilt_etc.go +14 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory) ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory) ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory) ctx.RegisterModuleType("prebuilt_rfsa", PrebuiltRFSAFactory) } var PrepareForTestWithPrebuiltEtc = android.FixtureRegisterWithContext(RegisterPrebuiltEtcBuildComponents) Loading Loading @@ -431,3 +432,16 @@ func PrebuiltDSPFactory() android.Module { android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) return module } // prebuilt_rfsa installs a firmware file that will be available through Qualcomm's RFSA // to the <partition>/lib/rfsa directory. func PrebuiltRFSAFactory() android.Module { module := &PrebuiltEtc{} // Ideally these would go in /vendor/dsp, but the /vendor/lib/rfsa paths are hardcoded in too // many places outside of the application processor. They could be moved to /vendor/dsp once // that is cleaned up. InitPrebuiltEtcModule(module, "lib/rfsa") // This module is device-only android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) return module }
etc/prebuilt_etc_test.go +34 −0 Original line number Diff line number Diff line Loading @@ -312,3 +312,37 @@ func TestPrebuiltDSPDirPath(t *testing.T) { }) } } func TestPrebuiltRFSADirPath(t *testing.T) { targetPath := "out/soong/target/product/test_device" tests := []struct { description string config string expectedPath string }{{ description: "prebuilt: system rfsa", config: ` prebuilt_rfsa { name: "foo.conf", src: "foo.conf", }`, expectedPath: filepath.Join(targetPath, "system/lib/rfsa"), }, { description: "prebuilt: vendor rfsa", config: ` prebuilt_rfsa { name: "foo.conf", src: "foo.conf", soc_specific: true, sub_dir: "sub_dir", }`, expectedPath: filepath.Join(targetPath, "vendor/lib/rfsa/sub_dir"), }} for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { result := prepareForPrebuiltEtcTest.RunTestWithBp(t, tt.config) p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) android.AssertPathRelativeToTopEquals(t, "install dir", tt.expectedPath, p.installDirPath) }) } }