From 3ce6cb9b6ee16c94b0cec3b2b331517ec36e641d Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Wed, 31 Jul 2024 13:10:48 +0900 Subject: [PATCH] Refactor init.environ.rc to append than replace Bug: 353429422 Test: boot Change-Id: Ibd432fa39fc75f8b49ae26fbc6b74f11fb3f771d --- rootdir/Android.bp | 10 +++++----- rootdir/init.environ.rc.in | 7 ++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/rootdir/Android.bp b/rootdir/Android.bp index bbc50534c..1e7b48b31 100644 --- a/rootdir/Android.bp +++ b/rootdir/Android.bp @@ -167,11 +167,11 @@ genrule { srcs: ["init.environ.rc.in"], out: ["init.environ.rc"], cmd: "cp -f $(in) $(out) && " + - "sed -i -e 's?%EXPORT_GLOBAL_ASAN_OPTIONS%?" + EXPORT_GLOBAL_ASAN_OPTIONS + "?g' $(out) && " + - "sed -i -e 's?%EXPORT_GLOBAL_GCOV_OPTIONS%?" + EXPORT_GLOBAL_GCOV_OPTIONS + "?g' $(out) && " + - "sed -i -e 's?%EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS%?" + EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS + "?g' $(out) && " + - "sed -i -e 's?%EXPORT_GLOBAL_HWASAN_OPTIONS%?" + EXPORT_GLOBAL_HWASAN_OPTIONS + "?g' $(out) && " + - "sed -i -e 's?%EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE%?" + EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE + "?g' $(out)", + "echo ' " + EXPORT_GLOBAL_ASAN_OPTIONS + "' >> $(out) && " + + "echo ' " + EXPORT_GLOBAL_GCOV_OPTIONS + "' >> $(out) && " + + "echo ' " + EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS + "' >> $(out) && " + + "echo ' " + EXPORT_GLOBAL_HWASAN_OPTIONS + "' >> $(out) && " + + "echo ' " + EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE + "' >> $(out)", } prebuilt_root { diff --git a/rootdir/init.environ.rc.in b/rootdir/init.environ.rc.in index 7ba1f46e7..9249270b3 100644 --- a/rootdir/init.environ.rc.in +++ b/rootdir/init.environ.rc.in @@ -10,8 +10,5 @@ on early-init export ANDROID_TZDATA_ROOT /apex/com.android.tzdata export EXTERNAL_STORAGE /sdcard export ASEC_MOUNTPOINT /mnt/asec - %EXPORT_GLOBAL_ASAN_OPTIONS% - %EXPORT_GLOBAL_GCOV_OPTIONS% - %EXPORT_GLOBAL_CLANG_COVERAGE_OPTIONS% - %EXPORT_GLOBAL_HWASAN_OPTIONS% - %EXPORT_GLOBAL_SCUDO_ALLOCATION_RING_BUFFER_SIZE% + # Additional environment variables will be appended here during build (see Android.bp). + # DO NOT ADD additional sections like 'on ' here.