From 9258f2e423a5a83e2d7ae2fed46136d8b9caf253 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 15 Jul 2020 17:04:43 -0700 Subject: [PATCH 1/3] Load sysprops from odm_dlkm. Load sysprops from /odm_dlkm/etc/build.prop. Note that no property contexts are loaded from odm_dlkm. Test: getprop | grep odm_dlkm Bug: 156020364 Change-Id: I90c3a54a110462736d9888101d4281100d586632 --- 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 0c4a3c498..1fa33628b 100644 --- a/init/property_service.cpp +++ b/init/property_service.cpp @@ -632,10 +632,11 @@ 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[3] = { + static constexpr const char* const kVendorPathPrefixes[4] = { "/vendor", "/odm", "/vendor_dlkm", + "/odm_dlkm", }; const char* context = kInitContext; @@ -941,6 +942,7 @@ void PropertyLoadBootDefaults() { // } load_properties_from_file("/vendor/build.prop", nullptr, &properties); load_properties_from_file("/vendor_dlkm/etc/build.prop", nullptr, &properties); + load_properties_from_file("/odm_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); From be78bb624c740d2e71a73cca4e6bf5712c290b01 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 15 Jul 2020 17:07:11 -0700 Subject: [PATCH 2/3] fastboot: Add odm_dlkm Test: add odm_dlkm partition and flash Bug: 156020364 Change-Id: I577b4420f2be8e8141d967f0d9107cae381c7675 --- fastboot/fastboot.bash | 2 +- fastboot/fastboot.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/fastboot/fastboot.bash b/fastboot/fastboot.bash index cc1366cf4..406e8b8d7 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 vendor_dlkm" + partitions="boot bootloader dtbo modem odm odm_dlkm 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 4ca6a6a69..d33c98770 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -145,6 +145,7 @@ static Image images[] = { { "dtbo", "dtbo.img", "dtbo.sig", "dtbo", true, ImageType::BootCritical }, { "dts", "dt.img", "dt.sig", "dts", true, ImageType::BootCritical }, { "odm", "odm.img", "odm.sig", "odm", true, ImageType::Normal }, + { "odm_dlkm", "odm_dlkm.img", "odm_dlkm.sig", "odm_dlkm", true, ImageType::Normal }, { "product", "product.img", "product.sig", "product", true, ImageType::Normal }, { "recovery", "recovery.img", "recovery.sig", "recovery", true, ImageType::BootCritical }, { "super", "super.img", "super.sig", "super", true, ImageType::Extra }, From e306bce92756d5b0c83033359352eb476643d9ff Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 15 Jul 2020 17:08:59 -0700 Subject: [PATCH 3/3] rootdir: add odm_dlkm symlinks Test: builds and boots Bug: 156020364 Change-Id: I678b787cbf81ea6038936a4059e0bf5adfe3274f --- rootdir/Android.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rootdir/Android.mk b/rootdir/Android.mk index ac8e8478a..77fa94e73 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -131,6 +131,16 @@ LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/vendor_dlkm # via /vendor/lib/modules directly. LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/vendor_dlkm/etc $(TARGET_ROOT_OUT)/vendor_dlkm/etc +# For /odm_dlkm partition. +LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/odm_dlkm +# For Treble Generic System Image (GSI), system-as-root GSI needs to work on +# both devices with and without /odm_dlkm partition. Those symlinks are for +# devices without /odm_dlkm partition. For devices with /odm_dlkm +# partition, mount odm_dlkm.img under /odm_dlkm will hide those symlinks. +# Note that /odm_dlkm/lib is omitted because odm DLKMs should be accessed +# via /odm/lib/modules directly. +LOCAL_POST_INSTALL_CMD += ; ln -sf /odm/odm_dlkm/etc $(TARGET_ROOT_OUT)/odm_dlkm/etc + ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/cache else