现在互联网上有很多编译openwrt,我自己编译了一下当个记录吧 先决条件:
Ubuntu TLS 或者是 Debian11的虚拟机
保证这台虚拟机可以全局科学
有了这些先决条件,我们可以进行编译了
编译我们使用的是L大的仓库,地址是GitHub - coolsnowwolf/lede: Lean’s LEDE source
L大已经把注意事项写的很清楚了
注意
不要用 root 用户进行编译
国内用户编译前最好准备好梯子
默认登陆IP 192.168.1.1 密码 password
编译命令 好了,知道了注意事项我们开始在虚拟机里安装一些必要依赖
1 2 3 4 5 6 7 8 9 sudo apt update -y sudo apt full-upgrade -y sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \ libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ vim wget xmlto xxd zlib1g-dev
下一步,我们git一下L大的仓库
1 2 3 4 5 6 7 8 9 10 11 12 13 git clone https://github.com/coolsnowwolf/lede cd lede # 添加自定义源 vim feeds.conf.default src-git kenzo https://github.com/kenzok8/openwrt-packages src-git small https://github.com/kenzok8/small # 这是我在使用的源,文件里也自带源可以取消注释 # 如果有其它需要也可以自行添加源 # 更新安装feeds源 ./scripts/feeds update -a ./scripts/feeds install -a # 进行编译 make menuconfig
这个是进来的选择界面
Target System(选择CPU架构)
Subtarget (选择CPU型号)
Target Profile (选择路由具体型号)
Target images
1 2 3 4 5 6 7 ext4(可读写文件系统,不支持恢复出厂设置,软件包可完全卸载) squashfs(只读文件系统,支持恢复出厂设置和web升级固件,软件包无法完全卸载) Block size (压缩比) 默认256(可调为512、1024或更高减小固件体积)数值越高占用运行内存越高,运行速度越慢 Build EFI GRUB images(编译支持UEFI启动固件) Build PVE/KVM image files(编译PVE镜像固件) Kernel partition size (内核分区大小) 默认16或30 (即:软件包安装区域的大小) Root filesystem partition size (系统分区大小) 默认160或90 (两个分区大小总和为固件大小)
其他的一些功能就不再这里单读列出,有想了解的可以去【2020-01-14 更新】OpenWrt入门编译 make menuconfig配置参考说明与自动生成脚本-OPENWRT专版-恩山无线论坛 - Powered by Discuz! (right.com.cn)
LuCI———这个是主要文件,也是插件所在
1 2 3 4 5 6 7 1. Collections ---> 2. Modules ---> 3. Applications ---> 插件 4. Themes ---> 主题 5. Protocols ---> 6. Libraries ---> <*> default-settings....................... LuCI support for Default Settings (NEW)
这几个其他暂时不用看主要是看插件和主题,以下是插件的详解,来自OpenWrt 编译 LuCI-> Applications 添加插件应用说明-L大【2022.11.28】-OPENWRT专版-恩山无线论坛 - Powered by Discuz! (right.com.cn)
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 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 OpenWrt 编译 LuCI 插件说明 LuCI Applications luci-app-accesscontrol 访问时间控制 LuCI Applications luci-app-adblock ADB广告过滤 LuCI Applications luci-app-adbyby-plus 广告屏蔽大师Plus + LuCI Applications luci-app-adbyby 广告过滤大师(已弃) LuCI Applications luci-app-adkill 广告过滤(已弃) LuCI Applications luci-app-advanced-reboot Linksys高级重启 LuCI Applications luci-app-ahcp 支持AHCPd LuCI Applications luci-app-aliddns 阿里DDNS客户端(已弃,集成至ddns) LuCI Applications luci-app-amule aMule是一个跨平台的ED2K/KAD客户端 P2P电驴下载 LuCI Applications luci-app-aria2 Aria2下载 LuCI Applications luci-app-arpbind IP/MAC绑定 LuCI Applications luci-app-asterisk 支持Asterisk电话服务器 LuCI Applications luci-app-attendedsysupgrade 固件更新升级相关 LuCI Applications luci-app-autoreboot 支持计划重启 LuCI Applications luci-app-baidupcs-web 百度网盘管理 LuCI Applications luci-app-bcp38 BCP38网络入口过滤(不确定) LuCI Applications luci-app-birdl-ipv4 对Birdl-ipv4的支持 LuCI Applications luci-app-birdl-ipv6 对Birdl-ipv6的支持 LuCI Applications luci-app-bird4 Bird4服务(未知) LuCI Applications luci-app-bird6 Bird6服务(未知) LuCI Applications luci-app-bmx6 BMX6路由协议 LuCI Applications luci-app-bmx7 BMX7路由协议 LuCI Applications luci-app-caldav 联系人 LuCI Applications luci-app-cifsd 网络共享CIFS/SMB服务器 LuCI Applications luci-app-cjdns 加密IPV6网络相关 LuCI Applications luci-app-clamav ClamAV杀毒软件 LuCI Applications luci-app-commands Shell命令模块 LuCI Applications luci-app-cshark CloudShark捕获工具 LuCI Applications luci-app-ddns 动态域名 DNS (集成阿里DDNS客户端) LuCI Applications luci-app-diag-core core诊断工具 LuCI Applications luci-app-dnscrypt-proxy DNSCrypt解决DNS污染 LuCI Applications luci-app-dnsforwarder DNSForwarder防DNS污染 LuCI Applications luci-app-dnspod DNSPod LuCI Applications luci-app-docker Docker容器 LuCI Applications luci-app-dump1090 民航无线频率(不确定) LuCI Applications luci-app-dynapoint DynaPoint(未知) LuCI Applications luci-app-e2guardian Web内容过滤器 LuCI Applications luci-app-familycloud 家庭云盘 LuCI Applications luci-app-filetransfer 文件传输 LuCI Applications luci-app-firewall 添加防火墙 LuCI Applications luci-app-flowoffload Turbo ACC 网络加速(集成FLOW,BBR,NAT,DNS… LuCI Applications luci-app-freifunk-diagnostics freifunk组件 诊断(未知) LuCI Applications luci-app-freifunk-policyrouting freifunk组件 策略路由(未知) LuCI Applications luci-app-freifunk-widgets freifunk组件 Widgets(未知) LuCI Applications luci-app-frpc 内网穿透 Frp LuCI Applications luci-app-fwknopd Firewall Knock Operator服务器 LuCI Applications luci-app-guest-wifi WiFi访客网络 LuCI Applications luci-app-gfwlist GFW域名列表(已弃) LuCI Applications luci-app-haproxy-tcp HAProxy负载均衡-TCP LuCI Applications luci-app-hd-idle 硬盘休眠 LuCI Applications luci-app-hnet Homenet Status家庭网络控制协议 LuCI Applications luci-app-ipsec-vpnd VPN服务器 IPSec LuCI Applications luci-app-kodexplorer KOD可道云私人网盘 LuCI Applications luci-app-kooldns VPN服务器 ddns替代方案 LuCI Applications luci-app-koolproxy KP去广告 LuCI Applications luci-app-lxc LXC容器管理 LuCI Applications luci-app-meshwizard 网络设置向导 LuCI Applications luci-app-minidlna 完全兼容DLNA / UPnP-AV客户端的服务器软件 LuCI Applications luci-app-mjpg-streamer 兼容Linux-UVC的摄像头程序 LuCI Applications luci-app-mtwifi MTWiFi驱动的支持 LuCI Applications luci-app-mmc-over-gpio 添加SD卡操作界面 LuCI Applications luci-app-multiwan 多拨虚拟网卡(已弃) LuCI Applications luci-app-mwan3 MWAN负载均衡 LuCI Applications luci-app-mwan3helper MWAN3分流助手 LuCI Applications luci-app-n2n_v2 N2N 内网穿透 N2N v2 VPN服务 LuCI Applications luci-app-netdata Netdata实时监控(图表) LuCI Applications luci-app-nft-qos QOS流控 Nftables版 LuCI Applications luci-app-ngrokc Ngrok 内网穿透 LuCI Applications luci-app-nlbwmon 网络带宽监视器 LuCI Applications luci-app-noddos NodDOS Clients 阻止DDoS攻击 LuCI Applications luci-app-nps 内网穿透nps LuCI Applications luci-app-ntpc NTP时间同步服务器 LuCI Applications luci-app-ocserv OpenConnect VPN服务 LuCI Applications luci-app-olsr OLSR配置和状态模块 LuCI Applications luci-app-olsr-services OLSR服务器 LuCI Applications luci-app-olsr-viz OLSR可视化 LuCI Applications luci-app-ocserv OpenConnect VPN服务(已弃) LuCI Applications luci-app-openvpn OpenVPN客户端 LuCI Applications luci-app-openvpn-server 易于使用的 OpenVPN 服务器 Web-UI LuCI Applications luci-app-oscam OSCAM服务器 LuCI Applications luci-app-p910nd 打印服务器模块 LuCI Applications luci-app-pagekitec Pagekite 内网穿透客户端 LuCI Applications luci-app-polipo Polipo代理(是一个小型且快速的网页缓存代理) LuCI Applications luci-app-pppoe-relay PPPoE NAT穿透 点对点协议(PPP) LuCI Applications luci-app-pptp-server VPN服务器 PPTP LuCI Applications luci-app-privoxy Privoxy网络代理(带过滤无缓存) LuCI Applications luci-app-qbittorrent BT下载工具(qBittorrent) LuCI Applications luci-app-qos 流量服务质量(QoS)流控 LuCI Applications luci-app-radicale CalDAV/CardDAV同步工具 LuCI Applications luci-app-ramfree 释放内存 LuCI Applications luci-app-rp-pppoe-server Roaring Penguin PPPoE Server 服务器 LuCI Applications luci-app-samba 网络共享(samba) LuCI Applications luci-app-samba4 网络共享(samba4) LuCI Applications luci-app-sfe Turbo ACC 网络加速(集成FLOW,BBR,NAT,DNS… LuCI Applications luci-app-shadowsocks 科学上网 LuCI Applications luci-app-shadowsocks-libev SS-libev服务端 LuCI Applications luci-app-shairplay 支持AirPlay功能 LuCI Applications luci-app-siitwizard SIIT配置向导 SIIT-Wizzard LuCI Applications luci-app-simple-adblock 简单的广告拦截 LuCI Applications luci-app-softethervpn SoftEther VPN服务器 NAT穿透 LuCI Applications luci-app-splash Client-Splash是无线MESH网络的一个热点认证系统 LuCI Applications luci-app-sqm 流量智能队列管理(QOS) LuCI Applications luci-app-squid Squid代理服务器 LuCI Applications luci-app-ssr-plus SSR科学上网Plus+ luci-app-ssr-plus Include Shadowsocks New Versiong 新SS代理 Include V2ray V2Ray透明代理 Include Trojan Trojan代理 Include Kcptun Kcptun代理 Include ShadowsocksR Server SSR服务器 Include ShadowsocksR Socks and Tunnel SSR代理 LuCI Applications luci-app-ssr-pro SSR科学上网pro LuCI Applications luci-app-ssrserver-python ShadowsocksR Python服务器 LuCI Applications luci-app-statistics 流量监控工具 LuCI Applications luci-app-syncdial 多拨虚拟WAN(原macvlan) LuCI Applications luci-app-tinyproxy Tinyproxy是 HTTP(S)代理服务器 LuCI Applications luci-app-transmission BT下载工具 LuCI Applications luci-app-travelmate 旅行路由器 LuCI Applications luci-app-ttyd 网页终端命令行 LuCI Applications luci-app-udpxy udpxy做组播服务器 LuCI Applications luci-app-uhttpd uHTTPd Web服务器 LuCI Applications luci-app-unblockmusic 解锁网易云灰色歌曲 LuCI Applications luci-app-unbound Unbound DNS解析器 LuCI Applications luci-app-upnp 通用即插即用UPnP(端口自动转发) LuCI Applications luci-app-usb-printer USB 打印服务器 LuCI Applications luci-app-v2ray-server V2Ray 服务器 LuCI Applications luci-app-v2ray-pro V2Ray透明代理(已弃,集成SSR) LuCI Applications luci-app-v2ray-verysync 微力同步 LuCI Applications luci-app-vlmcsd KMS服务器(激活工具) LuCI Applications luci-app-vnstat vnStat网络监控(图表) LuCI Applications luci-app-vpnbypass VPN BypassWebUI 绕过VPN设置 LuCI Applications luci-app-vsftpd FTP服务器 LuCI Applications luci-app-watchcat 断网检测功能与定时重启 LuCI Applications luci-app-webadmin Web管理页面设置 LuCI Applications luci-app-webshell 网页命令行终端 LuCI Applications luci-app-wifischedule WiFi 计划 LuCI Applications luci-app-wireguard VPN服务器 WireGuard状态 LuCI Applications luci-app-wireless-regdb WiFi无线 LuCI Applications luci-app-wol WOL网络唤醒 LuCI Applications luci-app-wrtbwmon 实时流量监测 LuCI Applications luci-app-xlnetacc 迅雷快鸟 LuCI Applications luci-app-zerotier 内网穿透 ZeroTier LuCI Applications luci-app-luci-i18n-chinese 添加luci的中文语言包
可选择自己需要的插件然后进行保存配置文件即可
我们现在下载dl库编译固件,建议全局科学上网(J是线程数,第一次编译建议单线程成功率了高)
1 2 make download -j8 make V=s -j1
第一次编译可能会出现一些错误,第一次基本都是网络错误或者是插件冲突,可以根据提示进行重新编译
也可以进行重新配置
1 2 3 rm -rf ./tmp && rm -rf .config make menuconfig make V=s -j$(nproc)
这是恩山论坛大佬已经整理好的,我下载的有需要自取点我