diff --git a/common.sh b/common.sh index 387614e45f..37cee5e809 100644 --- a/common.sh +++ b/common.sh @@ -46,6 +46,9 @@ fi # Turn on bash debug support if available for backtraces. shopt -s extdebug 2>/dev/null +# Source qemu library path +. /etc/profile.d/qemu-aarch64.sh 2> /dev/null || true + # Output a backtrace all the way back to the raw invocation, suppressing # only the _dump_trace frame itself. _dump_trace() { @@ -936,6 +939,8 @@ setup_qemu_static() { arm64-usr) if [[ -f "${root_fs_dir}/sbin/ldconfig" ]]; then sudo cp /usr/bin/qemu-aarch64 "${root_fs_dir}"/usr/bin/qemu-aarch64-static + echo export QEMU_LD_PREFIX=\"/build/arm64-usr/\" | sudo tee /etc/profile.d/qemu-aarch64.sh + . /etc/profile.d/qemu-aarch64.sh else die "Missing basic layout in target rootfs" fi