From: Nolen Johnson Date: Thu, 28 Nov 2024 07:18:53 +0000 (-0500) Subject: odroidc4: Add a shim extract that extracts only common tree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=refs%2Fheads%2Flineage-22.0;p=GitHub%2FLineageOS%2FG12%2Fandroid_device_hardkernel_odroidc4.git odroidc4: Add a shim extract that extracts only common tree * Just a bootloader image that we build out of tree, so extraction makes no sense. Just handle firmware @ `${DEVICE_PATH}/Android.mk`. * Import bootloader/misc images. Change-Id: I1e362296e937306f059da6e4e0c240aebc2a7921 --- diff --git a/Android.mk b/Android.mk index ccff9f4..05ef30b 100644 --- a/Android.mk +++ b/Android.mk @@ -9,8 +9,10 @@ ifneq ($(filter odroidc4 odroidc4_tab, $(TARGET_DEVICE)),) LOCAL_PATH := $(call my-dir) include $(call all-makefiles-under,$(LOCAL_PATH)) -include $(LOCAL_PATH)/factory.mk +RADIO_FILES := $(wildcard $(LOCAL_PATH)/factory/bootfiles/*) +$(foreach f, $(notdir $(RADIO_FILES)), \ + $(call add-radio-file,factory/bootfiles/$(f))) --include vendor/amlogic/odroidc4/firmware.mk +include $(LOCAL_PATH)/factory.mk endif diff --git a/BoardConfig.mk b/BoardConfig.mk index 6156769..faf769b 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -21,6 +21,3 @@ TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop ## Include the common tree BoardConfig makefile include device/amlogic/sm1-common/BoardConfigCommon.mk - -## Include the proprietary BoardConfig makefile -include vendor/amlogic/odroidc4/BoardConfigVendor.mk diff --git a/device.mk b/device.mk index ffa47e9..7b97c20 100644 --- a/device.mk +++ b/device.mk @@ -22,6 +22,3 @@ BOARD_HAVE_WIFI := false ## Inherit from the common tree product makefile $(call inherit-product, device/amlogic/sm1-common/sm1.mk) - -## Inherit from the proprietary files makefile -$(call inherit-product, vendor/amlogic/odroidc4/odroidc4-vendor.mk) diff --git a/extract-files.py b/extract-files.py new file mode 100755 index 0000000..9e7ddf3 --- /dev/null +++ b/extract-files.py @@ -0,0 +1,20 @@ +#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3 +# +# SPDX-FileCopyrightText: 2024 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 +# + +from extract_utils.main import ( + ExtractUtils, + ExtractUtilsModule, +) + +module = ExtractUtilsModule( + 'odroidc4', + 'hardkernel', + skip_main_proprietary_file=True, +) + +if __name__ == '__main__': + utils = ExtractUtils.device_with_common(module, '../amlogic/sm1-common', module.vendor) + utils.run() diff --git a/extract-files.sh b/extract-files.sh deleted file mode 100755 index eddf9d5..0000000 --- a/extract-files.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# SPDX-FileCopyrightText: 2016 The CyanogenMod Project -# SPDX-FileCopyrightText: 2017-2024 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=odroidc4 -export DEVICE_COMMON=sm1-common -export VENDOR=amlogic -export VENDOR_BRAND=hardkernel -export VENDOR_COMMON=amlogic - -"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@" diff --git a/factory.mk b/factory.mk index 314bf2f..605a1cb 100644 --- a/factory.mk +++ b/factory.mk @@ -54,14 +54,12 @@ INSTALL_IMAGES := \ $(INSTALLED_AML_INSTALL_PACKAGE_TARGET): $(addprefix $(PRODUCT_OUT)/,$(INSTALL_IMAGES)) $(ACP) $(AML_IMAGE_TOOL) $(hide) mkdir -p $(PRODUCT_INSTALL_OUT) -ifneq ("$(wildcard $(FACTORY_PATH)/u-boot.bin)","") - $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/u-boot.bin) +ifneq ("$(wildcard $(FACTORY_PATH)/bootfiles/bootloader.img)","") + $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/bootfiles/bootloader.img, u-boot.bin) else ifeq ($(WITH_CONSOLE_BL),true) - $(hide) $(call aml-copy-install-file, vendor/amlogic/odroidc4/radio/bootloader-console.img, u-boot.bin) -else ifneq ("$(wildcard vendor/amlogic/odroidc4/radio/bootloader.img)","") - $(hide) $(call aml-copy-install-file, vendor/amlogic/odroidc4/radio/bootloader.img, u-boot.bin) + $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/bootfiles/bootloader-console.img, u-boot.bin) else - $(error "no u-boot.bin found in $(FACTORY_PATH)") + $(error "no bootloader.img found in $(FACTORY_PATH)/bootfiles") endif $(hide) $(call aml-copy-install-file, $(PRODUCT_OUT)/logo.img) $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/aml_sdc_burn.ini) @@ -85,14 +83,12 @@ INSTALLED_RADIOIMAGE_TARGET += $(INSTALLED_AML_INSTALL_PACKAGE_TARGET) $(INSTALLED_AML_UPGRADE_PACKAGE_TARGET): $(addprefix $(PRODUCT_OUT)/,$(UPGRADE_IMAGES)) $(ACP) $(AML_IMAGE_TOOL) $(hide) mkdir -p $(PRODUCT_UPGRADE_OUT) -ifneq ("$(wildcard $(FACTORY_PATH)/u-boot.bin)","") - $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/u-boot.bin) +ifneq ("$(wildcard $(FACTORY_PATH)/bootfiles/bootloader.img)","") + $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/bootfiles/bootloader.img, u-boot.bin) else ifeq ($(WITH_CONSOLE_BL),true) - $(hide) $(call aml-copy-install-file, vendor/amlogic/odroidc4/radio/bootloader-console.img, u-boot.bin) -else ifneq ("$(wildcard vendor/amlogic/odroidc4/radio/bootloader.img)","") - $(hide) $(call aml-copy-upgrade-file, vendor/amlogic/odroidc4/radio/bootloader.img, u-boot.bin) + $(hide) $(call aml-copy-install-file, $(FACTORY_PATH)/bootfiles/bootloader-console.img, u-boot.bin) else - $(error "no u-boot.bin found in $(FACTORY_PATH)") + $(error "no bootloader.img found in $(FACTORY_PATH)/bootfiles") endif $(hide) $(call aml-copy-upgrade-file, $(PRODUCT_OUT)/logo.img) $(hide) $(call aml-copy-upgrade-file, $(FACTORY_PATH)/aml_sdc_burn.ini) diff --git a/factory/bootfiles/bootloader-console.img b/factory/bootfiles/bootloader-console.img new file mode 100644 index 0000000..243ece6 Binary files /dev/null and b/factory/bootfiles/bootloader-console.img differ diff --git a/factory/bootfiles/bootloader-recovery.img b/factory/bootfiles/bootloader-recovery.img new file mode 100644 index 0000000..310e673 Binary files /dev/null and b/factory/bootfiles/bootloader-recovery.img differ diff --git a/factory/bootfiles/bootloader.img b/factory/bootfiles/bootloader.img new file mode 100644 index 0000000..ae5ef37 Binary files /dev/null and b/factory/bootfiles/bootloader.img differ diff --git a/factory/bootfiles/misc.img b/factory/bootfiles/misc.img new file mode 100644 index 0000000..d61122f Binary files /dev/null and b/factory/bootfiles/misc.img differ diff --git a/proprietary-files.txt b/proprietary-files.txt deleted file mode 100644 index 8b13789..0000000 --- a/proprietary-files.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/setup-makefiles.py b/setup-makefiles.py new file mode 100755 index 0000000..32947cf --- /dev/null +++ b/setup-makefiles.py @@ -0,0 +1 @@ +#!./extract-files.py --regenerate_makefiles diff --git a/setup-makefiles.sh b/setup-makefiles.sh deleted file mode 100755 index cd4214e..0000000 --- a/setup-makefiles.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# SPDX-FileCopyrightText: 2016 The CyanogenMod Project -# SPDX-FileCopyrightText: 2017-2024 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=odroidc4 -export DEVICE_COMMON=sm1-common -export VENDOR=amlogic -export VENDOR_BRAND=hardkernel -export VENDOR_COMMON=amlogic - -"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"