-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·114 lines (86 loc) · 2.2 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·114 lines (86 loc) · 2.2 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env bash
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OPENWRT_DIR="${PROJECT_ROOT}/openwrt"
OPENWRT_REPO="https://github.com/openwrt/openwrt.git"
OPENWRT_BRANCH="openwrt-25.12"
echo
echo "=============================================="
echo " QUANTUMGRID OS BUILD SYSTEM"
echo "=============================================="
echo
echo "[1/8] Checking host environment..."
command -v git >/dev/null || {
echo "ERROR: git is not installed"
exit 1
}
command -v make >/dev/null || {
echo "ERROR: make is not installed"
exit 1
}
command -v python3 >/dev/null || {
echo "ERROR: python3 is not installed"
exit 1
}
echo "Host environment OK."
echo
echo "[2/8] Getting OpenWrt ${OPENWRT_BRANCH}..."
if [ ! -d "${OPENWRT_DIR}/.git" ]; then
git clone \
--branch "${OPENWRT_BRANCH}" \
--single-branch \
"${OPENWRT_REPO}" \
"${OPENWRT_DIR}"
else
echo "OpenWrt source already exists."
fi
cd "${OPENWRT_DIR}"
echo
echo "[3/8] OpenWrt version:"
git describe --tags --always || true
echo
echo "[4/8] Updating feeds..."
./scripts/feeds update -a
./scripts/feeds install -a
echo
echo "[5/8] Installing QuantumGrid files..."
cd "${PROJECT_ROOT}"
mkdir -p "${OPENWRT_DIR}/files"
if [ -d "${PROJECT_ROOT}/files" ]; then
cp -a "${PROJECT_ROOT}/files/." "${OPENWRT_DIR}/files/"
fi
echo
echo "[6/8] Applying QuantumGrid configuration..."
cd "${OPENWRT_DIR}"
if [ -f "${PROJECT_ROOT}/configs/aw1000.config" ]; then
cp "${PROJECT_ROOT}/configs/aw1000.config" .config
make defconfig
else
echo
echo "No AW1000 configuration exists yet."
echo "Run:"
echo
echo " make menuconfig"
echo
echo "and create configs/aw1000.config"
echo
exit 2
fi
echo
echo "[7/8] Running prerequisite checks..."
make prereq
echo
echo "[8/8] QuantumGrid build"
make download -j"$(nproc)"
make -j"$(nproc)" V=s
echo
echo "=============================================="
echo " QUANTUMGRID BUILD COMPLETE"
echo "=============================================="
echo
echo "Firmware:"
echo
find "${OPENWRT_DIR}/bin/targets" \
-type f \
\( -name "*.bin" -o -name "*.img" -o -name "*.itb" \) \
-print