20180123_jeffrey - silenceuncrio/diary GitHub Wiki

0840

review

0900

先參考 MitraStart 的 ReadMe.docx

3. Build the firmware for Web-GUI upgrade using
   NOTE: You can't do following things as "root"

   A. Decompress the source code 

	$ tar -zxvf MTKOpenWrt-ODM.tgz

   B. After decompress the source code please enter the "MTKOpenWrt-ODM" folder

	$ cd MTKOpenWrt-ODM/

   C. In the folder please tpye the folling to build the code,you can change your configure by "make menuconfig"
      NOTE: Please make sure your pc could connect the internet. Or the bulid process will stop on some download opensource atcion
	
	$ make menuconfig  
	$ make

   D. After build finish there will create a image named "openwrt-ramips-mt7621-mt7621-squashfs-sysupgrade.bin" in ./bin/ramips/
     
	$ ls bin/ramips/openwrt-ramips-mt7621-mt7621-squashfs-sysupgrade.bin

趁著 make 的時候

看一下 MTK_SDK_User_Manual.pdf

1015

MitraStart 給的 SDK 裡已經有一個 build 好的 image - sysupgrade.bin

不管是透過 uboot 的 2: Load system code then write to Flash via TFTP

或是透過 web 做 upgrade

重開機之後都是由 uboot 做一樣的事情

3: System Boot system code via Flash.
[board_init_r:2082]argv[1]: 0xBC140000
[do_bootm:644]argc: 2, addr: 0xBC140000
## Booting image at bc140000 ...
[do_bootm:685]addr:0xBC140000 >= CFG_FLASH_BASE:0xBC000000 ?
[do_bootm:687]ranand_read; from: 0x00140000
[do_bootm:694]hdr->ih_magic: 0x56190527
   Image Name:   OpenWrt Linux-3.10.14
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1566581 Bytes =  1.5 MB
   Load Address: 80001000
   Entry Point:  80001000
[do_bootm:738]addr:0xBC140000 >= CFG_FLASH_BASE:0xBC000000 ?
........................   Verifying Checksum ... OK
[do_bootm:789]name: Kernel Image
[do_bootm:802]ih_comp: IH_COMP_LZMA(3)
   Uncompressing Kernel Image ... OK
[do_bootm:832]ih_type: IH_TYPE_KERNEL(2)
[do_bootm:846]ih_os: IH_OS_LINUX(5)
[do_bootm_linux:252]argc: 2
[do_bootm_linux:339]no initrd image
[do_bootm_linux:350]No initrd
[do_bootm_linux:361]initrd_start = 0
[do_bootm_linux:362]initrd_end = 0
## Transferring control to Linux (at address 80001000) ...
## Giving linux memsize in MB, 128
[do_bootm_linux:379]linux env: initrd_start = 0x00000000
[do_bootm_linux:383]linux env: initrd_size = 0x0
[do_bootm_linux:387]linux env: flash_start = 0x00000000
[do_bootm_linux:391]linux env: flash_size = 0x0

Starting kernel ...

1310

從 GitLab checkout 下來的 M360P 目前 make 會失敗

1405

出錯的地方如下

 ...
 make[3] -C toolchain/uClibc/headers prepare
 make[3] -C toolchain/uClibc/headers compile
 make[3] -C toolchain/uClibc/headers install
make -r world: build failed. Please re-run make with V=s to see what's going on
make: *** [world] Error 1

build_dir\toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2\uClibc\extra\locale

c8tables.h

內容為

could not find a UTF8 locale ... please enable en_US.UTF-8

造成的錯誤如下

...
In file included from extra/locale/gen_locale.c:13:0:
extra/locale/c8tables.h:1:1: error: unknown type name 'could'
 could not find a UTF8 locale ... please enable en_US.UTF-8
 ^
extra/locale/c8tables.h:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'find'
 could not find a UTF8 locale ... please enable en_US.UTF-8
           ^
extra/locale/c8tables.h:1:11: error: unknown type name 'find'
...

1520

參考 Rollback to an old Git commit in a public repo

一路往前追追看到甚麼版本才 build 的過

1650

aaron 修正了 Dockerfile 解決了該問題

Add en_US.UTF-8 locale to avoid toolchain compile error

目前已經利用下述 command 重新得到正確的 docker image

  • Run the docker pull 192.168.0.118/m360/build-m360 to pull the image.
  • Rename the image to build-m360 by docker tag 192.168.0.118/m360/build-m360 build-m360 command.

當然要把原本的 container 刪除

目前正在 compile sdk 中

1705

參考 openwrt生成固件firmware过程

明天我也來追 M360P image 的產出過程