20190806_jeffrey - silenceuncrio/diary GitHub Wiki

0900

review task

  • M300
    • P3 - Layer 2 Encapsulation over GRE (L2oGRE)
      • 未安排 schedule
  • M330
    • P2 - Web UI: WAN WiFi
      • 40%
    • P2 - Wizard
      • 0% - 等 Web UI: WAN WiFi

沒有 P1 的 task

前幾天 M330 上面為了 OSPF 以及 RIP web page 做的修改也套到 M300 上

M360 並沒有提供 OSPF 以及 RIP


M300[develop] - fine tune 'IP Routing > RIP' and 'IP Routing > OSPF'

commit a3235b0177bf563742826279aaf8bdd5e95417a2
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Tue Aug 6 09:18:24 2019 +0800

    at 'IP Routing > RIP'
    - add the maxlength validator to the 'key' field
    - add the min and max validator to the 'Key ID' field
      - min = 1
      - max = 255

    at 'IP Routing > OSPF'
    - add the min and max validator to the 'Key ID' field
      - min = 1
      - max = 255
    - add the maxlength validator to the 'key' field
    - add the min and max validator to the 'Cost' field
      - min = 0
      - max = 65535
      - add the range to the hint

 proscend/prosrc/www/app/feature/ospf_2g.html | 36 +++++++++++++++++++++-------
 proscend/prosrc/www/app/feature/rip_2g.html  | 26 ++++++++++++++++----
 2 files changed, 49 insertions(+), 13 deletions(-)

1000

web server 換了 lighttpd 之後因為 CGI 裡執行時都需要 絕對路徑 的問題

困擾了許多同事

剛剛發現 lighttpd 的文件寫到要 setenv 對 lighttpd 而言也是個 module

先在 m330 做修改


diff --git a/M330_defconfig b/M330_defconfig
index 41b91ee..8484f81 100644
--- a/M330_defconfig
+++ b/M330_defconfig
@@ -3532,6 +3532,7 @@ CONFIG_PACKAGE_lighttpd=y
 CONFIG_LIGHTTPD_SSL=y
 CONFIG_PACKAGE_lighttpd-mod-cgi=y
 CONFIG_PACKAGE_lighttpd-mod-rewrite=y
+CONFIG_PACKAGE_lighttpd-mod-setenv=y
 # CONFIG_PACKAGE_mini-httpd is not set
 # CONFIG_PACKAGE_mini-httpd-htpasswd is not set
 # CONFIG_PACKAGE_mini-httpd-matrixssl is not set
diff --git a/proscend/prosrc/icos/icoslib/web/webcfg.c b/proscend/prosrc/icos/icoslib/web/webcfg.c
index 603a7c6..3dc1ce1 100644
--- a/proscend/prosrc/icos/icoslib/web/webcfg.c
+++ b/proscend/prosrc/icos/icoslib/web/webcfg.c
@@ -90,7 +90,7 @@


 #define WEB_CONFIG_SERVER_MODULES \
-    "server.modules = ( \"mod_rewrite\", \"mod_cgi\" )\n" \
+    "server.modules = ( \"mod_setenv\", \"mod_rewrite\", \"mod_cgi\" )\n" \
     "\n"

 #define WEB_CONFIG_INDEX_FILE_NAMES \
@@ -114,6 +114,10 @@
     "cgi.assign = ( \".cgi\" => \"\" )\n" \
     "\n"

+#define WEB_CONFIG_SETENV_ADD_ENVIRONMENT \
+    "setenv.add-environment = ( \"PATH\" => \"/sbin:/usr/sbin:/bin:/usr/bin\" )\n" \
+    "\n"
+
 #define WEB_CONFIG_URL_REWRITE \
     "url.rewrite = ( \n" \
     "  \"^/api/([a-zA-Z]+)[0-9a-zA-Z=.?]*$\" => \"/cgi-bin/api.cgi?act=$1\",\n" \
