使用 image builder 快速构建
0.下载image builder
wget http://mirrors.ustc.edu.cn/lede/releases/17.01.4/targets/ar71xx/nand/lede-imagebuilder-17.01.4-ar71xx-nand.Linux-x86_64.tar.xz
1.修改源为中科大的mirror
将repositories.conf修改如下
## Place your custom repositories here, they must match the architecture and version.
# src/gz reboot http://mirrors.ustc.edu.cn/lede/releases/17.01.4
# src custom file:///usr/src/lede/bin/ar71xx/packages
## Remote package repositories
src/gz reboot_core http://mirrors.ustc.edu.cn/lede/releases/17.01.4/targets/ar71xx/nand/packages
src/gz reboot_base http://mirrors.ustc.edu.cn/lede/releases/17.01.4/packages/mips_24kc/base
src/gz reboot_luci http://mirrors.ustc.edu.cn/lede/releases/17.01.4/packages/mips_24kc/luci
src/gz reboot_packages http://mirrors.ustc.edu.cn/lede/releases/17.01.4/packages/mips_24kc/packages
src/gz reboot_routing http://mirrors.ustc.edu.cn/lede/releases/17.01.4/packages/mips_24kc/routing
src/gz reboot_telephony http://mirrors.ustc.edu.cn/lede/releases/17.01.4/packages/mips_24kc/telephony
This is the local package repository, do not remove!
src imagebuilder file:packages
2.扩展128m分区
17.04
sed -i s/'23552k(ubi),25600k@0x6c0000(firmware)'/'120832k(ubi),122880k@0x6c0000(firmware)'/ target/linux/ar71xx/image/legacy.mk
18.06+ patch
patch:
--- trunk/target/linux/ar71xx/image/legacy.mk 2017-01-13 10:48:39.549787945 +0000
+++ trunk-ipvs/target/linux/ar71xx/image/legacy.mk 2016-12-27 21:32:11.480977031 +0000
@@ -199,7 +199,7 @@
LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
LOADER_DATA="$(KDIR)/vmlinux$(5).bin.lzma" BOARD="$(1)" \
compile loader.$(2)
- -$(if $(5),$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2))
+ -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
endef
#
@@ -281,7 +281,7 @@
wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata)ro,256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter)
tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
-wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
+wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),121856k(ubi),123904k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware)
mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi)
3.编译
make image PROFILE="WNDR4300V1" PACKAGES="wget ca-bundle ca-certificates iptables-mod-tproxy ip luci-app-samba block-mount kmod-usb-storage-extras kmod-fs-ntfs kmod-fs-vfat kmod-fs-exfat ip kmod-ip6tables ip6tables luci-proto-ipv6 odhcp6c ip6tables luci-ssl openssh-server openssh-sftp-server libssh2"
参考来源:https://simonsmh.cc/2016/03/为wndr4300编译openwrt/
准备工作
sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc
cd
git clone git://git.openwrt.org/15.05/openwrt.git
cd openwrt
源代码同步构建 (out of dated)
git pull
#git checkout 15.05.01 #检查15.05.01稳定分支
./scripts/feeds update -a
./scripts/feeds install luci
wget https://downloads.openwrt.org/chaos_calmer/15.05.01/ar71xx/nand/config.diff
sed -i s/'CONFIG_TARGET_ar71xx_nand_R6100=y'/'CONFIG_TARGET_ar71xx_nand_WNDR4300=y'/ config.diff
sed -i s/'23552k(ubi),25600k@0x6c0000(firmware)'/'120832k(ubi),122880k@0x6c0000(firmware)'/ target/linux/ar71xx/image/Makefile
cat config.diff >> .config
make defconfig
make -j #多线程
使用 openwrt image builder 快速构建
wget https://downloads.lede-project.org/releases/17.01.2/targets/ar71xx/nand/lede-imagebuilder-17.01.2-ar71xx-nand.Linux-x86_64.tar.xz
tar -xf lede-imagebuilder-17.01.2-ar71xx-nand.Linux-x86_64.tar.xz
cd lede-imagebuilder-17.01.2-ar71xx-nand.Linux-x86_64
make info #查看默认软件包和硬件支持列表
sed -i s/'23552k(ubi),25600k@0x6c0000(firmware)'/'120832k(ubi),122880k@0x6c0000(firmware)'/ target/linux/ar71xx/image/legacy.mk
make image PROFILE="WNDR4300V1" -j #指定机型+多线程
常用软件包
opkg install wget ca-bundle ca-certificates luci-i18n-base-file-zh-cn luci-i18n-firewall-zh-cn iptables-mod-tproxy ip shadowsocks-libev luci-app-shadowsocks ChinaDNS luci-app-chinadns pdnsd luci-app-pdnsd luci-app-samba luci-i18n-samba-zh-cn block-mount kmod-usb-storage-extras kmod-fs-ntfs kmod-fs-vfat kmod-fs-exfat
This blog is under a CC BY-NC-SA 3.0 Unported License
本文链接:https://simonsmh.cc/2016/03/为wndr4300编译openwrt/