Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions config/boards/kickpik2b.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Allwinner H618 quad core 1/2/4GB RAM SoC WiFi SPI USB-C
BOARD_NAME="KickPi K2B"
BOARDFAMILY="sun50iw9-bpi"
BOARD_MAINTAINER="pyavitz"
BOOTCONFIG="kickpi_k2b_defconfig"
OVERLAY_PREFIX="sun50i-h616"
BOOT_FDT_FILE="sun50i-h618-kickpi-k2b.dtb"
BOOT_LOGO="desktop"
KERNEL_TARGET="current,edge"
KERNEL_TEST_TARGET="current"
FORCE_BOOTSCRIPT_UPDATE="yes"
BOOTBRANCH_BOARD="tag:v2025.01"
BOOTPATCHDIR="v2025.01"
PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools"
Comment on lines +1 to +14
Copy link
Contributor

@coderabbitai coderabbitai bot Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add shebang to fix pipeline failure.

The pipeline failure indicates that ShellCheck requires a shebang directive. Since this is a configuration file that will be sourced by the build system, add a bash shebang at the top.

+#!/bin/bash
+
 # Allwinner H618 quad core 1/2/4GB RAM SoC WiFi SPI USB-C
 BOARD_NAME="KickPi K2B"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Allwinner H618 quad core 1/2/4GB RAM SoC WiFi SPI USB-C
BOARD_NAME="KickPi K2B"
BOARDFAMILY="sun50iw9-bpi"
BOARD_MAINTAINER="pyavitz"
BOOTCONFIG="kickpi_k2b_defconfig"
OVERLAY_PREFIX="sun50i-h616"
BOOT_FDT_FILE="sun50i-h618-kickpi-k2b.dtb"
BOOT_LOGO="desktop"
KERNEL_TARGET="current,edge"
KERNEL_TEST_TARGET="current"
FORCE_BOOTSCRIPT_UPDATE="yes"
BOOTBRANCH_BOARD="tag:v2025.01"
BOOTPATCHDIR="v2025.01"
PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools"
#!/bin/bash
# Allwinner H618 quad core 1/2/4GB RAM SoC WiFi SPI USB-C
BOARD_NAME="KickPi K2B"
BOARDFAMILY="sun50iw9-bpi"
BOARD_MAINTAINER="pyavitz"
BOOTCONFIG="kickpi_k2b_defconfig"
OVERLAY_PREFIX="sun50i-h616"
BOOT_FDT_FILE="sun50i-h618-kickpi-k2b.dtb"
BOOT_LOGO="desktop"
KERNEL_TARGET="current,edge"
KERNEL_TEST_TARGET="current"
FORCE_BOOTSCRIPT_UPDATE="yes"
BOOTBRANCH_BOARD="tag:v2025.01"
BOOTPATCHDIR="v2025.01"
PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools"
🧰 Tools
🪛 GitHub Actions: Shellcheck - PR #8388 ("Add board KickPi K2B and AIC8800 SDIO Wireless")

[error] 1-1: ShellCheck SC2148: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

🤖 Prompt for AI Agents
In config/boards/kickpik2b.conf at lines 1 to 14, the file lacks a shebang line
which causes the pipeline to fail ShellCheck validation. Add the line
"#!/bin/bash" at the very top of the file to specify the script interpreter and
fix the pipeline failure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. All these *.conf files should have a shebang. This isn't up to me to change and it is currently an Armbian standard not to have them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@pyavitz Thank you for clarifying the Armbian project standards. Let me investigate the current state of .conf files in the Armbian codebase to better understand the established patterns.


🏁 Script executed:

#!/bin/bash
# Check if other board configuration files have shebangs
echo "=== Checking existing board .conf files for shebangs ==="
fd -e conf . config/boards/ | head -10 | xargs -I {} sh -c 'echo "File: {}"; head -1 "{}" | grep -E "^#!" || echo "No shebang found"; echo ""'

