栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

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

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

编译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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/983709.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号