From c829836109ed3e14d78dcb14dda0faf14e5617fd Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Wed, 4 Oct 2023 01:03:45 +0000 Subject: [PATCH] Revert^2 "Add bootcontrol HAL APEX" e5687ce49225211f8ac75d404465d2c735134f25 Change-Id: Ie86897efb0380d2ad2884b29ae45126d25d40b34 --- boot/1.1/default/Android.bp | 1 + boot/1.1/default/boot_control/Android.bp | 13 +++- boot/1.2/default/Android.bp | 1 + boot/aidl/default/Android.bp | 70 ++++++++++++++++--- .../android.hardware.boot-service.default.rc | 2 +- boot/aidl/default/apex_file_contexts | 3 + boot/aidl/default/apex_manifest.json | 5 ++ 7 files changed, 80 insertions(+), 15 deletions(-) create mode 100644 boot/aidl/default/apex_file_contexts create mode 100644 boot/aidl/default/apex_manifest.json diff --git a/boot/1.1/default/Android.bp b/boot/1.1/default/Android.bp index 0b0a5b711e..e7a8d6e000 100644 --- a/boot/1.1/default/Android.bp +++ b/boot/1.1/default/Android.bp @@ -20,6 +20,7 @@ cc_library_shared { srcs: ["BootControl.cpp"], shared_libs: [ + "libbase", "liblog", "libhidlbase", "libhardware", diff --git a/boot/1.1/default/boot_control/Android.bp b/boot/1.1/default/boot_control/Android.bp index 6aa30c21fa..d0dcb59f5e 100644 --- a/boot/1.1/default/boot_control/Android.bp +++ b/boot/1.1/default/boot_control/Android.bp @@ -35,14 +35,13 @@ cc_defaults { ], shared_libs: [ - "android.hardware.boot@1.1", - "libbase", "liblog", ], static_libs: [ "libbootloader_message", "libfstab", ], + } cc_library_static { @@ -52,7 +51,13 @@ cc_library_static { recovery_available: true, vendor_available: true, - srcs: ["libboot_control.cpp"], + srcs: [ + "libboot_control.cpp", + ], + static_libs: [ + "android.hardware.boot@1.1", + "libbase", + ], } cc_library_shared { @@ -67,6 +72,8 @@ cc_library_shared { "libboot_control", ], shared_libs: [ + "android.hardware.boot@1.1", + "libbase", "libhardware", ], } diff --git a/boot/1.2/default/Android.bp b/boot/1.2/default/Android.bp index 4e1c35e599..f1e9c34a1b 100644 --- a/boot/1.2/default/Android.bp +++ b/boot/1.2/default/Android.bp @@ -20,6 +20,7 @@ cc_library_shared { srcs: ["BootControl.cpp"], shared_libs: [ + "libbase", "liblog", "libhidlbase", "libhardware", diff --git a/boot/aidl/default/Android.bp b/boot/aidl/default/Android.bp index dcb40dbe6a..c1d3c575ee 100644 --- a/boot/aidl/default/Android.bp +++ b/boot/aidl/default/Android.bp @@ -27,7 +27,39 @@ cc_defaults { name: "android.hardware.boot-service_common", relative_install_path: "hw", defaults: ["libboot_control_defaults"], + srcs: [ + "main.cpp", + "BootControl.cpp", + ], +} + +cc_binary { + name: "android.hardware.boot-service.default", + defaults: ["android.hardware.boot-service_common"], + vendor: true, + + stl: "c++_static", + shared_libs: [ + "libbinder_ndk", + "liblog", + ], + static_libs: [ + "android.hardware.boot@1.1", + "android.hardware.boot-V1-ndk", + "libbase", + "libboot_control", + ], + + installable: false, // installed in APEX +} + +cc_binary { + name: "android.hardware.boot-service.default_recovery", + defaults: ["android.hardware.boot-service_common"], + init_rc: ["android.hardware.boot-service.default_recovery.rc"], vintf_fragments: ["android.hardware.boot-service.default.xml"], + recovery: true, + shared_libs: [ "libbase", "libbinder_ndk", @@ -37,19 +69,35 @@ cc_defaults { static_libs: [ "libboot_control", ], - srcs: ["main.cpp", "BootControl.cpp"], } -cc_binary { - name: "android.hardware.boot-service.default", - defaults: ["android.hardware.boot-service_common"], - init_rc: ["android.hardware.boot-service.default.rc"], +prebuilt_etc { + name: "android.hardware.boot-service.default.rc", + src: "android.hardware.boot-service.default.rc", + installable: false, +} + +prebuilt_etc { + name: "android.hardware.boot-service.default.xml", + src: "android.hardware.boot-service.default.xml", + sub_dir: "vintf", + installable: false, +} + +apex { + name: "com.android.hardware.boot", vendor: true, -} + manifest: "apex_manifest.json", + file_contexts: "apex_file_contexts", + key: "com.android.hardware.key", + certificate: ":com.android.hardware.certificate", + updatable: false, -cc_binary { - name: "android.hardware.boot-service.default_recovery", - defaults: ["android.hardware.boot-service_common"], - init_rc: ["android.hardware.boot-service.default_recovery.rc"], - recovery: true, + binaries: [ + "android.hardware.boot-service.default", + ], + prebuilts: [ + "android.hardware.boot-service.default.rc", + "android.hardware.boot-service.default.xml", + ], } diff --git a/boot/aidl/default/android.hardware.boot-service.default.rc b/boot/aidl/default/android.hardware.boot-service.default.rc index 589f803e37..5090e2c43f 100644 --- a/boot/aidl/default/android.hardware.boot-service.default.rc +++ b/boot/aidl/default/android.hardware.boot-service.default.rc @@ -1,4 +1,4 @@ -service vendor.boot-default /vendor/bin/hw/android.hardware.boot-service.default +service vendor.boot-default /apex/com.android.hardware.boot/bin/hw/android.hardware.boot-service.default class early_hal user root group root diff --git a/boot/aidl/default/apex_file_contexts b/boot/aidl/default/apex_file_contexts new file mode 100644 index 0000000000..bf03585d45 --- /dev/null +++ b/boot/aidl/default/apex_file_contexts @@ -0,0 +1,3 @@ +(/.*)? u:object_r:vendor_file:s0 +/etc(/.*)? u:object_r:vendor_configs_file:s0 +/bin/hw/android\.hardware\.boot-service\.default u:object_r:hal_bootctl_default_exec:s0 diff --git a/boot/aidl/default/apex_manifest.json b/boot/aidl/default/apex_manifest.json new file mode 100644 index 0000000000..92661c960c --- /dev/null +++ b/boot/aidl/default/apex_manifest.json @@ -0,0 +1,5 @@ +{ + "name": "com.android.hardware.boot", + "version": 1, + "vendorBootstrap": true +} \ No newline at end of file