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
@@ -14,11 +14,8 @@ set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AMLBIAN_DIR="$(dirname "$(dirname "${SCRIPT_DIR}")")"
BASE_DIR="$(dirname "$(dirname "${AMLBIAN_DIR}")")"
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
# ==============================================================================
# Shared Helper Functions
@@ -48,16 +45,15 @@ function _modules_load_init_package_info() {
# Create layered build directory structure
# Parameters:
# $1 - base name (e.g. "${PKG_NAME}_${PKG_VERSION}_${PKG_ARCH}")
# Sets: TMP_DIR, BASE_BUILD_DIR, SOURCE_DIR, BUILD_DIR, INSTALL_DIR, PATCH_DIR,
# Sets: MODULE_BUILD_DIR, BASE_BUILD_DIR, SOURCE_DIR, BUILD_DIR, INSTALL_DIR, PATCH_DIR,
# DEB_PACKAGE_DIR, DEBIAN_DIR
function _modules_load_create_build_dirs() {
local base_name="$1"
TMP_DIR="${AMLBIAN_DIR}/.tmp"
mkdir -p "${TMP_DIR}"
mkdir -p "${MODULE_BUILD_DIR}"
# 基础构建目录
BASE_BUILD_DIR="${TMP_DIR}/${base_name}"
BASE_BUILD_DIR="${MODULE_BUILD_DIR}/${base_name}"
rm -rf ${BASE_BUILD_DIR}
@@ -83,6 +79,7 @@ function _modules_load_create_build_dirs() {
mkdir -p "${INSTALL_DIR}/etc"
mkdir -p "${INSTALL_DIR}/usr/bin"
mkdir -p "${INSTALL_DIR}/usr/chinese-fonts"
mkdir -p "${INSTALL_DIR}/etc/systemd/system"
}
# Display build directory info
@@ -90,12 +87,12 @@ function _modules_load_create_build_dirs() {
# $1 - log prefix
function _modules_load_display_build_info() {
local log_prefix="$1"
display_alert "${log_prefix} Source dir: ${SOURCE_DIR}" "info"
display_alert "${log_prefix} Build dir: ${BUILD_DIR}" "info"
display_alert "${log_prefix} Install dir: ${INSTALL_DIR}" "info"
display_alert "${log_prefix} Patch dir: ${PATCH_DIR}" "info"
display_alert "${log_prefix} Deb package dir: ${DEB_PACKAGE_DIR}" "info"
display_alert "${log_prefix} Modules source dir: ${MODULES_SRC_DIR}" "info"
aml_log debug "${log_prefix} Source dir: ${SOURCE_DIR}"
aml_log debug "${log_prefix} Build dir: ${BUILD_DIR}"
aml_log debug "${log_prefix} Install dir: ${INSTALL_DIR}"
aml_log debug "${log_prefix} Patch dir: ${PATCH_DIR}"
aml_log debug "${log_prefix} Deb package dir: ${DEB_PACKAGE_DIR}"
aml_log debug "${log_prefix} Modules source dir: ${MODULES_SRC_DIR}"
}
# ------------------------------------------------------------------------------
@@ -104,14 +101,14 @@ function _modules_load_display_build_info() {
# Validate and copy modules-load.sh
function _modules_load_copy_modules_load_sh() {
display_alert "COMPILE-${COMPONENT} Copying modules-load.sh from ${MODULES_SRC_DIR}" "info"
aml_log info "COMPILE-${COMPONENT} Copying modules-load.sh from ${MODULES_SRC_DIR}"
if [[ -f "${MODULES_SRC_DIR}/modules-load.sh" ]]; then
cp "${MODULES_SRC_DIR}/modules-load.sh" "${INSTALL_DIR}/etc/"
chmod 0755 "${INSTALL_DIR}/etc/modules-load.sh"
display_alert "COMPILE-${COMPONENT} Copied modules-load.sh" "info"
aml_log info "COMPILE-${COMPONENT} Copied modules-load.sh"
else
display_alert "COMPILE-${COMPONENT} modules-load.sh not found at ${MODULES_SRC_DIR}/modules-load.sh" "error"
aml_log error "COMPILE-${COMPONENT} modules-load.sh not found at ${MODULES_SRC_DIR}/modules-load.sh"
exit 1
fi
}
@@ -119,42 +116,62 @@ function _modules_load_copy_modules_load_sh() {
# Validate and copy install_chinese_font.sh
function _modules_load_copy_install_chinese_font_sh() {
display_alert "COMPILE-${COMPONENT} Copying install_chinese_font.sh from ${MODULES_SRC_DIR}" "info"
aml_log info "COMPILE-${COMPONENT} Copying install_chinese_font.sh from ${MODULES_SRC_DIR}"
if [[ -f "${MODULES_SRC_DIR}/install_chinese_font.sh" ]]; then
cp "${MODULES_SRC_DIR}/install_chinese_font.sh" "${INSTALL_DIR}/usr/chinese-fonts/"
chmod 0755 "${INSTALL_DIR}/usr/chinese-fonts/install_chinese_font.sh"
display_alert "COMPILE-${COMPONENT} Copied install_chinese_font.sh" "info"
aml_log info "COMPILE-${COMPONENT} Copied install_chinese_font.sh"
else
display_alert "COMPILE-${COMPONENT} install_chinese_font.sh not found at ${MODULES_SRC_DIR}/install_chinese_font.sh" "error"
aml_log error "COMPILE-${COMPONENT} install_chinese_font.sh not found at ${MODULES_SRC_DIR}/install_chinese_font.sh"
exit 1
fi
}
# Validate and copy aml_wifi_load.sh
function _modules_load_copy_aml_wifi_load_sh() {
display_alert "COMPILE-${COMPONENT} Copying aml_wifi_load.sh from ${MODULES_SRC_DIR}" "info"
aml_log info "COMPILE-${COMPONENT} Copying aml_wifi_load.sh from ${MODULES_SRC_DIR}"
if [[ -f "${MODULES_SRC_DIR}/aml_wifi_load.sh" ]]; then
cp "${MODULES_SRC_DIR}/aml_wifi_load.sh" "${INSTALL_DIR}/usr/bin/"
chmod 0755 "${INSTALL_DIR}/usr/bin/aml_wifi_load.sh"
display_alert "COMPILE-${COMPONENT} Copied aml_wifi_load.sh" "info"
aml_log info "COMPILE-${COMPONENT} Copied aml_wifi_load.sh"
else
display_alert "COMPILE-${COMPONENT} aml_wifi_load.sh not found at ${MODULES_SRC_DIR}/aml_wifi_load.sh" "error"
aml_log error "COMPILE-${COMPONENT} aml_wifi_load.sh not found at ${MODULES_SRC_DIR}/aml_wifi_load.sh"
exit 1
fi
}
# Validate and copy set-usb-serial.sh
function _modules_load_copy_aml_usb_serial_load_sh() {
display_alert "COMPILE-${COMPONENT} Copying set-usb-serial.sh from ${MODULES_SRC_DIR}" "info"
aml_log info "COMPILE-${COMPONENT} Copying set-usb-serial.sh from ${MODULES_SRC_DIR}"
if [[ -f "${MODULES_SRC_DIR}/set-usb-serial.sh" ]]; then
cp "${MODULES_SRC_DIR}/set-usb-serial.sh" "${INSTALL_DIR}/usr/bin/"
chmod 0755 "${INSTALL_DIR}/usr/bin/set-usb-serial.sh"
display_alert "COMPILE-${COMPONENT} Copied set-usb-serial.sh" "info"
aml_log info "COMPILE-${COMPONENT} Copied set-usb-serial.sh"
else
display_alert "COMPILE-${COMPONENT} set-usb-serial.sh not found at ${MODULES_SRC_DIR}/set-usb-serial.sh" "error"
aml_log error "COMPILE-${COMPONENT} set-usb-serial.sh not found at ${MODULES_SRC_DIR}/set-usb-serial.sh"
exit 1
fi
}
# Validate and copy set_rt_conf.sh
function _modules_load_copy_aml_rt_conf_sh() {
if [ "$RT_LINUX" != "yes" ]; then
return 0
fi
mkdir -p "${INSTALL_DIR}/etc/kernel/realtime"
aml_log info "COMPILE-${COMPONENT} Copying set_rt_conf.sh from ${MODULES_SRC_DIR}"
if [[ -f "${MODULES_SRC_DIR}/set_rt_conf.sh" ]]; then
cp "${MODULES_SRC_DIR}/set_rt_conf.sh" "${INSTALL_DIR}/usr/bin/"
chmod 0755 "${INSTALL_DIR}/usr/bin/set_rt_conf.sh"
cp "${MODULES_SRC_DIR}/set-rt-conf.service" "${INSTALL_DIR}/etc/systemd/system"
aml_log info "COMPILE-${COMPONENT} Copied set_rt_conf.sh"
else
aml_log error "COMPILE-${COMPONENT} set_rt_conf.sh not found at ${MODULES_SRC_DIR}/set_rt_conf.sh"
exit 1
fi
}
@@ -165,7 +182,7 @@ function _modules_load_copy_aml_usb_serial_load_sh() {
# Create Debian control file
function _modules_load_create_control_file() {
display_alert "COMPILE-${COMPONENT} Creating control file DEBIAN/control" "info"
aml_log info "COMPILE-${COMPONENT} Creating control file DEBIAN/control"
cat > "${DEBIAN_DIR}/control" <<EOF
Package: ${PKG_NAME}
Version: ${PKG_VERSION}
@@ -186,7 +203,7 @@ EOF
# Create post-installation script
function _modules_load_create_postinst() {
display_alert "COMPILE-${COMPONENT} Creating post-installation script DEBIAN/postinst" "info"
aml_log info "COMPILE-${COMPONENT} Creating post-installation script DEBIAN/postinst"
cat > "${DEBIAN_DIR}/postinst" << EOF
#!/bin/sh
set -e
@@ -204,16 +221,29 @@ if [ "\$1" = "configure" ]; then
echo "Modules load scripts installed successfully"
echo "Main script: /etc/modules-load.sh"
echo "WiFi loader: /usr/bin/aml_wifi_load.sh"
EOF
if [ "${RT_LINUX}" = "yes" ]; then
cat >> "${DEBIAN_DIR}/postinst" <<'EOF'
systemctl daemon-reload
systemctl enable set-rt-conf.service
EOF
fi
cat >> "${DEBIAN_DIR}/postinst" <<'EOF'
fi
exit 0
EOF
chmod 755 "${DEBIAN_DIR}/postinst"
}
# Create pre-removal script
function _modules_load_create_prerm() {
display_alert "COMPILE-${COMPONENT} Creating pre-removal script DEBIAN/prerm" "info"
aml_log info "COMPILE-${COMPONENT} Creating pre-removal script DEBIAN/prerm"
cat > "${DEBIAN_DIR}/prerm" << EOF
#!/bin/sh
set -e
@@ -246,11 +276,11 @@ function _modules_load_build_deb_package() {
local output_deb_name="$2"
# 将install目录内容拷贝到deb目录
display_alert "${log_prefix} Copying install directory to deb package directory" "info"
aml_log info "${log_prefix} Copying install directory to deb package directory"
cp -r "${INSTALL_DIR}/"* "${DEB_PACKAGE_DIR}/"
# 基于deb目录打包
display_alert "${log_prefix} Building Debian package from deb directory" "info"
aml_log info "${log_prefix} Building Debian package from deb directory"
dpkg-deb --build "${DEB_PACKAGE_DIR}"
# Move to output directory
@@ -258,8 +288,8 @@ function _modules_load_build_deb_package() {
mkdir -p "$(dirname "${OUTPUT_DEB}")"
mv "${DEB_PACKAGE_DIR}.deb" "${OUTPUT_DEB}"
display_alert "${log_prefix} Package built successfully ${output_deb_name}" "info"
display_alert "${log_prefix} Build directory preserved ${BASE_BUILD_DIR}" "info"
aml_log info "${log_prefix} Package built successfully ${output_deb_name}"
aml_log info "${log_prefix} Build directory preserved ${BASE_BUILD_DIR}"
}
# ------------------------------------------------------------------------------
@@ -268,9 +298,9 @@ function _modules_load_build_deb_package() {
# Display installation information
function _modules_load_display_install_info() {
display_alert "COMPILE-${COMPONENT} Modules load scripts will be installed to:" "info"
display_alert "COMPILE-${COMPONENT} - /etc/modules-load.sh" "info"
display_alert "COMPILE-${COMPONENT} - /usr/bin/aml_wifi_load.sh" "info"
aml_log debug "COMPILE-${COMPONENT} Modules load scripts will be installed to:"
aml_log debug "COMPILE-${COMPONENT} - /etc/modules-load.sh"
aml_log debug "COMPILE-${COMPONENT} - /usr/bin/aml_wifi_load.sh"
}
# ==============================================================================
@@ -288,7 +318,7 @@ function amlbian_build_modules_load() {
# ---- Step 1: Package Information ----
_modules_load_init_package_info
display_alert "COMPILE-${COMPONENT} Building modules load scripts package version ${PKG_VERSION}" "info"
aml_log info "COMPILE-${COMPONENT} Building modules load scripts package version ${PKG_VERSION}"
# ---- Step 2: Build Directory Setup ----
_modules_load_create_build_dirs "${PKG_NAME}_${PKG_VERSION}_${PKG_ARCH}"
@@ -299,6 +329,7 @@ function amlbian_build_modules_load() {
_modules_load_copy_aml_wifi_load_sh
_modules_load_copy_aml_usb_serial_load_sh
_modules_load_copy_install_chinese_font_sh
_modules_load_copy_aml_rt_conf_sh
# ---- Step 4: Debian Packaging Scripts ----
_modules_load_create_control_file
@@ -319,6 +350,6 @@ function amlbian_build_modules_load() {
# Main Execution
# ==============================================================================
display_alert "AMLbian Modules Load Build Script" "Starting modules load scripts build" "info"
aml_log info "AMLbian Modules Load Build Script" "Starting modules load scripts build"
amlbian_build_modules_load
display_alert "AMLOGIC: Modules load scripts build completed" "Check output directory for packages" "info"
aml_log info "AMLOGIC: Modules load scripts build completed" "Check output directory for packages"
@@ -61,6 +61,10 @@ load_common_modules()
if ! /bin/lsmod | grep -q "^cfg80211"; then
/sbin/modprobe cfg80211
fi
if [ -f /sys/class/aml_wifi/power ]; then
echo 1 > /sys/class/aml_wifi/power
fi
}
load_wifi_driver()
@@ -0,0 +1,12 @@
[Unit]
Description=Set Rt Linux Conf
After=basic.target
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/set_rt_conf.sh
RemainAfterExit=yes
[Install]
WantedBy=basic.target
@@ -0,0 +1,40 @@
#!/bin/sh
# SPDX-License-Identifier: (GPL-2.0-only OR MIT)
# Copyright (C) 2026 Amlogic, Inc. All rights reserved
#
#!/bin/bash
# echo dmc 0 0xf r > /sys/class/aml_ddr/priority
# echo dmc 1 0xf r > /sys/class/aml_ddr/priority
# echo dmc 0 0xc w > /sys/class/aml_ddr/priority
# echo dmc 1 0xc w > /sys/class/aml_ddr/priority
# echo max 0 0xf > /sys/class/aml_ddr/priority
# echo max 1 0xf > /sys/class/aml_ddr/priority
# echo max 2 0xb > /sys/class/aml_ddr/priority
# echo max 3 0xb > /sys/class/aml_ddr/priority
# echo max 4 0xb > /sys/class/aml_ddr/priority
# echo max 6 0xb > /sys/class/aml_ddr/priority
# echo max 7 0xb > /sys/class/aml_ddr/priority
# echo max 8 0xb > /sys/class/aml_ddr/priority
# echo max 9 0xb > /sys/class/aml_ddr/priority
# echo max 10 0xb > /sys/class/aml_ddr/priority
# echo max 11 0xb > /sys/class/aml_ddr/priority
# echo max 12 0xb > /sys/class/aml_ddr/priority
# echo max 13 0xb > /sys/class/aml_ddr/priority
# echo max 14 0xb > /sys/class/aml_ddr/priority
# echo max 15 0xb > /sys/class/aml_ddr/priority
# echo 6 > /sys/class/aml_ddr/ots
# echo 4 4 > /sys/class/aml_ddr/ots
# echo 12 4 > /sys/class/aml_ddr/ots
# echo 0 0x03023c2f > /sys/class/aml_ddr/ots
# echo 1 0x03023c2f > /sys/class/aml_ddr/ots
# taskset -p c0 `pidof vdec-core`
# taskset -a -p 3f `pidof isp5service`
# echo force_no_head_mode=0x80 > /sys/module/decoder_common/parameters/params
# echo codec_mm.scatter.scatter_multi_alloc=0 > /sys/class/codec_mm/config
#while (true); do
# taskset -a -p 3f `taskset 3f pgrep -x "com.github.rafo"` > /dev/null 2>&1
# taskset -a -p 0f `taskset 3f pidof python` > /dev/null 2>&1
# sleep 1
#done &