😌 整理、记录一下步骤..
前置
更改源
1 | sed -i.bak 's/\/us.archive.ubuntu.com\//\/cn.archive.ubuntu.com\//g' /etc/apt/sources.list |
关闭IPv6
echo 1 > /proc/sys/net/ipv6/conf/
前置安装
- git subversion make automake autoconf gcc g++ binutils
make, 缺省安装
- libncurses5-dev
- libssl-dev
- gawk
前置
- GitHub(git clone https://github.com/openwrt/openwrt) 获取 OpenWrt, 更改 openWrt 目录为当前用户所有权
1
2例如:
chown -R hocgin:hocgin openwrt
编译(openwrt/)
编译过程
make
./script/feeds update -a
./script/feeds install -a
1 | 4. make deconfig # 使用默认的配置 |
1 | 5. make menuconfig # 基于终端的一种配置方式,提供了文本模式的图形用户界面,用户可以通过光标移动来浏览所支持的各种特性。 |
固件配置, 可以选择编译的软件包
## 部分选项
- 架构(AR7xxx)
- FLASH(Generic)
- 路由器型号(WNDR3800)
- 文件系统(squashfs)
- 通用设置
- [-] Crytographically signed package lists
- [-] Compile with support for patented functionallty
- [-] Enable shadow password support
- [-] Crash logging
- [-] Compile the kernel with debug information
- [-] Compile the kernel SysRq support
- [-] Enable process core dump support
- [-] Enable printk timestamps
- [-] Enable Ipv6 support in packages
- [-] Compile certain packages parallelized
- [-] Enable gcc format-security
- [-] Build the OpenWrt Image Builder
- [-] In
- [-] Build the OpenWrt SDK
- [-] Package the OpenWrt-based Toolchain
其余默认。
make kernel_config
内核配置[开启浮点数模拟(FPU)]
make V=s -j<处理器数量>
编译完成后,移出
bin/ar71xx/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64.tar.bz2
文件, 并解压(tar xvf).进入(
OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64/
)编译成镜像
1
2
3
4
5
6检查基础镜像
parallels@ubuntu:~/OpenWrt/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64$ make image PROFILE=WNDR3700
包含必备包`预装软件`的镜像
parallels@ubuntu:~/OpenWrt/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64$ make image PROFILE=WNDR3700 PACKAGES="-dnsmasq dnsmasq-full ipset openssh-keygen openssh-server openssh-sftp-server kmod-fs-ext4 kmod-fs-ntfs kmod-fs-vfat kmod-usb2 kmod-usb-core kmod-usb-storage kmod-usb-storage-extras luci-app-firewall luci-app-samba luci-app-upnp luci luci-theme-material curl kmod-ipt-nat-extra libpcre"生成镜像(
~/OpenWrt/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64/bin/
)
- openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin
- openwrt-ar71xx-generic-wndr3800-squashfs-factory.img