Add basic validation to init.sh

This commit is contained in:
Tad 2018-06-03 08:02:43 -04:00
parent c6f7abd855
commit 2ac0a5cd15
2 changed files with 15 additions and 0 deletions

View File

@ -197,6 +197,7 @@ if [ "$MICROG_INCLUDED" = true ]; then echo "include vendor/lineage/config/sce-m
cp -r $patches"android_vendor_lineage/firmware_deblobber" .;
cp $patches"android_vendor_lineage/firmware_deblobber.mk" build/tasks/firmware_deblobber.mk;
sed -i 's/LINEAGE_BUILDTYPE := UNOFFICIAL/LINEAGE_BUILDTYPE := dos/' config/common.mk; #Change buildtype
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then sed -i 's/LINEAGE_BUILDTYPE := dos/LINEAGE_BUILDTYPE := dosNC/' config/common.mk; fi;
sed -i 's/messaging/Silence/' config/telephony.mk; #Replace AOSP Messaging app with Silence
#if [ "$HOSTS_BLOCKING" = false ]; then echo "PRODUCT_PACKAGES += DNS66" >> config/sce.mk; fi; #Include DNS66 as an alternative
if [ "$HOSTS_BLOCKING" = false ]; then cp $patches"android_vendor_lineage/dns66.json" prebuilt/common/etc/dns66.json; fi;

View File

@ -31,11 +31,21 @@ export NON_COMMERCIAL_USE_PATCHES=false; #Switch to false to prevent inclusion o
#END OF USER CONFIGURABLE OPTIONS
BUILD_WORKING_DIR=${PWD##*/};
if [ -d ".repo" ]; then
echo "Detected $BUILD_WORKING_DIR";
else
echo "Not a valid workspace!";
return 1;
fi;
export SIGNING_KEY_DIR=$androidWorkspace"Signing_Keys";
export OTA_PACKAGE_SIGNING_KEY=$SIGNING_KEY_DIR"/releasekey";
export base=$androidWorkspace"Build/$BUILD_WORKING_DIR/";
if [ ! -d $base ]; then
echo "Path mismatch! Please update init.sh!";
return 1;
fi;
export prebuiltApps=$androidWorkspace"PrebuiltApps/";
export patches=$androidWorkspace"Patches/$BUILD_WORKING_DIR/";
@ -45,6 +55,10 @@ export dosWallpapers=$androidWorkspace"Patches/Wallpapers/";
export scriptsCommon=$androidWorkspace"Scripts/Common/";
export scripts=$androidWorkspace"Scripts/$BUILD_WORKING_DIR/";
if [ ! -d $scripts ]; then
echo "$BUILD_WORKING_DIR is not supported!";
return 1;
fi;
export cveScripts=$scripts"CVE_Patchers/";
export ANDROID_HOME="/home/$USER/Android/Sdk";