echo "=== Checking family configuration files for shebangs ==="
fd -e conf . config/sources/families/ | head -5 | xargs -I {} sh -c 'echo "File: {}"; head -1 "{}" | grep -E "^#!" || echo "No shebang found"; echo ""'

echo "=== Checking ShellCheck configuration or exceptions ==="
find . -name ".shellcheckrc" -o -name "shellcheck.yml" -o -name "*shellcheck*" | head -5 | xargs -I {} sh -c 'echo "File: {}"; cat "{}" 2>/dev/null || echo "File not readable"'

Length of output: 12280


@pyavitz You're absolutely correct, and the evidence confirms your statement. I checked the existing codebase and found that all board configuration files (.conf) and family configuration files consistently lack shebang lines - this is indeed an established Armbian project standard.

The issue here is that the CI pipeline's ShellCheck configuration is enforcing rule SC2148 (missing shebang), which conflicts with the project's established convention. This creates a systematic problem that affects not just your PR but potentially any new .conf files added to the project.

Potential solutions to resolve this CI conflict:

  1. Add SC2148 to ShellCheck exclusions - The most appropriate solution would be to add SC2148 to the excluded rules in the ShellCheck configuration (in lib/tools/shellcheck.sh) for config files, since they are sourced rather than executed directly.

  2. Configure CI to handle this specific case - The CI pipeline could be configured to treat .conf files differently or skip the shebang check for configuration files.

  3. Project-wide decision - The project maintainers could decide whether to adopt shebangs consistently across all .conf files, but this would be a breaking change from established patterns.

Since this appears to be a project-wide infrastructure issue rather than a problem with your specific contribution, I'd recommend escalating this to the project maintainers or opening a separate issue about the CI configuration conflict with established coding standards.

Your PR correctly follows the existing Armbian conventions, and the CI failure is due to a configuration mismatch rather than a code issue.


✏️ Learnings added
Learnt from: pyavitz
PR: armbian/build#8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.085Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-06-16T03:24:00.458Z
Learning: In Armbian board configuration files (.csc), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features.

Learnt from: pyavitz
PR: armbian/build#8361
File: config/kernel/linux-sunxi64-edge.config:594-597
Timestamp: 2025-07-06T16:27:45.349Z
Learning: In Armbian sunxi64-edge kernel configurations, PCI/PCIe support may be enabled for future-proofing purposes to support upcoming Allwinner SoCs like the T536 that include PCIe Gen2 interfaces, even if current primary targets like H616 lack PCIe controllers. This forward-looking approach prepares the configuration for next-generation hardware in the same SoC family.

Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.

Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

Learnt from: Grippy98
PR: armbian/build#8152
File: lib/functions/configuration/interactive.sh:209-266
Timestamp: 2025-05-05T12:35:07.143Z
Learning: For the interactive kernel selection in Armbian, KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION are parsed from family.conf but deliberately not set as environment variables to avoid potential interference with other parts of the build system.

Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:13-23
Timestamp: 2025-06-12T21:08:11.318Z
Learning: In config/bootscripts/boot-sunxi.cmd the variable name `align_overlap_oboe_avoidance` intentionally uses the acronym “OBOE” (Off-By-One Error); it is not a typo and should not be renamed.

Learnt from: djurny
PR: armbian/build#8272
File: config/bootscripts/boot-mvebu.cmd:182-186
Timestamp: 2025-06-04T23:45:38.860Z
Learning: In config/bootscripts/boot-mvebu.cmd, the `fdtfile` variable is mandatory for booting and is pre-set by U-Boot, but can be overridden via armbianEnv.txt. If `fdtfile` is empty, the subsequent device tree file search logic will eventually fail and trigger the critical error "Cannot find DT!" with proper error handling.

