20181009_jeffrey - silenceuncrio/diary GitHub Wiki

0905

review

1025

commit a7351917ce8663dd3de220215ea0f0633499cba5
Refs: [release/v0.08], {origin/release/v0.08}
Author: jeffrey <[email protected]>
Date:   Tue Oct 9 10:20:56 2018 +0800

    re-layout the 'LTE / Lock Bands' web page

 proscend/prosrc/www/app/feature/lock_bands.html | 150 +++++++++++++-----------
 proscend/prosrc/www/app/feature/lock_bands.js   |   1 +
 2 files changed, 83 insertions(+), 68 deletions(-)

1035

盤一下 52XXZ 剩什麼

  • GRE
    • 已有 web ui
    • 待測

不過今天先待機準備應對 M360P V0.08 的 release

monkeyjj time

1340

M360P 已經順利 release

切回 52XXZ

先 pull latest code... ok

進 proscend 目錄 make clean 後再 make

upgrade via uboot... ok

邊測 GRE 邊寫 wiki

一出門就碰壁

root@52XXZ:~# ip tunnel add gre1 mode gre remote 192.168.1.5 local 192.168.1.4 t
tl 255
add tunnel gre0 failed: No such device

裝一台 M360P 來當對照組

root@M360-P:/home/pi_admin# ip tunnel add gre1 mode gre remote 192.168.1.4 local
 192.168.1.5 ttl 255

M360 利用 ifconfig -a 可以看到 gre0 這個 interface

root@M360-P:/home/pi_admin# ifconfig -a
...
gre0      Link encap:UNSPEC  HWaddr C0-A8-01-05-00-00-30-57-00-00-00-00-00-00-00-00
          NOARP  MTU:1476  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

gre1      Link encap:UNSPEC  HWaddr C0-A8-01-05-00-00-90-51-00-00-00-00-00-00-00-00
          POINTOPOINT NOARP  MTU:1476  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
...

52XXZ 利用 ifconfig -a 並沒有看到 gre0 這個 interface

下面是另一個 verify 方式 - lsmod | grep gre

M360P

root@M360-P:/home/pi_admin# lsmod | grep gre
sch_gred 7216 0 - Live 0xc020c000
ip_gre 8560 0 - Live 0xc00d9000
gre 2338 1 ip_gre, Live 0xc00d0000
ip_tunnel 12491 1 ip_gre, Live 0xc00bf000

52XXZ

root@52XXZ:~# lsmod | grep gre

另一種 - ls /lib/modules/<version>/ | grep gre

M360P

root@M360-P:/home/pi_admin# ls /lib/modules/3.10.14/ | grep gre
gre.ko
ip_gre.ko
sch_gred.ko

52XXZ

root@52XXZ:~# ls /lib/modules/3.10.12/ | grep gre
sch_gred.ko
sch_ingress.ko

參考 M360P 的 wiki

確認 52XXZ 的 make menuconfig 目前跟 GRE 相關的 option

image

不過 52XXZ 最好不要直接套用 make menuconfig 產出的 .config

直接修改 52xxz_defconfig

@@ -1682,7 +1682,7 @@ CONFIG_PACKAGE_kmod-macvlan=y
 # CONFIG_PACKAGE_kmod-bonding is not set
 # CONFIG_PACKAGE_kmod-bridge is not set
 # CONFIG_PACKAGE_kmod-capi is not set
-# CONFIG_PACKAGE_kmod-gre is not set
+CONFIG_PACKAGE_kmod-gre=y
 CONFIG_PACKAGE_kmod-ip6-tunnel=y
 # CONFIG_PACKAGE_kmod-ipip is not set
 # CONFIG_PACKAGE_kmod-ipsec is not set

proscend 外層下 make distclean 要很久

直接 source proenv.sh 重套一次 52xxz_defconfig 再直接 make 先看看結果如何

進 proscend 目錄作 make clean 後再 make

直接在 compile host 的 proscend 目錄下作 check

user@8de9e3d5af60:~/proscend$ ls rootfs/lib/modules/3.10.12/ | grep gre
gre.ko
ip_gre.ko
sch_gred.ko
sch_ingress.ko

看來是有的

upgrade via uboot... ok

52XXZ 再次確認

ls /lib/modules/3.10.12/ | grep gre... PASS

root@52XXZ:~# ls /lib/modules/3.10.12/ | grep gre
gre.ko
ip_gre.ko
sch_gred.ko
sch_ingress.ko

lsmod | grep gre... fail

root@52XXZ:~# lsmod | grep gre

為什麼呢?

跟 john 和 aaron 聊過後兩個 solution

第一個就是我目前進行到一半的

直接修改 52xxz_defconfig

