-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·39 lines (28 loc) · 977 Bytes
/
build.sh
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
#!/bin/sh
set -ex
openwrt_url='https://git.openwrt.org/openwrt/openwrt.git'
openwrt_tag='v23.05.2'
#openwrt_tag='origin/master'
cpus=$(nproc)
top="$PWD"
if [ ! -d "$top/openwrt" ]; then
git clone --depth 1 "$openwrt_url" -b "$openwrt_tag" "$top/openwrt"
fi
cd "$top/openwrt"
git fetch --depth 1 origin tag "$openwrt_tag"
git reset --hard HEAD
git checkout "$openwrt_tag"
# TODO we only need to pull if we are building origin/master
#git pull origin master
#make dirclean
git am $top/patches/*.patch
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
make -j"$cpus" download
make -j"$cpus" kernel_menuconfig CONFIG_TARGET=subtarget
# set all kernel modules to be built-in
find build_dir/target-mips_74kc_musl/linux-ath79_generic -name .config -type f | xargs sed -i -e "s/=m/=y/g"
make -j"$cpus"
cp bin/targets/ath79/generic/openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin "$top"
cp bin/targets/ath79/generic/sha256sums "$top"