100 lines
3.7 KiB
PHP
100 lines
3.7 KiB
PHP
# Amlogic Local Sources Configuration Include
|
|
# This file contains common configuration for using local U-Boot and kernel sources
|
|
# instead of downloading from remote repositories.
|
|
# Include this file in board configurations with: source amlogic-local-sources.inc
|
|
|
|
# AMLOGIC TODO: Configuration loaded - verify local source paths
|
|
display_alert "AMLOGIC TODO: Loading amlogic local sources configuration" "${BOARD:-unknown}" "info"
|
|
|
|
# ####################################
|
|
# 跳过 git 克隆
|
|
BOOTSOURCE="" # 清空源路径
|
|
FORCE_CHECKOUT="no" # 强制不检查
|
|
|
|
# 跳过 git 信息生成
|
|
GENERATE_GIT_INFO="no"
|
|
SKIP_GIT_INFO="yes"
|
|
|
|
# 使用本地目录
|
|
USE_LOCAL_UBOOT="yes"
|
|
LOCAL_UBOOT_READY="yes"
|
|
|
|
# 在 amlogic-local-sources.inc 中
|
|
SKIP_UBOOT_ARTIFACT_VERSION="yes"
|
|
SKIP_KERNEL_ARTIFACT_VERSION="yes"
|
|
|
|
# 或者完全禁用 artifact
|
|
CREATE_UBOOT_ARTIFACT="no"
|
|
CREATE_KERNEL_ARTIFACT="no"
|
|
|
|
AML_COMP_DIR="${SRC}/../aml-comp"
|
|
UBOOT_VENDOR_DIR="${AML_COMP_DIR}/uboot"
|
|
KERNEL_VENDOR_DIR="${AML_COMP_DIR}/kernel"
|
|
|
|
# #######################################
|
|
|
|
|
|
|
|
# Default to using local sources if not specified
|
|
USE_LOCAL_SOURCES="${USE_LOCAL_SOURCES:-yes}"
|
|
|
|
# Custom image packaging function for Amlogic boards
|
|
# AMLOGIC TODO: Implement custom image packaging method
|
|
function custom_image_packaging__amlogic() {
|
|
display_alert "AMLOGIC TODO: Starting custom image packaging" "${BOARD}" "info"
|
|
|
|
# This function is called during image creation to apply custom packaging
|
|
# The image components (uboot, kernel, rootfs) are already prepared by Armbian
|
|
|
|
# Example custom packaging steps:
|
|
# 1. Sign the image with custom keys
|
|
# 2. Add custom partitions or layout
|
|
# 3. Compress with specific settings
|
|
# 4. Generate checksums
|
|
|
|
display_alert "AMLOGIC TODO: Custom packaging not yet implemented" "Using Armbian native packaging" "warn"
|
|
|
|
# For now, just call the default Armbian packaging
|
|
# This ensures we use Armbian native rootfs building and packaging
|
|
return 0
|
|
}
|
|
|
|
# Hook to integrate custom packaging into Armbian build process
|
|
function post_image_creation__amlogic_custom_packaging() {
|
|
display_alert "AMLOGIC TODO: Post image creation hook for custom packaging" "${BOARD}" "info"
|
|
custom_image_packaging__amlogic
|
|
}
|
|
|
|
# Rootfs building uses Armbian native implementation - no changes needed
|
|
# AMLOGIC TODO: Rootfs is built by Armbian, no custom modifications required
|
|
display_alert "AMLOGIC TODO: Rootfs building uses Armbian native implementation" "No custom rootfs modifications" "info"
|
|
|
|
# Common U-Boot functions for Amlogic boards
|
|
|
|
# Smarter/faster/better to-spi writer using flashcp (hopefully with --partition)
|
|
# This function can be overridden by board-specific implementations
|
|
function write_uboot_platform_mtd__amlogic() {
|
|
declare -a extra_opts_flashcp=("--verbose")
|
|
echo "Writing U-Boot to SPI flash /dev/mtd0 using flashcp... ${extra_opts_flashcp}" >&2
|
|
if flashcp -h | grep -q -e '--partition'; then
|
|
echo "Confirmed flashcp supports --partition -- read and write only changed blocks." >&2
|
|
extra_opts_flashcp+=("--partition")
|
|
else
|
|
echo "flashcp does not support --partition, will write full SPI flash blocks." >&2
|
|
fi
|
|
flashcp "${extra_opts_flashcp[@]}" "${1}/u-boot-spi.bin" /dev/mtd0
|
|
}
|
|
|
|
# Common post-processing for U-Boot FIP blobs
|
|
function post_uboot_custom_postprocess__amlogic() {
|
|
display_alert "Amlogic Signing u-boot FIP" "${BOARD}" "info"
|
|
#uboot_s6_postprocess "${SRC}"/cache/sources/amlogic-boot-fip/${BOARD} ${BOARDFAMILY}
|
|
}
|
|
|
|
# Common extra U-Boot config options
|
|
function post_config_uboot_target__extra_configs_for_amlogic() {
|
|
display_alert "post_config_uboot_target__extra_configs_for_amlogic todo........" "info"
|
|
return 0
|
|
}
|
|
|
|
# End of amlogic-local-sources.inc
|