Learnt from: libiunc
PR: armbian/build#8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-03-31T12:57:13.880Z
Learning: For StarFive2 platform kernel configurations, maintain alignment with vendor-provided configurations rather than modifying security settings like SECCOMP. This ensures hardware compatibility as intended by the manufacturer.

Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:38-44
Timestamp: 2025-06-12T21:14:36.024Z
Learning: In config/bootscripts/boot-sunxi.cmd the unconditional "+1" increment in func_align_addr_next (when align_overlap_oboe_avoidance="on") is intentional. It compensates for a known off-by-one error in U-Boot where the end address is calculated as start+size instead of start+size-1, so the extra page prevents overlap. This behavior should not be “optimized away”.

Learnt from: leggewie
PR: armbian/build#8133
File: extensions/apa.sh:1-2
Timestamp: 2025-04-28T08:27:26.890Z
Learning: In the Armbian build system, extension scripts in the `extensions/` directory contain hook functions and are meant to be sourced, not executed directly. These scripts don't require a shebang or `set -euo pipefail`.

Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the `${cpu}` environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.

Learnt from: EvilOlaf
PR: armbian/build#8298
File: extensions/https_proxy.sh:1-9
Timestamp: 2025-06-14T05:53:10.627Z
Learning: Armbian build framework extensions are NOT designed to run standalone but are called by the supervisor. The framework provides environment variables like USERPATCHES_PATH and SDCARD, and commands are executed with protection via run_host_command_logged and chroot_sdcard functions that use bash -e -o pipefail.

Learnt from: djurny
PR: armbian/build#8315
File: lib/functions/rootfs/distro-agnostic.sh:54-68
Timestamp: 2025-06-22T00:45:26.182Z
Learning: In Armbian build system, external command dependencies like envsubst are handled by adding the required packages (e.g., gettext for envsubst) to host_dependencies in adaptative_prepare_host_dependencies function in lib/functions/host/prepare-host.sh, rather than checking command availability at runtime.

Learnt from: Grippy98
PR: armbian/build#8202
File: config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh:2-3
Timestamp: 2025-05-16T15:34:34.672Z
Learning: The shell scripts in the Armbian build system's desktop configuration files, such as config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh, rely on environment variables like $SRC and $destination that are expected to be set externally before the script is executed.

Learnt from: EvilOlaf
PR: armbian/build#8328
File: lib/functions/compilation/patch/drivers_network.sh:542-545
Timestamp: 2025-06-24T10:08:40.313Z
Learning: In the Armbian build system, when a PR removes build support for a specific kernel version, version check issues for that removed version become practically irrelevant even if they appear incorrect in isolation. Context about which kernel versions are being deprecated/removed is important for understanding the impact of version-related code changes.


