diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..bb6ecd0 --- /dev/null +++ b/Android.bp @@ -0,0 +1,8 @@ +// +// Copyright (C) 2022 The LineageOS Project +// +// SPDX-License-Identifier: Apache-2.0 +// + +soong_namespace { +} diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..3aec131 --- /dev/null +++ b/Android.mk @@ -0,0 +1,11 @@ +# +# Copyright (C) 2022 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +LOCAL_PATH := $(call my-dir) + +ifneq ($(filter rosemary, $(TARGET_DEVICE)),) +include $(call all-makefiles-under,$(LOCAL_PATH)) +endif diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..53e3213 --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1,13 @@ +# +# Copyright (C) 2022 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +PRODUCT_MAKEFILES := \ + $(LOCAL_DIR)/lineage_rosemary.mk + +COMMON_LUNCH_CHOICES := \ + lineage_rosemary-user \ + lineage_rosemary-userdebug \ + lineage_rosemary-eng diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..229b03c --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,10 @@ +# +# Copyright (C) 2022 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +DEVICE_PATH := device/xiaomi/rosemary + +# Inherit the proprietary files +include vendor/xiaomi/rosemary/BoardConfigVendor.mk diff --git a/README.md b/README.md new file mode 100644 index 0000000..5fdbfe3 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Device tree for Redmi Note 10S + +``` +# +# Copyright (C) 2022 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# +``` diff --git a/device.mk b/device.mk new file mode 100644 index 0000000..631494e --- /dev/null +++ b/device.mk @@ -0,0 +1,15 @@ +# +# Copyright (C) 2022 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +# Shipping API level +PRODUCT_SHIPPING_API_LEVEL := 30 + +# Soong namespaces +PRODUCT_SOONG_NAMESPACES += \ + $(LOCAL_PATH) + +# Inherit the proprietary files +$(call inherit-product, vendor/xiaomi/rosemary/rosemary-vendor.mk) diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..25654d9 --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=rosemary +VENDOR=xiaomi + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true + +KANG= +SECTION= + +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}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" + +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" + +"${MY_DIR}/setup-makefiles.sh" diff --git a/lineage_rosemary.mk b/lineage_rosemary.mk new file mode 100644 index 0000000..492cbcf --- /dev/null +++ b/lineage_rosemary.mk @@ -0,0 +1,23 @@ +# +# Copyright (C) 2022 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +# 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_telephony.mk) + +# Inherit from device makefile. +$(call inherit-product, device/xiaomi/rosemary/device.mk) + +# Inherit some common LineageOS stuff. +$(call inherit-product, vendor/lineage/config/common_full_phone.mk) + +PRODUCT_NAME := lineage_rosemary +PRODUCT_DEVICE := rosemary +PRODUCT_MANUFACTURER := Xiaomi +PRODUCT_BRAND := Redmi +PRODUCT_MODEL := Redmi Note 10S + +PRODUCT_GMS_CLIENTID_BASE := android-xiaomi diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100755 index 0000000..08d35b4 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=rosemary +VENDOR=xiaomi + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/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}" "${ANDROID_ROOT}" + +# Warning headers and guards +write_headers + +write_makefiles "${MY_DIR}/proprietary-files.txt" true + +# Finish +write_footers