20200130_jeffrey - silenceuncrio/diary GitHub Wiki
0845
繼續 M350
0935
感覺目前的虛擬機光 cd 進一個目錄都要花很多時間 - 超過 10 秒鐘
透過 win 10 的工作管理員可以看到 VMware 在 磁碟 的處理程序相當的忙碌
為了 M350 再安裝一個新的 VMware - Ubuntu 64-bit (2)
參考過去的紀錄 - 20180604_jeffrey
VMware 一樣使用 Ubuntu 16.04 LTS 64 位元版本
帳密維持一樣
- jeffrey
- proscend
安裝 SSH Server 方便後續的使用
sudo apt install openssh-server
有了 SSH Server 就直接從 window 端安裝 putty 利用 ssh 連線來做控制
注意到一些 putty 的設定
- Terminal/Feature
- Disable application keypad mode
- 使用數字鍵盤
- Window/Apperance
- 字形可以大一些
注意到 ssh 的目標 ip 如下
ens33 的 inet addr 為 192.168.217.129
順利利用 ssh login 之後就可以把 Vmware 視窗縮到最小了
再來可以參考 - 20180605_jeffrey
安裝 Oh-My-Zsh
安裝 tmux
安裝 Docker
跟 GitLab 連線的前置作業
產生 ssh 連線所需的 key
➜ ~ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/jeffrey/.ssh/id_rsa):
Created directory '/home/jeffrey/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/jeffrey/.ssh/id_rsa.
Your public key has been saved in /home/jeffrey/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:PhFun9OWbBXUWzUurYFOq6PPcosHrTAYLVW+rb6UW7Y jeffrey@jjbox
The key's randomart image is:
+---[RSA 2048]----+
| .. .oo|
| .. ..o +|
| o .. o o.oo|
| o . .o.o . +o |
| + .S. o .. |
| . o +o+.+ o |
| o+==+ * |
| ooB+o+ |
| **E. |
+----[SHA256]-----+
cat 剛剛產生的 key 然後加入 GitLab
➜ ~ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAkkbAEXba0S68cYFo9bcCEn9lLk09nJmtLzheztVHaZQQCaxmNhMnITtrwh2pgIRPbtf63QVNQVdwE5gAId+UnClRk6aDun1XdxsXnd5YZL2KlVKrKdOqbJ0rgaqpg8YC4IolMATBMsPTbRgJ/YwPvdFOczpmyCm5iYYaekAtZ9lQXSvBRA6Uf6sTRrzEoK1mpMm6F9eAdtDdIKt8eLcD/As2WeUyYgvU9ougDNlNP5SH2ZGBL08Uz4kctvF34xe0c1xhrooRPLc3lSC/igv4J2SWsJ4Z0rBRDulWrMWHx/6RK3uMTh+FYFAwdpYNAS02uwsC/TiNT3eKwnYM1ReX jeffrey@jjbox
可以來產生編譯 M350 環境所需的 docker image 了
git clone build-m350.git 並從 Dockerfile 來產生 M350 所需的編譯環境
git clone [email protected]:RD/build-m350.git
build docker image 的時候會發現紅色的訊息
debconf: delaying package configuration, since apt-utils is not installed
修正 Dockerfile 如下
diff --git a/Dockerfile b/Dockerfile
index ad825b2..0bfcea0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,9 @@
FROM i386/ubuntu:16.04
+ARG DEBIAN_FRONTEND=noninteractive
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get install -y apt-utils
+
+RUN apt-get install -y \
gcc \
g++ \
binutils \
(END)
rm 剛剛產生的 docker image 再 build 一次
image build 好了
➜ build-m350 git:(master) ✗ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
build-m350 latest 214293bb8931 33 seconds ago 719MB
i386/ubuntu 16.04 faf5784ef367 2 weeks ago 120MB
hello-world latest fce289e99eb9 13 months ago 1.84kB
git clone M350 的 source code
➜ ~ git clone [email protected]:RD/m350.git
Cloning into 'm350'...
remote: Enumerating objects: 129829, done.
remote: Counting objects: 100% (129829/129829), done.
remote: Compressing objects: 100% (109297/109297), done.
remote: Total 129829 (delta 39429), reused 106644 (delta 16244), pack-reused 0
Receiving objects: 100% (129829/129829), 443.16 MiB | 15.09 MiB/s, done.
Resolving deltas: 100% (39429/39429), done.
Checking connectivity... done.
Checking out files: 100% (90096/90096), done.
cd 到 m350 並切換至 develop branch
➜ m350 git:(master) git checkout develop
Checking out files: 100% (105042/105042), done.
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
➜ m350 git:(develop) git pull
Already up-to-date.
➜ m350 git:(develop)
基於該 source code 的目錄建立 docker container
docker run --name build-m350 \
-e LOCAL_USER_ID=`id -u $USER` \
-v `pwd`:/home/user \
-it --restart=always -d build-m350 /bin/bash
利用 docker container ls 可確認
➜ m350 git:(develop) docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b6289dfacafe build-m350 "/entrypoint.sh /bin…" 43 seconds ago Up 41 seconds build-m350
➜ m350 git:(develop)
在自己的 home 目錄下建立 ./m350.sh 如下方便進入 build-m350 的 shell
➜ ~ pwd
/home/jeffrey
➜ ~ cat m350.sh
#! /bin/bash
docker exec -it -u user build-m350 /bin/bash
➜ ~
cd 進 /home/user - 也就是 source code 所在目錄
先執行 source proenv.sh - 前置作業或 porting 之前的平台使然
source code 附錄下還有一隻 build.sh
b6289dfacafe:~$ cat build.sh
#!/bin/bash
top=$(pwd)
ARTIFACT="$top/artifact"
rm -rf $ARTIFACT
mkdir -p $ARTIFACT
source proenv.sh
make -j2
if [ $? -ne 0 ]; then
exit $?
fi
#generate partition table
cd $top/full_image/boot_images/build/ms/bin/40xx/misc/tools;python genimg.py --partition_tool=partition_tool --mbn_gen=nand_mbn_generator.py --skip_export --image_name=NOR_PLUS_NAND_IMAGES;cp -rf ./out/norplusnand-system-partition-ipq40xx.bin ../../nor-plus-nand
cd $top/full_image/common/build
./gen_image.sh
cp bin/*.img $ARTIFACT
記得 make -j2 容易出錯
我已執行過 source proenv.sh
自己敲 make 吧
1135
看到 automake 已經 pass
等吧
1300
繼續等待
1340
剛剛利用 國泰世華 手機 APP
順利的將今年包給爸媽的的壓歲錢
轉帳給先代墊的弟弟
整個 APP 的操作過程真的很好用阿
1420
檢視一下 web 相關的 library 升級的 concern
- AngularJS
- 前端主架構
- 完全不考慮更動
- bootstrap
- CSS 套版
- 目前 3.3.7
- 最新 4.4
- 更換的好處
- 沒想到
- 更換的風險
- 每個頁面都要 review 有些頁面不是我寫的
- Font Awesome
- 免費的 icon
- 目前 4.6.3
- 最新 5.12.0
- 更換的好處
- 有更多 icon 可以用
- 切換密碼顯示與否的眼睛圖示
- 鎖頭圖示
- 有更多 icon 可以用
- 更換的風險
- 每個頁面都要 review 有些頁面不是我寫的
- 不過不牽涉到整體的設計 相對單純
- sweetalert
- 沒有明顯的更換好處
- 每個頁面都要去 review 修改後的正確性
最明顯能帶來好處就是 Font Awesome 了
另外值得一提的是利用 ng-include 結合 c 的 Preprocessor 來結合 compile flag 在 compile time 決定某些呈現上的不同
某些客戶的某些畫面有不同的需求
目前的 www 目錄下各 file 個資料夾的配置以及 Makefile 需要更好的整理
1520
proscend 目錄外層 make 已完成
參考 jessy 2020-01-17 的 email 或參考 20200120_jeffrey
Hi all:
M350 upgrade firmware:
(1) build environment is 32 bit OS
(2) "git pull" and "make clean" in top directory
(3) Execute "build.sh" in top directory
(4) rebuild proscend code
(5) Execute "build-image.sh" in top directory,
(6) Set tftp server 192.168.1.10 and specify "(top directory)/artifact" folder
(7) Enter M350 u-boot. Press "s" enter u-boot in console.
(8) Execute follow command:
tftpboot 0x84000000 nornand-ipq40xx-single.img
imgaddr=0x84000000 && source $imgaddr:script
reset
(4) rebuild proscend code
cd 進 proscend - make distclean
user@b6289dfacafe:~$ cd proscend/
user@b6289dfacafe:~/proscend$ make distclean
...
echo "PROSCEND DISCLEAN"
PROSCEND DISCLEAN
user@b6289dfacafe:~/proscend$
make menuconfig
- Vendor/Prosucts = CTCU/1_CTCU_WIFI
make clean
make
(5) Execute "build-image.sh" in top directory
proscend
user@b6289dfacafe:~/proscend$ cd ..
user@b6289dfacafe:~$ ./build-image.sh
***********************************************
SBL dir: /home/user/full_image/boot_images/build/ms/bin/40xx
Config dir: /home/user/full_image/boot_images/build/ms/bin/40xx/misc/tools/config
Output dir:/home/user/full_image/boot_images/build/ms/bin/40xx/misc/tools/out
partition_tool location: /home/user/full_image/boot_images/build/ms/bin/40xx/misc/tools/partition_tool
nand_mbn_generator.py location: /home/user/full_image/boot_images/build/ms/bin/40xx/misc/tools/nand_mbn_generator.py
Processing ipq40xx
Created board directory: /home/user/full_image/boot_images/build/ms/bin/40xx/misc/tools/out
Nor page size: 256, pages/block: 256, total blocks: 512, partition info: /home/user/full_image/boot_images/build/ms/bin/40xx/misc/tools/config/nor-plus-nand-parition.xml
Creating user partition ...User partition created
Creating system partition ...System partition created
Processing AP.DK01.1-C1
Using existing directory: /home/user/full_image/boot_images/build/ms/bin/40xx/misc/tools/out
No NOR+NAND combination!
...
../tools/meta/meta_lib.py:447: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if tool_elem:
update_common_info:Platform is:linux2
update_common_info:Python Version is:2.7.12 (default, Oct 8 2019, 14:14:10)
[GCC 5.4.0 20160609]
update_common_info:Current directory is:/home/user/full_image/common/build
update_common_info:Loading the Meta-Info file
update_common_info: Generate ipq single image
Executing: python /home/user/full_image/./apss_proc/out/pack.py -t norplusnand -B -F boardconfig_premium -o ./bin/nornand-ipq40xx-single.img ./ipq
FIT description: Flashing norplusnand 100 10000
Created: Thu Jan 30 07:29:20 2020
Image 0 (script)
Description: flash.scr
Created: Thu Jan 30 07:29:20 2020
Type: Script
Compression: uncompressed
Data Size: 170912 Bytes = 166.91 kB = 0.16 MB
Hash algo: crc32
Hash value: 1df8c589
Image 1 (mibib-e1b8dae18137ae92508d2592f50a0cfca44215db)
Description: norplusnand-system-partition-ipq40xx.bin
Created: Thu Jan 30 07:29:20 2020
Type: Firmware
Compression: uncompressed
Data Size: 65536 Bytes = 64.00 kB = 0.06 MB
Architecture: ARM
Load Address: unavailable
Hash algo: crc32
Hash value: 3c774bfe
Image 2 (sbl1-a9831d8db37c18ebe43878fda3139605f6b0d448)
Description: sbl1_nor.mbn
...
Image 17 (ubi-2113e3f3cc2a94e31f40d2c220669cca1b7e2845)
Description: openwrt-ipq806x-ipq40xx-ubi-root.img
Created: Thu Jan 30 07:29:20 2020
Type: Firmware
Compression: uncompressed
Data Size: 31064064 Bytes = 30336.00 kB = 29.62 MB
Architecture: ARM
Load Address: unavailable
Hash algo: crc32
Hash value: 70d2f08f
ret_nornand_single 0.
pack_tool = /home/user/full_image/./apss_proc/out/pack.py
Executing: python /home/user/full_image/./apss_proc/out/pack.py -t norplusnand -B -F appsboardconfig_premium -o ./bin/ipq40xx-nornand-apps.img ./ipq
FIT description: Flashing norplusnand 100 10000
Created: Thu Jan 30 07:29:20 2020
Image 0 (script)
Description: flash.scr
Created: Thu Jan 30 07:29:20 2020
Type: Script
Compression: uncompressed
Data Size: 18669 Bytes = 18.23 kB = 0.02 MB
Hash algo: crc32
Hash value: d06bc390
Image 1 (ubi-2113e3f3cc2a94e31f40d2c220669cca1b7e2845)
Description: openwrt-ipq806x-ipq40xx-ubi-root.img
Created: Thu Jan 30 07:29:20 2020
Type: Firmware
Compression: uncompressed
Data Size: 31064064 Bytes = 30336.00 kB = 29.62 MB
Architecture: ARM
Load Address: unavailable
Hash algo: crc32
Hash value: 70d2f08f
ret_nornand_apps 0.
update_common_info.py:============ UPDATE COMMON INFO COMPLETE====================
user@b6289dfacafe:~$
(6) Set tftp server 192.168.1.10 and specify "(top directory)/artifact" folder
繼續這個步驟前我需要設定 samba - 參考 20180605_jeffrey
安裝 samba
sudo apt install samba
修改 Samba 設定 - /etc/samba/smb.conf
...
[jjbox]
path = /home/jeffrey
writable = yes
guest account = jeffrey
force user = jeffrey
public = yes
force group = jeffrey
browseable = yes
create mask = 0664
directory mask = 0775
重新啟動 samba
sudo service smbd restart
sudo service nmbd restart
window 10 連線網路磁碟機
(7) Enter M350 u-boot. Press "s" enter u-boot in console.
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.1-00126
S - IMAGE_VARIANT_STRING=DAABANAZA
S - OEM_IMAGE_VERSION_STRING=CRM
S - Boot Config, 0x00000021
S - Reset status Config, 0x00000000
S - Core 0 Frequency, 0 MHz
B - 261 - PBL, Start
B - 1339 - bootable_media_detect_entry, Start
B - 1679 - bootable_media_detect_success, Start
B - 1693 - elf_loader_entry, Start
B - 5080 - auth_hash_seg_entry, Start
B - 7230 - auth_hash_seg_exit, Start
B - 579269 - elf_segs_hash_verify_entry, Start
B - 697624 - PBL, End
B - 697648 - SBL1, Start
B - 788511 - pm_device_init, Start
D - 7 - pm_device_init, Delta
B - 789976 - boot_flash_init, Start
D - 52833 - boot_flash_init, Delta
B - 846948 - boot_config_data_table_init, Start
D - 3838 - boot_config_data_table_init, Delta - (419 Bytes)
B - 854428 - clock_init, Start
D - 7558 - clock_init, Delta
B - 866135 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:0,Subtype:1
B - 869549 - sbl1_ddr_set_params, Start
B - 874647 - cpr_init, Start
D - 2 - cpr_init, Delta
B - 879029 - Pre_DDR_clock_init, Start
D - 4 - Pre_DDR_clock_init, Delta
D - 13177 - sbl1_ddr_set_params, Delta
B - 892342 - pm_driver_init, Start
D - 2 - pm_driver_init, Delta
B - 962832 - sbl1_wait_for_ddr_training, Start
D - 27 - sbl1_wait_for_ddr_training, Delta
B - 978200 - Image Load, Start
D - 153144 - QSEE Image Loaded, Delta - (299560 Bytes)
B - 1131773 - Image Load, Start
D - 1444 - SEC Image Loaded, Delta - (2048 Bytes)
B - 1142068 - Image Load, Start
D - 210364 - APPSBL Image Loaded, Delta - (429987 Bytes)
B - 1352830 - QSEE Execution, Start
D - 60 - QSEE Execution, Delta
B - 1359042 - SBL1, End
D - 663502 - SBL1, Delta
S - Flash Throughput, 2006 KB/s (732014 Bytes, 364760 us)
S - DDR Frequency, 672 MHz
U-Boot 2012.07 [Chaos Calmer 15.05.1,efad98e+r49254] (Jan 17 2020 - 06:29:45)
smem ram ptable found: ver: 1 len: 3
DRAM: 256 MiB
machid : 0x8010001
NAND: ID = 9590daef
Vendor = ef
Device = da
ONFI device found
SF: Detected W25Q256 with page size 64 KiB, total 32 MiB
ipq_spi: page_size: 0x100, sector_size: 0x10000, size: 0x2000000
288 MiB
MMC: qca_mmc: 0
In: serial
Out: serial
Err: serial
machid: 8010001
flash_type: 0
[switch_partition 288]image_active[a]
get no_good = [.xx] for first time
image_active a -> b
Erasing Nand...
Erasing at 0xe0000 -- 100% complete.
Writing to Nand... done
Hit any key to stop autoboot: 0
Net: MAC0 addr:0:11:7f:1c:10:ef
PHY ID1: 0x4d
PHY ID2: 0xd0b1
ipq40xx_ess_sw_init done
eth0
(IPQ40xx) #
(8) Execute follow command:
將 serverip 指向自己的 192.168.1.113 並 save
(IPQ40xx) # set serverip 192.168.1.113
(IPQ40xx) # save
Saving Environment to NAND...
Erasing Nand...
Erasing at 0xe0000 -- 100% complete.
Writing to Nand... done
(IPQ40xx) # print serverip
serverip=192.168.1.113
(IPQ40xx) #
tftpboot 0x84000000 nornand-ipq40xx-single.img
imgaddr=0x84000000 && source $imgaddr:script
reset
依據 jessy 的說法
cd /tmp;tftp -g -r firmware.img 192.168.1.10;FirmwareUpgrade.sh firmware.img;reboot
firmware.img 是在 proscend/image 下的那個檔案只含 kernel + rootfs
實際操作看看
root@ICR-W401:/home/admin# cd /tmp/
root@ICR-W401:/tmp# tftp -g -r firmware.img 10.1.1.113
root@ICR-W401:/tmp# FirmwareUpgrade.sh /tmp/firmware.img
UPGRADE_BIN is /tmp/firmware.img ....
[main 886]mage_hdr(512)+firmware.md5(95)+mcsv.enc(40)+kernel.bin(0)+root.squashfs_ubi(31064064)+uboot.bin(0) = 31064711
b960663eb777a44013ae9a704ca1de31 mcsv.enc in firmware.md5(check ok)
dc92bc26f3978642eabf7fbe8140916d root.squashfs_ubi in firmware.md5(check ok)
sw_mcsv = [014B001200830DC2], hw_mcsv = [014B001200830DC2]
sw_mcsv_mmmm = [014B], hw_mcsv_mmmm = [014B]
sw_mcsv_cccc = [0012], hw_mcsv_cccc = [0012]
Unlocking /dev/mtd9 ...
Erasing /dev/mtd9 ...
Unlocking /dev/mtd9 ...
Unlocking /dev/mtd9 ...
current active_image[a]
write active_image (b) kernel_mtd->(/dev/mtd9) rootfs_mtd->(/dev/mtd9)
Writing from 'root.squashfs_ubi' to MTD '/dev/mtd9' ... [ok]
cp -f /tmp/FirmwareUpgrade.log /tmp/FirmwareUpgrade_BAK.log
cp -f /tmp/FirmwareUpgrade.progress.json /tmp/FirmwareUpgrade.progress_BAK.json
cp -f /tmp/FirmwareUpgrade.progress_BAK.json /tmp/FirmwareUpgrade.progress.json
touch /tmp/fwupgrade_ok
fw_setenv no_good .xx
fw_setenv no_good .xx
cp -f /tmp/FirmwareUpgrade_BAK.log /tmp/FirmwareUpgrade.log
no_good=.xx
root@ICR-W401:/tmp#
可以 reboot 了
1625
另存一個 /tmp/lighttpd.conf 試一下 lighttpd
啟動的過程發現還少了 setenv 這個 module
root@ICR-W401:/home/admin# lighttpd -f /tmp/lighttpd.conf
2020-01-30 07:31:53: (plugin.c.227) dlopen() failed for: /usr/lib/lighttpd/mod_setenv.so File not found
2020-01-30 07:31:53: (server.c.911) loading plugins finally failed
修改 M350_defconfig
diff --git a/M350_defconfig b/M350_defconfig
index 35444ed..f4ac320 100755
--- a/M350_defconfig
+++ b/M350_defconfig
@@ -4653,6 +4653,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_nginx is not set
# CONFIG_PACKAGE_polipo is not set
# CONFIG_PACKAGE_privoxy is not set
(END)
在 proscend 外層先 clean lighttpd 這個 package
make package/feeds/packages/lighttpd/clean
直接使用 build.sh
1705
進 proscend 目錄
make clean
make
再次 upgrade firmware.img
root@ICR-W401:/tmp# tftp -g -r firmware.img 10.1.1.113
root@ICR-W401:/tmp# FirmwareUpgrade.sh /tmp/firmware.img
UPGRADE_BIN is /tmp/firmware.img ....
[main 886]mage_hdr(512)+firmware.md5(142)+mcsv.enc(40)+kernel.bin(0)+root.squashfs_ubi(31064064)+uboot.bin(0) = 31064758
8d0c29d73fdd5e1e85bec1ca66abf9a6 mcsv.enc in firmware.md5(check ok)
56b4567dc420155a0c4d5fb6ac76bea2 root.squashfs_ubi in firmware.md5(check ok)
sw_mcsv = [014B001200830DC2], hw_mcsv = [014B001200830DC2]
sw_mcsv_mmmm = [014B], hw_mcsv_mmmm = [014B]
sw_mcsv_cccc = [0012], hw_mcsv_cccc = [0012]
Unlocking /dev/mtd8 ...
Erasing /dev/mtd8 ...
Unlocking /dev/mtd8 ...
Unlocking /dev/mtd8 ...
current active_image[b]
write active_image (a) kernel_mtd->(/dev/mtd8) rootfs_mtd->(/dev/mtd8)
Writing from 'root.squashfs_ubi' to MTD '/dev/mtd8' ... [ok]
cp -f /tmp/FirmwareUpgrade.log /tmp/FirmwareUpgrade_BAK.log
cp -f /tmp/FirmwareUpgrade.progress.json /tmp/FirmwareUpgrade.progress_BAK.json
cp -f /tmp/FirmwareUpgrade.progress_BAK.json /tmp/FirmwareUpgrade.progress.json
touch /tmp/fwupgrade_ok
fw_setenv no_good .xx
fw_setenv no_good .xx
cp -f /tmp/FirmwareUpgrade_BAK.log /tmp/FirmwareUpgrade.log
no_good=.xx
root@ICR-W401:/tmp#
上傳 image 一分多鐘
寫入 MTD 似乎不到一分鐘
1715
lihgttpd 成功啟動
root@ICR-W401:/home/admin# cp /tmp/icos/web/lighttpd.conf /tmp/
root@ICR-W401:/home/admin# vi /tmp/lighttpd.conf
root@ICR-W401:/home/admin# lighttpd -f /tmp/lighttpd.conf
2020-01-30 09:07:34: (log.c.217) server started
root@ICR-W401:/home/admin# ps | grep ligh
2496 root 3248 S lighttpd -f /tmp/lighttpd.conf
2548 root 1660 S grep ligh
root@ICR-W401:/home/admin#
直接看一下 web page
直接透過 web 來 upgrade firmware.img - PASS
也能透過 web 來 reboot device
1715
commit setenv module 前 git 還需要一些設定
➜ m350 git:(develop) ✗ vi M350_defconfig
➜ m350 git:(develop) ✗ git diff
➜ m350 git:(develop) ✗ tig status
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'jeffrey@jjbox.(none)')
Press Enter to continue
設定如下
➜ m350 git:(develop) ✗ git config --global user.email "[email protected]"
➜ m350 git:(develop) ✗ git config --global user.name "jeffrey"
➜ m350 git:(develop) ✗
還要裝 astyle
✗ git config --global user.name "jeffrey"
➜ m350 git:(develop) ✗ tig status
[!] astyle not installed. Unable to check source file format policy.
Press Enter to continue
還要把 git commit 默認的編輯器改成 vim
git config --global core.editor vim
為了避免無謂的 merge 還要作以下設定
➜ m350 git:(develop) ✗ git config --global pull.rebase true
上 code 囉
m350[develop] - add the setenv module for lighttpd
commit 7c6ee9bdf72f12836c6b6902b52f26c5c990eb75
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date: Thu Jan 30 17:24:01 2020 +0800
add the setenv module for lighttpd
M350_defconfig | 1 +
1 file changed, 1 insertion(+)
1740
讓 web module 自己發 ICOS_BOOTINIT_DONE 給自己
就可以利用既有的流程把自己叫起來
diff --git a/proscend/prosrc/icos/icoslib/web/webcfg.c b/proscend/prosrc/icos/icoslib/web/webcfg.c
index 42b5a6f..7367751 100644
--- a/proscend/prosrc/icos/icoslib/web/webcfg.c
+++ b/proscend/prosrc/icos/icoslib/web/webcfg.c
@@ -1102,6 +1102,10 @@ static int notify_web(PRO_EVENT *pevent)
WEB_INFO("module init\n");
web_init((sWebConfig *)pevent->msg);
gWebCtrl.mod_init_done=1;
+
+ // testing only; start the web by itself
+ ICOS_msg_sendto(MODULE_WEB, MODULE_WEB, NULL, 0, ICOS_BOOTINIT_DONE);
+
}
else
{
(END)
測試 PASS
上 code 方便大家透過 web upgrade
m350[develop] - start the web by itself
commit d14751492ccf717ddaaa4c07278798b61d2ec0c1
Refs: [develop], {origin/develop}
Author: jeffrey <[email protected]>
Date: Thu Jan 30 17:50:17 2020 +0800
start the web by itself
- send ICOS_BOOTINIT_DONE to itself
- testing only
proscend/prosrc/icos/icoslib/web/webcfg.c | 4 ++++
1 file changed, 4 insertions(+)