@@ -1682,7 +1682,7 @@ CONFIG_PACKAGE_kmod-macvlan=y
 # CONFIG_PACKAGE_kmod-bonding is not set
 # CONFIG_PACKAGE_kmod-bridge is not set
 # CONFIG_PACKAGE_kmod-capi is not set
-# CONFIG_PACKAGE_kmod-gre is not set
+CONFIG_PACKAGE_kmod-gre=y
 CONFIG_PACKAGE_kmod-ip6-tunnel=y
 # CONFIG_PACKAGE_kmod-ipip is not set
 # CONFIG_PACKAGE_kmod-ipsec is not set

然後在 device run-time 石子己選擇是否來 insert kernel module

例如我可以在 shell 使用

root@52XXZ:~# modprobe gre
root@52XXZ:~# modprobe ip_gre

再利用 lsmod | grep gre check

root@52XXZ:~# lsmod | grep gre
ip_gre 7728 0 - Live 0x86e6e000
gre 1906 1 ip_gre, Live 0x86dbf000

這樣一來 ifconfig -a 便可以看到 gre0 這個 interface 了

root@52XXZ:~# ifconfig -a
...
gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-D9-70-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:1476  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
...

另一個 solution 事先在 proscend 外層使用 make kernel_menuconfig

然後參考 M360P 的 wiki

找到 GRE 相關的 configuration

image

然後利用 Help 找出 Symbol

IP: GRE demultiplexer 的 Symbol 是 NET_IPGRE_DEMUX

image

IP: GRE tunnels over IP 的 Symbol 是 NET_IPGRE

不要在這邊作修改然後直接離開

記得砍掉 make kernel_menuconfig 產生出來的 local/kernel-config

rm -rf local/kernel-config

那找出來的的兩個 symbol 要套在哪邊呢

答案是 package/proscend/Makefile

直接作以下修改

@@ -35,6 +35,8 @@ define KernelPackage/proscend-kmods-dep
        CONFIG_NF_NAT_IPV6=y \
        CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y \
        CONFIG_NETFILTER_XT_MATCH_RECENT=y \
+       CONFIG_NET_IPGRE_DEMUX=y \
+       CONFIG_NET_IPGRE=y \

 endef

記得把剛剛 solution 1 修改過的 52xxz_defconfig 先還原

在 proscend 外層 source proenv.sh

確認 local/kernel-config 不存在 - 否則會干擾到 linux kernel 的 building

make clean 後再 time make 量一下時間

1635

build 好了 - 32m50.192s

user@8de9e3d5af60:~$ time make
...
 make[1] world
 make[2] target/compile
 ...
 make[3] -C target/linux install
 make[2] package/index

real    32m50.192s
user    25m39.674s
sys     6m32.439s
user@8de9e3d5af60:~$

進 proscend make clean 後再 make... ok

upgrade via uboot... ok

ls /lib/modules/3.10.12/ | grep gre... 沒有 ???

root@52XXZ:~# ls /lib/modules/3.10.12/ | grep gre
sch_gred.ko
sch_ingress.ko

lsmod | grep gre... 也沒有 ???

root@52XXZ:~# lsmod | grep gre

ifconfig -a... 有

root@52XXZ:~# ifconfig -a
...
gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-C9-70-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:1476  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
...

來測試吧

兩台都用 52XXZ

參考 M300 的 wiki 來進行測試

一下就測完囉...

上 code

commit e7524d306172c7a629ded3d864bd055e1cb81e45
Refs: [develop], {origin/develop}, {origin/HEAD}
Author: jeffrey <[email protected]>
Date:   Tue Oct 9 16:52:49 2018 +0800

    add GRE function:
    - use proscend package to add GRE related kernel module

 package/proscend/Makefile | 2 ++
 1 file changed, 2 insertions(+)

1745

M360P ping 指定 APN1 時帶的 interface 是 eth0

應該要帶 eth1 才對

修改 proscend/prosrc/www/app/feature/ping.html

@@ -29,7 +29,7 @@
     <label class="col-sm-3 control-label">{{ 'PING_LABEL_INTERFACE' | translate }}</label>
     <div class="col-sm-4">
       <select class="form-control" ng-model="vm.use_interface">
-      <option value="eth0">APN1</option>
+      <option value="eth1">APN1</option>
       <option value="ppp800">APN2</option>
       </select>
     </div>

上 code

commit df56b0d89a9a8ae083e10f97cf04655ac05d4b8c
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Tue Oct 9 17:50:19 2018 +0800

    correct the interface of 'APN1'

 proscend/prosrc/www/app/feature/ping.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
⚠️ **GitHub.com Fallback** ⚠️