Skip to content

Commit 913e384

Browse files
committed
Implement #240 Fix aarch/arm64 Architecture Issues
1 parent 693157e commit 913e384

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ set -x
88

99
define(){ IFS='\n' read -r -d '' ${1} || true; }
1010

11+
# Source in dist config to seed generate_board_config.py
12+
# but will then be overwritten ${CUSTOM_PI_OS_PATH}/config for
13+
# 'final' configuration
14+
source ${DIST_PATH}/config
15+
1116
define SCRIPT <<'EOF'
1217
BUILD_SCRIPT_PATH=$(dirname $(realpath -s $BASH_SOURCE))
1318
export EXTRA_BOARD_CONFIG=$(mktemp)

src/common.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ function chroot_correct_qemu() {
616616
chmod 755 common.sh
617617

618618
# Set up QEMU if needed
619-
if [[ "$host_arch" != "armv7l" ]] || [[ "$host_arch" != "aarch64" ]]; then
619+
if [[ "$host_arch" != "armv7l" ]] && [[ "$host_arch" != "aarch64" ]]; then
620620
if [[ "$target_arch" == "armv7l" ]] || [[ "$target_arch" == "armhf" ]]; then
621621
if grep -q gentoo /etc/os-release; then
622622
ROOT="$(realpath .)" emerge --usepkgonly --oneshot --nodeps qemu
@@ -630,6 +630,8 @@ function chroot_correct_qemu() {
630630
cp "$(which qemu-aarch64-static)" usr/bin/qemu-aarch64-static
631631
fi
632632
fi
633+
elif [[ ( "$target_arch" == "armv7l" || "$target_arch" == "armhf" ) && "$host_arch" != "armv7l" ]]; then
634+
cp "$(which qemu-aarch64-static)" usr/bin/qemu-aarch64-static
633635
fi
634636

635637
# Execute chroot with appropriate QEMU setup
@@ -655,7 +657,7 @@ function chroot_correct_qemu() {
655657
echo "Unknown arch, building on: $host_arch image: $target_arch"
656658
return 1
657659
fi
658-
elif { [[ "$target_arch" == "armv7l" ]] || [[ "$target_arch" == "armhf" ]]; } && [[ "$host_arch" != "armv7l" ]]; then
660+
elif [[ ( "$target_arch" == "armv7l" || "$target_arch" == "armhf" ) && "$host_arch" != "armv7l" ]]; then
659661
echo "Building on aarch64/arm64 device a armv7l system, using qemu-arm-static"
660662
chroot . usr/bin/qemu-arm-static /bin/bash /chroot_script
661663
else

0 commit comments

Comments
 (0)