summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Luo <royluo@google.com>2024-04-01 19:56:46 +0000
committerRoy Luo <royluo@google.com>2024-04-01 19:56:46 +0000
commit21105d052e349b5f61bc0317b5d37de7d104a558 (patch)
tree6c5a0309974199394279ff09fe0df65885d26199
parenta1bb522ee2c09d9c12bbda5bb8326a099bbd6b42 (diff)
downloadapex-21105d052e349b5f61bc0317b5d37de7d104a558.tar.gz
Support boot config to make adbd bootstrap
adbd is essential for debugging, but inaccessible during early Android boot phases before apex packages are unpacked. A new boot config "androidboot.apex.early_adbd" will allow adbd to start much earlier by making it a bootstrap apex. This gives developers immediate debugging access during early product bringup. Caveat: adbd apex should not be in compressed format when being configured as a bootstrap package. Bug: 329861763 Test: androidboot.apex.early_adbd=1 in kernel cmdline and PRODUCT_COMPRESSED_APEX:=false in build script, verify adbd is moved to bootstrap apex. Change-Id: I606525cb2b5546518f9f627990d01343daf3b919
-rw-r--r--apexd/apexd.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/apexd/apexd.cpp b/apexd/apexd.cpp
index a09e3d55..d22cebc5 100644
--- a/apexd/apexd.cpp
+++ b/apexd/apexd.cpp
@@ -167,11 +167,21 @@ static const std::vector<std::string> kBootstrapApexes = ([]() {
static constexpr const int kNumRetriesWhenCheckpointingEnabled = 1;
bool IsBootstrapApex(const ApexFile& apex) {
+ static std::vector<std::string> additional = []() {
+ std::vector<std::string> ret;
+ if (android::base::GetBoolProperty("ro.boot.apex.early_adbd", false)) {
+ ret.push_back("com.android.adbd");
+ }
+ return ret;
+ }();
+
if (IsVendorApex(apex) && apex.GetManifest().vendorbootstrap()) {
return true;
}
return std::find(kBootstrapApexes.begin(), kBootstrapApexes.end(),
- apex.GetManifest().name()) != kBootstrapApexes.end();
+ apex.GetManifest().name()) != kBootstrapApexes.end() ||
+ std::find(additional.begin(), additional.end(),
+ apex.GetManifest().name()) != additional.end();
}
void ReleaseF2fsCompressedBlocks(const std::string& file_path) {