From 5dea710e2e1887816d2a7179828e0ffe5d8e02db Mon Sep 17 00:00:00 2001 From: Griffin Millender Date: Tue, 29 Dec 2015 00:25:59 -0600 Subject: [PATCH] AOSPB initial Change-Id: I5253588a2c754a44da7d72788d5c29f0630ee8d5 --- core/Makefile | 25 +++------- core/config.mk | 4 +- core/dumpvar.mk | 2 +- core/product_config.mk | 10 ++-- envsetup.sh | 46 +++++++++---------- tools/buildinfo.sh | 2 +- .../{slim.mk.template => aospb.mk.template} | 9 ++-- tools/device/mkvendor.sh | 4 +- tools/releasetools/edify_generator.py | 2 +- tools/releasetools/ota_from_target_files.py | 16 +------ tools/roomservice.py | 8 ++-- 11 files changed, 50 insertions(+), 78 deletions(-) rename tools/device/{slim.mk.template => aospb.mk.template} (60%) diff --git a/core/Makefile b/core/Makefile index 80162ca91..5ffc738e1 100644 --- a/core/Makefile +++ b/core/Makefile @@ -220,7 +220,7 @@ endif $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \ TARGET_BUILD_FLAVOR="$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)" \ TARGET_DEVICE="$(TARGET_VENDOR_DEVICE_NAME)" \ - SLIM_DEVICE="$(TARGET_DEVICE)" \ + AOSPB_DEVICE="$(TARGET_DEVICE)" \ PRODUCT_NAME="$(TARGET_VENDOR_PRODUCT_NAME)" \ PRODUCT_BRAND="$(PRODUCT_BRAND)" \ PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \ @@ -1871,7 +1871,7 @@ endif ifeq ($(WITH_GMS),true) $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false else -ifneq ($(SLIM_BUILD),) +ifneq ($(AOSPB_BUILD),) $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := true else $(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false @@ -1880,7 +1880,7 @@ endif BOOT_ZIP_FROM_IMAGE_SCRIPT := ./build/tools/releasetools/boot_flash_from_image KERNEL_PATH := $(TARGET_KERNEL_SOURCE)/arch/arm/configs/$(TARGET_KERNEL_CONFIG) -#BOOT_ZIP_OUT_FILE := Slim-Kernel-$(DEVICE).zip +#BOOT_ZIP_OUT_FILE := AOSPB-Kernel-$(DEVICE).zip ifeq ($(TARGET_OTA_ASSERT_DEVICE),) $(INTERNAL_OTA_PACKAGE_TARGET): override_device := auto @@ -1913,25 +1913,14 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) $(if $(OEM_OTA_CONFIG), -o $(OEM_OTA_CONFIG)) \ $(BUILT_TARGET_FILES_PACKAGE) $@ -SLIM_TARGET_PACKAGE := $(PRODUCT_OUT)/$(SLIM_MOD_VERSION).zip +AOSPB_TARGET_PACKAGE := $(PRODUCT_OUT)/$(AOSPB_MOD_VERSION).zip .PHONY: otapackage bacon bootzip otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) bacon: otapackage - $(hide) ln -f $(INTERNAL_OTA_PACKAGE_TARGET) $(SLIM_TARGET_PACKAGE) - $(hide) $(MD5SUM) $(SLIM_TARGET_PACKAGE) > $(SLIM_TARGET_PACKAGE).md5sum - @echo -e ${CL_SLIM}" _______________________________________________ "${CL_SLIM} - @echo -e ${CL_SLIM}" / www.slimroms.org | "${CL_SLIM} - @echo -e ${CL_SLIM}" / _____________________________________________| "${CL_SLIM} - @echo -e ${CL_SLIM}" / / "${CL_SLIM} - @echo -e ${CL_SLIM}" / / _ _ "${CL_SGRY}" ______ "${CL_SLIM} - @echo -e ${CL_SLIM}" / / | |(_) "${CL_SGRY}"(_____ \ "${CL_SLIM} - @echo -e ${CL_SLIM}" / / | | _ _____ "${CL_SGRY}"_____) )___ _____ ___ "${CL_SLIM} - @echo -e ${CL_SLIM}" _____________________/ / | || | |"${CL_SGRY}" __ // _ \| |/___) "${CL_SLIM} - @echo -e ${CL_SLIM}" | / | || | | | |"${CL_SGRY}" | \ \ |_| | | | |___ | "${CL_SLIM} - @echo -e ${CL_SLIM}" |_______________________/ \_)_|_|_|_|"${CL_SGRY}"_| |_\___/|_|_|_(___/ "${CL_SLIM} - @echo -e ${CL_SLIM}" "${CL_SLIM} - @echo -e ${CL_CYN}"Package Complete: $(SLIM_TARGET_PACKAGE)"${CL_RST} + $(hide) ln -f $(INTERNAL_OTA_PACKAGE_TARGET) $(AOSPB_TARGET_PACKAGE) + $(hide) $(MD5SUM) $(AOSPB_TARGET_PACKAGE) > $(AOSPB_TARGET_PACKAGE).md5sum + @echo -e ${CL_CYN}"Package Complete: $(AOSPB_TARGET_PACKAGE)"${CL_RST} bootzip: bootimage $(BOOT_ZIP_FROM_IMAGE_SCRIPT) \ diff --git a/core/config.mk b/core/config.mk index 7149cdc8d..1e4395b8f 100644 --- a/core/config.mk +++ b/core/config.mk @@ -726,10 +726,10 @@ ifneq ($(TARGET_COPY_FILES_OVERRIDES),) PRODUCT_COPY_FILES := $(filter-out $(TARGET_COPY_FILES_OVERRIDES), $(PRODUCT_COPY_FILES)) endif -ifneq ($(SLIM_BUILD),) +ifneq ($(AOSPB_BUILD),) ## We need to be sure the global selinux policies are included ## last, to avoid accidental resetting by device configs -$(eval include vendor/slim/sepolicy/sepolicy.mk) +$(eval include vendor/aospb/sepolicy/sepolicy.mk) # Include any vendor specific config.mk file -include $(TOPDIR)vendor/*/build/core/config.mk diff --git a/core/dumpvar.mk b/core/dumpvar.mk index 6aa423a98..9f30253e6 100644 --- a/core/dumpvar.mk +++ b/core/dumpvar.mk @@ -77,7 +77,7 @@ $(info |_________/ |_|_|_| |_| |_| "Y88888P" |) $(info |==========================================|) $(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME)) $(info PLATFORM_VERSION=$(PLATFORM_VERSION)) -$(info SLIM_VERSION=$(SLIM_VERSION)) +$(info AOSPB_VERSION=$(AOSPB_VERSION)) $(info TARGET_PRODUCT=$(TARGET_PRODUCT)) $(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT)) $(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) diff --git a/core/product_config.mk b/core/product_config.mk index b157a3a66..e4622e65d 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -179,9 +179,9 @@ include $(BUILD_SYSTEM)/node_fns.mk include $(BUILD_SYSTEM)/product.mk include $(BUILD_SYSTEM)/device.mk -# A SLIM build needs only the SLIM product makefiles. -ifneq ($(SLIM_BUILD),) - all_product_configs := $(shell find device -path "*/$(SLIM_BUILD)/slim.mk") +# A AOSPB build needs only the AOSPB product makefiles. +ifneq ($(AOSPB_BUILD),) + all_product_configs := $(shell find device -path "*/$(AOSPB_BUILD)/aospb.mk") else ifneq ($(strip $(TARGET_BUILD_APPS)),) # An unbundled app build needs only the core product makefiles. @@ -192,9 +192,9 @@ else # files in the tree. all_product_configs := $(get-all-product-makefiles) endif # TARGET_BUILD_APPS -endif # SLIM_BUILD +endif # AOSPB_BUILD -ifeq ($(SLIM_BUILD),) +ifeq ($(AOSPB_BUILD),) # Find the product config makefile for the current product. # all_product_configs consists items like: # : diff --git a/envsetup.sh b/envsetup.sh index cceb7045d..5824d1921 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -78,13 +78,13 @@ function check_product() return fi - if (echo -n $1 | grep -q -e "^slim_") ; then - SLIM_BUILD=$(echo -n $1 | sed -e 's/^slim_//g') - export BUILD_NUMBER=$((date +%s%N ; echo $SLIM_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10) + if (echo -n $1 | grep -q -e "^aospb_") ; then + AOSPB_BUILD=$(echo -n $1 | sed -e 's/^aospb_//g') + export BUILD_NUMBER=$((date +%s%N ; echo $AOSPB_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10) else - SLIM_BUILD= + AOSPB_BUILD= fi - export SLIM_BUILD + export AOSPB_BUILD TARGET_PRODUCT=$1 \ TARGET_BUILD_VARIANT= \ @@ -506,7 +506,7 @@ function print_lunch_menu() echo " (ohai, koush!)" fi echo - if [ "z${SLIM_DEVICES_ONLY}" != "z" ]; then + if [ "z${AOSPB_DEVICES_ONLY}" != "z" ]; then echo "Breakfast menu... pick a combo:" else echo "Lunch menu... pick a combo:" @@ -520,7 +520,7 @@ function print_lunch_menu() i=$(($i+1)) done | column - if [ "z${SLIM_DEVICES_ONLY}" != "z" ]; then + if [ "z${AOSPB_DEVICES_ONLY}" != "z" ]; then echo "... and don't forget the bacon!" fi @@ -549,10 +549,10 @@ function breakfast() { target=$1 local variant=$2 - SLIM_DEVICES_ONLY="true" + AOSPB_DEVICES_ONLY="true" unset LUNCH_MENU_CHOICES add_lunch_combo full-eng - for f in `/bin/ls vendor/slim/vendorsetup.sh 2> /dev/null` + for f in `/bin/ls vendor/aospb/vendorsetup.sh 2> /dev/null` do echo "including $f" . $f @@ -568,11 +568,11 @@ function breakfast() # A buildtype was specified, assume a full device name lunch $target else - # This is probably just the SLIM model name + # This is probably just the AOSPB model name if [ -z "$variant" ]; then variant="userdebug" fi - lunch slim_$target-$variant + lunch aospb_$target-$variant fi fi return $? @@ -622,7 +622,7 @@ function lunch() check_product $product if [ $? -ne 0 ] then - # if we can't find a product, try to grab it off the SLIM github + # if we can't find a product, try to grab it off the AOSPB github T=$(gettop) pushd $T > /dev/null build/tools/roomservice.py $product @@ -734,7 +734,7 @@ function tapas() function eat() { if [ "$OUT" ] ; then - MODVERSION=$(get_build_var SLIM_VERSION) + MODVERSION=$(get_build_var AOSPB_VERSION) ZIPFILE=$MODVERSION.zip ZIPPATH=$OUT/$ZIPFILE if [ ! -f $ZIPPATH ] ; then @@ -750,7 +750,7 @@ function eat() done echo "Device Found.." fi - if (adb shell getprop ro.slim.device | grep -q "$SLIM_BUILD"); + if (adb shell getprop ro.aospb.device | grep -q "$AOSPB_BUILD"); then # if adbd isn't root we can't write to /cache/recovery/ adb root @@ -772,7 +772,7 @@ EOF fi return $? else - echo "The connected device does not appear to be $SLIM_BUILD, run away!" + echo "The connected device does not appear to be $AOSPB_BUILD, run away!" fi } @@ -1751,7 +1751,7 @@ function repopick() { function fixup_common_out_dir() { common_out_dir=$(get_build_var OUT_DIR)/target/common target_device=$(get_build_var TARGET_DEVICE) - if [ ! -z $SLIM_FIXUP_COMMON_OUT ]; then + if [ ! -z $AOSPB_FIXUP_COMMON_OUT ]; then if [ -d ${common_out_dir} ] && [ ! -L ${common_out_dir} ]; then mv ${common_out_dir} ${common_out_dir}-${target_device} ln -s ${common_out_dir}-${target_device} ${common_out_dir} @@ -1796,7 +1796,7 @@ function installboot() sleep 1 adb wait-for-online shell mount /system 2>&1 > /dev/null adb wait-for-online remount - if (adb shell getprop ro.slim.device | grep -q "$SLIM_BUILD"); + if (adb shell getprop ro.aospb.device | grep -q "$AOSPB_BUILD"); then adb push $OUT/boot.img /cache/ for i in $OUT/system/lib/modules/*; @@ -1807,7 +1807,7 @@ function installboot() adb shell chmod 644 /system/lib/modules/* echo "Installation complete." else - echo "The connected device does not appear to be $SLIM_BUILD, run away!" + echo "The connected device does not appear to be $AOSPB_BUILD, run away!" fi } @@ -1841,13 +1841,13 @@ function installrecovery() sleep 1 adb wait-for-online shell mount /system 2>&1 > /dev/null adb wait-for-online remount - if (adb shell getprop ro.slim.device | grep -q "$SLIM_BUILD"); + if (adb shell getprop ro.aospb.device | grep -q "$AOSPB_BUILD"); then adb push $OUT/recovery.img /cache/ adb shell dd if=/cache/recovery.img of=$PARTITION echo "Installation complete." else - echo "The connected device does not appear to be $SLIM_BUILD, run away!" + echo "The connected device does not appear to be $AOSPB_BUILD, run away!" fi } @@ -1867,7 +1867,7 @@ function dopush() echo "Device Found." fi - if (adb shell getprop ro.slim.device | grep -q "$SLIM_BUILD") || [ "$FORCE_PUSH" == "true" ]; + if (adb shell getprop ro.aospb.device | grep -q "$AOSPB_BUILD") || [ "$FORCE_PUSH" == "true" ]; then # retrieve IP and PORT info if we're using a TCP connection TCPIPPORT=$(adb devices | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+[^0-9]+' \ @@ -1971,7 +1971,7 @@ EOF rm -f $OUT/.log return 0 else - echo "The connected device does not appear to be $SLIM_BUILD, run away!" + echo "The connected device does not appear to be $AOSPB_BUILD, run away!" fi } @@ -2095,7 +2095,7 @@ unset f # Add completions check_bash_version && { - dirs="sdk/bash_completion vendor/slim/bash_completion" + dirs="sdk/bash_completion vendor/aospb/bash_completion" for dir in $dirs; do if [ -d ${dir} ]; then for f in `/bin/ls ${dir}/[a-z]*.bash 2> /dev/null`; do diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh index c41ecd72d..1abeba256 100755 --- a/tools/buildinfo.sh +++ b/tools/buildinfo.sh @@ -58,6 +58,6 @@ if [ "$TARGET_UNIFIED_DEVICE" == "" ] ; then fi echo "ro.build.characteristics=$TARGET_AAPT_CHARACTERISTICS" -echo "ro.slim.device=$SLIM_DEVICE" +echo "ro.aospb.device=$AOSPB_DEVICE" echo "# end build properties" diff --git a/tools/device/slim.mk.template b/tools/device/aospb.mk.template similarity index 60% rename from tools/device/slim.mk.template rename to tools/device/aospb.mk.template index 6af93d7e9..7ddd27bba 100644 --- a/tools/device/slim.mk.template +++ b/tools/device/aospb.mk.template @@ -1,18 +1,15 @@ -## Specify phone tech before including full_phone -$(call inherit-product, vendor/slim/config/gsm.mk) - # Release name PRODUCT_RELEASE_NAME := __DEVICE__ -# Inherit some common SLIM stuff. -$(call inherit-product, vendor/slim/config/common_full_phone.mk) +# Inherit some common AOSPB stuff. +$(call inherit-product, vendor/aospb/config/common_full_phone.mk) # Inherit device configuration $(call inherit-product, device/__MANUFACTURER__/__DEVICE__/device___DEVICE__.mk) ## Device identifier. This must come after all inclusions PRODUCT_DEVICE := __DEVICE__ -PRODUCT_NAME := slim___DEVICE__ +PRODUCT_NAME := aospb___DEVICE__ PRODUCT_BRAND := __MANUFACTURER__ PRODUCT_MODEL := __DEVICE__ PRODUCT_MANUFACTURER := __MANUFACTURER__ diff --git a/tools/device/mkvendor.sh b/tools/device/mkvendor.sh index 2742a8b79..ca1eddb25 100755 --- a/tools/device/mkvendor.sh +++ b/tools/device/mkvendor.sh @@ -110,6 +110,6 @@ popd echo Done! echo Use the following command to set up your build environment: -echo ' 'lunch slim_$DEVICE-eng +echo ' 'lunch aospb_$DEVICE-eng echo And use the follwowing command to build a recovery: -echo ' '. build/tools/device/makerecoveries.sh slim_$DEVICE-eng +echo ' '. build/tools/device/makerecoveries.sh aospb_$DEVICE-eng diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index b4c50697a..5c5e20474 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -151,7 +151,7 @@ def RunBackup(self, command): self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s");' % command)) def ValidateSignatures(self, command): - self.script.append('package_extract_file("META-INF/org/slimroms/releasekey", "/tmp/releasekey");') + self.script.append('package_extract_file("META-INF/org/aospb/releasekey", "/tmp/releasekey");') # Exit code 124 == abort. run_program returns raw, so left-shift 8bit self.script.append('run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can\'t install this package on top of incompatible data. Please try another package or run a factory reset");') diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index a64c79c11..bf4538325 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -629,20 +629,6 @@ def WriteFullOTAPackage(input_zip, output_zip): system_progress = 0.75 - script.Print(" _____________________ ") - script.Print(" / www.slimroms.org |") - script.Print(" / |") - script.Print(" / ___________________|") - script.Print(" / / ___ ") - script.Print(" / / ___/ \ ") - script.Print(" / / / \___/____ ____ ") - script.Print(" / / | |___/ \_/ |") - script.Print(" ___________/ / | | | |") - script.Print("| / | | | | | |") - script.Print("| / | | | | | |") - script.Print("|_____________/ \___^___^___^___^___/") - script.Print(" ") - if OPTIONS.wipe_user_data: system_progress -= 0.1 if HasVendorPartition(input_zip): @@ -763,7 +749,7 @@ def output_sink(fn, data): common.ZipWriteStr(output_zip, "system/build.prop", ""+input_zip.read("SYSTEM/build.prop")) - common.ZipWriteStr(output_zip, "META-INF/org/slimroms/releasekey", + common.ZipWriteStr(output_zip, "META-INF/org/aospb/releasekey", ""+input_zip.read("META/releasekey.txt")) def WritePolicyConfig(file_name, output_zip): diff --git a/tools/roomservice.py b/tools/roomservice.py index 5f5c237cb..b23da0eab 100755 --- a/tools/roomservice.py +++ b/tools/roomservice.py @@ -42,11 +42,11 @@ DEBUG = False default_manifest = ".repo/manifest.xml" -custom_local_manifest = ".repo/local_manifests/slim_manifest.xml" +custom_local_manifest = ".repo/local_manifests/aospb_manifest.xml" custom_default_revision = "mm6.0" -custom_dependencies = "slim.dependencies" -org_manifest = "SlimRoms" # leave empty if org is provided in manifest -org_display = "SlimRoms" # needed for displaying +custom_dependencies = "aospb.dependencies" +org_manifest = "AOSPB" # leave empty if org is provided in manifest +org_display = "AOSPB" # needed for displaying github_auth = None