diff options
author | Huang Jianan <huangjianan@oppo.com> | 2021-08-02 15:00:02 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2021-09-27 21:17:05 +0800 |
commit | 190df0bdb26adbc7f654e8945e54180ed0e901e3 (patch) | |
tree | 885a3499f06bdcfeb6299c2a21f2712ef3b82fff /apexd | |
parent | 81b8907194b55146d7e1a10b824d0202dddaa62f (diff) |
Add EROFS support for APEXHEADlineage-18.1
Bug: 195274797
Test: ./apxer/runtests.sh
Change-Id: I19019d2809496bfc37eca1964e58a4e04d8bbbe7
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Diffstat (limited to 'apexd')
-rw-r--r-- | apexd/apex_file.cpp | 3 | ||||
-rw-r--r-- | apexd/apex_file_test.cpp | 4 | ||||
-rw-r--r-- | apexd/apexd_testdata/Android.bp | 22 |
3 files changed, 27 insertions, 2 deletions
diff --git a/apexd/apex_file.cpp b/apexd/apex_file.cpp index abcda7d..212b295 100644 --- a/apexd/apex_file.cpp +++ b/apexd/apex_file.cpp @@ -60,7 +60,8 @@ struct FsMagic { const char* magic; }; constexpr const FsMagic kFsType[] = {{"f2fs", 1024, 4, "\x10\x20\xf5\xf2"}, - {"ext4", 1024 + 0x38, 2, "\123\357"}}; + {"ext4", 1024 + 0x38, 2, "\123\357"}, + {"erofs", 1024, 4, "\xe2\xe1\xf5\xe0"}}; Result<std::string> RetrieveFsType(borrowed_fd fd, int32_t image_offset) { for (const auto& fs : kFsType) { diff --git a/apexd/apex_file_test.cpp b/apexd/apex_file_test.cpp index 9d2cf17..f8973be 100644 --- a/apexd/apex_file_test.cpp +++ b/apexd/apex_file_test.cpp @@ -42,7 +42,9 @@ struct ApexFileTestParam { }; constexpr const ApexFileTestParam kParameters[] = { - {"ext4", "apex.apexd_test"}, {"f2fs", "apex.apexd_test_f2fs"}}; + {"ext4", "apex.apexd_test"}, + {"f2fs", "apex.apexd_test_f2fs"}, + {"erofs", "apex.apexd_test_erofs"}}; class ApexFileTest : public ::testing::TestWithParam<ApexFileTestParam> {}; diff --git a/apexd/apexd_testdata/Android.bp b/apexd/apexd_testdata/Android.bp index 9c41241..ba69f71 100644 --- a/apexd/apexd_testdata/Android.bp +++ b/apexd/apexd_testdata/Android.bp @@ -44,6 +44,17 @@ apex { } apex { + name: "apex.apexd_test_erofs", + manifest: "manifest.json", + file_contexts: ":apex.test-file_contexts", + prebuilts: ["sample_prebuilt_file"], + key: "com.android.apex.test_package.key", + installable: false, + min_sdk_version: "current", + payload_fs_type: "erofs", +} + +apex { name: "apex.apexd_test_no_hashtree", manifest: "manifest.json", file_contexts: ":apex.test-file_contexts", @@ -182,6 +193,17 @@ apex { payload_fs_type: "f2fs", } +apex { + name: "apex.apexd_test_erofs_no_inst_key", + manifest: "manifest_no_inst_key.json", + file_contexts: ":apex.test-file_contexts", + prebuilts: ["sample_prebuilt_file"], + key: "com.android.apex.test_package.no_inst_key.key", + installable: false, + payload_fs_type: "erofs", + updatable: false, +} + apex_key { name: "com.android.apex.test_package_2.key", public_key: "com.android.apex.test_package_2.avbpubkey", |