Skip to content

This is Pr #240 with unit testing #251

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

Open
wants to merge 1 commit 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
6 changes: 4 additions & 2 deletions src/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ function chroot_correct_qemu() {
chmod 755 common.sh

# Set up QEMU if needed
if [[ "$host_arch" != "armv7l" ]] || [[ "$host_arch" != "aarch64" ]]; then
if [[ "$host_arch" != "armv7l" ]] && [[ "$host_arch" != "aarch64" ]]; then
if [[ "$target_arch" == "armv7l" ]] || [[ "$target_arch" == "armhf" ]]; then
if grep -q gentoo /etc/os-release; then
ROOT="$(realpath .)" emerge --usepkgonly --oneshot --nodeps qemu
Expand All @@ -630,6 +630,8 @@ function chroot_correct_qemu() {
cp "$(which qemu-aarch64-static)" usr/bin/qemu-aarch64-static
fi
fi
elif [[ ( "$target_arch" == "armv7l" || "$target_arch" == "armhf" ) && "$host_arch" != "armv7l" ]]; then
cp "$(which qemu-aarch64-static)" usr/bin/qemu-aarch64-static
fi

# Execute chroot with appropriate QEMU setup
Expand All @@ -655,7 +657,7 @@ function chroot_correct_qemu() {
echo "Unknown arch, building on: $host_arch image: $target_arch"
return 1
fi
elif { [[ "$target_arch" == "armv7l" ]] || [[ "$target_arch" == "armhf" ]]; } && [[ "$host_arch" != "armv7l" ]]; then
elif [[ ( "$target_arch" == "armv7l" || "$target_arch" == "armhf" ) && "$host_arch" != "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