@@ -426,6 +430,7 @@ static void _make_configuration_file(sWebConfig *setting)
     fprintf(fp, WEB_CONFIG_INDEX_FILE_NAMES);
     fprintf(fp, WEB_CONFIG_MINETYPE_ASSIGN);
     fprintf(fp, WEB_CONFIG_CGI_ASSIGN);
+    fprintf(fp, WEB_CONFIG_SETENV_ADD_ENVIRONMENT);
     fprintf(fp, WEB_CONFIG_URL_REWRITE);

     fclose(fp);
diff --git a/proscend/prosrc/webcgi/route.c b/proscend/prosrc/webcgi/route.c
index 4e14f21..1c89aa4 100644
--- a/proscend/prosrc/webcgi/route.c
+++ b/proscend/prosrc/webcgi/route.c
@@ -127,7 +127,8 @@ static void _config()
 static void _status()
 {

-    system("/usr/sbin/icos/RouteStatus.sh /tmp/route_status.json");
+    //system("/usr/sbin/icos/RouteStatus.sh /tmp/route_status.json");
+    system("RouteStatus.sh /tmp/route_status.json");


     json_object *status = json_object_from_file("/tmp/route_status.json");

如果成功的話

IP Routing > Static Route 的 status 就能正常顯示了


回顧日記 20190619_jeffrey

一樣的流程再跑一次


M330[release/v0.06] - use setenv module in lighttpd to specify a PATH for CGI scripts

commit 8b28932d00567be193667ea1541442581eb6ecbb
Refs: [release/v0.06], {origin/release/v0.06}
Author: jeffrey <[email protected]>
Date:   Tue Aug 6 11:07:39 2019 +0800

    use setenv module in lighttpd to specify a PATH for CGI scripts

 M330_defconfig                            | 1 +
 proscend/prosrc/icos/icoslib/web/webcfg.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

1115

M300 和 M360 也要套用

先看 M360 - 一樣是 openwrt

1305

M360P[develop] - use setenv module in lighttpd to specify a PATH for CGI scripts

commit 15f0d613d7de57bdba0f206b3973816244997779
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Tue Aug 6 13:04:59 2019 +0800

    use setenv module in lighttpd to specify a PATH for CGI scripts

 m360p_defconfig                           | 1 +
 proscend/prosrc/icos/icoslib/web/webcfg.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

再來是 M300


M300[develop] - use setenv module in lighttpd to specify a PATH for CGI scripts

commit dfc79e630254011fc7b5b6e79a1d3f5c023f4470
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date:   Tue Aug 6 13:38:55 2019 +0800

    use setenv module in lighttpd to specify a PATH for CGI scripts

 meta-proscend/recipes-extended/lighttpd/lighttpd_1.4.53.bbappend | 1 +
 proscend/prosrc/icos/icoslib/web/webcfg.c                        | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

1420

M330 這禮拜的 release/v0.06 涉及到 大陸那邊的生產

我需要更新相關的文件

先用比較正式的方式來 build image

./build.sh -f GENERIC/0_GENERIC

build 完得到三個 file

user@3b95631f73fe:~$ ls proscend/image/ -al
total 23044
drwxr-xr-x  2 user user     4096 Aug  6 06:51 .
drwxrwxr-x 13 user user     4096 Aug  6 06:51 ..
-rw-r--r--  1 user user 21889024 Aug  6 06:51 root.squashfs_ubi
-rw-r--r--  1 user user   189148 Aug  6 06:51 uboot.bin
-rw-r--r--  1 user user  1507328 Aug  6 06:51 vmlinux.lzma.uImage

1515

review 當初給 yuncore 的文件時發現

利用 ./build.sh -f GENERIC/0_GENERIC 得到的 image 並不包含 wifi 的功能

照代表著有風險 - 測不出 wifi 相關的問題

我應該 build 一個可以測出盡可能所有硬體功能的軟體版本

user@3b95631f73fe:~$ ./build.sh -f GENERIC/1_GENERIC_WIFI

等吧

1625

有些 command 需要加上去方便 M330 產測

已通知相關同仁