Update source to Armbian-dev-202610.A311Y3

This commit is contained in:
2026-11-11 08:50:43 +08:00
parent 3428a94f6b
commit f459ef6a9e
12514 changed files with 2264376 additions and 468481 deletions
+51 -52
View File
@@ -14,11 +14,8 @@ set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AMLBIAN_DIR="$(dirname "$(dirname "${SCRIPT_DIR}")")"
BUILD_DIR="${SRC}"
MODULE_BUILD_DIR="${SRC}/output/.tmp"
# Source common functions
if [[ -f "${AMLBIAN_DIR}/lib/function-common.sh" ]]; then
source "${AMLBIAN_DIR}/lib/function-common.sh"
fi
# ==============================================================================
# Section 2: Default Configuration
@@ -45,25 +42,25 @@ function __hdmi_test_prepare_source {
local aml_comp_path="$(amlbian_get_aml_comp_dir)"
if [[ -z "${aml_comp_path}" ]] || [[ ! -d "${aml_comp_path}" ]]; then
display_alert "HDMI-TEST" "aml-comp not found: ${aml_comp_path}" "err"
aml_log error "HDMI-TEST" "aml-comp not found: ${aml_comp_path}"
exit 1
fi
local source_dir="${aml_comp_path}/vendor/amlogic/linux_sample_app/aml-hdmi-test"
if [[ ! -d "${source_dir}" ]]; then
display_alert "HDMI-TEST" "Source directory not found: ${source_dir}" "err"
aml_log error "HDMI-TEST" "Source directory not found: ${source_dir}"
exit 1
fi
display_alert "HDMI-TEST" "Copying source from ${source_dir} to ${build_dir}" "info"
aml_log info "HDMI-TEST" "Copying source from ${source_dir} to ${build_dir}"
# 复制源代码到构建目录
cp -r "${source_dir}"/* "${build_dir}/" 2>/dev/null || true
# Check for necessary source files
if [[ ! -f "${build_dir}/Makefile" ]]; then
display_alert "HDMI-TEST" "Makefile not found in source" "err"
aml_log error "HDMI-TEST" "Makefile not found in source"
exit 1
fi
@@ -73,17 +70,17 @@ function __hdmi_test_prepare_source {
function __hdmi_test_build {
local build_dir="${1}"
display_alert "HDMI-TEST" "Starting hdmi-test build..." "info"
aml_log info "HDMI-TEST" "Starting hdmi-test build..."
if [[ ! -d "${build_dir}" ]]; then
display_alert "HDMI-TEST" "Build directory not found: ${build_dir}" "err"
aml_log error "HDMI-TEST" "Build directory not found: ${build_dir}"
return 1
fi
# Get aml_comp_path again for include paths
local aml_comp_path="$(amlbian_get_aml_comp_dir)"
if [[ -z "${aml_comp_path}" ]] || [[ ! -d "${aml_comp_path}" ]]; then
display_alert "HDMI-TEST" "aml-comp not found: ${aml_comp_path}" "err"
aml_log error "HDMI-TEST" "aml-comp not found: ${aml_comp_path}"
return 1
fi
@@ -96,10 +93,10 @@ function __hdmi_test_build {
if [[ -n "${ROOTFS_TEMP}" ]] && [[ -d "${ROOTFS_TEMP}" ]] && [[ -d "${ROOTFS_TEMP}/usr/lib/aarch64-linux-gnu" ]]; then
SYSROOT="${ROOTFS_TEMP}"
display_alert "HDMI-TEST" "Using ROOTFS_TEMP as sysroot: ${SYSROOT}" "info"
aml_log info "HDMI-TEST" "Using ROOTFS_TEMP as sysroot: ${SYSROOT}"
else
display_alert "HDMI-TEST" "ROOTFS_TEMP not found or invalid: ${ROOTFS_TEMP}" "err"
display_alert "HDMI-TEST" "ROOTFS_TEMP should be created by create_base_rootfs function" "err"
aml_log error "HDMI-TEST" "ROOTFS_TEMP not found or invalid: ${ROOTFS_TEMP}"
aml_log error "HDMI-TEST" "ROOTFS_TEMP should be created by create_base_rootfs function"
return 1
fi
@@ -131,8 +128,8 @@ function __hdmi_test_build {
local out_dir="${build_dir}/output"
mkdir -p "${out_dir}"
display_alert "HDMI-TEST" "Building using Makefile..." "info"
display_alert "HDMI-TEST" "CC=${CC}" "debug"
aml_log info "HDMI-TEST" "Building using Makefile..."
aml_log debug "HDMI-TEST" "CC=${CC}"
# Build flags
local current_cflags="${CFLAGS} -Wno-unused-result -Wno-unused-variable -Wno-unused-function -Os"
@@ -151,11 +148,11 @@ function __hdmi_test_build {
if is_feature_contains "$DISTRO_FEATURES" "mediactrlsrc"; then
make_targets="" # Build all targets (default)
expected_bins=("test_amlv4l2src" "aml_hdmi_test")
display_alert "HDMI-TEST" "mediactrlsrc enabled, building both test_amlv4l2src and aml_hdmi_test" "info"
aml_log info "HDMI-TEST" "mediactrlsrc enabled, building both test_amlv4l2src and aml_hdmi_test"
else
make_targets="aml_hdmi_test"
expected_bins=("aml_hdmi_test")
display_alert "HDMI-TEST" "mediactrlsrc disabled, building only aml_hdmi_test" "info"
aml_log info "HDMI-TEST" "mediactrlsrc disabled, building only aml_hdmi_test"
fi
# Run make with OUT_DIR pointing to our output directory
@@ -168,7 +165,7 @@ function __hdmi_test_build {
${make_targets} \
-j$(nproc) \
2>&1 | tee "${out_dir}/make.log" || {
display_alert "HDMI-TEST" "Build failed" "err"
aml_log error "HDMI-TEST" "Build failed"
return 1
}
@@ -177,29 +174,30 @@ function __hdmi_test_build {
for bin in "${expected_bins[@]}"; do
if [[ -f "${out_dir}/${bin}" ]]; then
display_alert "HDMI-TEST" "Binary created: ${out_dir}/${bin}" "info"
aml_log info "HDMI-TEST" "Binary created: ${out_dir}/${bin}"
bins_created=$((bins_created + 1))
else
# Check in build directory
if [[ -f "${build_dir}/${bin}" ]]; then
cp "${build_dir}/${bin}" "${out_dir}/"
display_alert "HDMI-TEST" "Binary found and copied: ${build_dir}/${bin}" "info"
aml_log info "HDMI-TEST" "Binary found and copied: ${build_dir}/${bin}"
bins_created=$((bins_created + 1))
else
display_alert "HDMI-TEST" "Binary not found: ${bin}" "warn"
aml_log error "HDMI-TEST" "Binary not found: ${bin}"
return 1
fi
fi
done
# Check for library
if [[ -f "${out_dir}/libamlv4l2adaptation.so" ]] || [[ -f "${build_dir}/libamlv4l2adaptation.so" ]]; then
display_alert "HDMI-TEST" "Library created: libamlv4l2adaptation.so" "info"
aml_log info "HDMI-TEST" "Library created: libamlv4l2adaptation.so"
fi
if [[ ${bins_created} -gt 0 ]]; then
display_alert "HDMI-TEST" "Build completed successfully (${bins_created} binaries)" "success"
else
display_alert "HDMI-TEST" "No binaries were created" "err"
aml_log error "HDMI-TEST" "No binaries were created"
return 1
fi
@@ -210,12 +208,12 @@ function __hdmi_test_install {
local build_dir="${1}"
local install_dir="${2}"
display_alert "HDMI-TEST" "Installing hdmi-test..." "info"
aml_log info "HDMI-TEST" "Installing hdmi-test..."
local out_dir="${build_dir}/output"
if [[ ! -d "${out_dir}" ]]; then
display_alert "HDMI-TEST" "Output directory not found: ${out_dir}" "err"
aml_log error "HDMI-TEST" "Output directory not found: ${out_dir}"
return 1
fi
@@ -230,14 +228,14 @@ function __hdmi_test_install {
# Check if mediactrlsrc feature is enabled
if is_feature_contains "$DISTRO_FEATURES" "mediactrlsrc"; then
binaries_to_install=("test_amlv4l2src" "aml_hdmi_test")
display_alert "HDMI-TEST" "mediactrlsrc enabled, installing both test_amlv4l2src and aml_hdmi_test" "info"
aml_log info "HDMI-TEST" "mediactrlsrc enabled, installing both test_amlv4l2src and aml_hdmi_test"
else
binaries_to_install=("aml_hdmi_test")
display_alert "HDMI-TEST" "mediactrlsrc disabled, installing only aml_hdmi_test" "info"
aml_log info "HDMI-TEST" "mediactrlsrc disabled, installing only aml_hdmi_test"
fi
# Install binaries
display_alert "HDMI-TEST" "Installing binaries: ${binaries_to_install[*]}" "info"
aml_log info "HDMI-TEST" "Installing binaries: ${binaries_to_install[*]}"
for bin in "${binaries_to_install[@]}"; do
local bin_path="${out_dir}/${bin}"
@@ -247,9 +245,10 @@ function __hdmi_test_install {
if [[ -f "${bin_path}" ]]; then
install -m 0755 "${bin_path}" "${install_dir}/usr/bin/"
display_alert "HDMI-TEST" "Installed ${bin} to ${install_dir}/usr/bin/" "debug"
aml_log debug "HDMI-TEST" "Installed ${bin} to ${install_dir}/usr/bin/"
else
display_alert "HDMI-TEST" "Binary not found: ${bin}" "warn"
aml_log error "HDMI-TEST" "Binary not found: ${bin}"
return 1
fi
done
@@ -261,18 +260,18 @@ function __hdmi_test_install {
if [[ -f "${lib_path}" ]]; then
install -m 0644 "${lib_path}" "${install_dir}/usr/lib/"
display_alert "HDMI-TEST" "Installed libamlv4l2adaptation.so to ${install_dir}/usr/lib/" "debug"
aml_log debug "HDMI-TEST" "Installed libamlv4l2adaptation.so to ${install_dir}/usr/lib/"
fi
# Install headers
display_alert "HDMI-TEST" "Installing headers..." "info"
aml_log info "HDMI-TEST" "Installing headers..."
local headers=("amlv4l2src_adaptation.h")
for header in "${headers[@]}"; do
local header_path="${build_dir}/${header}"
if [[ -f "${header_path}" ]]; then
install -m 0644 "${header_path}" "${install_dir}/usr/include/"
display_alert "HDMI-TEST" "Installed ${header} to ${install_dir}/usr/include/" "debug"
aml_log debug "HDMI-TEST" "Installed ${header} to ${install_dir}/usr/include/"
fi
done
@@ -292,7 +291,7 @@ function __hdmi_test_create_deb {
local description="Amlogic HDMI Test Application"
local description_long="This package provides HDMI test application for Amlogic platforms, based on v4l2src patch for media controller support."
display_alert "HDMI-TEST" "Creating Debian package for ${pkg_name} ${version}..." "info"
aml_log info "HDMI-TEST" "Creating Debian package for ${pkg_name} ${version}..."
# Create Debian package directory structure
local deb_dir="${build_dir}/deb/${pkg_name}-${version}"
@@ -303,10 +302,10 @@ function __hdmi_test_create_deb {
# Copy installed files to package directory
if [[ -d "${install_dir}" ]] && [[ "$(ls -A "${install_dir}")" ]]; then
cp -r "${install_dir}"/* "${deb_dir}/" 2>/dev/null || true
display_alert "HDMI-TEST" "Copied installed files to ${deb_dir}" "info"
aml_log info "HDMI-TEST" "Copied installed files to ${deb_dir}"
else
display_alert "HDMI-TEST" "No installed files found in ${install_dir}" "warning"
return 0
aml_log error "HDMI-TEST" "No installed files found in ${install_dir}"
return 1
fi
# Create control file
@@ -356,7 +355,7 @@ PRERM_EOF
chmod 755 "${debian_dir}/prerm"
display_alert "HDMI-TEST" "Building Debian package..." "info"
aml_log info "HDMI-TEST" "Building Debian package..."
# Build Debian package
cd "${build_dir}/deb"
@@ -369,7 +368,7 @@ PRERM_EOF
mv "${deb_file}" "${output_dir}/linux-${pkg_name}-${BOARD}-amlbian_${version}_${architecture}.deb"
display_alert "HDMI-TEST" "Debian package created: ${output_dir}/linux-${pkg_name}-${BOARD}-amlbian_${version}_${architecture}.deb" "success"
else
display_alert "HDMI-TEST" "Failed to build Debian package" "err"
aml_log error "HDMI-TEST" "Failed to build Debian package"
return 1
fi
@@ -379,14 +378,14 @@ PRERM_EOF
function amlbian_build_hdmi_test {
# Check if hdmi-test is enabled in BUILD_UNITS
if ! is_unit_enabled "hdmi-test"; then
display_alert "[SKIP] >> hdmi-test disable in BUILD_UNITS" "" "info"
aml_log info "[SKIP] >> hdmi-test disable in BUILD_UNITS"
return
fi
display_alert "AMLOGIC: Building hdmi-test ${HDMI_TEST_VERSION} ${BOARD}" "info"
aml_log info "AMLOGIC: Building hdmi-test ${HDMI_TEST_VERSION} ${BOARD}"
# Define all directory paths (in .tmp directory)
local build_root="${BUILD_DIR}/.tmp/hdmi-test-build-${ARCH:-arm64}"
local build_root="${MODULE_BUILD_DIR}/hdmi-test-build-${ARCH:-arm64}"
local build_dir="${build_root}/build" # Build directory with source code
local install_dir="${build_root}/install" # Install directory
@@ -395,26 +394,26 @@ function amlbian_build_hdmi_test {
# 创建目录
mkdir -p "${build_dir}" "${install_dir}"
display_alert "AMLOGIC: build_dir ${build_dir}" "info"
display_alert "AMLOGIC: install_dir ${install_dir}" "info"
display_alert "AMLOGIC: output_dir ${BUILD_DIR}/output" "info"
aml_log debug "AMLOGIC: build_dir ${build_dir}"
aml_log debug "AMLOGIC: install_dir ${install_dir}"
aml_log debug "AMLOGIC: output_dir ${BUILD_DIR}/output"
# 准备源代码
__hdmi_test_prepare_source "${build_dir}"
# 构建
if ! __hdmi_test_build "${build_dir}"; then
display_alert "AMLOGIC: hdmi-test build failed" "err"
aml_log error "AMLOGIC: hdmi-test build failed"
return 1
fi
# 安装到安装目录
if ! __hdmi_test_install "${build_dir}" "${install_dir}"; then
display_alert "AMLOGIC: hdmi-test installation failed" "err"
aml_log error "AMLOGIC: hdmi-test installation failed"
return 1
fi
display_alert "AMLOGIC: Creating Debian package..." "info"
aml_log info "AMLOGIC: Creating Debian package..."
__hdmi_test_create_deb "${build_dir}" "${install_dir}"
__unset_hdmi_test_config
@@ -426,12 +425,12 @@ function amlbian_build_hdmi_test {
# Section 5: Main
# ==============================================================================
display_alert "AMLIbian HDMI Test Build Script" "Version: ${HDMI_TEST_VERSION}, Board: ${BOARD}" "info"
aml_log info "AMLIbian HDMI Test Build Script" "Version: ${HDMI_TEST_VERSION}, Board: ${BOARD}"
amlbian_build_hdmi_test
display_alert "AMLOGIC: hdmi-test build completed" "${BUILD_DIR}/output" "info"
aml_log info "AMLOGIC: hdmi-test build completed" "${BUILD_DIR}/output"
# ==============================================================================
# End of build-hdmi-test.sh
# ==============================================================================
# ==============================================================================