From 618f12594885ee9e66c527ea9687bc8d5630aef1 Mon Sep 17 00:00:00 2001 From: royna2544 Date: Sun, 23 Mar 2025 13:51:30 +0900 Subject: [PATCH] a20: Init --- AndroidProducts.mk | 4 ++ BoardConfig.mk | 23 ++++++++++ device.mk | 15 +++++++ extract-files.sh | 33 ++++++++++++++ lineage_a20.mk | 23 ++++++++++ proprietary-files.txt | 100 ++++++++++++++++++++++++++++++++++++++++++ setup-makefiles.sh | 15 +++++++ 7 files changed, 213 insertions(+) create mode 100644 AndroidProducts.mk create mode 100644 BoardConfig.mk create mode 100644 device.mk create mode 100644 extract-files.sh create mode 100644 lineage_a20.mk create mode 100644 proprietary-files.txt create mode 100644 setup-makefiles.sh diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..894caaf --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1,4 @@ +# Copyright (C) 2025 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 + +PRODUCT_MAKEFILES += $(LOCAL_DIR)/lineage_a20.mk diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..c14a3d3 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,23 @@ +DEVICE_PATH := device/samsung/a20 + +# Asserts +TARGET_OTA_ASSERT_DEVICE := a20,a20dd + +# Kernel +TARGET_KERNEL_CONFIG := exynos7885-a20_defconfig + +# Display +TARGET_SCREEN_DENSITY := 280 + +# Partitions +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 55574528 # 55MB +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 4320133120 #4.02GB +BOARD_CACHEIMAGE_PARTITION_SIZE := 157286400 +BOARD_VENDORIMAGE_PARTITION_SIZE := 452984832 + +# Inherit common board flags +include device/samsung/exynos7885-common/BoardConfigCommon.mk + +# SPL +VENDOR_SECURITY_PATCH := 2021-06-01 + diff --git a/device.mk b/device.mk new file mode 100644 index 0000000..ae070cb --- /dev/null +++ b/device.mk @@ -0,0 +1,15 @@ +# Copyright (C) 2025 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 + +# Inherit common device configuration +$(call inherit-product, device/samsung/exynos7885-common/exynos7885-common.mk) + +# Inherit proprietary files setup +$(call inherit-product, vendor/samsung/a20/a20-vendor.mk) + +# Inherit dalvik config +$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) + +# Display resolution +TARGET_SCREEN_HEIGHT := 1560 +TARGET_SCREEN_WIDTH := 720 diff --git a/extract-files.sh b/extract-files.sh new file mode 100644 index 0000000..0e65d3c --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +function blob_fixup() { + case "${1}" in + vendor/lib/libsample1.so) + sed -i 's|/data/misc/sample1|/data/misc/sample2|g' "${2}" + ;; + vendor/lib64/libsample2.so) + "${PATCHELF}" --remove-needed "libsample3.so" "${2}" + "${PATCHELF}" --add-needed "libsample4.so" "${2}" + ;; + esac +} + +# 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=a20 +export DEVICE_COMMON=exynos7885-common +export VENDOR=samsung + +"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@" diff --git a/lineage_a20.mk b/lineage_a20.mk new file mode 100644 index 0000000..30eb48b --- /dev/null +++ b/lineage_a20.mk @@ -0,0 +1,23 @@ +# Copyright (C) 2025 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 + +# Inherit from those products. Most specific first. +$(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) + +# Inherit device configuration +$(call inherit-product, device/samsung/a20/device.mk) + +BUILD_FINGERPRINT := "samsung/a20ub/a20:11/RP1A.200720.012/A205GUBU9CUF4:user/release-keys" + +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRIVATE_BUILD_DESC="a20ub-user 11 RP1A.200720.012 A205GUBU9CUF4 release-keys" + +# Device identifier. This must come after all inclusions +PRODUCT_DEVICE := a20 +PRODUCT_NAME := lineage_a20 +PRODUCT_MODEL := SM-A205F +PRODUCT_BRAND := samsung +PRODUCT_MANUFACTURER := samsung diff --git a/proprietary-files.txt b/proprietary-files.txt new file mode 100644 index 0000000..6e94ef0 --- /dev/null +++ b/proprietary-files.txt @@ -0,0 +1,100 @@ +# Blobs are from samsung/a20ub/a20:11/RP1A.200720.012/A205GUBU9CUF4:user/release-keys, unless otherwise stated. + +# Audio +vendor/lib/hw/audio.primary.exynos7884B.so +vendor/lib/vndk/libaudioroute.so + +# Dap +vendor/etc/dolby/dax-default.xml +vendor/lib/soundfx/libswdap.so + +# Camera +vendor/lib/hw/camera.exynos7884B.so +vendor/lib/libOpenCv.camera.samsung.so +vendor/lib/libSEF.quram.so +vendor/lib/libexynoscamera3.so +vendor/lib/libsaiv_BeautySolutionVideo.so +vendor/lib/libuniapi.so +vendor/lib/libuniplugin.so +vendor/lib/libvideobeauty_interface.so +vendor/lib64/hw/camera.exynos7884B.so +vendor/lib64/libOpenCv.camera.samsung.so +vendor/lib64/libSEF.quram.so +vendor/lib64/libexynoscamera3.so +vendor/lib64/libsaiv_BeautySolutionVideo.so +vendor/lib64/libuniapi.so +vendor/lib64/libuniplugin.so +vendor/lib64/libvideobeauty_interface.so + +# Gralloc +vendor/lib/hw/gralloc.exynos7884B.so +vendor/lib64/hw/gralloc.exynos7884B.so + +# HWC +vendor/lib/hw/hwcomposer.exynos7884B.so +vendor/lib64/hw/hwcomposer.exynos7884B.so + +# Fingerprint +vendor/lib64/libbauthserver.so +vendor/lib64/libbauthtzcommon.so +vendor/lib64/libegis_fp_normal_sensor_test.so +vendor/lib64/libgf_in_system_lib.so +vendor/lib64/libqfp_sensortest.so +vendor/lib64/libsynaFpSensorTestNwd.so + +# Sensors +vendor/etc/yas_set.cfg +vendor/lib64/hw/sensors.universal7884B.so +vendor/lib64/libsensorlistener.so +vendor/lib64/libyasalgo.so + +# GPS +vendor/bin/hw/gpsd +vendor/bin/hw/vendor.samsung.hardware.gnss@2.0-service +vendor/etc/init/vendor.samsung.hardware.gnss@2.0-service.rc +vendor/lib64/hw/android.hardware.gnss@2.1-impl.so +vendor/lib64/hw/vendor.samsung.hardware.gnss@2.0-impl.so +vendor/lib64/libwrappergps.so + +# Gatekeeper +vendor/lib/hw/gatekeeper.exynos7884B.so +vendor/lib64/hw/gatekeeper.exynos7884B.so + +# Memtrack +vendor/lib/hw/memtrack.exynos7884B.so +vendor/lib64/hw/memtrack.exynos7884B.so + +# Thermal +vendor/lib/hw/thermal.universal7884B.so +vendor/lib64/hw/thermal.universal7884B.so + +# Media +vendor/etc/mixer_gains.xml +vendor/etc/mixer_paths.xml + +# Firmware +vendor/firmware/dax_param.bin +vendor/firmware/fimc_is_lib.bin +vendor/firmware/fimc_is_rta.bin +vendor/firmware/mfc_fw.bin +vendor/firmware/setfile_3l6.bin +vendor/firmware/setfile_4ha_front.bin +vendor/firmware/setfile_imx258.bin +vendor/firmware/setfile_sr556.bin + +# NFC firmware +vendor/etc/nfc/sec_s3nrn81_rfreg.bin +vendor/firmware/nfc/sec_s3nrn81_firmware.bin + +# Wifi +vendor/etc/wifi/hydra_config.sdb +vendor/etc/wifi/indoorchannel.info +vendor/etc/wifi/mx +vendor/etc/wifi/mx140.bin +vendor/etc/wifi/mx140_bt.hcf +vendor/etc/wifi/mx140_t.bin +vendor/etc/wifi/mx140_t_wlan.hcf +vendor/etc/wifi/mx140_t_wlan_t.hcf +vendor/etc/wifi/mx140_wlan.hcf +vendor/etc/wifi/mx140_wlan_t.hcf +vendor/etc/wifi/platform.txt diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100644 index 0000000..32ee9aa --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +export DEVICE=a20 +export DEVICE_COMMON=exynos7885-common +export VENDOR=samsung + +"./../../${VENDOR}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"