Skip to content

Commit

Permalink
AOSPB initial
Browse files Browse the repository at this point in the history
Change-Id: I5253588a2c754a44da7d72788d5c29f0630ee8d5
  • Loading branch information
gmillz authored and PRJosh committed May 29, 2016
1 parent 32c8543 commit 5dea710
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 78 deletions.
25 changes: 7 additions & 18 deletions core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))" \
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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) \
Expand Down
4 changes: 2 additions & 2 deletions core/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/dumpvar.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
10 changes: 5 additions & 5 deletions core/product_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
# <product_name>:<path_to_the_product_makefile>
Expand Down
46 changes: 23 additions & 23 deletions envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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= \
Expand Down Expand Up @@ -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:"
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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 $?
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
}

Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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/*;
Expand All @@ -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
}

Expand Down Expand Up @@ -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
}

Expand All @@ -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]+' \
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/buildinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
@@ -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__
4 changes: 2 additions & 2 deletions tools/device/mkvendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tools/releasetools/edify_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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");')

Expand Down
16 changes: 1 addition & 15 deletions tools/releasetools/ota_from_target_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions tools/roomservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5dea710

Please sign in to comment.