20200203_jeffrey - silenceuncrio/diary GitHub Wiki
上禮拜使用 VMware 的 Expand Disk Capacity 將 Maximum disk size 從 120 GB 加到 160 GB 已完成
依照下面的訊息來做後續的動作
參考 How to Resize Your Ubuntu Partitions
不確定會花掉多少時間
先放棄
後續空間不夠的話可以參考 jessy 的方案
新增 hard disk 再用 mount 的方式
這新增的 hard disk 可專為了某一個 project
pm 希望我先抽時間完成 來自客戶 ADVICE 的需求 - 機種是 M300
上禮拜五 是估 4 天
開工吧
再度開啟 VMware - Ubuntu 64-bit
git pull - M300[develop]
- Products/Vendor = M300/8_GPS_ADVICE
目前正在 compile 中
估一下怎麼來完成這件事
- 先從 m330 把 gre porting 過來
- 整理 compile flag
- 從 profile 來看不要有 gre_2g 或 gre_3g
- icos module 可以有
- 測試環境
- M300 兩台
先從 m330 把 gre porting 過來
先 porting grek
發生在 m330 沒看過的錯誤
user@f14571e79bb2:~/proscend/prosrc/icos/greK$ make
/home/user/build_small/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/user/build_small/tmp/sysroo
ts/m300 -c -finstrument-functions -fPIC -std=gnu99 -Wall -I/home/user/proscend/prosrc/icos/include -I/home/user/build_small/tmp/sysroots/m300/usr/include -I/home/user/build_small/tmp/sysroots/m300/usr/include/li
bxml2 -I/home/user/build_small/tmp/sysroots/m300/usr/include/glib-2.0 -I/home/user/build_small/tmp/sysroots/m300/usr/lib/glib-2.0/include -I/home/user/build_small/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe
-g -feliminate-unused-debug-types -D__DEBUG__ -D__DEBUG__0 -o main.o main.c
In file included from /home/user/build_small/tmp/sysroots/m300/usr/include/pcap/pcap.h:49:0,
from /home/user/build_small/tmp/sysroots/m300/usr/include/pcap.h:43,
from main.c:18:
/home/user/build_small/tmp/sysroots/m300/usr/include/pcap/bpf.h:86:9: error: unknown type name 'u_int'
typedef u_int bpf_u_int32;
^
/home/user/build_small/tmp/sysroots/m300/usr/include/pcap/bpf.h:106:2: error: unknown type name 'u_int'
u_int bf_len;
^
/home/user/build_small/tmp/sysroots/m300/usr/include/pcap/bpf.h:1460:2: error: unknown type name 'u_short'
u_short code;
^
...
參考 C PCAP library unknown types error
在 grek 的 Makefile 新增
CFLAGS += -D_BSD_SOURCE
再次 make
user@f14571e79bb2:~/proscend/prosrc/icos/greK$ make
/home/user/build_small/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/user/build_small/tmp/sysroots/m300 -c -finstrument-functions -fPIC -std=gnu99 -Wall -I/home/user/proscend/prosrc/icos/include -I/home/user/build_small/tmp/sysroots/m300/usr/include -I/home/user/build_small/tmp/sysroots/m300/usr/include/libxml2 -I/home/user/build_small/tmp/sysroots/m300/usr/include/glib-2.0 -I/home/user/build_small/tmp/sysroots/m300/usr/lib/glib-2.0/include -I/home/user/build_small/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -g -feliminate-unused-debug-types -D__DEBUG__ -D__DEBUG__0 -D_BSD_SOURCE -o main.o main.c
In file included from /home/user/build_small/tmp/sysroots/m300/usr/include/ctype.h:25:0,
from main.c:6:
/home/user/build_small/tmp/sysroots/m300/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
^
main.c:63:0: warning: "ETHER_ADDR_LEN" redefined
#define ETHER_ADDR_LEN 6
^
...
注意到
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
修正成在 grek 的 Makefile 新增
CFLAGS += -D_DEFAULT_SOURCE
user@f14571e79bb2:~/proscend/prosrc/icos/greK$ make
/home/user/build_small/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/home/user/build_small/tmp/sysroots/m300 -c -finstrument-functions -fPIC -std=gnu99 -Wall -I/home/user/proscend/prosrc/icos/include -I/home/user/build_small/tmp/sysroots/m300/usr/include -I/home/user/build_small/tmp/sysroots/m300/usr/include/libxml2 -I/home/user/build_small/tmp/sysroots/m300/usr/include/glib-2.0 -I/home/user/build_small/tmp/sysroots/m300/usr/lib/glib-2.0/include -I/home/user/build_small/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -g -feliminate-unused-debug-types -D__DEBUG__ -D__DEBUG__0 -D_DEFAULT_SOURCE -o main.o main.c
main.c:63:0: warning: "ETHER_ADDR_LEN" redefined
#define ETHER_ADDR_LEN 6
^
In file included from main.c:19:0:
/home/user/build_small/tmp/sysroots/m300/usr/include/net/ethernet.h:59:0: note: this is the location of the previous definition
#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
^
main.c: In function 'my_packet_handler':
main.c:149:36: error: 'SHM_ID_GRE_TUNNEL_KEEPALIVE_COUNTER' undeclared (first use in this function)
ICOS_shm_status_update(SHM_ID_GRE_TUNNEL_KEEPALIVE_COUNTER, Tunnel_index, &Tunnel_keepalive_counter);
^
main.c:149:36: note: each undeclared identifier is reported only once for each function it appears in
main.c:116:34: warning: variable 'ethernet' set but not used [-Wunused-but-set-variable]
const struct sniff_ethernet *ethernet; /* The ethernet header */
^
main.c: In function 'handler':
main.c:213:32: error: 'SHM_ID_GRE_TUNNEL_INTF_DOWN' undeclared (first use in this function)
ICOS_shm_status_update(SHM_ID_GRE_TUNNEL_INTF_DOWN, Tunnel_index, &down);
^
main.c:216:19: error: 'MODULE_GRE_3G' undeclared (first use in this function)
ICOS_slog(MODULE_GRE_3G, LOG_INFO, "set the interface %s down", Tunnel_name);
^
main.c:267:28: error: 'SHM_ID_GRE_TUNNEL_KEEPALIVE_COUNTER' undeclared (first use in this function)
ICOS_shm_status_update(SHM_ID_GRE_TUNNEL_KEEPALIVE_COUNTER, Tunnel_index, &Tunnel_keepalive_counter);
^
main.c: In function 'main':
main.c:588:12: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
printf("Timer ID: %ld (%s)\n", (long) tid);
^
main.c:339:14: warning: unused variable 'xfnd' [-Wunused-variable]
int opt, xfnd;
^
make: *** [main.o] Error 1
user@f14571e79bb2:~/proscend/prosrc/icos/greK$
來解錯誤之處吧
grek 算是 porting 完成
root@m300:/tmp# ./grek
Please offer the DEVICE
Usage: ./grek [OPTIONS]
GRE Tunnel Keepalive
-d DEVICE Device to issue keepalive
-t TUNNLE Tunnel name
-i INDEX Tunnel index for update to share memory
-l LOCAL Local address of the tunnel
-r REMOTE Remote address of the tunnel
-p Period <0-32767> Keepalive period (default 10 seconds)
-n Retries <1-255> Keepalive retries (default 3 times)
root@m300:/tmp#
areil 來信跟 team member 表示
Hytec Japan 剛剛通知水壩工程標案飛了. 所以 DO Schedule 也不用繼續做下了. 唉! ...
整理 compile flag
- 從 profile 來看不要有 gre_2g 或 gre_3g
- icos module 可以有
profile 只留 PROSRC_GRE 來控制 gre module
但我內部的 icos module 一樣進階到 gre_3g - 但受 compiel flag PROSRC_GRE 來控制
- 一來方便自己升級 module 沒有後顧之憂
- 需要修改 profile 的同仁不用煩惱到底要開哪個 gre 的 compile flag
除了 cgi 及 web 之外 - 先 build 一版來試試
修了不少 compile error... 必要的辛苦
結論一下前天禮拜六投資給車子的改善
- android 主機 14000 - 快九吋的螢幕
- 倒車鏡頭 2000
- 行車紀錄器 4000
- 德國RAINBOW喇叭一對 5500 * 2
禮拜六帶全一家人去 關西 黛安莊園
- 導航王 導航
- youtube 放音樂
一整個滿意 - 好好保養的話還可以再開個五年都不是問題
porting 只剩 web 部分
趕緊 porting 完 - aaron 也要幫忙 cli
加上 compile flag 改吃 PROSRC_GRE - 怕是會花掉一些額外時間
剛剛結束二月份的月會
gre web 的部分也從 m330 porting 到 m300 去了
透過 web 來啟動 gre with keepalive
可以發現 grek 有啟動
而且 interface status 的確有從 UP 變成 DOWN
雖然還沒有實際拿兩台 M300 做測試
但還是先把目前的 code 做 commit 方便 aaron porting cli
M300[develop] - porting new gre module from m330
commit 8d373654aba8289b6d2206393cc8ec38519c0d63
Author: jeffrey <[email protected]>
Date: Mon Feb 3 16:32:00 2020 +0800
porting new gre module from m330
.../rootfs/home/factory/icos/gre_3g/gre_3g.json | 31 +
proscend/mconfig/9_GPS_TELEWELL.bak/defconfig | 3 +-
proscend/mconfig/Config.in | 1 -
proscend/mconfig/M300_11_SIERRA/defconfig | 3 +-
proscend/mconfig/M300_15_SIERRA_TELWELL/defconfig | 3 +-
.../mconfig/configs/Azuretec/0_OLTRG100/defconfig | 3 +-
.../mconfig/configs/Azuretec/1_OLTRG101/defconfig | 3 +-
.../mconfig/configs/Azuretec/2_OLTRG100X/defconfig | 3 +-
.../mconfig/configs/LITE/0_GPS_XENTINO/defconfig | 3 +-
proscend/mconfig/configs/LITE/1_GPS/defconfig | 3 +-
proscend/mconfig/configs/M300/0_GENERIC/defconfig | 3 +-
.../mconfig/configs/M300/10_GPS_HYTEC/defconfig | 3 +-
proscend/mconfig/configs/M300/11_PLANET2/defconfig | 3 +-
proscend/mconfig/configs/M300/12_XENTINO/defconfig | 3 +-
.../mconfig/configs/M300/13_XENTINO_GPS/defconfig | 3 +-
.../mconfig/configs/M300/14_NAUTILUS/defconfig | 3 +-
.../mconfig/configs/M300/15_GPS_PLANET2/defconfig | 3 +-
.../mconfig/configs/M300/16_MTK_WIFI/defconfig | 3 +-
.../mconfig/configs/M300/17_LAN_ADVICE/defconfig | 3 +-
proscend/mconfig/configs/M300/1_GPS/defconfig | 3 +-
proscend/mconfig/configs/M300/2_PLANET/defconfig | 3 +-
.../mconfig/configs/M300/3_GPS_PLANET/defconfig | 3 +-
proscend/mconfig/configs/M300/4_CTCU/defconfig | 3 +-
.../configs/M300/5_XENTINO_MR401G/defconfig | 3 +-
proscend/mconfig/configs/M300/6_CXR/defconfig | 3 +-
proscend/mconfig/configs/M300/7_GPS_CXR/defconfig | 3 +-
.../mconfig/configs/M300/8_GPS_ADVICE/defconfig | 3 +-
proscend/mconfig/configs/M300E/1_GPS/defconfig | 3 +-
.../configs/M300E/2_AZURETEC_LTRG101/defconfig | 3 +-
.../mconfig/configs/M300E/3_GPS_XENTINO/defconfig | 3 +-
.../mconfig/configs/M300E/4_MTK_WIFI/defconfig | 3 +-
proscend/prosrc/icos/Makefile | 12 +-
proscend/prosrc/icos/clishell/Makefile | 2 +-
proscend/prosrc/icos/clishell/cli.c | 2 +-
proscend/prosrc/icos/clishell/gre.c | 20 +-
proscend/prosrc/icos/clishell/menutree.c | 6 +-
proscend/prosrc/icos/greK/Makefile | 39 ++
proscend/prosrc/icos/greK/grek | Bin 0 -> 11788 bytes
proscend/prosrc/icos/greK/main.c | 660 ++++++++++++++++++
proscend/prosrc/icos/icoslib/Makefile | 6 +-
proscend/prosrc/icos/icoslib/cli/cli.c | 2 +-
proscend/prosrc/icos/icoslib/entry.c | 13 +-
proscend/prosrc/icos/icoslib/gre_3g/Makefile | 14 +
proscend/prosrc/icos/icoslib/gre_3g/gre_3g.c | 751 +++++++++++++++++++++
.../prosrc/icos/icoslib/ipc_utility/icos_ipc.c | 59 +-
proscend/prosrc/icos/icoslib/pptpd/pptpd.c | 4 +-
.../prosrc/icos/icoslib/utility/icos_utility.c | 6 +-
proscend/prosrc/icos/include/icos_common.h | 3 +-
proscend/prosrc/icos/include/icos_module.h | 5 +-
proscend/prosrc/icos/include/icos_shm.h | 22 +-
proscend/prosrc/icos/include/module_gre_3g.h | 43 ++
proscend/prosrc/webcgi/Makefile | 6 +-
proscend/prosrc/webcgi/gre_3g.c | 105 +++
proscend/prosrc/webcgi/icos_shm.c | 30 +
proscend/prosrc/www/Makefile | 1 +
proscend/prosrc/www/app/feature/gre_3g.js | 126 ++++
proscend/prosrc/www/app/feature/gre_3g_edit.html | 147 ++++
.../prosrc/www/app/feature/gre_3g_summary.html | 78 +++
proscend/prosrc/www/app/locale-en.json | 26 +
proscend/prosrc/www/app/locale-fr.json | 26 +
proscend/prosrc/www/app/locale-zh-tw.json | 26 +
proscend/prosrc/www/app/services/icos.service.js | 15 +
.../prosrc/www/src/app/feature/gre_3g.html.src | 3 +
proscend/prosrc/www/src/index.html.src | 3 +-
proscend/prosrc/www/src/menu.html.src | 5 +-
65 files changed, 2246 insertions(+), 139 deletions(-)
M300[develop] - remove binary
commit b5f70aaa3da1ed5f6fd2e6015c82e5367de04678
Author: jeffrey <[email protected]>
Date: Mon Feb 3 16:33:41 2020 +0800
remove binary
proscend/prosrc/icos/greK/grek | Bin 11788 -> 0 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
M300[develop] - ignore grek binary
commit b79367d8e328637f9282083914f7d366b2ac43f9
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date: Mon Feb 3 16:35:33 2020 +0800
ignore grek binary
proscend/prosrc/icos/greK/.gitignore | 1 +
1 file changed, 1 insertion(+)
可以開始進行 bgp over gre 的測試了
再準備一台 M300
等 M300 最新的 image build 完
下班前我先參考 jessy 的方案
新增 hard disk 再用 mount 的方式
這新增的 hard disk 可專為了某一個 project
試著來整理我新的的 VMware 架構
Virtual machine setting
- Name: Jubuntu
- Operation System: Ubuntu 64-bit
- Hard Disk: 40 GB (Store virtual disk as a single file)
- Memory: 2048 MB
Ubuntu setting
- name: jubuntu
- username: jeffrey
- password: proscend
Ubuntu 安裝後第一次開機馬上做 apt-get update
sudo apt-get update
開始安裝所需的軟體
- openssh-server
sudo apt-get install openssh-server
window 端利用 putty 跟 Junbuntu 做 ssh 連線
- Terminal/Feature
- Disable application keypad mode
- 為了使用數字鍵盤
- Window/Apperance
- 字形可以大一些
馬上關機
開始做實驗
可以參考