openwrt 移植 mt7620并定制个性版.docVIP

  • 93
  • 0
  • 约5.85千字
  • 发布于天津
  • 举报
  • 文档已下架,其它文档更精彩
openwrt 移植 mt7620并定制个性版.doc

openwrt普及及一般操作 Openwrt源码 /wiki/GetSource trunk 开发快照 git clone git:///openwrt.git branch(基于backfire的分支) attitude adjustment 内核更新至3.3 git clone git:///12.09/openwrt.git barrier breaker 内核更新至3.10 (本次实验使用版本) git clone git:///14.07/openwrt.git chaos calmer 最新 git clone git:///15.05/openwrt.git openwrt源码目录 include 存放.mk文件,makefile中使用 bin 生成的目标固件 build_dir/host 建立工具链时临时文件 build_dir/toolchain-arch* 对应硬件的工具链的目录 staging_dir/toolchain-arch* 对应硬件工具链安装目录 target/linux/platform 目录对应各平台arch相关代码 target/linux/platform/config* 文件就是配置文件 dl 就是下载的文件 build_dir/ 目录下进行解压,编译和打补丁 package/ 目录里保护所有配置文件中设定的编译好的软件包 feeds/packages 执行feeds install后安装的包 源码下载、配置编译 创建用户 Openwrt不能以root用户编译,需要创建一个非root用户 useradd openwrt passwd openwort su – openwrt 源码下载 git clone git:///14.07/openwrt.git ./scripts/feeds update –a ./scripts/feeds install –a 配置 make menuconfig Target System –Ralink RT288x/RT3xxx Subtarget-MT7620a based boards LuCI-Collections-*luci -Translations-*luci-i18n-chinese 编译 make V=99 烧写实验 bin/rampis/ openwrt-ramips-mt7620a-MZK-squashfs-sysupgrade.bin 发现可以启动,但是波特率有问题,uboot和内核的不一样 修改target/linux/ramips/dts/mt7620a.dtsi bootargs = “console=ttyS0,57600” 重新编译,烧写。发现启动无异常 定制sxfg openwrt dts文件修改 cd target/linux/ramips/dts/ cp MZK-750DHP.dts FENGGUANG.dts 修改FENGGUANG.dts 修改设备名称 module = “sxfg” (L7) 修改flash分区 由于我们的flash是16M的,修改firmware分区大小为0xfb0000(L45) (firmware)+(factory)+(uboot-env)+(uboot)=flash (kernel)+(rootfs)=firmware (squashfs(ro))+(jffs2(rw,rootfs_data))=rootfs 修改Makefile使其生成定制镜像 cd target/linux/ramips/image/ 在MT7620A Profiles下面增加变量 Image/Build/Profile/FENGGUANG=$(call BuildFirmware/Default16M/$(1),$(1),sxfg,FENGGUANG) 在Image/Build/Profile/Default宏中增加 $(call Image/Build/Profile/FENGGUANG,$(1)) 这样就可以生成*sxfg*的镜像,为了不生成无关的,在宏中删除掉其他的就好 解决mtd分区没有对齐问题 考虑到openwrt是自动分离内核跟文件系统,因此考虑解决办法是固定内核大小,给内核padding空数据 cd target/linux/ramips/image/ 修改Makefile中宏PatchKernelLzmaDtb 在压缩内核调用后增加调用$(call KernelPadding,$(KDI

文档评论(0)

1亿VIP精品文档

相关文档