From 9374a9c6f75412f30d473d9b974d8b53efcf1c8c Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 13 May 2020 21:30:09 -0700 Subject: [PATCH 1/3] rootdir: add vendor_dlkm symlinks Test: builds and boots Bug: 156020364 Change-Id: I99b0eeda0066d6c885aefe181f233a97507a61a9 --- rootdir/Android.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rootdir/Android.mk b/rootdir/Android.mk index a9d0ed08a..ac8e8478a 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -120,6 +120,17 @@ LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/overlay $(TARGET_ROOT_OUT)/odm/ov LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/priv-app $(TARGET_ROOT_OUT)/odm/priv-app LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/usr $(TARGET_ROOT_OUT)/odm/usr + +# For /vendor_dlkm partition. +LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/vendor_dlkm +# For Treble Generic System Image (GSI), system-as-root GSI needs to work on +# both devices with and without /vendor_dlkm partition. Those symlinks are for +# devices without /vendor_dlkm partition. For devices with /vendor_dlkm +# partition, mount vendor_dlkm.img under /vendor_dlkm will hide those symlinks. +# Note that /vendor_dlkm/lib is omitted because vendor DLKMs should be accessed +# via /vendor/lib/modules directly. +LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/vendor_dlkm/etc $(TARGET_ROOT_OUT)/vendor_dlkm/etc + ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/cache else From 6b1c15c0637cc47cd4bb65a91bc70479e1abe1c8 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Tue, 12 May 2020 10:38:53 -0700 Subject: [PATCH 2/3] fastboot: Add vendor_dlkm Test: add vendor_dlkm partition and flash Bug: 156020364 Change-Id: If6794ca5a76613a1a3337a4637edd1d364eff5dd --- fastboot/fastboot.bash | 2 +- fastboot/fastboot.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fastboot/fastboot.bash b/fastboot/fastboot.bash index cb1d3541c..cc1366cf4 100644 --- a/fastboot/fastboot.bash +++ b/fastboot/fastboot.bash @@ -109,7 +109,7 @@ _fastboot_cmd_flash() { cur="${COMP_WORDS[COMP_CWORD]}" if [[ $i -eq $COMP_CWORD ]]; then - partitions="boot bootloader dtbo modem odm oem product radio recovery system vbmeta vendor" + partitions="boot bootloader dtbo modem odm oem product radio recovery system vbmeta vendor vendor_dlkm" COMPREPLY=( $(compgen -W "$partitions" -- $cur) ) else _fastboot_util_complete_local_file "${cur}" '!*.img' diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 86cf30df2..4ca6a6a69 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -166,6 +166,10 @@ static Image images[] = { "vendor_boot.img", "vendor_boot.sig", "vendor_boot", true, ImageType::BootCritical }, + { "vendor_dlkm", + "vendor_dlkm.img", "vendor_dlkm.sig", + "vendor_dlkm", + true, ImageType::Normal }, { nullptr, "vendor_other.img", "vendor.sig", "vendor", true, ImageType::Normal }, // clang-format on }; From 2ed3cdaa06e390e0fc72f568b175c70537dd313c Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 24 Jun 2020 18:29:22 -0700 Subject: [PATCH 3/3] load sysprops from vendor_dlkm. Load sysprops from /vendor_dlkm/build.prop. Note that no property contexts are loaded from vendor_dlkm. Test: getprop | grep vendor_dlkm Bug: 156020364 Change-Id: Ib0e8ba1791e1d2c11d055ef496208993e11d9b0f --- init/property_service.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init/property_service.cpp b/init/property_service.cpp index b593b623f..0c4a3c498 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -632,9 +632,10 @@ static void LoadProperties(char* data, const char* filter, const char* filename, char *key, *value, *eol, *sol, *tmp, *fn; size_t flen = 0; - static constexpr const char* const kVendorPathPrefixes[2] = { + static constexpr const char* const kVendorPathPrefixes[3] = { "/vendor", "/odm", + "/vendor_dlkm", }; const char* context = kInitContext; @@ -939,6 +940,7 @@ void PropertyLoadBootDefaults() { load_properties_from_file("/vendor/default.prop", nullptr, &properties); // } load_properties_from_file("/vendor/build.prop", nullptr, &properties); + load_properties_from_file("/vendor_dlkm/etc/build.prop", nullptr, &properties); load_properties_from_partition("odm", /* support_legacy_path_until */ 28); load_properties_from_partition("product", /* support_legacy_path_until */ 30);