fix(rootfs/qemu-static): use direct armhf exec probe instead of broken arch-test gate#140
fix(rootfs/qemu-static): use direct armhf exec probe instead of broken arch-test gate#140iav wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d6d4728c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42eb08da2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n arch-test gate `arch-test arm` probes ARMv5 EABI, divergent from kernel COMPAT (armhf EABI v5+), and returns failure on modern aarch64 hosts (Ubuntu Noble 6.8 / Ampere Altra) with a fully working CONFIG_COMPAT path — routing mmdebstrap through qemu-user emulation at ~10× slowdown. Replace with a 4-tier detection: prefer the packaged `/usr/share/binfmts/qemu-arm` descriptor if present, trust an already-enabled kernel registration, otherwise probe COMPAT directly by exec'ing `ld-linux-armhf.so.3`, falling back to the hand-rolled descriptor only when none applies. Assisted-by: Claude:claude-opus-4.7
c456ae4 to
1c66025
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c66025814
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| echo 0 > /proc/sys/fs/binfmt_misc/qemu-arm || | ||
| exit_with_error "Failed to disable qemu-arm before native armhf probe" |
There was a problem hiding this comment.
Avoid hard-failing when qemu-arm cannot be toggled
When qemu-arm is already enabled, this path now unconditionally writes 0 to /proc/sys/fs/binfmt_misc/qemu-arm and aborts if that write fails. In constrained/containerized environments where binfmt entries are readable but not writable, this causes an immediate build failure even if the existing registration is already usable (the previous implementation could proceed via arch-test). The native-COMPAT probe should degrade gracefully (e.g., skip disable-and-probe on permission failure) instead of treating inability to toggle as fatal.
Useful? React with 👍 / 👎.
…registration When CONFIG_COMPAT runs armhf binaries natively on aarch64 (≈10× faster than qemu-user emulation), but qemu-arm is registered in kernel binfmt_misc, the previous "trust existing setup" check returned early and the build went through qemu anyway. Empirically: helios4 build 41 min via qemu vs 19 min native COMPAT on droid (RK3399). Reorder probes: 1. Snapshot initial qemu-arm state. 2. COMPAT probe must run with qemu-arm OFF — kernel binfmt_misc routes armhf exec through qemu first when enabled, making the probe a liar about native capability. Temp-disable before probe; on probe failure (no COMPAT, e.g. Apple Silicon under HVF where AArch32@EL0 SIGILL's) restore qemu-arm and fall through to qemu setup. Toggle errors are not swallowed. 3. Trust-existing path validates via arch-test arm — the `enabled` flag alone does not attest that the interpreter actually runs (stale path, removed package); without this, broken registrations passed setup and failed later in chroot. 4. _verify_qemu_arm_executes helper called after each successful import/enable/repair branch, so qemu issues fail fast at host-prepare time instead of mid-rootfs-build. The descriptor itself is left intact — only the active flag is toggled. Gated by ARMBIAN_PREFER_NATIVE_ARMHF=no for explicit opt-out. Behaviour preserved on hosts without COMPAT. Assisted-by: Claude:claude-opus-4.7
1c66025 to
12f0371
Compare
codex-trap mirror of upstream PR armbian#9820 (re-opened after force-push made the old head commit unreachable; previous trap was #117).
Latest CR nitpick fix (
|| trueoutsiderun_host_command_logged arch-testinSHOW_DEBUG=yesdebug branch) is included; squashed into the single commit.@codex review