--- /dev/null
+#
+# Copyright (C) 2021 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+PRODUCT_MAKEFILES := \
+ $(LOCAL_DIR)/lineage_m5.mk
+
+COMMON_LUNCH_CHOICES := \
+ lineage_m5-eng \
+ lineage_m5-user \
+ lineage_m5-userdebug
--- /dev/null
+#
+# Copyright (C) 2021 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+include device/amlogic/g12-common/BoardConfigCommon.mk
+
+DEVICE_PATH := device/bananapi/m5
+
+## Bootloader
+TARGET_BOOTLOADER_BOARD_NAME := m5
--- /dev/null
+#
+# Copyright (C) 2021 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+DEVICE_PATH := device/bananapi/m5
+
+$(call inherit-product, device/amlogic/g12-common/g12.mk)
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) 2016 The CyanogenMod Project
+# Copyright (C) 2017-2021 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+# If we're being sourced by the common script that we called,
+# stop right here. No need to go down the rabbit hole.
+if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
+ return
+fi
+
+set -e
+
+export DEVICE=m5
+export DEVICE_COMMON=g12-common
+export VENDOR_COMMON=amlogic
+export VENDOR_DEVICE=bananapi
+
+"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@"
--- /dev/null
+[
+ {
+ "repository": "android_device_amlogic_g12-common",
+ "target_path": "device/amlogic/g12-common"
+ }
+]
--- /dev/null
+#
+# Copyright (C) 2021 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+# Inherit some common AOSP stuff
+$(call inherit-product, device/google/atv/products/atv_base.mk)
+
+# Inherit some common Lineage stuff
+$(call inherit-product, vendor/lineage/config/common_full_tv.mk)
+
+# Inherit device configuration
+$(call inherit-product, $(LOCAL_PATH)/device.mk)
+
+## Device identifier. This must come after all inclusions
+PRODUCT_BRAND := bananapi
+PRODUCT_DEVICE := m5
+PRODUCT_MANUFACTURER := bananapi
+PRODUCT_MODEL := BPI-M5
+PRODUCT_NAME := lineage_m5
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) 2016 The CyanogenMod Project
+# Copyright (C) 2017-2021 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+set -e
+
+export DEVICE=m5
+export DEVICE_COMMON=g12-common
+export VENDOR_COMMON=amlogic
+export VENDOR_DEVICE=bananapi
+
+"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"