From 7e093e0500864b9325a8423969d9ae40a799ca35 Mon Sep 17 00:00:00 2001 From: Tad Date: Sat, 18 Sep 2021 21:22:44 -0400 Subject: [PATCH] Ensure all used defconfigs are altered --- Scripts/Common/Functions.sh | 15 +++++++-------- Scripts/LineageOS-17.1/Functions.sh | 3 +-- Scripts/LineageOS-17.1/Patch.sh | 1 - 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Scripts/Common/Functions.sh b/Scripts/Common/Functions.sh index ce20095f..b26c13dd 100644 --- a/Scripts/Common/Functions.sh +++ b/Scripts/Common/Functions.sh @@ -646,7 +646,8 @@ getDefconfig() { elif ls arch/arm64/configs/lineage*defconfig 1> /dev/null 2>&1; then local defconfigPath="arch/arm64/configs/lineage*defconfig"; else - local defconfigPath="arch/arm*/configs/*defconfig arch/arm*/configs/*/*defconfig"; + #grep TARGET_KERNEL_CONFIG /mnt/dos/Build/*/device/ -Rih | sed 's|TARGET_KERNEL_CONFIG .= |arch/arm\*/configs/|' | grep -v lineage | sort -u + local defconfigPath="arch/arm*/configs/lineage*defconfig arch/arm*/configs/aura_defconfig arch/arm*/configs/beryllium_defconfig arch/arm*/configs/clark_defconfig arch/arm*/configs/enchilada_defconfig arch/arm*/configs/exynos8890-herolte_defconfig arch/arm*/configs/floral_defconfig arch/arm*/configs/griffin_defconfig arch/arm*/configs/grouper_defconfig arch/arm*/configs/m7_defconfig arch/arm*/configs/m8_defconfig arch/arm*/configs/msm8974-hdx_defconfig arch/arm*/configs/msm8974-hdx-perf_defconfig arch/arm*/configs/oneplus2_defconfig arch/arm*/configs/osprey_defconfig arch/arm*/configs/redbull_defconfig arch/arm*/configs/samsung_serrano_defconfig arch/arm*/configs/samsung_serrano_usa_defconfig arch/arm*/configs/shamu_defconfig arch/arm*/configs/sunfish_defconfig arch/arm*/configs/surnia_defconfig arch/arm*/configs/tuna_defconfig arch/arm*/configs/twrp_defconfig arch/arm*/configs/vendor/alioth_defconfig arch/arm*/configs/vendor/lineage_davinci_defconfig arch/arm*/configs/vendor/lito-perf_defconfig arch/arm*/configs/vendor/lmi_defconfig arch/arm*/configs/vendor/raphael_defconfig arch/arm*/configs/vendor/sm8150-perf_defconfig arch/arm*/configs/vendor/vayu_defconfig arch/arm*/configs/yellowstone_defconfig arch/arm*/configs/Z00T_defconfig arch/arm*/configs/z2_plus_defconfig arch/arm*/configs/zenfone3-perf_defconfig"; fi; echo $defconfigPath; } @@ -770,9 +771,9 @@ hardenDefconfig() { do sed -i 's/# '"CONFIG_$option"' is not set/'"CONFIG_$option"'=y/' $defconfigPath &>/dev/null || true; #Some defconfigs are very minimal/not-autogenerated, so lets add the rest. Obviously most won't have any affect as they aren't supported. - if [[ "$defconfigPath" == *"lineage"* ]] && [[ "$1" != *"kernel/oneplus/msm8996"* ]]; then - if ! grep -q "CONFIG_$option=y" $defconfigPath; then - echo "CONFIG_$option=y" | tee -a $defconfigPath > /dev/null; + if [[ "$1" != *"kernel/oneplus/msm8996"* ]]; then + if ! grep -q "CONFIG_$option=y" $defconfigPath &>/dev/null; then + echo "CONFIG_$option=y" | tee -a $defconfigPath &>/dev/null || true; fi; fi; done @@ -789,10 +790,8 @@ hardenDefconfig() { sed -i 's/'"CONFIG_$option"'=y/# '"CONFIG_$option"' is not set/' $defconfigPath &>/dev/null || true; #sed -i 's/'"CONFIG_$option"'=y/'"CONFIG_$option"'=n/' $defconfigPath &>/dev/null || true; #Some defconfigs are very minimal/not-autogenerated, so lets add the rest. Obviously most won't have any affect as they aren't supported. - if [[ "$defconfigPath" == *"lineage"* ]]; then - if ! grep -q "CONFIG_$option=n" $defconfigPath; then - echo "CONFIG_$option=n" | tee -a $defconfigPath > /dev/null; - fi; + if ! grep -q "CONFIG_$option=n" $defconfigPath &>/dev/null; then + echo "CONFIG_$option=n" | tee -a $defconfigPath &>/dev/null || true; fi; done diff --git a/Scripts/LineageOS-17.1/Functions.sh b/Scripts/LineageOS-17.1/Functions.sh index 39b6349e..1def762c 100644 --- a/Scripts/LineageOS-17.1/Functions.sh +++ b/Scripts/LineageOS-17.1/Functions.sh @@ -92,9 +92,8 @@ patchWorkspace() { umask 0022; if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/lineage"; fi; - source build/envsetup.sh; + #source build/envsetup.sh; #repopick -it ten-firewall; - repopick -it Q_asb_2021-09; source "$DOS_SCRIPTS/Patch.sh"; source "$DOS_SCRIPTS_COMMON/Copy_Keys.sh"; diff --git a/Scripts/LineageOS-17.1/Patch.sh b/Scripts/LineageOS-17.1/Patch.sh index bc3258f6..69b21003 100644 --- a/Scripts/LineageOS-17.1/Patch.sh +++ b/Scripts/LineageOS-17.1/Patch.sh @@ -68,7 +68,6 @@ sed -i '75i$(my_res_package): PRIVATE_AAPT_FLAGS += --auto-add-overlay' core/aap sed -i 's/messaging/Silence/' target/product/aosp_base_telephony.mk target/product/gsi_common.mk; #Replace the Messaging app with Silence awk -i inplace '!/updatable_apex.mk/' target/product/mainline_system.mk; #Disable APEX sed -i 's/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 23/PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 28/' core/version_defaults.mk; #Set the minimum supported target SDK to Pie (GrapheneOS) -sed -i 's/2021-08-05/2021-09-05/' core/version_defaults.mk; #Bump Security String #Q_asb_2021-09 #XXX fi; if enterAndClear "build/soong"; then