REMOVE ALL THE BLOBS!!1!

This commit is contained in:
Tad 2017-02-15 14:37:34 -05:00
parent 21ef09f219
commit f65a2d65e4
2 changed files with 31 additions and 4 deletions

View File

@ -10,9 +10,10 @@
#Fully Functional: bacon, clark
#LTE Broken (Potentially Unrelated): mako
base="/home/tad/Android/Build/LineageOS-14.1/"
base="/home/tad/Android/Build/LineageOS-14.1/";
blobsRemoved=0;
deblob() {
dir=$1
dir=$1;
blobList=$2;
cd $base$dir; #Enter the target directory
cp $blobList $blobList".bak";
@ -100,12 +101,27 @@ deblob() {
grep -vE "("$blobs")" $blobList > $blobList".new"; #Remove the bad blobs from the manifest
mv $blobList".new" $blobList; #Move the new list into place
delta=$(($(wc -l < $blobList".bak") - $(wc -l < $blobList))); #Calculate the difference in size
blobsRemoved=$(($blobsRemoved + $delta));
echo "Removed "$delta" blobs from "$dir$blobList; #Inform the user
sh -c "cd $base$dir && ./setup-makefiles.sh"; #Update the makefiles
cd $base;
}
#Find all using: cd device && find . -name "*proprietary*.txt" | grep -v ".bak"
deblobMk() {
cd $base;
mkfile=$1;
cp $mkfile $mkfile".bak";
grep -vE "("$blobs")" $mkfile> $mkfile".new"; #Remove the bad blobs from the makefile
mv $mkfile".new" $mkfile; #Move the new list into place
delta=$(($(wc -l < $mkfile".bak") - $(wc -l < $mkfile))); #Calculate the difference in size
blobsRemoved=$(($blobsRemoved + $delta));
echo "Removed "$delta" blobs from "$mkfile; #Inform the user
}
#
#Deblob all the device proprietary-blobs manifests
#Find all using: cd device && find . -name "*proprietary*.txt"
#
deblob "device/amazon/hdx-common/" "proprietary-adreno-files.txt";
deblob "device/amazon/hdx-common/" "proprietary-files.txt";
deblob "device/asus/msm8916-common/" "proprietary-files.txt";
@ -131,3 +147,14 @@ deblob "device/moto/shamu/" "proprietary-blobs.txt";
echo "vendor/lib/libcneapiclient.so" >> device/oneplus/bacon/proprietary-files-qc.txt; #Commit b7b6d94529e17ce51566aa6509cebab6436b153d disabled CNE but left this binary in the makefile vendor since NetMgr requires it. Without this line rerunning setup-makefiles.sh breaks cell service, since the resulting build will be missing it.
deblob "device/oneplus/bacon/" "proprietary-files-qc.txt";
deblob "device/oneplus/bacon/" "proprietary-files.txt";
#
#Deblob all the makefiles
#
export base;
export blobs;
export -f deblobMk;
find vendor -name "*vendor*.mk" -type f -exec bash -c 'deblobMk "$0"' {} \;
echo "Removed "$blobsRemoved" blobs from workspace!";

View File

@ -9,7 +9,7 @@
#rm -rf build vendor/cm device/motorola/clark device/oneplus/bacon device/lge/mako kernel/lge/mako kernel/oneplus/msm8974 kernel/motorola/msm8992 packages/apps/Settings frameworks/base build system/core external/sqlite packages/apps/Nfc packages/apps/Settings packages/apps/FDroid packages/apps/FDroidPrivilegedExtension packages/apps/GmsCore packages/apps/GsfProxy packages/apps/FakeStore kernel/lge/hammerhead kernel/moto/shamu bootable/recovery packages/apps/CMParts vendor/cmsdk packages/apps/SetupWizard
#Start a build
#repo sync -j24 --force-sync && sh ../../Scripts/LAOS-14.1_Patches.sh && sh ../../Scripts/LAOS-14.1_Deblob.sh && source build/envsetup.sh && export WITH_SU=true && export ANDROID_HOME="/home/tad/Android/SDK" && export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m" && brunch mako && export OTA_PACKAGE_SIGNING_KEY=../../Signing_Keys/releasekey && export SIGNING_KEY_DIR=../../Signing_Keys && brunch clark && brunch bacon && brunch thor
#repo sync -j24 --force-sync && sh ../../Scripts/LAOS-14.1_Patches.sh && source ../../Scripts/LAOS-14.1_Deblob.sh && source build/envsetup.sh && export WITH_SU=true && export ANDROID_HOME="/home/tad/Android/SDK" && export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m" && brunch mako && export OTA_PACKAGE_SIGNING_KEY=../../Signing_Keys/releasekey && export SIGNING_KEY_DIR=../../Signing_Keys && brunch clark && brunch bacon && brunch thor
#
#START OF PREPRATION