参考:wiki.openwrt.org/doc/howto/obtain.firmware.generate
工作:到官网下载imagebuilder 解压得到文件:OpenWrt-ImageBuilder-ar71xx_nand-for-linux-x86_64
1 进入该文件
vim repositories.conf
## Place your custom repositories here, they must match the architecture and version.
src/gz barrier_breaker_base
src/gz barrier_breaker_luci
src/gz barrier_breaker_management
src/gz barrier_breaker_oldpackages
src/gz barrier_breaker_packages
src/gz barrier_breaker_routing
src/gz barrier_breaker_telephony
# src/gz barrier_breaker
# src custom file:///usr/src/openwrt/bin/ar71xx/packages
## This is the local package repository, do not remove!
src imagebuilder file:packages
2 修改Makefile 完全利用128M nand flash
vim ./target/linux/ar71xx/image/Makefile
将
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),
23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
改为(将ubi和firmware增加96M,完全使用128M flash)
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)
3 定制自己的配置文件
mkdir -p ./files/etc/config
然后可以在config文件夹下放置配置文件,如:network、wireless
4 生成固件:make iamge
sudo make image PROFILE=WNDR4300 PACKAGES="lsqlite3 lua lua-examples luabitop luac luacurl luaexpat luafilesystem luai2c lualanes luaposix luaprofiler luasec luasoap luasocket luasql-sqlite3 luci luci-app-firewall luci-app-multiwan luci-app-qos luci-app-samba luci-app-wshaper luci-base luci-i18n-chinese luci-i18n-english luci-lib-httpclient luci-lib-json luci-lib-nixio luci-mod-admin-full luci-mod-failsafe luci-proto-ppp luci-ssl luci-theme-bootstrap mtd multiwan netifd odhcp6c odhcpd openssh-client openssh-client-utils openssh-keygen openssh-server openssh-sftp-client openssh-sftp-server gpsd gpsd-clients kmod-usb-serial kmod-usb-serial-pl2303" FILES=files/
思考:如何添加自己编译的ipk 软件包
---------------------------------------------------------------------
刷机:
刷img
-
sudo apt-get install tftp
-
-
sudo service network-manager stop Ubuntu 10.4或以上系统用这个命令、
-
-
sudo ifconfig eth0 192.168.1.2
-
sudo ifconfig eth0 netmask 255.255.255.0 (此步可以省略)
-
-
关闭路由电源、
-
捅菊花
-
开电源
-
等变绿灯
-
-
在终端输入
-
tftp
-
tftp> verbose
-
提示Verbose mode on.
-
tftp> binary
-
提示 mode set to octet.
-
tftp> trace
-
提示 Packet tracing on.
-
tftp> rexmt 1
-
tftp> timeout 60
-
tftp> connect 192.168.1.1
-
tftp> put openwrt.bin
完成
-
quit
-
-
sudo service network-manager start
然后就可以尝试是否可以进luci了
阅读(1622) | 评论(0) | 转发(0) |