By default the git ref of BOOTSOURCE/BOOTBRANCH is memoized for 3600 seconds,
so pushing new commits to a tracked branch is not picked up until the cache
expires. Add UBOOT_GIT_CACHE_TTL, mirroring KERNEL_GIT_CACHE_TTL in
artifact-kernel.sh, so users can override this timeout (set to a low value
or 0 to always re-resolve the upstream SHA1).
As suggested by rpardini in armbian/build#7710.
mountopts[] values start with a leading comma by convention (line 26),
but all call sites added an explicit comma before the expansion, producing
e.g. `defaults,,commit=120,errors=remount-ro` for ext4.
Also removed duplicate mountopts[btrfs] override (line 345 duplicated
line 85 and would silently clobber options set by hooks).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Enable the binman pkg_resources fix for all builds.
The extension is a no-op for U-Boot >= v2025.10.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ubuntu hardcodes lookups for ubuntu-logo.svg, ubuntu-logo-text.png,
and ubuntu-logo-text-dark.png in GNOME Settings -> About and other
places. LOGO=armbian-logo in os-release only helps apps that use
the icon-spec lookup; the rest reference the filenames directly.
Since we repack base-files as our own, replace the upstream files
with relative symlinks pointing at the Armbian equivalents
(armbian-logo.svg, armbian-logo-text.png, armbian-logo-text-dark.png)
which are shipped by armbian-bsp-cli via packages/bsp/common/usr/
share/pixmaps/. Also handles debian-logo variants if present.
Result: every panel that references ubuntu-logo* by filename now
renders the Armbian logo without needing to know about the
LOGO= os-release field.
The linux-headers-${BRANCH}-${LINUXFAMILY} package declared
"Provides: linux-headers" without a version. Per Debian Policy §7.5,
an unversioned virtual package cannot satisfy a versioned dependency.
DKMS packages (e.g. bcachefs-kernel-dkms) commonly depend on
"linux-headers (>= X.Y)" as the last alternative after distro-specific
headers. With the unversioned Provides, apt skipped this alternative
and pulled linux-headers-generic from the Ubuntu archive, installing
headers that do not match the running Armbian kernel.
Set "Provides: linux-headers (= ${kernel_version})" so that the upstream
kernel version (e.g. 7.0.0-rc7) satisfies such version constraints.
Versioned Provides have been supported since dpkg 1.17.11 (Debian 8,
Ubuntu 15.04).
kernel_config_modifying_hashes was declared locally in
artifact_kernel_prepare_version(), and the kernel_config_set_{y,n,m,string,val}
helpers never wrote to it. Hooks that used those helpers (e.g.
custom_kernel_config) would be applied to .config but invisible to
the kernel-artifact cache fingerprint, so a cached artifact built
without the hook could be reused for a later build that added one.
Declare the array globally, make every setter append its change, and
initialize the array in call_extensions_kernel_config as a safety net
for non-artifact call paths.
Refs: #9680
Co-authored-by: EvilOlaf <50047739+EvilOlaf@users.noreply.github.com>
Kernel's ./scripts/config appends via `echo >>`; configs without a
trailing newline end up with the first new option glued to the last
line, silently dropping subsequent custom_kernel_config hooks.
Fixes: #9680
- Add comprehensive function documentation for kernel config hooks
- Add inline comments for all kernel configuration options
- Align all inline comments to column 55 for consistency
- Remove excessive blank lines between options
- Split multi-option lines for better readability
Signed-off-by: Igor Pecovnik <igor@armbian.com>
This commit rewords the BTF memory check in lib/functions/compilation/armbian-kernel.sh to include the value checked against
Additionally, the unit is correctly set as MiB
Replace all 43 POSIX `[ ]` tests with bash `[[ ]]` across five board-side
package hook functions (preinst, postinst_base, postinst_finish,
postinst_update_uboot_bootscript, get_bootscript_info).
Normalise `=` to `==` in the `"$1" == "upgrade"` comparison.
Collapse paired `[ A ] && [ B ]` into a single `[[ A && B ]]` where possible.
Variables that were previously unquoted inside `[ ]` (e.g. ${BOOTSCRIPT_DST},
${BOOTSCRIPT_BACKUP_VERSION}) are now properly quoted.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace two chained POSIX `[ ]` with a single bash `[[ ]]` using `&&`
inside the double brackets.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace POSIX `[ ]` with bash `[[ ]]` on four conditionals: file/path
existence checks and an array length comparison.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace POSIX `[ ]` with bash `[[ ]]` on six conditionals: file existence
checks, string comparisons, and -n tests. Also normalise `=` to `==` in
the string comparison.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace POSIX `[ ]` with bash `[[ ]]` on three remaining single-bracket
conditionals: two numeric comparisons on sfdisk version (lines 251, 270)
and one -z test with unquoted variable (line 485, also adds quoting).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If patch B sorts after patch A but has an older mtime, it would
overwrite A's timestamp on the shared file, causing the kernel Makefile
to skip recompilation.
Fix: only call os.utime() when the new mtime is strictly greater than
the file's current mtime.
* add hook to allow customizing before kernel make env creation
* Hook runs in docker_cli_prepare_launch() just before DOCKER_EXTRA_ARGS
is processed, allowing extensions to add Docker arguments with a more
descriptive hook name than add_host_dependencies.
* Extension: ccache-remote
Enables ccache with remote Redis storage for sharing compilation cache across build hosts.
Features:
- Auto-discovery via Avahi/mDNS (ccache.local hostname)
- Explicit Redis server configuration via CCACHE_REMOTE_STORAGE
- Build statistics display at end of build (hit/miss/error rates)
- Support for both Docker and native builds
- Hooks for kernel and u-boot compilation environments
Documentation includes server setup instructions with security warnings,
client mDNS configuration, and cache sharing requirements.
* uboot: fix ccache environment and add extension hook
U-Boot build uses `env -i` which clears all environment variables.
CCACHE_DIR and CCACHE_TEMPDIR were not explicitly passed to make,
unlike kernel build (kernel-make.sh). This caused ccache to use
default directory instead of configured Armbian one, breaking
cache statistics and shared cache functionality.
Changes:
- Add CCACHE_DIR and CCACHE_TEMPDIR to uboot_make_envs
- Add uboot_make_config hook for extensions (similar to kernel_make_config),
allowing modification of environment variables before compilation
* add long list of allowed ccache-related env vars
* set permissions to ccache files RW for everyone if cache not private
* ccache: add ccache_post_compilation hook for extensions
* ccache-remote: use ccache_post_compilation hook instead of cleanup handler
Show remote ccache stats after each compilation (kernel, uboot) via hook,
instead of once at the end via cleanup handler. Stats now shown even on
build failure.
* ccache: show stats with safe arithmetic
* ccache/uboot: improve code comments per review feedback
- uboot.sh: clarify ARMBIAN=foe workaround for dual-compiler scenario
- ccache-remote.sh: document that CCACHE_REDIS_CONNECT_TIMEOUT must be
set before extension loads
* ccache-remote: mask storage URLs in logs
Mask CCACHE_REMOTE_STORAGE when emitting Docker env debug logs.
* ccache-remote: extract ccache_inject_envs() helper to deduplicate passthrough loops
Extract ccache_inject_envs() helper to deduplicate identical passthrough
loops in kernel and uboot make config hooks.
ccache-remote: rename functions to follow project naming conventions
Rename get_redis_stats and mask_storage_url to ccache_get_redis_stats
and ccache_mask_storage_url to follow project naming conventions.
ccache-remote: mask credentials in debug log output for passthrough loops
Mask CCACHE_REMOTE_STORAGE value through ccache_mask_storage_url() before
logging in both Docker env and make env passthrough loops to avoid leaking
credentials into build logs.
* ccache-remote: add HTTP/WebDAV backend and DNS discovery
* ccache-remote: move extension script into directory layout
* ccache-remote: add server setup docs and config files
* ccache-remote: validate Redis credentials in URLs
* ccache-remote: document Redis auth options and safe passwords
Add separate insecure config example for trusted networks.
Recommend URL-safe hex passwords and update setup docs.
* ccache-remote: improve Docker loopback handling and IPv6 host parsing
Was only used once (orangepi5pro.csc) and has been deprecated.
Remove the implementation, the board config, and the README entry.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Other read calls in the same file already use -r.
Without -r, backslashes in user input are interpreted as escape characters.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
При упаковке linux-headers скомпилированные бинарники из scripts/ удаляются,
так как они собраны под хост сборки, а не под целевую машину (типичный случай
кросс-сборки). Поэтому postinst при установке пакета пересобирает их нативно,
предварительно запустив `make olddefconfig`.
Однако olddefconfig не только подготавливает окружение — он заново вычисляет
конфигурацию ядра, проверяя тулчейн, доступный на целевом хосте при установке.
Если инструменты, использовавшиеся при сборке ядра, на целевой машине отсутствуют
или имеют другую версию, olddefconfig молча отключает соответствующие CONFIG_*
опции (например, CONFIG_CC_IS_CLANG, CONFIG_LTO_CLANG, CONFIG_DEBUG_INFO_BTF).
В результате установленный пакет заголовков описывает не то ядро, которое
реально собрано и работает, а то, которое можно было бы собрать на данном хосте.
Это затрагивает:
- include/generated/autoconf.h (используется препроцессором C)
- include/config/auto.conf + маркер-файлы include/config/ (используются
make-правилами kbuild)
- include/generated/rustc_cfg (используется Rust-сборками)
Все эти файлы — артефакты сборки и должны описывать скомпилированное ядро,
а не возможности хоста установки.
Исправление: при упаковке сохраняем сайдкар-тарбол с build-time версиями
include/config/ и include/generated/{autoconf.h,rustc_cfg}; восстанавливаем
его в postinst в самом конце, после всех make-шагов.
Fixes: https://github.com/armbian/build/issues/9425
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add version-gated NETFILTER_XTABLES_LEGACY and BRIDGE_NF_EBTABLES_LEGACY
support in armbian-kernel.sh for kernels >= 6.18. Also add missing
ebtables table modules (BRIDGE_EBT_BROUTE, BRIDGE_EBT_T_FILTER,
BRIDGE_EBT_T_NAT) unconditionally to the nftables config function.
This ensures all hardware families automatically get legacy xtables
support when building kernels 6.18+, fixing Docker and Proxmox
firewall breakage without requiring per-family config changes.
Integrate the libc0607/rtl88x2eu-20230815 out-of-tree driver into the build
system under EXTRA_WIFI for kernels >= 3.14 and < 6.19.
- Fetch pinned upstream commit ccb31f4ee346d5c2dd45475d276171b2f8de8350
- Install sources under drivers/net/wireless/rtl8822eu
- Enable AP and P2P modes in driver Makefile
- Hook into kernel Kconfig and Makefile via CONFIG_RTL8822EU
Tested working on `6.12.74-current-sunxi` and `6.6.75-legacy-sunxi`.