OpenWrt备忘录

模板选择

https://github.com/P3TERX/Actions-OpenWrt

源码选择

https://github.com/Lienol/openwrt
https://github.com/coolsnowwolf/lede

插件仓库选择

https://github.com/siropboy/mypackages
https://github.com/jerrykuku/openwrt-package
https://github.com/xiaorouji/openwrt-passwall

命令

#ssh编译命令
cd openwrt && make menuconfig
#ssh界面获取config
./scripts/diffconfig.sh > seed.config
cat seed.config
#上传tmp刷机命令
dd if=/tmp/upload/op.img of=/dev/sda
#echo '替换UPNP为2.0.20170421'
rm -rf feeds/packages/net/miniupnpd
svn co https://github.com/coolsnowwolf/packages/trunk/net/miniupnpd feeds/packages/net/miniupnpd
#echo '修改默认IP为10.0.0.1'
sed -i 's/192.168.1.1/10.0.0.1/g' package/base-files/files/bin/config_generate
#修改版本号
sed -i 's/OpenWrt/xxxx $(TZ=UTC-8 date "+%Y.%m.%d") @ OpenWrt/g' package/lean/default-settings/files/zzz-default-settings
echo '重定向dns'
sed -i 's/iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53/# iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53/g' package/lean/default-settings/files/zzz-default-settings

#echo '修改机器名称'
sed -i 's/OpenWrt/XXXX/g' package/base-files/files/bin/config_generate
echo '添加插件库'
#sed -i '$a src-git lienol https://github.com/Lienol/openwrt-package' feeds.conf.default
#sed -i '$a src-git opentopd https://github.com/sirpdboy/sirpdboy-package' feeds.conf.default
#sed -i '$a src-git diy https://github.com/firker/diy-ziyong' feeds.conf.default
#sed -i '$a src-git kenzo https://github.com/kenzok8/openwrt-packages' feeds.conf.default
#sed -i '$a src-git small https://github.com/kenzok8/small' feeds.conf.default
#sed -i '$a src-git s1oz https://github.com/s1oz/package' feeds.conf.default
#sed -i '$a src-git xiaorouji https://github.com/xiaorouji/openwrt-passwall' feeds.conf.default
sed -i '$a src-git ssr https://github.com/fw876/helloworld' feeds.conf.default

#echo '下载ServerChan'
#git clone https://github.com/tty228/luci-app-serverchan.git package/luci-app-serverchan

echo '下载bandwidthd'
git clone https://github.com/AlexZhuo/luci-app-bandwidthd.git package/luci-app-bandwidthd

echo '下载adguardhome'
git clone https://github.com/rufengsuixing/luci-app-adguardhome package/luci-app-adguardhome
#svn co https://github.com/sirpdboy/sirpdboy-package/trunk/AdGuardHome/files/etc files/etc

echo '下载eqos'
git clone https://github.com/swxk521/luci-app-eqos.git package/luci-app-eqos
#svn co https://github.com/sirpdboy/sirpdboy-package/trunk/luci-app-eqos package/luci-app-eqos

echo '下载主题'
svn co https://github.com/kenzok8/openwrt-packages/trunk/luci-theme-argon_new package/luci-theme-argon_new
将所需配置文件按原路径丢入新建名为files的文件夹中即为files大法