-
Notifications
You must be signed in to change notification settings - Fork 0
/
aarch64_fixes.patch
48 lines (44 loc) · 1.89 KB
/
aarch64_fixes.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/src/build b/src/build
index 8822486..c7d75cf 100755
--- a/src/build
+++ b/src/build
@@ -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)
diff --git a/src/custompios b/src/custompios
index 5abf038..7d3d867 100755
--- a/src/custompios
+++ b/src/custompios
@@ -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
@@ -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
@@ -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