Skip to content

gateway-dk-ask: pin ASK with libxml2 2.12+ compat fix for fmc#9677

Merged
igorpecovnik merged 5 commits intoarmbian:mainfrom
we-are-mono:fix/ask-libxml2-compat
Apr 16, 2026
Merged

gateway-dk-ask: pin ASK with libxml2 2.12+ compat fix for fmc#9677
igorpecovnik merged 5 commits intoarmbian:mainfrom
we-are-mono:fix/ask-libxml2-compat

Conversation

@tomazzaman
Copy link
Copy Markdown

@tomazzaman tomazzaman commented Apr 15, 2026

Description

Update the ASK repo pin to a commit that adds a libxml2 compatibility patch for fmc.

Newer libxml2 (2.12.0+, released Oct 2023) changed the xmlStructuredErrorFunc callback signature to take a const xmlError * instead of xmlError *. Without the patch, fmc fails to compile against libxml2 2.12+ headers, breaking builds against newer distributions.

The patch in the ASK repo uses a LIBXML_VERSION preprocessor check to select the correct callback signature for both old and new libxml2.

Distribution coverage

Distribution libxml2 Status
Debian Trixie 2.9.14 (despite version string) OK
Ubuntu Noble (24.04 LTS) 2.9.14 OK
Ubuntu Resolute (26.04 dev) 2.12+ Was broken, now fixed

How Has This Been Tested?

  • Built locally with `RELEASE=trixie` (passes)
  • Built locally with `RELEASE=noble` (passes)
  • Built locally with `RELEASE= resolute` (passes)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Summary by CodeRabbit

  • Bug Fixes

    • Resolved const-correctness compatibility issues in kernel library for newer glibc environments.
  • Chores

    • Updated build infrastructure with improved patch staging and dependency management.
    • Enhanced installation process for more reliable package deployment.
    • Refreshed component metadata and configuration file management.

Update ASK to a commit that adds a libxml2 compatibility patch for
fmc. Newer libxml2 (2.12+) changed the xmlStructuredErrorFunc
callback signature to take a const error pointer. Without the patch,
fmc fails to compile against libxml2 2.12+ headers (Ubuntu Resolute
and other distros with newer libxml2).
@github-actions github-actions Bot added size/small PR with less then 50 lines 05 Milestone: Second quarter release Needs review Seeking for review Framework Framework components labels Apr 15, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 92d83970-207b-40ea-9065-2616c055ea1a

📥 Commits

Reviewing files that changed from the base of the PR and between 1e48e90 and d56fe5d.

📒 Files selected for processing (1)
  • extensions/gateway-dk-ask.sh

📝 Walkthrough

Walkthrough

Two files modified: a gateway ASK build script updated with new commit pinning, restructured patch staging directories, Debian metadata adjustments, installation method changes, and enhanced patch resolution with validation logic; and a kernel libbpf patch adding const-correctness for newer glibc compatibility.

Changes

Cohort / File(s) Summary
Build Script Updates
extensions/gateway-dk-ask.sh
Updated ASK branch commit reference; restructured patch staging to use versioned subdirectories; modified Debian control metadata (Maintainer, libxml2 dependency, added FMC config files to conffiles); replaced dpkg with noninteractive apt-get installation; enhanced patch resolution to parse upstream version from changelog and validate patch existence before application.
Kernel Patch
patch/kernel/archive/ls1046a-6.12/004-libbpf-const-correctness-for-newer-glibc.patch
Added const-correctness to local variables in libbpf.c by changing res and next_path from char* to const char* in kallsyms_cb() and resolve_full_path() functions respectively for glibc compatibility.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A swift hop through patches so fine,
ASK commits updated in line,
Patches staged fresh in their own tiny homes,
Dependencies OR'd, dependencies roam,
Const-correct declarations at last!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: pinning ASK to a newer commit and addressing libxml2 2.12+ compatibility for fmc.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

glibc 2.42+ (Ubuntu Resolute and later) ships const-aware strstr/strchr
declarations in <string.h>. Assigning their results to non-const char*
triggers -Werror=discarded-qualifiers in tools/bpf/resolve_btfids,
which is compiled by the linux-headers .deb postinst on the build host.

