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
+33 -36
View File
@@ -13,11 +13,8 @@ set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AMLBIAN_DIR="$(dirname "${SCRIPT_DIR}")"
BUILD_DIR="${AMLBIAN_DIR}/../build"
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
@@ -36,7 +33,7 @@ function __linux_uapi_headers_prepare_source {
local aml_comp_path="$(amlbian_get_aml_comp_dir)"
if [[ -z "${aml_comp_path}" ]] || [[ ! -d "${aml_comp_path}" ]]; then
display_alert "LINUX-UAPI-HEADERS" "aml-comp not found: ${aml_comp_path}" "err"
aml_log error "LINUX-UAPI-HEADERS" "aml-comp not found: ${aml_comp_path}"
exit 1
fi
@@ -45,7 +42,7 @@ function __linux_uapi_headers_prepare_source {
local STAGING_KERNEL_DIR="${aml_comp_path}/kernel/aml-${KERNEL_VERSION}"
if [[ ! -d "${kernel_build_dir}" ]]; then
display_alert "LINUX-UAPI-HEADERS" "Kernel build directory not found. Expected at: ${kernel_build_dir}" "err"
aml_log error "LINUX-UAPI-HEADERS" "Kernel build directory not found. Expected at: ${kernel_build_dir}"
return 1
fi
@@ -56,18 +53,18 @@ function __linux_uapi_headers_prepare_source {
function __linux_uapi_headers_install {
local install_dir="${1}"
display_alert "LINUX-UAPI-HEADERS" "Starting Linux UAPI headers installation..." "info"
aml_log info "LINUX-UAPI-HEADERS" "Starting Linux UAPI headers installation..."
local aml_comp_path="$(amlbian_get_aml_comp_dir)"
if [[ -z "${aml_comp_path}" ]] || [[ ! -d "${aml_comp_path}" ]]; then
display_alert "LINUX-UAPI-HEADERS" "aml-comp not found: ${aml_comp_path}" "err"
aml_log error "LINUX-UAPI-HEADERS" "aml-comp not found: ${aml_comp_path}"
exit 1
fi
local STAGING_KERNEL_DIR="${aml_comp_path}/kernel/aml-${KERNEL_VERSION}"
if [[ ! -d "${STAGING_KERNEL_DIR}" ]]; then
display_alert "LINUX-UAPI-HEADERS" "Kernel source directory not found: ${STAGING_KERNEL_DIR}" "err"
aml_log error "LINUX-UAPI-HEADERS" "Kernel source directory not found: ${STAGING_KERNEL_DIR}"
return 1
fi
@@ -75,19 +72,19 @@ function __linux_uapi_headers_install {
mkdir -p "${includedir}/linux/amlogic"
# 1. 安装 Amlogic 自定义头文件(有第二种路径尝试)
display_alert "LINUX-UAPI-HEADERS" "Installing Amlogic customized headers..." "info"
aml_log info "LINUX-UAPI-HEADERS" "Installing Amlogic customized headers..."
local aml_uapi_path="${STAGING_KERNEL_DIR}/common_drivers/include/uapi/amlogic"
if [[ -d "${aml_uapi_path}" ]]; then
cp -af "${aml_uapi_path}" "${includedir}/linux/"
display_alert "LINUX-UAPI-HEADERS" "Copied Amlogic headers from ${aml_uapi_path}" "info"
aml_log debug "LINUX-UAPI-HEADERS" "Copied Amlogic headers from ${aml_uapi_path}"
else
display_alert "LINUX-UAPI-HEADERS" "Amlogic headers not found at both locations" "warn"
aml_log warn "LINUX-UAPI-HEADERS" "Amlogic headers not found at both locations"
fi
# 2. 安装额外头文件 (dma-heap.h, ion.h)
display_alert "LINUX-UAPI-HEADERS" "Installing extra headers..." "info"
aml_log info "LINUX-UAPI-HEADERS" "Installing extra headers..."
local uapi_path="${STAGING_KERNEL_DIR}/include/uapi/linux/"
@@ -96,24 +93,24 @@ function __linux_uapi_headers_install {
# 简化处理:只检查目标目录是否已存在
if [[ ! -e "${includedir}/linux/${f}" ]]; then
install -m 0644 "${uapi_path}${f}" "${includedir}/linux/"
display_alert "LINUX-UAPI-HEADERS" "Installed ${f}" "info"
aml_log debug "LINUX-UAPI-HEADERS" "Installed ${f}"
else
display_alert "LINUX-UAPI-HEADERS" "Skipping ${f} - already exists" "info"
aml_log debug "LINUX-UAPI-HEADERS" "Skipping ${f} - already exists"
fi
else
display_alert "LINUX-UAPI-HEADERS" "Header ${f} not found at ${uapi_path}" "debug"
aml_log debug "LINUX-UAPI-HEADERS" "Header ${f} not found at ${uapi_path}"
fi
done
# 3. 安装 DVB 额外头文件
display_alert "LINUX-UAPI-HEADERS" "Installing DVB extra headers..." "info"
aml_log info "LINUX-UAPI-HEADERS" "Installing DVB extra headers..."
for f in aml_ca_ext.h aml_dmx_ext.h aml_fe_ext.h; do
if [[ -f "${uapi_path}/dvb/${f}" ]]; then
install -m 0644 "${uapi_path}/dvb/${f}" "${includedir}/linux/amlogic/"
display_alert "LINUX-UAPI-HEADERS" "Installed DVB header ${f}" "info"
aml_log debug "LINUX-UAPI-HEADERS" "Installed DVB header ${f}"
else
display_alert "LINUX-UAPI-HEADERS" "DVB header ${f} not found" "debug"
aml_log debug "LINUX-UAPI-HEADERS" "DVB header ${f} not found"
fi
done
@@ -132,7 +129,7 @@ function __linux_uapi_headers_create_deb {
local maintainer="Amlbian Builder <[email protected]>"
local description="Linux UAPI headers for kernel ${KERNEL_VERSION}"
display_alert "LINUX-UAPI-HEADERS" "Creating Debian package for ${pkg_name} ${version}..." "info"
aml_log info "LINUX-UAPI-HEADERS" "Creating Debian package for ${pkg_name} ${version}..."
# 创建Debian包控制文件
local deb_dir="${build_dir}/deb/${pkg_name}-${version}"
@@ -143,10 +140,10 @@ function __linux_uapi_headers_create_deb {
# 将安装目录的内容复制到debian-root
if [[ -d "${install_dir}" ]] && [[ "$(ls -A "${install_dir}")" ]]; then
cp -r "${install_dir}"/* "${deb_dir}/" 2>/dev/null || true
display_alert "LINUX-UAPI-HEADERS" "Copied installed files to ${deb_dir}" "info"
aml_log debug "LINUX-UAPI-HEADERS" "Copied installed files to ${deb_dir}"
else
display_alert "LINUX-UAPI-HEADERS" "No installed files found in ${install_dir}" "warn"
return 0
aml_log error "LINUX-UAPI-HEADERS" "No installed files found in ${install_dir}"
return 1
fi
# 创建control文件
@@ -161,7 +158,7 @@ Section: devel
Priority: optional
EOF
display_alert "LINUX-UAPI-HEADERS" "Building Debian package..." "info"
aml_log info "LINUX-UAPI-HEADERS" "Building Debian package..."
# 构建Debian包
cd "${build_dir}/deb"
@@ -174,7 +171,7 @@ EOF
mv "${deb_file}" "${output_dir}/linux-${pkg_name}-${BOARD}-amlbian_${version}_${architecture}.deb"
display_alert "LINUX-UAPI-HEADERS" "Debian package created: ${output_dir}/linux-${pkg_name}-${BOARD}-amlbian_${version}_${architecture}.deb" "success"
else
display_alert "LINUX-UAPI-HEADERS" "Failed to build Debian package" "err"
aml_log error "LINUX-UAPI-HEADERS" "Failed to build Debian package"
return 1
fi
@@ -183,14 +180,14 @@ EOF
function amlbian_build_linux_uapi_headers {
if ! is_unit_enabled "linux-uapi-headers"; then
display_alert "[SKIP] >> linux-uapi-headers disable in BUILD_UNITS" "" "info"
aml_log info "[SKIP] >> linux-uapi-headers disable in BUILD_UNITS"
return
fi
display_alert "AMLOGIC: Building Linux UAPI headers ${KERNEL_VERSION} ${BOARD}" "info"
aml_log info "AMLOGIC: Building Linux UAPI headers ${KERNEL_VERSION} ${BOARD}"
# Define all directory paths (in .tmp directory)
local build_root="${BUILD_DIR}/.tmp/linux-uapi-headers-build-${ARCH:-arm64}"
local build_root="${MODULE_BUILD_DIR}/linux-uapi-headers-build-${ARCH:-arm64}"
local build_dir="${build_root}/build" # Build directory
local install_dir="${build_root}/install" # Install directory
@@ -199,20 +196,20 @@ function amlbian_build_linux_uapi_headers {
# 创建目录
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"
# 准备源代码
__linux_uapi_headers_prepare_source "${build_dir}"
# 安装头文件
if ! __linux_uapi_headers_install "${install_dir}"; then
display_alert "AMLOGIC: Linux UAPI headers installation failed" "err"
aml_log error "AMLOGIC: Linux UAPI headers installation failed"
return 1
fi
display_alert "AMLOGIC: Creating Debian package..." "info"
aml_log info "AMLOGIC: Creating Debian package..."
__linux_uapi_headers_create_deb "${build_dir}" "${install_dir}"
return 0
@@ -222,12 +219,12 @@ function amlbian_build_linux_uapi_headers {
# Section 5: Main
# ==============================================================================
display_alert "AMLIbian Linux UAPI Headers Build Script" "Version: ${KERNEL_VERSION}, Board: ${BOARD}" "info"
aml_log info "AMLIbian Linux UAPI Headers Build Script" "Version: ${KERNEL_VERSION}, Board: ${BOARD}"
amlbian_build_linux_uapi_headers
display_alert "AMLOGIC: Linux UAPI headers build completed" "${OUTPUT_DIR}" "info"
aml_log info "AMLOGIC: Linux UAPI headers build completed" "${OUTPUT_DIR}"
# ==============================================================================
# End of build-linux-uapi-headers.sh
# ==============================================================================
# ==============================================================================