20190211_jeffrey - silenceuncrio/diary GitHub Wiki

0925

review

0950

確定要開始張羅彌月蛋糕的事宜了

1000

盤一下目前待做項目

  • M330
    • web server and GUI
    • GRE
    • PPTP
    • RIP 1/2
    • OSPF
    • BGP

1105

M330 工作的 branch 在 feature/proscend-proting

利用 ~/330.sh 進開發環境

cd /home/user
source proenv.sh

從 mail 得知 kessy 已完成了 Quectel driver done 以及 LTE CONTROL POWER CHANGE

please git pull then

  1. make target/linux/clean
  2. make

1300

進 proscend

  • make distclean
  • make menuconfig
    • Products/Vendor = M330/1_WIFI
  • make

1340

經過 jessy 和 aaron 的幫助

現在 M330 已經能看到 web 了

盤一下有用的情報

proscend 目錄外層 make 後有用的只有 uboot

  • bin/ar71xx/openwrt-ar71xx-ap147-16M-qca-legacy-uboot.bin
  • 記得要另存新檔成 u-boot.bin
  • 重新 make uboot 的方法
    • make package/qca-legacy-uboot/clean
    • make package/qca-legacy-uboot/compile
    • make package/qca-legacy-uboot/install

proscend 目錄下 make 後有 kernel 以及 rootfs

  • kernel - proscend/image/vmlinux.lzma.uImage
  • rootfs - proscend/image/ap147-nand-jffs2

如何燒錄可使用 uboot 現有的 env

  • 燒錄 uboot - run lu
    tftp 0x80060000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
    
  • 燒錄 kernel - run lk
    tftp 0x80060000 ${dir}vmlinux${bc}.lzma.uImage&&nand erase 0x0 0x200000&&nand write $fileaddr 0x0 $filesize
    
  • 燒錄 rootfs - run lf
    tftp 0x80060000 ${dir}ap147${bc}-nand-jffs2&&nand erase 0x200000 0x2000000&&nand write $fileaddr 0x200000 $filesize
    

注意到要把已經存下來的 uboot env 清掉

erase 0x9f040000 +0x10000

這樣才套到修正過的 uboot env

1425

盤一下我 M330 各個工作項目在系統剛開機完的現況

  • web server and GUI
    ...
    ### module <web> init
    ...
    
  • GRE
    ...
    ### module <gre> init
    ...
    
  • PPTP
    ...
    ### module <pptpd> init
    ...
    
  • RIP 1/2
    ...
    ### module <rip> init
    ...
    ### module <rip> init
     Error: Module rip cfg init failure
    ...
    
  • OSPF
    ...
    ### module <ospf> init
     Error: Module ospf cfg init failure
    ...
    
  • BGP
    ...
    ### module <bgp> init
    ...
    

來看為什麼 rip 會 init 兩次

1540

rip 會 init 兩次

...
### module <rip> init
...
### module <rip> init
 Error: Module rip cfg init failure
...

是因為 profile 裡 PROSRC_RIP 被定義的關係

修正並上 code

commit 36b2a24788eb2c124f7284df0f17ac932fcbb719
Refs: [feature/proscend-porting], {origin/feature/proscend-porting}
Author: jeffrey <[email protected]>
Date:   Mon Feb 11 15:40:58 2019 +0800

    not set the `PROSRC_RIP`

 proscend/mconfig/configs/M330/0_GENERIC/defconfig | 2 +-
 proscend/mconfig/configs/M330/1_WIFI/defconfig    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

再來看為什麼 init 失敗

...
### module <rip> init
 Error: Module rip cfg init failure
...

直接看 log file - cat /home/log/rip_2g.log

182[19700101 0:3:2] [_init:414][Info]
182[19700101 0:3:2] [_get_setting:484][Info] flag: 0
182[19700101 0:3:2] [_verify_setting:549][Info]
182[19700101 0:3:2] [_init:437][Error] Failed to get the current setting to init the rip_2g module

作以下修正

diff --git a/proscend/prosrc/icos/icoslib/rip_2g/rip_2g.c b/proscend/prosrc/icos/icoslib/rip_2g/rip_2g.c
index 5d041c0..fd25038 100644
--- a/proscend/prosrc/icos/icoslib/rip_2g/rip_2g.c
+++ b/proscend/prosrc/icos/icoslib/rip_2g/rip_2g.c
@@ -555,8 +555,7 @@ static int _verify_setting(int flag, int index, void* pStruct, int structSize)
         return ICOS_FAILURE;
     }

-
-
+    return ICOS_SUCCESS;
 }
...
### module <rip> init
...
root@M330:~# cat /home/log/rip_2g.log
169[19700101 0:2:49] [_init:414][Info]
169[19700101 0:2:49] [_get_setting:484][Info] flag: 0
169[19700101 0:2:49] [_verify_setting:549][Info]
169[19700101 0:2:49] [_get_setting:500][Debug] Getting JSON data from /etc/icos/rip_2g/rip_2g.json
169[19700101 0:2:49] [_get_setting:508][Debug] jobj: { "mode": "off", "redistribute_kernel": "off", "redistribute_static": "off", "redistribute_connected": "off", "redistribute_ospf": "off", "redistribute_bgp": "off", "interfaces": [ ] }
169[19700101 0:2:49] [_json_2_setting_handle:231][Debug] mode: 0
169[19700101 0:2:49] [_json_2_setting_handle:239][Debug] redistribute_kernel: 0
169[19700101 0:2:49] [_json_2_setting_handle:247][Debug] redistribute_static: 0
169[19700101 0:2:49] [_json_2_setting_handle:255][Debug] redistribute_connected: 0
169[19700101 0:2:49] [_json_2_setting_handle:263][Debug] redistribute_ospf: 0
169[19700101 0:2:49] [_json_2_setting_handle:271][Debug] redistribute_bgp: 0
169[19700101 0:2:49] [_apply:451][Info] flag: 0
169[19700101 0:2:49] [_set_setting:521][Info] flag: 2
169[19700101 0:2:49] [_verify_setting:549][Info]
198[19700101 0:3:18] [_apply:463][Info] mode: 0
root@M330:~#

解決

問題是之前的平台 M300M360 都是一樣的 code 結果都沒遇到問題

重點是我有印象

搜尋一下自己的日記

上 code 吧

commit 7caf912e209edb6a6d3997edd2d237d057ea923a
Refs: [feature/proscend-porting], {origin/feature/proscend-porting}
Author: jeffrey <[email protected]>
Date:   Mon Feb 11 16:12:29 2019 +0800

    return 'ICOS_SUCCESS' explicitly

 proscend/prosrc/icos/icoslib/rip_2g/rip_2g.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

1615

我想 OSPF 應該也是同樣的症狀

果然是同樣的症頭

commit 1a62fb511f60d96ae2167cee6fe48df8d93f058c
Refs: [feature/proscend-porting], {origin/feature/proscend-porting}
Author: jeffrey <[email protected]>
Date:   Mon Feb 11 16:22:09 2019 +0800

    return 'ICOS_SUCCESS' explicitly

 proscend/prosrc/icos/icoslib/ospf_2g/ospf_2g.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

這樣一來我所負責的 task 在 icos init 階段就都正常了

⚠️ **GitHub.com Fallback** ⚠️