Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aarch/arm64 Architecture Issues #240

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ set -x

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

# Source in dist config to seed generate_board_config.py
# but will then be overwritten ${CUSTOM_PI_OS_PATH}/config for
# 'final' configuration
source ${DIST_PATH}/config

define SCRIPT <<'EOF'
BUILD_SCRIPT_PATH=$(dirname $(realpath -s $BASH_SOURCE))
export EXTRA_BOARD_CONFIG=$(mktemp)
Expand Down
7 changes: 4 additions & 3 deletions src/custompios
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ function execute_chroot_script() {
fi

#black magic of qemu-arm-static
# cp `which qemu-arm-static` usr/bin
if [ "$(uname -m)" != "armv7l" ] || [ "$(uname -m)" != "aarch64" ] ; then
if [ "$(uname -m)" != "armv7l" ] && [ "$(uname -m)" != "aarch64" ] ; then
if [ "$BASE_ARCH" == "armv7l" ] || [ "$BASE_ARCH" == "armhf" ]; then
if (grep -q gentoo /etc/os-release);then
ROOT="`realpath .`" emerge --usepkgonly --oneshot --nodeps qemu
Expand All @@ -45,6 +44,8 @@ function execute_chroot_script() {
cp `which qemu-aarch64-static` usr/bin/qemu-aarch64-static
fi
fi
elif [[ ( "$BASE_ARCH" == "armv7l" || "$BASE_ARCH" == "armhf" ) && "$(uname -m)" != "armv7l" ]]; then
cp `which qemu-aarch64-static` usr/bin/qemu-aarch64-static
fi

cp $2 chroot_script
Expand Down Expand Up @@ -74,7 +75,7 @@ function execute_chroot_script() {
echo "Unknown arch, building on: $(uname -m) image: $BASE_ARCH"
exit 1
fi
elif { [ "$BASE_ARCH" == "armv7l" ] || [ "$BASE_ARCH" == "armhf" ]; } && [ "$(uname -m)" != "armv7l" ]; then
elif [[ ( "${BASE_ARCH}" == "armv7l" || "${BASE_ARCH}" == "armhf" ) && "$(uname -m)" != "armv7l" ]]; then
echo "Building on aarch64/arm64 device a armv7l system, using qemu-arm-static"
chroot . usr/bin/qemu-arm-static /bin/bash /chroot_script
else
Expand Down