编译Openwrt(LEDE)for K3固件详细指南

一、环境

笔者可怜的ubuntu20.04主机,慢就慢点吧。下次用服务器搭个平台~
先照L大的说明来,注意别用root用户!

安装编译依赖:

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-pip qemu-utils \
rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev

二、开始

下载源代码,更新 feeds :

git clone https://github.com/coolsnowwolf/lede
cd lede
./scripts/feeds update -a
./scripts/feeds install -a

三、加入其它包

直接clone到源码的package目录:

cd package
git clone https://github.com/AdguardTeam/AdGuardHome
git clone https://github.com/rufengsuixing/luci-app-adguardhome 
git clone https://github.com/jerrykuku/luci-app-jd-dailybonus
git clone https://github.com/destan19/OpenAppFilter
git clone https://github.com/fw876/helloworld
git clone https://github.com/xiaorouji/openwrt-passwall
cd ..
./scripts/feeds update -i luci
./scripts/feeds install -a -p luci

四、调整一些设置

网络配置在config_generate这个文件里,终端进入源码目录用VIM或其他编辑器:

# 大约在第150行,改默认ip为192.168.2.1,可以用/搜索192.168.1.1来定位
# 大约在第290行,改默认名字'Openwrt',为你喜欢的,不要有空格哦~
# 下一行,改默认时区‘UTC’为‘Asia/Shanghai’
vim package/base-files/files/bin/config_generate
:wq

默认主题:

rm -rf luci-theme-argon
git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git package/lean/luci-theme-argon
sed -i 's/luci-theme-bootstrap/luci-theme-argon/' feeds/luci/collections/luci/Makefile

五、终于开工

按喜好选择要用的插件:

make menuconfig

常用插件:

1.选择CPU型号
Target System—–Target System (Broadcom BCM47xx/53xx (ARM))

2.选择路由型号
Target Profile—-(PHICOMM K3)

3.添加luci
LuCI—>Collections—– <*> luci
						luci-ssl-nginx
						luci-ssl-openssl
4.添加luci的中文语言包、主题
LuCI—>Modules  ---Translations—- <*> chinese
LuCI ─>Themes <*> luci-theme-argon

5.添加DDNS等luci包
LuCI—>Applications —> <*>luci-app-ddns
                       	 luci-app-dnsforwarder
                         luci-app-aria2
                         luci-app-hd-idle         
                         luci-app-ntpc     时间同步服务器
                         luci-app-mwan3    网络叠加
                         luci-app-oaf ...  Open App Filter
                         luci-app-qos
                         luci-app-minidlna
                         luci-app-shairplay
                         luci-app-watchcat
                         luci-app-nlbwmon
                         luci-app-statistics
                         luci-app-wrtbwmon
LuCI —> Applications —>  ssrplush

6.添加USB挂载
Base system —> <*>block-mount
Kernel modules ---> Other modules --->  kmod-mmc     (MMC卡)
Kernel modules ---> Other modules --->  kmod-sdhci   (SD卡)
Kernel modules ---> USB Support --->    kmod-usb-hid (usb键盘鼠标支持) 
                                	    kmod-usb-ohci
                    				    kmod-usb-storage (usb storage 驱动)
                    					kmod-usb-storage-extras
                    					kmod-usb-uhci (usb 1.1 驱动)
                    					kmod-usb2
                    					kmod-usb3
Kernel modules ---> Block Device ---> <> kmod-block2mtd
Kernel modules ---> Block Device ---> <> kmod-scsi-core
Kernel modules ---> Block Device ---> <*> kmod-scsi-generic (usb 转IDE ,SATA)

7.添加硬盘格式支持
Kernel modules —> Filesystems —> <*>kmod-fs-ext4
                                    kmod-fs-f2fs  (overlay要用这个格式)
Kernel modules --> Filesystems -->	kmod-fs-nfs  (NFS服务)
					                kmod-fs-nfs-common
                              		kmod-fs-nfs-common-rpcsec
                             		kmod-fs-nfsd
                              		kmod-fs-ntfs (win硬盘格式只读)
Kernel modules ---> Filesystems ---> kmod-fs-vfat  (古老的dos格式,有些U盘在用)

8.添加UTF8编码
Kernel modules —> Native Language Support —>kmod-nls-utf8

9.添加自动挂载工具
Utilities —> Filesystem —> <*> badblocks
							   f2fs-tools
Utilities ---> Filesystem ---> e2fsprogs (支持ext2/ext3/ext4格式化工具)

10.添加一键开关无线等工具
Utilities —> <*> wifitoggle
Utilities ---> Compression ---> <> unrar (解压缩工具)
Utilities ---> Compression ---> <> unzip (解压缩工具)
Utilities ---> Compression ---> <> zip (压缩工具)
								    bzip2 (解压缩工具)
Utilities ---> disc ---> <> blkid (可以列出分区类型卷标等)
Utilities ---> disc ---> <> fdisk (分区工具)
Utilities ---> disc ---> <> lsblk (列出块设备,还能显示他们之间的依赖关系)
Utilities ─>usb-modeswitch

11.其它重要工具
Extra packages ---> ipv6helper 
Network ---> SSH ---> client
                      server
                      keygen

六、开编

继续听L大的:

make download -j8
make V=s -j1

几小时或一天后…没有梯子能折腾几天或几星期
编译完成后输出路径:bin/targets

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

无证的攻城狮

如本文对您有用,大爷给打个赏!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值