commit f8225f0f5a3d42ba37e5a80d46c525534efd506a Author: AdarshGrewal Date: Sat Apr 2 00:38:13 2022 +0530 miuicamera: Initial repo diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..5053e7d --- /dev/null +++ b/Android.mk @@ -0,0 +1 @@ +include $(call all-subdir-makefiles) diff --git a/common/Android.bp b/common/Android.bp new file mode 100644 index 0000000..2ac948c --- /dev/null +++ b/common/Android.bp @@ -0,0 +1,9 @@ +// Automatically generated file. DO NOT MODIFY +// +// This file is generated by vendor/xiaomi/garnet-miuicamera/setup-makefiles.sh + +soong_namespace { + imports: [ + ], +} + diff --git a/common/Android.mk b/common/Android.mk new file mode 100644 index 0000000..4a8ccfe --- /dev/null +++ b/common/Android.mk @@ -0,0 +1,9 @@ +# Automatically generated file. DO NOT MODIFY +# +# This file is generated by vendor/xiaomi/garnet-miuicamera/setup-makefiles.sh + +LOCAL_PATH := $(call my-dir) + +ifneq ($(filter arm64,$(TARGET_ARCH)),) + +endif diff --git a/common/BoardConfigVendor.mk b/common/BoardConfigVendor.mk new file mode 100644 index 0000000..e8025e7 --- /dev/null +++ b/common/BoardConfigVendor.mk @@ -0,0 +1,4 @@ +# Automatically generated file. DO NOT MODIFY +# +# This file is generated by vendor/xiaomi/garnet-miuicamera/setup-makefiles.sh + diff --git a/common/common-vendor.mk b/common/common-vendor.mk new file mode 100644 index 0000000..1d49151 --- /dev/null +++ b/common/common-vendor.mk @@ -0,0 +1,7 @@ +# Automatically generated file. DO NOT MODIFY +# +# This file is generated by vendor/xiaomi/garnet-miuicamera/setup-makefiles.sh + +PRODUCT_SOONG_NAMESPACES += \ + vendor/xiaomi/garnet-miuicamera/common + diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..180b796 --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=common +VENDOR=xiaomi/garnet-miuicamera + +# 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 + +function blob_fixup() { + case "${1}" in + esac +} + +if [ -z "$SRC" ]; then + echo "Path to system dump not specified! Specify one with --path" + exit 1 +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/products/board.mk b/products/board.mk new file mode 100644 index 0000000..ced9192 --- /dev/null +++ b/products/board.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. +# + +include vendor/xiaomi/garnet-miuicamera/common/BoardConfigVendor.mk diff --git a/products/miuicamera.mk b/products/miuicamera.mk new file mode 100644 index 0000000..56261ae --- /dev/null +++ b/products/miuicamera.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. +# + +$(call inherit-product, vendor/xiaomi/garnet-miuicamera/common/common-vendor.mk) 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..dae2175 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=common +VENDOR=xiaomi/garnet-miuicamera + +# 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}" true + +# Warning headers and guards +write_headers "arm64" +sed -i 's|TARGET_DEVICE|TARGET_ARCH|g' "${ANDROIDMK}" +sed -i 's|vendor/xiaomi/garnet-miuicamera/|vendor/xiaomi/garnet-miuicamera/common|g' "${PRODUCTMK}" +sed -i 's|device/xiaomi/garnet-miuicamera//setup-makefiles.sh|vendor/xiaomi/garnet-miuicamera/setup-makefiles.sh|g' "${ANDROIDBP}" "${ANDROIDMK}" "${BOARDMK}" "${PRODUCTMK}" + +write_makefiles "${MY_DIR}/proprietary-files.txt" true +sed -i 's|"xiaomi/garnet-miuicamera"|"xiaomi"|g' "${ANDROIDBP}" + +# Finish +write_footers