openwrt-x86-compile
约 286 字 预计阅读 1 分钟
次阅读
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
|
#!/bin/bash
proj=immortalwrt
home=/home/henry
ver=openwrt-23.05
nasdir=henry@10.8.0.2:/volume1/pve/images
system=x86
target=64
profile=generic
bindir=$home/$proj/bin/targets/$system/$target
combined=$proj-$system-$target-$profile-squashfs-combined-efi
timestamp=$(date +"%Y%m%d")
## For the first time compile
#git clone -b $ver --single-branch --filter=blob:none https://github.com/immortalwrt/immortalwrt
cd $home/$proj && \
cp .config $home/compile/openwrt-$(date +%u).config && \
git pull && \
##### For the first time compile
#echo "src-git passwall_packages https://github.com/xiaorouji/openwrt-passwall-packages.git;main" >> feeds.conf.default && \
#echo "src-git passwall https://github.com/xiaorouji/openwrt-passwall.git;main" >> feeds.conf.default && \
#echo "src-git helloworld https://github.com/fw876/helloworld;main" >> feeds.conf.default && \
#git clone https://github.com/jerrykuku/luci-theme-argon.git package/luci-theme-argon.git && \
#git clone https://github.com/jerrykuku/luci-app-argon-config.git package/luci-app-argon-config && \
#git clone https://github.com/nixonli/ddns-scripts_dnspod.git package/ddns-scripts_dnspod && \
#git clone https://github.com/zzsj0928/luci-app-pushbot package/luci-app-pushbot && \
## If select passwall
#git clone https://github.com/Microsoft/GSL build_dir/target-x86_64_musl/trojan-plus-10.0.3/external/GSL && \
sed -i 's/192.168.1.1/10.8.9.1/g' package/base-files/files/bin/config_generate && \
./scripts/feeds update -a && ./scripts/feeds install -a && \
make clean && make -j1 V=s && \
scp -i $home/.ssh/id_ed25519 $bindir/$combined.qcow2 $nasdir/$combined-$timestamp.qcow2 && \
scp -i $home/.ssh/id_ed25519 $bindir/$combined.img.gz $nasdir/$combined-$timestamp.img.gz
if [ $? -eq 0 ]; then
result="成功"
else
result="失败"
fi
dingding="https://oapi.dingtalk.com/robot/send?access_token=dingdingtoken"
msg="'{\"msgtype\": \"text\", \"text\":{\"content\":\"[Builder] Built $ver for $system-$target $result\"}}'"
CURL="curl $dingding -H 'Content-Type: application/json' -X POST --data $msg"
eval $CURL
#echo " 编译OpenWrt报告:结果为 $? " | mailx -s " 编译OpenWrt $ver$result " root
|