summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2023-03-20 17:06:34 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2023-03-20 17:06:34 +0100
commit7394401ac32542e753869e5447f5d49fe4c9cbab (patch)
tree09009e0080fa2034a96077fee26989a729e66540
parentf385336036af5c0af00db4e01520327a6f7bb4e9 (diff)
Add manifest and change path name in the Android.bpandroid
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--Android.bp118
-rw-r--r--thermal-manager.xml5
2 files changed, 68 insertions, 55 deletions
diff --git a/Android.bp b/Android.bp
index 8d55010..1ee6f45 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,7 +1,7 @@
// Copyright 2023 The Android Open Source Project
package {
- default_applicable_licenses: ["external_dtpm_license"],
+ default_applicable_licenses: ["external_thermal_manager_license"],
}
// Added automatically by a large-scale-change that took the approach of
@@ -19,7 +19,7 @@ package {
// used in the current project.
// See: http://go/android-license-faq
license {
- name: "external_dtpm_license",
+ name: "external_thermal_manager_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-LGPL",
@@ -31,32 +31,45 @@ license {
],
}
-cc_library_headers {
- name: "libthermal_headers",
- header_libs: ["libthermal"],
- export_include_dirs: ["src/include"],
-}
+/// In the beryllium device.mk add the thermal-manager to PRODUCT_PACKAGES, like:
+/// https://github.com/aospm/android_device_generic_sdm845/blob/main/shared/device.mk#L185
+/// That should get it building, it will be installed in /vendor/bin/hw/
+/// You should adjust your manifest.xml to clone the thermal-manager repo to external/thermal-manager
+/// if you stick with "vendor: true" below
-cc_library_shared {
- host_supported: true,
- vendor_available: true,
- product_available: true,
- recovery_available: true,
- vndk: {
- enabled: true,
- },
-
- target: {
- android: {
- enabled: true,
- },
-
- linux_bionic: {
- enabled: true,
- },
- },
+/// pixel powerstats seems like it may be a somewhat analogous example:
+/// https://cs.android.com/android/platform/superproject/+/master:hardware/google/pixel/powerstats/Android.bp
+/// dmesgd uses cc_defaults which maybe is useful for commonizing cflags?
+/// https://cs.android.com/android/platform/superproject/+/master:system/dmesgd/Android.bp
+cc_library_shared {
name: "libthermal",
+
+ /// I used a library and daemon i worked on as an example:
+ /// https://github.com/aospm/libqril/blob/main/Android.bp
+ /// https://github.com/aospm/qrild/blob/rewrite/Android.bp
+ /// If you just want to shove this somewhere, making it a vendor only
+ /// module is the easiest way, anything that depends on it must also
+ /// be vendor only.
+ vendor: true,
+
+ /// Otherwise, if it's meant to be a core library, the the below commented
+ /// out options seem right
+ /// https://source.android.com/docs/core/architecture/vndk/build-system#vndk
+ /// Mostly a build system constraint, enables vendor modules
+ /// to depend on this library, as well as system modules, i think
+ /// I would hedge my bets on vendor: true for now...
+ // vendor_available: true,
+
+ /// Stuffs the library in a versioned APEX file
+ /// https://source.android.com/docs/core/architecture/vndk
+ /// https://source.android.com/docs/core/architecture/vndk/build-system#vndk-apex
+ // vndk: {
+ // enabled: true,
+ // },
+
+ shared_libs: ["libnl"],
+
srcs: [
"src/lib/thermal.c",
"src/lib/events.c",
@@ -64,53 +77,48 @@ cc_library_shared {
"src/lib/commands.c",
"src/lib/thermal_nl.c",
],
-
- local_include_dirs: [
- "src/include",
- ],
-
- header_libs: [ "libthermal_headers" ],
-
- export_header_lib_headers: ["libthermal_headers"],
-
cflags: [
"-Wall",
"-Werror",
"-Wno-sign-compare",
"-Wno-unused-parameter",
],
- shared_libs: ["libnl"],
+
+ /// Anything that depends on libthermal will
+ /// automagically get these include dirs
+ export_include_dirs: [
+ "src/include",
+ ],
}
cc_binary {
- host_supported: true,
- vendor_available: true,
- product_available: true,
- vndk: {
- enabled: true,
- },
-
- target: {
- linux_bionic: {
- enabled: true,
- },
- },
-
- local_include_dirs: ["src/include"],
-
- name: "dtpm",
+ name: "thermal-manager",
+ /// Same as above
+ vendor: true,
+ /// This seems to be expected for vendor HALs ??
+ relative_install_path: "hw",
+
+ /// the libthermal library defines these include
+ /// dirs already, so it shouldn't be needed here
+ // local_include_dirs: ["src/include"],
+
srcs: [
- "src/dtpm/log.c",
- "src/dtpm/mainloop.c",
- "src/dtpm/thermal-engine.c",
- "src/dtpm/uptimeofday.c",
+ "src/thermal-manager/log.c",
+ "src/thermal-manager/mainloop.c",
+ "src/thermal-manager/thermal-engine.c",
+ "src/thermal-manager/uptimeofday.c",
],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
+ "-Wno-sign-compare",
],
+ /// libbase, libutils, libcutils might be handy
shared_libs: ["libthermal"],
+
+ /// TODO: this probably requires dealing with SELinux policies and stuff
+ // init_rc: ["thermal-manager.rc"],
}
diff --git a/thermal-manager.xml b/thermal-manager.xml
new file mode 100644
index 0000000..f2c34e6
--- /dev/null
+++ b/thermal-manager.xml
@@ -0,0 +1,5 @@
+<manifest>
+ <!-- Repositories -->
+ <remote name="linaro" fetch="http://git.linaro.org/power"/>
+ <project path="external/thermal-manager" name="thermal-manager" revision="android" remote="linaro" groups="default"/>
+</manifest>