You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rootfs/qemu-static): use direct armhf exec probe instead of broken 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
display_alert "Trying to update binfmts - aarch64 mostly does 32-bit sans emulation, but Apple said no""update-binfmts --enable qemu-${wanted_arch}""debug"
197
-
run_host_command_logged update-binfmts --enable "qemu-${wanted_arch}""&>""/dev/null""||""true"# don't fail nor produce output, which can be misleading.
display_alert "qemu-arm enabled via packaged descriptor""leaving package-provided setup intact""debug"
242
+
return 0
243
+
fi
244
+
exit_with_error "/usr/share/binfmts/qemu-arm exists but qemu-arm could not be enabled — packaged interpreter likely missing. Reinstall qemu-user-binfmt (resolute) / qemu-user-static, or remove the descriptor and retry."
245
+
fi
246
+
247
+
# Kernel entry exists but disabled, no descriptor on host. The kernel
248
+
# keeps the magic/mask in memory once registered; only the enabled
249
+
# flag toggles. Try `echo 1 > /proc/...` before giving up — that
250
+
# repairs the common "someone toggled it off" state without needing
251
+
# the descriptor file back.
252
+
if [[ -e /proc/sys/fs/binfmt_misc/qemu-arm ]];then
if [[ "$(head -n1 /proc/sys/fs/binfmt_misc/qemu-arm 2> /dev/null)"=="enabled" ]];then
255
+
display_alert "qemu-arm re-enabled via /proc""kernel state restored without descriptor""debug"
256
+
return 0
257
+
fi
258
+
exit_with_error "qemu-arm kernel entry present but cannot be re-enabled and no descriptor to re-register from. Reinstall qemu-user-binfmt / qemu-user-static and retry."
259
+
fi
260
+
261
+
# Apple-Silicon-like (no COMPAT, no qemu pkg): hand-roll the descriptor.
262
+
display_alert "arm64 host can't run armhf natively (no CONFIG_COMPAT?)""importing+enabling qemu-arm""debug"
0 commit comments