向openwrt新增ap143的支援

2021-08-15 17:59:47 字數 2562 閱讀 3101

0、 linux核心版本 3.18.36   openwrt版本cc

1、向檔案 \target\linux\ar71xx\generic\profiles\atheros.mk 中新增ap143型別

define profile/ap143

name:=atheros ap143 reference board

// 對應make menuconfig中單板型別選擇處的顯示 

packages:=kmod-usb-core kmod-usb2 kmod-usb-storage 

endef

define profile/ap143/description

package set optimized for the atheros ap143 reference board.

endef

$(eval $(call profile,ap143))

修改完後儲存檔案,然後刪除tmp目錄。

命令: rm -rf tmp

重新進入單板型別後,就會存在ap143單板型別。

2,修改target/linux/ar71xx/image/makefile,在相應三個位置新增以下三行**

ap143_mtdlayout_16m=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art),16000k@0x50000(firmware)

$(eval $(call singleprofile,athlzma,64k,ap143_16m,ap143-16m,ap143,ttys0,115200,$$(ap143_mtdlayout_16m),rkuimage))

$(eval $(call multiprofile,ap143,ap143_16m))

如下圖所示

3、在target/linux/ar71xx/config-3.18檔案中新增下面這行**

config_ath79_mach_ap143=y

4、這步我提供了patch

target/linux/ar71xx/patches-3.18/ 

下即可。

檔名稱為:

909-mips-ath79-add-support-for-ap143.patch

手動修改比較麻煩,於是做了patch

自動完成,修改了

核心原始碼目錄中的

arch/mips/ath79/ 目錄 下machtypes.h 、makefile 、kconfig、gpio.c 、common.h

,並新增了mach-ap143.c檔案,具體修改的內容開啟

patch

一看便知。

5、這一步要修改的這些指令碼都是在刷機後,韌體啟動過程中用到的,也要新增對

ap143單板

的識別。

開啟 target/linux/ar71xx/base-files/lib/ar71xx.sh 

找到 ar71xx_board_detect 函式,加入單板型別:

*"ap143 reference board")

name="ap143"

;; 注:這裡引號內的mw4530r 

和下面其它指令碼中要修改的內容一致

target/linux/ar71xx/base-files/lib/upgrade/platform.sh

檔案中函式 platform_check_image 新增「ap143」

ap136-010 | \

ap136-020 | \

ap135-020 | \

ap143 | \

ap96 | \

bxu2000n-2-a1 | \

db120 | \

注:不修改這個檔案web

頁面刷機會提示韌體不正確。

target/linux/ar71xx/base-files/etc/uci-defaults/leds

找到:ap113)

ucidef_set_led_usbdev "usb" "usb" "ap113:green:usb" "1-1"

;;在下面新增

ap143)

ucidef_set_led_default "wan" "wan" "ap143:green:wan" "1"

ucidef_set_led_switch "lan1" "lan1" "ap143:green:lan1" "switch0" "0x1"

ucidef_set_led_wlan "wlan" "wlan" "ap143:green:wlan" "phy0tpt"

;;6、 修改 target/linux/ar71xx/base-files/etc/uci-defaults/02_network 新增以下**

ap143)

ucidef_set_inte***ces_lan_wan "eth1" "eth0"

ucidef_add_switch "eth1" "1" "1"

ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4"

;;

openwrt之新增OpenWrt軟體包概述

新增軟體包 makefile引入檔案 openwrt 使用三個 makefile 的子檔案,分別為 include topdir rules.mk include include dir kernel.mk include include dir package.mk 由這些 makefile 子檔...

openwrt 新增web介面

要給自己的開發板新增上 web 介面,只需要在 openwrt原始碼中,將 luci 配置進去即可。首先進入 openwrt原始碼頂層目錄,然後執行 make menuconfig 命令。sz yy szyy pc home linux openwrt trunk make menuconfig 然...

OpenWRT新增 crontab開機預設執行

openwrt系統預設已經新增了crond,只是沒有配置預設配置引數,致使服務起不來。1.修改啟動指令碼 etc ini.d cron etc rc.d s50cron為 etc ini.d cron的鏈結 bin sh etc rc.common start 50 service use pid ...