-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipk_generate.sh
60 lines (47 loc) · 1.22 KB
/
ipk_generate.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# ----- ----- ----- ----- ----- -----
# platform: ubuntu22 (with base tools)
# Desc: ipk 软件包生成
# Date: 2023.12.07
#
# 在 openwrt 同级目录新建 wp_packages, 将项目存放进去
# 构建前需要在复制具体的项目到 ../openwrt/package/ 里
# ----- ----- ----- ----- ----- -----
set -u
# all proj put them in wp_packages
run_feeds() {
# e.g. xxx/feeds update wp_packages
./scripts/feeds update $1
./scripts/feeds install -a -p $1
}
buildC() {
local arr=(`echo "$@"`)
for val in ${arr[*]}
do
# make
make package/$val/compile -j1 V=s
make package/$val/clean -j1 V=s
done
echo "build ok"
}
# ----- ----- start ----- -----
pathProj=`pwd`
DirProj=`basename $pathProj`
echo "my projects all in: $pathProj"
# src openwrt and our proj have same level
cd ../openwrt-22.03.6
# create and check feeds.conf
if [ ! -f feeds.conf ]; then touch feeds.conf
fi
lineWrite="src-link $DirProj $pathProj"
if [[ `tail -n 1 feeds.conf` != $lineWrite ]]; then
echo ${lineWrite} >> feeds.conf
fi
rm -rf feeds/wp_*
run_feeds $DirProj
make menuconfig
# ----- ----- start compile ----- -----
# add here
projMore=("example1" "example2" "example3" "hello_world")
buildC `echo ${projMore[*]}`
cd ..