如何编译自己需要的 OpenWrt 固件

Lean https://github.com/coolsnowwolf/lede

注意:

  1. 要用 root 用户 git 和编译!!!
  2. 国内用户编译前最好准备好梯子
  3. 默认登陆IP 192.168.1.1, 密码 password

编译命令如下:

  1. 首先装好 Ubuntu 64bit,推荐 Ubuntu 18 LTS x64
  2. 命令行输入 sudo apt-get update ,然后输入 sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 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 curl swig rsync
  3. 使用 git clone https://github.com/coolsnowwolf/lede 命令下载好源代码,然后 cd lede 进入目录
  4. ./scripts/feeds update -a ./scripts/feeds install -a make menuconfig
  5. make -j8 download V=s 下载dl库(国内请尽量全局科学上网)
  6. 输入 make -j1 V=s (-j1 后面是线程数。第一次编译推荐用单线程)即可开始编译你要的固件了。

本套代码保证肯定可以编译成功。里面包括了 R20 所有源代码,包括 IPK 的。

二次编译:

cd lede
git pull
./scripts/feeds update -a && ./scripts/feeds install -a
make defconfig
make -j8 download
make -j$(($(nproc) + 1)) V=s

如果需要重新配置:

rm -rf ./tmp && rm -rf .config
make menuconfig
make -j$(($(nproc) + 1)) V=s

编译完成后输出路径:/lede/bin/targets

English Version: How to make your Openwrt firmware.

Note:

  1. DO NOT USE ROOT USER TO CONFIGURE!!!
  2. Login IP is 192.168.1.1 and login password is “password”.

Let’s start!

First, you need a computer with a linux system. It’s better to use Ubuntu 18 LTS 64-bit.

Next you need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers installed.

To install these program, please login root users and type 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 rsync in terminal

Third, logout of root users. And type this git clone https://github.com/coolsnowwolf/lede in terminal to clone this source.

After these please type cd lede to cd into the source.

Please Run ./scripts/feeds update -a to get all the latest package definitions defined in feeds.conf / feeds.conf.default respectively and ./scripts/feeds install -a to install symlinks of all of them into package/feeds/ .

Please use make menuconfig to choose your preferred configuration for the toolchain and firmware.

Use make menuconfig to configure your image.

Simply running make will build your firmware. It will download all sources, build the cross-compile toolchain, the kernel and all chosen applications.

To build your own firmware you need to have access to a Linux, BSD or MacOSX system (case-sensitive filesystem required). Cygwin will not be supported because of the lack of case sensitiveness in the file system.

Note: Addition Lean’s private package source code in ./package/lean directory. Use it under GPL v3.

GPLv3 is compatible with more licenses than GPLv2: it allows you to make combinations with code that has specific kinds of additional requirements that are not in GPLv3 itself. Section 7 has more information about this, including the list of additional requirements that are permitted.

(0)
PipitaPipita
上一篇 2020-12-10
下一篇 2020-12-10

相关文章

  • Teamviewer便携版

    https://www.pita.ltd/wp-content/uploads/2020/11/TeamViewer.zip

    无关专业 2020-11-28
  • 利用 Caddy 一键反代网站并签发证书SSL

    安装Caddy 运行以下命令: 配置文件 以下所有示例域名为boluo.link,请注意替换为自己的域名 ! 1、服务器IP反向代理 下面是一个,用你服务器的IP来反向代理一个http协议的网站http://www.baidu.com 。 服务器IP也可以反向代理HTTPS协议的网站,但是需要自签SSL证书,现在的浏览器一般都不会认自签的SSL证书,所以不建…

    无关专业 2020-12-01
  • PROXMOX PVE 设置国内源

    目前Proxmox中文社区源已正式提供镜像服务,镜像更新频率为每10小时,镜像站机房存放在法国巴黎online机房使用阿里云、华为云融合提供国内CDN加速服务。 地址 http://download.proxmox.wiki # 删除企业源 rm -rf /etc/apt/sources.list.d/pve-enterprise.list #下载秘钥 wg…

    无关专业 2020-12-01
  • 教程:Linux挂载FTP为本地文件夹

    本教程适用于Debian/ubuntu,其他linux发行版安装curlftpfs也可。 1、安装curlftpfs apt-get install  curlftpfs 2、创建用于挂载的文件夹 mkdir /mnt/ftp   #也可在宝塔中创建 3、挂载 curlftpfs ftp.yourserver…

    无关专业 2020-06-27
  • PVE导入img为磁盘

    ./img2kvm <img文件> <vmid如101>  <虚拟磁盘名称如vm-101-disk-1> 另一种方法: qemu-img convert -f raw -O qcow2 DS3617xs_DSM6.1_Broadwell.img vm-103-disk-2.qcow2…

    无关专业 2020-07-19
  • UNRAID使用NVIDIA显卡(直通篇)

    在UNRAID下想要利用NVIDIA显卡,最为传统的方法是创建一个虚拟机,并将显卡直通进去。最早使用1080测试了直通功能,只需要在虚拟机设置里的Other PCI Devices选中1080即可。但20系显卡因为多了一个type c接口,情况有些变化,之前在知乎上分享了URNIAD 6.6.6直通2080ti的经历,特地将其转载过来。 错误 之前在Unra…

    无关专业 2020-05-18