Fix by declaring the receiving variables as const char* in two places
in tools/lib/bpf/libbpf.c. Matches the upstream 6.13+ fix, backported
to the NXP lf-6.12.y SDK kernel (which NXP has moved off for 6.18+).
@github-actions github-actions Bot added size/medium PR with more then 50 and less then 250 lines Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... and removed size/small PR with less then 50 lines labels Apr 15, 2026
@tomazzaman
Copy link
Copy Markdown
Author

tomazzaman commented Apr 15, 2026

Went ahead and fixed the headers issue as well, however, identified another bug, so I'm fixing the whole ASK patching process for future-proofness. Will push soon.

Patched library rebuilds now pick the correct ASK patch by parsing the
upstream version from debian/changelog after apt-get source. Patches are
staged under /tmp/ask-patches/<pkg>/<version>/<file>, letting one ASK
repo cover distros whose source versions differ (Trixie/Noble 1.1.0 vs
Resolute 1.1.1). Missing-patch case fails loudly instead of patching
the wrong tree.

Other changes in this bundle:
- Switch .deb install in chroot from dpkg -i to apt-get install so
  runtime deps resolve automatically.
- Add libxml2 | libxml2-16 alternative dep for Trixie/Noble compat.
- Declare /etc/fmc/config/{cfgdata.xsd,hxs_pdl_v3.xml,netpcd.xsd} as
  conffiles so local edits survive OTA upgrades.
- Bump pinned ASK commit to 9f5a37e.
- Update package maintainer to Tomaz Zaman <tomaz@mono.si>.
- leds-lp5812: mutex_destroy in probe err_out and remove paths to
  pair the mutex_init in probe.
@tomazzaman tomazzaman requested a review from a team as a code owner April 15, 2026 22:19
@tomazzaman tomazzaman requested review from swissiety and removed request for a team April 15, 2026 22:19
@github-actions github-actions Bot added the BSP Board Support Packages label Apr 15, 2026
@tomazzaman
Copy link
Copy Markdown
Author

All three images build, flash and run fine now.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/bsp/gateway-dk/leds-lp5812.c`:
- Around line 610-612: The mutex for lp5812 chip (chip->lock) is being destroyed
too early in the probe error path and in .remove(), causing
use-after-destruction when devm_led_classdev_register cleanup invokes brightness
callbacks; stop calling mutex_destroy(&chip->lock) directly in the err_out path
and .remove() (and anywhere before devm cleanup completes). Instead either
remove those explicit mutex_destroy calls entirely (since kernel mutexes need no
explicit destruction) or register a devm action immediately after mutex_init()
to destroy the mutex during device teardown, ensuring destruction happens after
devm_led_classdev_unregister/cleanup; update references in lp5812_deinit_device,
err_out, and the .remove() path accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ce183a21-1a20-4e68-805e-69e300f81077

📥 Commits

Reviewing files that changed from the base of the PR and between b61bf00 and 1e48e90.

📒 Files selected for processing (2)
  • extensions/gateway-dk-ask.sh
  • packages/bsp/gateway-dk/leds-lp5812.c

Comment thread packages/bsp/gateway-dk/leds-lp5812.c Outdated
Tomaz Zaman added 2 commits April 16, 2026 00:48
mutex_destroy ran before devres unwinds devm_led_classdev_register,
whose cleanup can invoke brightness_set via led_trigger_set(NULL).
Those callbacks acquire chip->lock, so destroying it in .remove
created a use-after-destruction hazard on CONFIG_DEBUG_MUTEXES=y
builds. Kernel mutexes don't require explicit destruction — the
memory holding chip->lock is freed by the devm_kzalloc devres entry
after all callbacks complete.
cdx: refuse to load without ASK-capable FMAN microcode.
@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot removed the Needs review Seeking for review label Apr 16, 2026
@igorpecovnik igorpecovnik merged commit 17360fa into armbian:main Apr 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release BSP Board Support Packages Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

2 participants