爲openwrt添加新的profile

一、環境
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 7620
endef
define Profile/WIFI7620/Description
        Default package set compatible with WIFI7620
endef
$(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.sh
5.添加upgrade時board的是吧
    target/linux/ramips/base-files/lib/upgrade/platform.sh
6.status LED如果有
    target/linux/ramps/base-files/etc/diag.sh
7.其他LED如wifi、sub如果有
     target/linux/ramps/base-files/etc/board.d/01_leds
8.network針對board的特別設置
    target/linux/ramps/base-files/etc/board.d/02_network
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章