为openwrt添加新的profile

来源:互联网 发布:冯大辉丁香园离职知乎 编辑:程序博客网 时间:2024/05/18 11:25

一、环境
openwrt版本为15.05.1,以添加基于mt7620a硬件为例介绍添加新profile的方法。
二、步骤
1.添加profile
在target/linux/ramips/mt7620/profiles/下添加一个新的profile wifi7620.mk:

## Copyright (C) 2011 OpenWrt.org## This is free software, licensed under the GNU General Public License v2.# See /LICENSE for more information.#define Profile/WIFI7620        NAME:=wifi 7620endefdefine Profile/WIFI7620/Description        Default package set compatible with WIFI7620endef$(eval $(call Profile,WIFI7620))
    记住名字WIFI7620,之后新建dts文件时名字必须为WIFI7620.dts。2.添加dts    在target/linux/ramips/dts/添加dts文件WIIF7620.dts,该可以拷贝其他使用mt7620的dts,然后稍作修改即可。    完成该步骤后,make menuconfong即可在 Target Profile中看到我们新加的profile(当然Target System要选择Ralink RT288x/RT3xxx,Subtarget选择MT7620 based boards)。注意:要是新添加的profile能被看到,需要删除主目录下的tmp目录或使用touch更新target/linux/ramips/Makefile的时间。3.image build    做完以上步骤后,还需要在target/linux/ramips/image/Makefile添加相应的条目来编译生成升级文件。
## MT7620A Profiles#Image/Build/Profile/WIFI7620=$(call BuildFirmware/Default16M/$(1),$(1),wifi7620,WIFI7620)
4.添加board的识别    target/linux/ramips/base-files/lib/ramips.sh5.添加upgrade时board的是吧    target/linux/ramips/base-files/lib/upgrade/platform.sh6.status LED如果有    target/linux/ramps/base-files/etc/diag.sh7.其他LED如wifi、sub如果有     target/linux/ramps/base-files/etc/board.d/01_leds8.network针对board的特别设置    target/linux/ramps/base-files/etc/board.d/02_network
0 0