Skip to content

Extract setup_qemu_static() and add test coverage for QEMU binary copy logic#270

Merged
guysoft merged 1 commit intodevelfrom
fix/qemu-static-dedup-and-tests
Feb 18, 2026
Merged

Extract setup_qemu_static() and add test coverage for QEMU binary copy logic#270
guysoft merged 1 commit intodevelfrom
fix/qemu-static-dedup-and-tests

Conversation

@guysoft
Copy link
Owner

@guysoft guysoft commented Feb 18, 2026

The QEMU binary copy logic was duplicated between execute_chroot_script() in src/custompios and chroot_correct_qemu() in src/common.sh. The inline version in custompios also had a bug: the condition used || instead of &&, making it always true (a tautology).

This commit:

  • Extracts the copy logic into a new setup_qemu_static() function in common.sh, fixing the || to && bug and adding arch-match escape hatches
  • Fixes the aarch64->armv7l case to copy qemu-arm-static (not qemu-aarch64-static)
  • Replaces both inline copy blocks with calls to setup_qemu_static()
  • Adds 24 new test cases covering all host/target/OS combinations for the QEMU binary copy logic

Related to PR #261 and issue #262.

…y logic

The QEMU binary copy logic was duplicated between execute_chroot_script()
in src/custompios and chroot_correct_qemu() in src/common.sh. The inline
version in custompios also had a bug: the condition used || instead of &&,
making it always true (a tautology).

This commit:
- Extracts the copy logic into a new setup_qemu_static() function in
  common.sh, fixing the || to && bug and adding arch-match escape hatches
- Fixes the aarch64->armv7l case to copy qemu-arm-static (not
  qemu-aarch64-static)
- Replaces both inline copy blocks with calls to setup_qemu_static()
- Adds 24 new test cases covering all host/target/OS combinations for
  the QEMU binary copy logic

Related to PR #261 and issue #262.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant