峯言凬语 O ever youthful O ever weeping~
本无意与众不同,怎奈何口味太重。
首页
平水韵
颜色表
ABOUT
文章分类
友情链接
OpenWrt 编译
2019-07-19 |Nonni | Net

nh020.png
UPDATE: 20200707
准备
*基于Lean`s源: https://github.com/coolsnowwolf/lede
*添加被删除的回退源: https://github.com/kenzok8/openwrt-packages
*编译前准备好梯子
*不要用root来git和编译
*默认IP: 192.168.1.1, 密码: password
*Ubuntu 18.04 LTS 64bit

开工

  1. 安装更新:

    sudo apt-get update

  2. 安装环境工具:

    sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3.5 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget swig

  3. Git源码目录:

    git clone https://github.com/coolsnowwolf/lede
    cd lede

编译passwall & ss-plus:

cd package
git clone https://github.com/kenzok8/openwrt-packages.git
git clone https://github.com/kenzok8/small.git
git clone https://github.com/OpenWrt-Actions/OpenWrt-Packages
cd ..

如需编译内核:

make target/linux/compile V=s

如需切换内核:

/home/nonni/lede/target/linux/x86/Makefile

KERNEL_PATCHVER:=4.19

具体支持内核版本可查:include/kernel-version.mk

  1. 更新feeds:

    ./scripts/feeds clean
    ./scripts/feeds update -a
    ./scripts/feeds install -a
    

如果出现 feeds update 警告:

rm -rf ./feeds

删掉 feeds 文件夹后再UPDATE:

git pull
./scripts/feeds clean && ./scripts/feeds update -a && ./scripts/feeds install -a
  1. 预下载编译:

    make defconfig
    make -j8 download

选择Soc,<*>编译进固件,<m>编译不进固件,确定路由配置
预下载dl库可以避免下载造成的编译失败
编译冲突,配置还原到初始状态命令:

rm -f .config && rm -f .config.old
rm -rf ./tmp && rm -rf .config
  1. 编译菜单:

    make menuconfig

  2. 开始编译

    make -j1 V=s

-j1 后面是线程数,推荐单线程编译。
或:

make -j$(($(nproc) + 1)) V=s

GoodLuck!

respond-post-334

添加新评论

请填写称呼
请填写合法的电子邮箱地址
请填写合法的网站地址
请填写内容