function post_family_tweaks_bsp__kickpi_k2b_aic8800() {
display_alert "$BOARD" "Installing AIC8800 Support" "info"
mkdir -p "${destination}"/etc/modprobe.d
mkdir -p "${destination}"/etc/modules-load.d
mkdir -p "${destination}"/etc/systemd/system
mkdir -p "${destination}"/lib/firmware/updates
mkdir -p "${destination}"/usr/bin
# Install firmware
git clone --depth=1 -q -b aic8800_sdio https://github.com/pyavitz/firmware.git "${destination}"/lib/firmware/updates/aic8800
rm -fdr "${destination}"/lib/firmware/updates/aic8800/.git
# Add udev rule
cat <<EOF > "${destination}"/etc/modprobe.d/aic8800-wireless.conf
options aic8800_fdrv aicwf_dbg_level=0 custregd=0 ps_on=0
EOF
# Add needed bluetooth modules
cat <<EOF > "${destination}"/etc/modules-load.d/aic8800-btlpm.conf
hidp
rfcomm
bnep
aic8800_btlpm
EOF
# Install Bluetooth helper script and service
cat <<EOF > "${destination}"/usr/bin/aic-bthelper
#!/bin/bash

# HW Reset
hciattach -r -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1

# Kill hciattach
sleep .50
killall hciattach

# Attach Bluetooth HCI UART
sleep .50
hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1
rfkill unblock all

exit 0
EOF
Comment on lines +38 to +54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve error handling and reduce timing dependencies in Bluetooth helper script.

The script has several issues that could affect reliability:

  1. Hardcoded device path: /dev/ttyS1 may not exist on all systems
  2. Timing dependencies: Multiple sleep commands create race conditions
  3. No error handling: Commands may fail silently
  4. Potential process conflicts: killall hciattach affects all hciattach processes
 #!/bin/bash
+
+# Check if device exists
+if [ ! -e /dev/ttyS1 ]; then
+    echo "Error: /dev/ttyS1 not found" >&2
+    exit 1
+fi

 # HW Reset
-hciattach -r -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1
+if ! hciattach -r -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1; then
+    echo "Error: Failed to reset Bluetooth device" >&2
+    exit 1
+fi

 # Kill hciattach
-sleep .50
-killall hciattach
+sleep 0.5
+# Kill only the specific hciattach process for ttyS1
+pkill -f "hciattach.*ttyS1" || true

 # Attach Bluetooth HCI UART
-sleep .50
-hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1
-rfkill unblock all
+sleep 0.5
+if ! hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1; then
+    echo "Error: Failed to attach Bluetooth HCI UART" >&2
+    exit 1
+fi
+
+if ! rfkill unblock all; then
+    echo "Warning: Failed to unblock rfkill" >&2
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cat <<EOF > "${destination}"/usr/bin/aic-bthelper
#!/bin/bash
# HW Reset
hciattach -r -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1
# Kill hciattach
sleep .50
killall hciattach
# Attach Bluetooth HCI UART
sleep .50
hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1
rfkill unblock all
exit 0
EOF
cat <<EOF > "${destination}"/usr/bin/aic-bthelper
#!/bin/bash
# Check if device exists
if [ ! -e /dev/ttyS1 ]; then
echo "Error: /dev/ttyS1 not found" >&2
exit 1
fi
# HW Reset
if ! hciattach -r -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1; then
echo "Error: Failed to reset Bluetooth device" >&2
exit 1
fi
# Kill hciattach
sleep 0.5
# Kill only the specific hciattach process for ttyS1
pkill -f "hciattach.*ttyS1" || true
# Attach Bluetooth HCI UART
sleep 0.5
if ! hciattach -s 1500000 /dev/ttyS1 any 1500000 flow nosleep > /dev/null 2>&1; then
echo "Error: Failed to attach Bluetooth HCI UART" >&2
exit 1
fi
if ! rfkill unblock all; then
echo "Warning: Failed to unblock rfkill" >&2
fi
exit 0
EOF
🤖 Prompt for AI Agents
In config/boards/kickpik2b.conf around lines 38 to 54, the Bluetooth helper
script uses a hardcoded device path, relies on fixed sleep durations causing
race conditions, lacks error handling, and uses killall which may terminate
unrelated processes. To fix this, replace the hardcoded device path with a
configurable variable or detect the correct device dynamically, remove or
minimize sleep commands by using process status checks or wait loops, add error
checking after each command to handle failures explicitly, and replace killall
with a more targeted approach to terminate only the specific hciattach process
started by the script.

chmod +x "${destination}"/usr/bin/aic-bthelper
cat <<EOF > "${destination}"/etc/systemd/system/bthelper.service
[Unit]
Description=Bluetooth Helper
After=bluetooth.service bluetooth.target getty.target
Requires=bluetooth.service bluetooth.target getty.target

[Service]
Type=idle
ExecStartPre=/usr/sbin/rfkill unblock all
ExecStart=/usr/bin/aic-bthelper
TimeoutStartSec=0
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
EOF
Comment on lines +56 to +72
Copy link
Contributor

@coderabbitai coderabbitai bot Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve systemd service configuration.

The service configuration has several issues that should be addressed:

  1. Deprecated directive: SysVStartPriority is deprecated in systemd
  2. Inappropriate service type: Type=idle may cause unnecessary boot delays
  3. Disabled timeout: TimeoutStartSec=0 could cause boot hangs if the service fails
  4. Redundant dependencies: getty.target is not needed for Bluetooth functionality
 [Unit]
 Description=Bluetooth Helper
-After=bluetooth.service bluetooth.target getty.target
-Requires=bluetooth.service bluetooth.target getty.target
+After=bluetooth.service
+Wants=bluetooth.service

 [Service]
-Type=idle
+Type=oneshot
 ExecStartPre=/usr/sbin/rfkill unblock all
 ExecStart=/usr/bin/aic-bthelper
-TimeoutStartSec=0
+TimeoutStartSec=30
 RemainAfterExit=yes
-SysVStartPriority=99

 [Install]
 WantedBy=multi-user.target
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cat <<EOF > "${destination}"/etc/systemd/system/bthelper.service
[Unit]
Description=Bluetooth Helper
After=bluetooth.service bluetooth.target getty.target
Requires=bluetooth.service bluetooth.target getty.target
[Service]
Type=idle
ExecStartPre=/usr/sbin/rfkill unblock all
ExecStart=/usr/bin/aic-bthelper
TimeoutStartSec=0
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF > "${destination}"/etc/systemd/system/bthelper.service
[Unit]
Description=Bluetooth Helper
After=bluetooth.service
Wants=bluetooth.service
[Service]
Type=oneshot
ExecStartPre=/usr/sbin/rfkill unblock all
ExecStart=/usr/bin/aic-bthelper
TimeoutStartSec=30
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
🤖 Prompt for AI Agents
In config/boards/kickpik2b.conf around lines 56 to 72, the systemd service file
for bthelper uses deprecated and suboptimal directives. Remove the deprecated
SysVStartPriority directive, change the service Type from idle to simple to
avoid unnecessary boot delays, set a reasonable TimeoutStartSec value instead of
0 to prevent potential boot hangs, and remove getty.target from the After and
Requires dependencies since it is not relevant to Bluetooth functionality.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boot delays are intentional. There is no compatibility to load AIC8800 bluetooth in mainline.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pyavitz, understood! Thank you for clarifying the technical context. I acknowledge that the Type=idle and boot delays are intentionally designed to work around the AIC8800 Bluetooth compatibility issues in mainline. The current systemd service configuration is appropriate for this specific hardware requirement.


✏️ Learnings added
Learnt from: pyavitz
PR: armbian/build#8388
File: config/boards/kickpik2b.conf:56-72
Timestamp: 2025-07-17T04:16:29.520Z
Learning: For AIC8800 Bluetooth devices in Armbian board configurations, systemd service configurations intentionally use Type=idle and boot delays because there is no compatibility to load AIC8800 bluetooth in mainline kernel. These delays and service timing are necessary workarounds for hardware limitations rather than performance issues.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: pyavitz
PR: armbian/build#8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.085Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.

Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-06-16T03:24:00.458Z
Learning: In Armbian board configuration files (.csc), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features.

Learnt from: pyavitz
PR: armbian/build#8361
File: config/kernel/linux-sunxi64-edge.config:594-597
Timestamp: 2025-07-06T16:27:45.349Z
Learning: In Armbian sunxi64-edge kernel configurations, PCI/PCIe support may be enabled for future-proofing purposes to support upcoming Allwinner SoCs like the T536 that include PCIe Gen2 interfaces, even if current primary targets like H616 lack PCIe controllers. This forward-looking approach prepares the configuration for next-generation hardware in the same SoC family.

Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:38-44
Timestamp: 2025-06-12T21:14:36.024Z
Learning: In config/bootscripts/boot-sunxi.cmd the unconditional "+1" increment in func_align_addr_next (when align_overlap_oboe_avoidance="on") is intentional. It compensates for a known off-by-one error in U-Boot where the end address is calculated as start+size instead of start+size-1, so the extra page prevents overlap. This behavior should not be “optimized away”.

Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

Learnt from: djurny
PR: armbian/build#8272
File: config/bootscripts/boot-mvebu.cmd:182-186
Timestamp: 2025-06-04T23:45:38.860Z
Learning: In config/bootscripts/boot-mvebu.cmd, the `fdtfile` variable is mandatory for booting and is pre-set by U-Boot, but can be overridden via armbianEnv.txt. If `fdtfile` is empty, the subsequent device tree file search logic will eventually fail and trigger the critical error "Cannot find DT!" with proper error handling.

Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.

Learnt from: libiunc
PR: armbian/build#8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-03-31T12:57:13.880Z
Learning: For StarFive2 platform kernel configurations, maintain alignment with vendor-provided configurations rather than modifying security settings like SECCOMP. This ensures hardware compatibility as intended by the manufacturer.

Learnt from: djurny
PR: armbian/build#8287
File: config/bootscripts/boot-sunxi.cmd:13-23
Timestamp: 2025-06-12T21:08:11.318Z
Learning: In config/bootscripts/boot-sunxi.cmd the variable name `align_overlap_oboe_avoidance` intentionally uses the acronym “OBOE” (Off-By-One Error); it is not a typo and should not be renamed.

Learnt from: EvilOlaf
PR: armbian/build#8328
File: lib/functions/compilation/patch/drivers_network.sh:542-545
Timestamp: 2025-06-24T10:08:40.313Z
Learning: In the Armbian build system, when a PR removes build support for a specific kernel version, version check issues for that removed version become practically irrelevant even if they appear incorrect in isolation. Context about which kernel versions are being deprecated/removed is important for understanding the impact of version-related code changes.

}

function post_family_tweaks__enable_aic8800_bthelper() {
display_alert "$BOARD" "Enabling AIC8800 Bluetooth Helper" "info"
chroot_sdcard systemctl --no-reload enable bthelper.service
}
1 change: 1 addition & 0 deletions lib/functions/compilation/patch/drivers-harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function kernel_drivers_prepare_harness() {
driver_generic_bring_back_ipx
driver_mt7921u_add_pids
driver_rtl8152_rtl8153
driver_aic8800_sdio
driver_rtl8189ES
driver_rtl8189FS
driver_rtl8192EU
Expand Down
54 changes: 54 additions & 0 deletions lib/functions/compilation/patch/drivers_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,60 @@ function driver_generic_bring_back_ipx() {
fi
}

driver_aic8800_sdio() {
# Aicsemi aic8800 Wi-Fi driver
# https://github.com/radxa-pkg/aic8800

if linux-version compare "${version}" ge 6.1 && [[ "$LINUXFAMILY" =~ ^(sunxi64)$ ]]; then
local aic8800_sdio_ver="commit:fc7cbdd1791416c2457fa27a59e508bf325c9c3f"
display_alert "Adding" "Wireless AIC8800 SDIO ${aic8800_sdio_ver}" "info"
fetch_from_repo "$GITHUB_SOURCE/radxa-pkg/aic8800.git" "aic8800" "${aic8800_sdio_ver}" "yes"
cd "$kerneldir" || exit
rm -fdr $kerneldir/drivers/net/wireless/aic8800_sdio
cp -fr "${SRC}/cache/sources/aic8800/${aic8800_sdio_ver#*:}/src/SDIO/driver_fw/driver/aic8800" $kerneldir/drivers/net/wireless/aic8800_sdio
echo "obj-\$(CONFIG_AIC_WLAN_SUPPORT) += aic8800_sdio/" >> $kerneldir/drivers/net/wireless/Makefile
sed -i 's/MAKEFLAGS +=-j$(shell nproc)/#MAKEFLAGS +=-j$(shell nproc)/g' $kerneldir/drivers/net/wireless/aic8800_sdio/Makefile
sed -i 's/CONFIG_GPIO_WAKEUP = n/CONFIG_GPIO_WAKEUP = y/g' $kerneldir/drivers/net/wireless/aic8800_sdio/Makefile
sed -i 's/CONFIG_SDIO_PWRCTRL := y/CONFIG_SDIO_PWRCTRL := n/g' $kerneldir/drivers/net/wireless/aic8800_sdio/aic8800_bsp/Makefile
sed -i '/source "drivers\/net\/wireless\/admtek\/Kconfig"/a source "drivers\/net\/wireless\/aic8800_sdio\/Kconfig"' \
"$kerneldir/drivers/net/wireless/Kconfig"
cat <<EOF > $kerneldir/drivers/net/wireless/aic8800_sdio/Kconfig
config AIC_WLAN_SUPPORT
bool "AIC wireless Support"
default m
help
This is support for aic wireless chip.

config AIC_FW_PATH
depends on AIC_WLAN_SUPPORT
string "Firmware & config file path"
default "/lib/firmware/updates/aic8800"
help
Path to the firmware & config file.

source "drivers/net/wireless/aic8800_sdio/aic8800_fdrv/Kconfig"
source "drivers/net/wireless/aic8800_sdio/aic8800_btlpm/Kconfig"
EOF
cat <<EOF > $kerneldir/drivers/net/wireless/aic8800_sdio/aic8800_fdrv/Kconfig
config AIC8800_WLAN_SUPPORT
tristate "AIC8800 wlan Support"
default m
help
This is support for aic wifi driver.
EOF
cat <<EOF > $kerneldir/drivers/net/wireless/aic8800_sdio/aic8800_btlpm/Kconfig
config AIC8800_BTLPM_SUPPORT
tristate "AIC8800 bluetooth Support"
default m
help
This is support for aic bluetooh driver.
EOF
fi
if [[ -f "${SRC}/patch/misc/aic8800_sdio/001-Aicsemi-aic8800-fixups.patch" ]]; then
process_patch_file "${SRC}/patch/misc/aic8800_sdio/001-Aicsemi-aic8800-fixups.patch" "applying"
fi
}

driver_rtl8189ES() {

# Wireless drivers for Realtek 8189ES chipsets
Expand Down
38 changes: 38 additions & 0 deletions patch/kernel/archive/sunxi-6.12/0000.patching_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
config:

# Just some info stuff; not used by the patching scripts
name: sunxi-6.12
kind: kernel
type: mainline # or: mainline
branch: linux-6.12.y
last-known-good-tag: v6.7.0
maintainers:
- { github: pyavitz, name: Patrick Yavitz, email: [email protected], armbian-forum: c0rnelius }

# .dts files in these directories will be copied as-is to the build tree; later ones overwrite earlier ones.
# This is meant to provide a way to "add a board DTS" without having to null-patch them in.
dts-directories:
# will copy patch/kernel/archive/meson64-MAJOR.MINOR/dt-boards/*.dts to arch/arm64/boot/dts/allwinner
- { source: "dt", target: "arch/arm64/boot/dts/allwinner" }

# every file in these directories will be copied as-is to the build tree; later ones overwrite earlier ones
# This is meant as a way to have overlays, bare, in a directory, without having to null-patch them in.
# @TODO need a solution to auto-Makefile the overlays as well
# overlay-directories:
# will copy patch/kernel/archive/meson64-MAJOR.MINOR/overlay/**/* to arch/arm64/boot/dts/allwinner/overlay
# - { source: "overlay", target: "arch/arm64/boot/dts/allwinner/overlay" }

# the Makefile in each of these directories will be magically patched to include the dts files copied
# or patched-in; overlay subdir will be included "-y" if it exists.
# No more Makefile patching needed, yay!
auto-patch-dt-makefile:
- { directory: "arch/arm64/boot/dts/allwinner", config-var: "CONFIG_ARCH_SUNXI" }

# configuration for when applying patches to git / auto-rewriting patches (development cycle helpers)
patches-to-git:
do-not-commit-files:
- "MAINTAINERS" # constant churn, drop them. sorry.
- "Documentation/devicetree/bindings/arm/allwinner.yaml" # constant churn, conflicts on every bump, drop it. sorry.
do-not-commit-regexes: # Python-style regexes
- "^arch/([a-zA-Z0-9]+)/boot/dts/([a-zA-Z0-9]+)/Makefile$" # ignore DT Makefile patches, we've an auto-patcher now

Loading