Openwrt-增加你的板子到Openwrt

增加你的板子到Openwrt

以7688为例:

openwrt/target/linux/ramips/

  1. 创建profiles/02-ipRec-DM06.mk文件

openwrt\target/linux/ramips/mt7688/profiles/02-iprec-dm06.mk

最简单的方法是直接复制01-mediatek.mk文件到02-iprec-dm06.mk,然后修改相关设置

#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

define Profile/ipRec-DM06
        NAME:=ipRec-DM06
        PACKAGES:=\
                kmod-usb-core kmod-usb2 kmod-usb-ohci \
                uboot-envtools kmod-ledtrig-netdev
endef

define Profile/ipRec-DM06/Description
        Default package set compatible with most boards.
endef
$(eval $(call Profile,ipRec-DM06))
~

该文件中包含了Profile的项目名称,和依赖的工具。

  1. 创建dts/IPREC-DM06.dts文件

openwrt\target/linux/ramips/mt7688/dts/IPREC-DM06.dts

也采用和prfiles类似的方式,复制现有的dts文件,然后修改参数。

$ cp LINKIT7688.dts IPREC-DM06.dts
  1. 修改image/Makefile文件

openwrt_1505/target/linux/ramips/image/Makefile

#
# MT7688 Profiles
#

Image/Build/Profile/MT7688=$(call BuildFirmware/Default4M/$(1),$(1),mt7628,MT7628)
Image/Build/Profile/LinkIt7688=$(call BuildFirmware/Default32M/$(1),$(1),LinkIt7688,LINKIT7688)
Image/Build/Profile/ipRec-DM06=$(call BuildFireware/Default16M/$(1),$(1),ipRec-DM06,IPREC-DM06)
ifeq ($(SUBTARGET),mt7628)
define Image/Build/Profile/Default
        $(call Image/Build/Profile/MT7688,$(1))
        $(call Image/Build/Profile/LinkIt7688,$(1))
        $(call Image/Build/Profile/ipRec-DM06,$(1))
endef
endif
  1. 修改相关的配置文件

    • base-files/lib/ramips.sh
    • base-files/etc/board.d/01_leds
    • base-files/etc/board.d/02_network
  2. make menuconfig

$ cd openwrt
$ rm -rf tmp
$ make menuconfig

欢迎修正

猜你喜欢

转载自blog.csdn.net/hnhkj/article/details/54630098