From d09a0838a2d4170e9da7749e679a6694691671c2 Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Wed, 22 Apr 2020 16:15:44 +0200 Subject: [PATCH] initial troika tree Change-Id: Ie710294a9c06915fc67d9f27557481356cc1749b --- Android.mk | 28 ++++++++++++++++++ AndroidProducts.mk | 17 +++++++++++ BoardConfig.mk | 28 ++++++++++++++++++ device.mk | 20 +++++++++++++ extract-files.sh | 68 +++++++++++++++++++++++++++++++++++++++++++ lineage.dependencies | 6 ++++ lineage_troika.mk | 42 ++++++++++++++++++++++++++ proprietary-files.txt | 0 setup-makefiles.sh | 48 ++++++++++++++++++++++++++++++ 9 files changed, 257 insertions(+) create mode 100644 Android.mk create mode 100644 AndroidProducts.mk create mode 100644 BoardConfig.mk create mode 100644 device.mk create mode 100755 extract-files.sh create mode 100644 lineage.dependencies create mode 100644 lineage_troika.mk create mode 100644 proprietary-files.txt create mode 100755 setup-makefiles.sh diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..0112ef7 --- /dev/null +++ b/Android.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2020 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# WARNING: Everything listed here will be built on ALL platforms, +# including x86, the emulator, and the SDK. Modules must be uniquely +# named (liblights.tuna), and must build everywhere, or limit themselves +# to only building on ARM if they include assembly. Individual makefiles +# are responsible for having their own logic, for fine-grained control. + +LOCAL_PATH := $(call my-dir) + +ifeq ($(TARGET_DEVICE),troika) + +include $(call all-makefiles-under,$(LOCAL_PATH)) + +endif diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..9d5e759 --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2020 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PRODUCT_MAKEFILES := \ + $(LOCAL_DIR)/lineage_troika.mk diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..00baa82 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2020 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# inherit from common +-include device/motorola/exynos9610-common/BoardConfigCommon.mk + +DEVICE_PATH := device/motorola/troika + +# Assert +TARGET_OTA_ASSERT_DEVICE := troika,one_action + +# Kernel +TARGET_KERNEL_CONFIG := troika_defconfig + +# inherit from the proprietary version +-include vendor/motorola/troika/BoardConfigVendor.mk diff --git a/device.mk b/device.mk new file mode 100644 index 0000000..6c9f91c --- /dev/null +++ b/device.mk @@ -0,0 +1,20 @@ +# +# Copyright (C) 2020 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Inherit from common +$(call inherit-product, device/motorola/exynos9610-common/common.mk) + +$(call inherit-product-if-exists, vendor/motorola/troika/troika-vendor.mk) diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..1a8810d --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# +# Copyright (C) 2018-2020 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -e + +VENDOR=motorola +DEVICE=troika + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}"/../../.. + +HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +SECTION= +KANG= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" +fi + +# Initialize the helper +setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" true "${CLEAN_VENDOR}" + +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \ + "${KANG}" --section "${SECTION}" + +"${MY_DIR}/setup-makefiles.sh" diff --git a/lineage.dependencies b/lineage.dependencies new file mode 100644 index 0000000..280ffaa --- /dev/null +++ b/lineage.dependencies @@ -0,0 +1,6 @@ +[ + { + "repository": "android_device_motorola_exynos9610-common", + "target_path": "device/motorola/exynos9610-common" + } +] diff --git a/lineage_troika.mk b/lineage_troika.mk new file mode 100644 index 0000000..53626c2 --- /dev/null +++ b/lineage_troika.mk @@ -0,0 +1,42 @@ +# +# Copyright (C) 2020 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Inherit from those products. Most specific first. +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) + +# Inherit from troika device +$(call inherit-product, device/motorola/troika/device.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) + +# Inherit some common Lineage stuff. +$(call inherit-product, vendor/lineage/config/common_full_phone.mk) + +# Device identifier. This must come after all inclusions +PRODUCT_DEVICE := troika +PRODUCT_NAME := lineage_troika +PRODUCT_BRAND := Motorola +PRODUCT_MODEL := One Action +PRODUCT_MANUFACTURER := Motorola + +PRODUCT_GMS_CLIENTID_BASE := android-motorola + +# Use the latest approved GMS identifiers +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRODUCT_NAME=troika_sprout \ + PRIVATE_BUILD_DESC="10/QSBS30.62-17-7/415cd:user/release-keys" + +BUILD_FINGERPRINT := motorola/troika_retail/troika_sprout:10/QSBS30.62-17-7/415cd:user/release-keys diff --git a/proprietary-files.txt b/proprietary-files.txt new file mode 100644 index 0000000..e69de29 diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100755 index 0000000..2d958ec --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2017-2020 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -e + +VENDOR=motorola +DEVICE=troika + +export INITIAL_COPYRIGHT_YEAR=2020 + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}/../../.." + +HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Initialize the helper +setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" + +# Copyright headers and guards +write_headers "troika" + +# The standard blobs +write_makefiles "${MY_DIR}/proprietary-files.txt" true + +# Finish +write_footers -- 2.20.1