Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This refactors some of the QEMU-related code, adds documentation, and adds support for discovering the default
QEMU_LD_PREFIX
value.QEMU_LD_PREFIX
is an environment variable that determines whereqemu
user-mode emulation will attempt to resolve file paths if the "real" file doesn't exist. On Ubuntu, this is e.g./etc/qemu-binfmt/arm
, which is then generally symlinked to e.g./usr/arm-linux-gnueabihf
.Previously, we hard-coded logic to expect
/etc/qemu-binfmt
. Other distros use other paths, and in fact vanilla (non-Ubuntu-maintained) QEMU uses a different path.We now detect the path appropriately by checking the environment, and extract the compiled-into-QEMU default value by running e.g.
qemu-arm --help
. The help message contains a lines that look like:This goes all the way back to at least qemu 2.0.0, which is probably sufficient.