Chinaunix首页 | 论坛 | 博客
  • 博客访问: 884367
  • 博文数量: 286
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1841
  • 用 户 组: 普通用户
  • 注册时间: 2015-05-09 16:26
文章分类

全部博文(286)

文章存档

2016年(38)

2015年(248)

我的朋友

分类: LINUX

2015-07-22 18:36:58

    参考: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

点击(此处)折叠或打开

  1. sudo apt-get install tftp

  2. sudo service network-manager stop Ubuntu 10.4或以上系统用这个命令、

  3.  sudo ifconfig eth0 192.168.1.2  
  4.  sudo ifconfig eth0 netmask 255.255.255.0 (此步可以省略)
  5.   
  6. 关闭路由电源、
  7. 捅菊花
  8. 开电源
  9. 等变绿灯

  10. 在终端输入
  11.     tftp
  12.     tftp> verbose
  13.     提示Verbose mode on.
  14.     tftp> binary
  15.     提示 mode set to octet.
  16.     tftp> trace
  17.     提示 Packet tracing on.
  18.     tftp> rexmt 1
  19.     tftp> timeout 60
  20.     tftp> connect 192.168.1.1
  21.     tftp> put openwrt.bin

                    完成

  1.     quit
  2.    
  3. sudo service network-manager start
然后就可以尝试是否可以进luci了

阅读(1615) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~