如何编译自己需要的 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

相关文章

  • 在外科医生生日当天做手术,患者的死亡率更高?

    「医生,日历上说明日宜手术,请您给我安排一下?」隔壁小李诉说着今天查房的遭遇,老成持重的林主任拍了拍小李的肩膀,「患者说的也不是全无道理嘛,手术的效果确实可能和时间有关。」 在美国医疗界,很早就有「七月效应(July Effect)」的说法,即在每年的七月,以及后面的一段时间内,手术并发症发生的概率相较于其他月份明显升高。 事实上,不同时间对于手术效果的影响…

    无关专业 2020-12-28
  • Docker+Nextcloud快速部署个人网盘

    实验环境:小伙伴的阿里云服务器,安装的是Centos7的系统,要安装的网盘叫Nextcloud如果是debain,需要先修改一下源。在/etc/apt/sources.list文件下添加一条源 然后执行apt-get update命令更新源。 下面开始安装第一步老规矩,先安装Docker环境.命令如下: 我这里已经安装完成就不重复安装了。启动docker并设…

    无关专业 2020-10-12
  • Debian系Linux网卡、下载源及一些全局环境变量设置

        近期有个关于CentOS操作系统的新闻成了热点,CentOS系统的上游公司Red Hat(红帽)将于明年结束CentOS 8的维护,并将CentOS 7持续到2024年结束维护,取而代之的是CentOS Stream 8。CentOS Stream 8与CentOS 8的区别在于CentOS 8是基于稳定版本的Red Hat 系统源代码编译过来的,而…

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

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

    无关专业 2020-12-01
  • Tewa-708G admin password

    1. 假设你光猫的局域网ip是 192.168.1.11. 光猫插入u盘,fat32文件系统。2. 常规用户登陆 http://192.168.1.1:80803. 切换到 管理-设备管理4. 浏览器进入调试模式,在console处,从top切换到MD_Device.html5. 在console内执行`http://192.168.1.1:8080/usb
    无关专业 2020-12-01
  • #脚本#SSH端口怎么防止被暴力破解攻击?使用一键脚本自动拉黑

    SSH端口两种防御脚本 方法1: 超过10次登陆失败就封掉IP,创建shell脚本:secure_ssh.sh 123456789101112 #! /bin/bashcat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{pr…

    无关专业 2021-09-20