20180717_jeffrey - silenceuncrio/diary GitHub Wiki

0905

客戶新需求 - schedule reboot

  • schedule reboot - enable / disable
    • Interval(In second)
    • At a set time

You can schedule regular reboots for the Router :
Regularly after xxx seconds.
At a specific date time each week or everyday.

目前打算用 crontab 來實作

昨天已經把 cronie 這 recipe 加了上去

diff --git a/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb b/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb
index 9c3e688..659bf4b 100644
--- a/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb
+++ b/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb
@@ -58,6 +58,9 @@ RDEPENDS_${PN} += " curl"
 # For AZ version
 RDEPENDS_${PN} += " syslog-ng"

+# Schedule Reboot
+RDEPENDS_${PN} += " cronie"
+
 # ======================================

 # Build dependence

目前 M300 多了以下兩個工具

crond

root@Cellular Router:~# crond -h
Usage:
 crond [options]

Options:
 -h         print this message
 -i         deamon runs without inotify support
 -m <comm>  off, or specify preferred client for sending mails
 -n         run in foreground
 -p         permit any crontab
 -P         use PATH="/usr/bin:/bin"
 -c         enable clustering support
 -s         log into syslog instead of sending mails
 -x <flag>  print debug information

Debugging flags are: ext,sch,proc,pars,load,misc,test,bit

crontab

root@Cellular Router:~# crontab -h
crontab: invalid option -- 'h'
crontab: usage error: unrecognized option
Usage:
 crontab [options] file
 crontab [options]
 crontab -n [hostname]

Options:
 -u <user>  define user
 -e         edit user's crontab
 -l         list user's crontab
 -r         delete user's crontab
 -i         prompt before deleting
 -n <host>  set host in cluster to run users' crontabs
 -c         get host in cluster to run users' crontabs
 -x <mask>  enable debugging

Default operation is replace, per 1003.2

0950

是方科技 拿我們的 M300 想跟 CISCO 用 GRE 連接

但是 CISCO 對於 GRE 的詮釋方式跟我們不同

有提到啥 NHRP

要設啥 key 和 network-id

我需要找時間 survey 一下

0955

52XXZ 目前 proscend 目錄 build 過了

但是 linux 跑起來的時候說啥 rootfs not found

我需要幫忙看一下

目前已經沒有 feature/UGW6.1 這個 branch

UGW6.1 目前已成為 develop

➜  52XXZ git:(feature/UGW6.1) git checkout develop
Checking out files: 100% (10960/10960), done.
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
➜  52XXZ git:(develop) git pull
remote: Counting objects: 2058, done.
remote: Compressing objects: 100% (1685/1685), done.
remote: Total 2058 (delta 336), reused 2049 (delta 327)
Receiving objects: 100% (2058/2058), 11.42 MiB | 0 bytes/s, done.
Resolving deltas: 100% (336/336), completed with 17 local objects.
From 192.168.0.124:RD/52XXZ
   b4160f6..ee3f532  develop    -> origin/develop
 * [new branch]      feature/UGW5.4 -> origin/feature/UGW5.4
First, rewinding head to replay your work on top of it...
Fast-forwarded develop to ee3f5327a528cea9cddca151e4c30566cfebc9e3.

進 build-52xxz container

docker exec -it -u user build-52xxz bash

整個 clean 再重 build

make clean
time make -j4

1005

GRE 與 NHRP 的議題可以參考 Introduction to Multipoint GRE and NHRP

先找時間了解後再想想 M300 如何來實作

1030

52xxz proscend 外層已經 build 好了

 ...
 make[3] -C target/linux install
 make[2] package/index

real    27m42.755s
user    55m41.239s
sys     16m21.272s

來 build proscend 內層

...
/home/user/staging_dir/host/bin/mkimage -A MIPS -O Linux -C lzma -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img
Image Name:   LTQCPE RootFS
Created:      Tue Jul 17 02:32:08 2018
Image Type:   MIPS Linux Filesystem Image (lzma compressed)
Data Size:    15134720 Bytes = 14780.00 kB = 14.43 MB
Load Address: 00000000
Entry Point:  00000000
cp /home/user/bin/lantiq/vrx288_gw_he_vdsl_lte/uImage image/
cp /home/user/bin/lantiq/vrx288_gw_he_vdsl_lte/firmware.img image/
add image/rootfs.img to image/fullimage.tmp ...
    ==>image/rootfs.img, size=15134784, pad=0
add image/uImage to image/fullimage.tmp ...
    ==>image/uImage, size=1835008, pad=0
add image/firmware.img to image/fullimage.tmp ...
    ==>image/firmware.img, size=450624, pad=0
/home/user/staging_dir/host/bin/mkimage -A MIPS -O Linux -C none -T multi -e 0x00 -a 0x00 -n "VR9 Fullimage" -d image/fullimage.tmp image/fullimage.img;
Image Name:   VR9 Fullimage
Created:      Tue Jul 17 02:32:08 2018
Image Type:   MIPS Linux Multi-File Image (uncompressed)
Data Size:    17420424 Bytes = 17012.13 kB = 16.61 MB
Load Address: 00000000
Entry Point:  00000000
Contents:
   Image 0: 17420416 Bytes = 17012.12 kB = 16.61 MB

real    1m14.350s
user    1m1.821s
sys     0m15.716s

1040

利用 uboot 作燒錄

VR9 # run update_fullimage
UBI: mtd1 is detached from ubi0
Creating 1 MTD partitions on "nand0":
0x0000001c0000-0x0000065c0000 : "mtd=4"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=4"
UBI: MTD device size:            100 MiB
UBI: number of good PEBs:        800
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     8
UBI: available PEBs:             367
UBI: total number of reserved PEBs: 433
UBI: number of PEBs reserved for bad PEB handling: 8
UBI: max/mean erase counter: 1443/720
Using vr9 Switch device
TFTP from server 192.168.1.113; our IP address is 192.168.1.1
Filename 'fullimage.img'.
Load address: 0x80800000
Loading: T T T T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################
done
Bytes transferred = 17420488 (109d0c8 hex)
Image contains header with name [LTQCPE RootFS]
Volume rootfsB found at valid 4
remove UBI volume rootfsB (id 4)
Creating dynamic volume rootfsB of size 15134720 and volume id 4
Volume "rootfsB" found at volume id 4
Erasing redundant Nand...
Erasing at 0x160000 -- 100% complete.
Writing to redundant Nand... done
Image contains header with name [MIPS LTQCPE Linux-3.10.12]
Volume kernelB found at valid 3
remove UBI volume kernelB (id 3)
Creating dynamic volume kernelB of size 1835008 and volume id 3
Volume "kernelB" found at volume id 3
Erasing Nand...
Erasing at 0x120000 -- 100% complete.
Writing to Nand... done
Image contains header with name [XRX200 Firmware]
Volume firmwareB found at valid 5
remove UBI volume firmwareB (id 5)
Creating dynamic volume firmwareB of size 450560 and volume id 5
Volume "firmwareB" found at volume id 5
Erasing redundant Nand...
Erasing at 0x160000 -- 100% complete.
Writing to redundant Nand... done
Image contains header with name [LTQCPE RootFS]
Volume rootfsA found at valid 1
remove UBI volume rootfsA (id 1)
Creating dynamic volume rootfsA of size 15134720 and volume id 1
Volume "rootfsA" found at volume id 1
Erasing Nand...
Erasing at 0x120000 -- 100% complete.
Writing to Nand... done
Image contains header with name [MIPS LTQCPE Linux-3.10.12]
Volume kernelA found at valid 0
remove UBI volume kernelA (id 0)
Creating dynamic volume kernelA of size 1835008 and volume id 0
Volume "kernelA" found at volume id 0
Erasing redundant Nand...
Erasing at 0x160000 -- 100% complete.
Writing to redundant Nand... done
Image contains header with name [XRX200 Firmware]
Volume firmwareA found at valid 2
remove UBI volume firmwareA (id 2)
Creating dynamic volume firmwareA of size 450560 and volume id 2
Volume "firmwareA" found at volume id 2
Erasing Nand...
Erasing at 0x120000 -- 100% complete.
Writing to Nand... done

開機

...
Starting kernel ...

[    0.000000] Linux version 3.10.12 (user@8de9e3d5af60) (gcc version 4.8.1 20130401 (prerelease) (Linaro GCC 4.8-2013.04) ) #1 Tue Jul 17 02:27:28 UTC 2018
[    0.000000] SoC: xRX200 rev 1.2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019556 (MIPS 34Kc)
[    0.000000] adding memory size:66060288 from DT
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 03f00000 @ 00000000 (usable)
[    0.690000] pcie_wait_phy_link_up port 0 timeout
[    1.200000] pcie_wait_phy_link_up port 0 timeout
[    1.710000] pcie_wait_phy_link_up port 0 timeout
[    2.220000] pcie_wait_phy_link_up port 0 timeout
[    2.730000] pcie_wait_phy_link_up port 0 timeout
[    2.740000] pcie_rc_initialize port 0 link up failed!!!!!
[    2.780000] ts-xway 1f103000.ts: temp sensor not supported in this chip !!
[    2.890000] Switch API: PCE MicroCode loaded !!
[    2.890000] gphy_driver_init: fw_mode:22F-FW, no of phys:2, mode:0

...
U-Boot V010.04-LANTIQ-v-2.2.70 (May 05 2016 - 14:21:56)
...

狀況跟之前遇到的問題一樣

會不斷的重開機

Winston 表示需要換 uboot

我先從 aaron 那邊拿一片之前已經換過 uboot 的板子來試試

1045

一樣先從 uboot 作燒錄

VR9 # run update_fullimage
Creating 1 MTD partitions on "nand0":
0x0000001c0000-0x0000065c0000 : "mtd=4"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=4"
UBI: MTD device size:            100 MiB
UBI: number of good PEBs:        800
UBI: number of bad PEBs:         0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     8
UBI: available PEBs:             350
UBI: total number of reserved PEBs: 450
UBI: number of PEBs reserved for bad PEB handling: 8
UBI: max/mean erase counter: 531/8
Using vr9 Switch device
TFTP from server 192.168.1.113; our IP address is 192.168.1.100
Filename 'fullimage.img'.
Load address: 0x80800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################
done
Bytes transferred = 17420488 (109d0c8 hex)
Image contains header with name [LTQCPE RootFS]
Volume rootfsB found at valid 4
remove UBI volume rootfsB (id 4)
Creating dynamic volume rootfsB of size 15134720 and volume id 4
Volume "rootfsB" found at volume id 4
Erasing redundant Nand...
Erasing at 0x160000 -- 100% complete.
Writing to redundant Nand... done
Image contains header with name [MIPS LTQCPE Linux-3.10.12]
Volume kernelB found at valid 3
remove UBI volume kernelB (id 3)
Creating dynamic volume kernelB of size 1835008 and volume id 3
Volume "kernelB" found at volume id 3
Erasing Nand...
Erasing at 0x120000 -- 100% complete.
Writing to Nand... done
Image contains header with name [XRX200 Firmware]
Volume firmwareB found at valid 5
remove UBI volume firmwareB (id 5)
Creating dynamic volume firmwareB of size 450560 and volume id 5
Volume "firmwareB" found at volume id 5
Erasing redundant Nand...
Erasing at 0x160000 -- 100% complete.
Writing to redundant Nand... done
Image contains header with name [LTQCPE RootFS]
Volume rootfsA found at valid 1
remove UBI volume rootfsA (id 1)
Creating dynamic volume rootfsA of size 15134720 and volume id 1
Volume "rootfsA" found at volume id 1
Erasing Nand...
Erasing at 0x120000 -- 100% complete.
Writing to Nand... done
Image contains header with name [MIPS LTQCPE Linux-3.10.12]
Volume kernelA found at valid 0
remove UBI volume kernelA (id 0)
Creating dynamic volume kernelA of size 1835008 and volume id 0
Volume "kernelA" found at volume id 0
Erasing redundant Nand...
Erasing at 0x160000 -- 100% complete.
Writing to redundant Nand... done
Image contains header with name [XRX200 Firmware]
Volume firmwareA found at valid 2
remove UBI volume firmwareA (id 2)
Creating dynamic volume firmwareA of size 450560 and volume id 2
Volume "firmwareA" found at volume id 2
Erasing Nand...
Erasing at 0x120000 -- 100% complete.
Writing to Nand... done
VR9 #

開機

...
Starting kernel ...

[    0.000000] Linux version 3.10.12 (user@8de9e3d5af60) (gcc version 4.8.1 20130401 (prerelease) (Linaro GCC 4.8-2013.04) ) #1 Tue Jul 17 02:27:28 UTC 2018
[    0.000000] SoC: xRX200 rev 1.2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019556 (MIPS 34Kc)
[    0.000000] adding memory size:66060288 from DT
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 03f00000 @ 00000000 (usable)
[    0.690000] pcie_wait_phy_link_up port 0 timeout
[    1.200000] pcie_wait_phy_link_up port 0 timeout
[    1.710000] pcie_wait_phy_link_up port 0 timeout
[    2.220000] pcie_wait_phy_link_up port 0 timeout
[    2.730000] pcie_wait_phy_link_up port 0 timeout
[    2.740000] pcie_rc_initialize port 0 link up failed!!!!!
[    2.780000] ts-xway 1f103000.ts: temp sensor not supported in this chip !!
[    2.880000] Switch API: PCE MicroCode loaded !!
[    2.890000] gphy_driver_init: fw_mode:22F-FW, no of phys:2, mode:0
[    3.110000] SQUASHFS error: Filesystem uses "lzma" compression. This is not supported
[    3.110000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,8)
[    3.110000] Rebooting in 1 seconds..

...

U-Boot 2010.06-LANTIQ-v-2.3.08 (Jun 28 2018 - 11:33:36)
...

也是不斷的重開機

不過造成重開機的點如下

[    3.110000] SQUASHFS error: Filesystem uses "lzma" compression. This is not supported
[    3.110000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,8)
[    3.110000] Rebooting in 1 seconds..

1050

改用不包含 proscend 的 image 試試 - Z:\52XXZ\bin\lantiq\vrx288_gw_he_vdsl_lte

從 uboot 作燒錄

開機

...
Starting kernel ...

[    0.000000] Linux version 3.10.12 (user@8de9e3d5af60) (gcc version 4.8.1 20130401 (prerelease) (Linaro GCC 4.8-2013.04) ) #1 Tue Jul 17 02:27:28 UTC 2018
[    0.000000] SoC: xRX200 rev 1.2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019556 (MIPS 34Kc)
[    0.000000] adding memory size:66060288 from DT
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 03f00000 @ 00000000 (usable)
[    0.690000] pcie_wait_phy_link_up port 0 timeout
[    1.200000] pcie_wait_phy_link_up port 0 timeout
[    1.710000] pcie_wait_phy_link_up port 0 timeout
[    2.220000] pcie_wait_phy_link_up port 0 timeout
[    2.730000] pcie_wait_phy_link_up port 0 timeout
[    2.740000] pcie_rc_initialize port 0 link up failed!!!!!
[    2.780000] ts-xway 1f103000.ts: temp sensor not supported in this chip !!
[    2.880000] Switch API: PCE MicroCode loaded !!
[    2.890000] gphy_driver_init: fw_mode:22F-FW, no of phys:2, mode:0
mount: mounting none on /dev/pts failed: No such file or directory
rootdir=/
table='/etc/device_table.txt'
makedevs: line 64: can't create node dev/ram: File exists
makedevs: line 108: can't create node dev/vcc/: File exists
makedevs: line 110: can't create node dev/vc/: File exists
starting pid 584, tty '': '/etc/init.d/rcS S boot'
902+1 records in
902+1 records out
[    6.260000] ltq_gphy_firmware_config: fw_mode:22F-FW, no of phys:2,data_ptr:3100000
Mounting ADSL firmware..
user obj count 2
starting pid 629, tty '': '/usr/bin/login'
(none) login:

看來需要修正我們產生 image 的流程

重點是要參考什麼來產生我們的 image

1115

先參考以下這兩個 Makefile

1335

試著整理一下 579X 的 Makefile 和 fullimage 有關的流程

image/firmware.img:
ifeq ($(BUILD_BY_OPENWRT_BASE), 1)
        cp $(OPENWRT_BASE_DIR)/firmware.img image/
else
        cp $(LTQCPE_IMAGE_DIR)/firmware.img image/
endif

ifneq ("$(KERNEL_DIR)", "$(LTQ_DIR)/linux-2.6.32.42")
image/uImage: $(KERNEL_DIR)/uImage
        cp $(KERNEL_DIR)/uImage image/
else ifeq ($(BUILD_BY_OPENWRT_BASE), 1)
image/uImage: $(OPENWRT_BASE_DIR)/uImage
        cp $(OPENWRT_BASE_DIR)/uImage image/
else
image/uImage: $(LTQCPE_IMAGE_DIR)/uImage
        cp $(LTQCPE_IMAGE_DIR)/uImage image/
endif

image/rootfs.img:
        @echo "===remove svn files..."
        @find rootfs/ -name ".svn" | xargs rm -rf
        @find rootfs/ -name "*~" | xargs rm -rf
        $(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp lzma -processors 1
        $(MKIMAGE) -A MIPS -O Linux -C lzma -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img
        @rm -f image/root.squashfs

image/fullimage.img: image/rootfs.img image/uImage image/firmware.img
        @rm -f $(FULLIMAGE).tmp
        @touch $(FULLIMAGE).tmp
        @FILE="image/rootfs.img"; \
                echo "add $$FILE to $(FULLIMAGE).tmp ..."; \
                cat $$FILE >> $(FULLIMAGE).tmp; \
                len=`wc -c $$FILE | awk '{ printf $$1 }'`; pad=`expr 16 - $$len % 16`; pad=`expr $$pad % 16`; padlen=$$pad; pad=0; \
                while [ $$pad -ne 0 ]; do echo -n "0" >> $(FULLIMAGE).tmp; pad=`expr $$pad - 1`; done; \
                echo "    ==>$$FILE, size=$$len, pad=$$padlen";
        @FILE="image/uImage"; \
                echo "add $$FILE to $(FULLIMAGE).tmp ..."; \
                cat $$FILE >> $(FULLIMAGE).tmp; \
                len=`wc -c $$FILE | awk '{ printf $$1 }'`; pad=`expr 16 - $$len % 16`; pad=`expr $$pad % 16`; padlen=$$pad; pad=0; \
                while [ $$pad -ne 0 ]; do echo -n "0" >> $(FULLIMAGE).tmp; pad=`expr $$pad - 1`; done; \
                echo "    ==>$$FILE, size=$$len, pad=$$padlen";
        @FILE="image/firmware.img"; \
                echo "add $$FILE to $(FULLIMAGE).tmp ..."; \
                cat $$FILE >> $(FULLIMAGE).tmp; \
                len=`wc -c $$FILE | awk '{ printf $$1 }'`; pad=`expr 16 - $$len % 16`; pad=`expr $$pad % 16`; padlen=$$pad; pad=0; \
                while [ $$pad -ne 0 ]; do echo -n "0" >> $(FULLIMAGE).tmp; pad=`expr $$pad - 1`; done; \
                echo "    ==>$$FILE, size=$$len, pad=$$padlen";
        $(MKIMAGE) -A MIPS -O Linux -C none -T multi -e 0x00 -a 0x00 -n "VR9 Fullimage" -d $(FULLIMAGE).tmp $(FULLIMAGE).img;
        @rm -f $(FULLIMAGE).tmp

rm_fullimage_img:
        rm -f image/fullimage.img

fullimage: rm_fullimage_img image/fullimage.img

目前的 52XXZ 的 Makefile 和 fullimage 有關的流程

image/root.squashfs: merge
	rm -f image/root.squashfs
	$(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp lzma -processors 1

image/firmware.img:
	cp $(LTQCPE_IMAGE_DIR)/firmware.img image/

image/uImage: $(LTQCPE_IMAGE_DIR)/uImage
	cp $(LTQCPE_IMAGE_DIR)/uImage image/

image/rootfs.img: image/root.squashfs
	$(MKIMAGE) -A MIPS -O Linux -C lzma -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img

image/fullimage.img: image/rootfs.img image/uImage image/firmware.img
	@rm -f $(FULLIMAGE).tmp
	@touch $(FULLIMAGE).tmp
	@FILE="image/rootfs.img"; \
		echo "add $$FILE to $(FULLIMAGE).tmp ..."; \
		cat $$FILE > $(FULLIMAGE).tmp; \
		len=`wc -c $$FILE | awk '{ printf $$1 }'`; pad=`expr 16 - $$len % 16`; pad=`expr $$pad % 16`; \
		while [ $$pad -ne 0 ]; do echo -n "0" >> $(FULLIMAGE).tmp; pad=`expr $$pad - 1`; done; \
		echo "    ==>$$FILE, size=$$len, pad=$$pad";
	@FILE="image/uImage"; \
		echo "add $$FILE to $(FULLIMAGE).tmp ..."; \
		cat $$FILE >> $(FULLIMAGE).tmp; \
		len=`wc -c $$FILE | awk '{ printf $$1 }'`; pad=`expr 16 - $$len % 16`; pad=`expr $$pad % 16`; \
		while [ $$pad -ne 0 ]; do echo -n "0" >> $(FULLIMAGE).tmp; pad=`expr $$pad - 1`; done; \
		echo "    ==>$$FILE, size=$$len, pad=$$pad";
	@FILE="image/firmware.img"; \
		echo "add $$FILE to $(FULLIMAGE).tmp ..."; \
		cat $$FILE >> $(FULLIMAGE).tmp; \
		len=`wc -c $$FILE | awk '{ printf $$1 }'`; pad=`expr 16 - $$len % 16`; pad=`expr $$pad % 16`; \
		while [ $$pad -ne 0 ]; do echo -n "0" >> $(FULLIMAGE).tmp; pad=`expr $$pad - 1`; done; \
		echo "    ==>$$FILE, size=$$len, pad=$$pad";
	$(MKIMAGE) -A MIPS -O Linux -C none -T multi -e 0x00 -a 0x00 -n "VR9 Fullimage" -d $(FULLIMAGE).tmp $(FULLIMAGE).img;
	@rm -f $(FULLIMAGE).tmp

clean_image:
	rm -rf image
	mkdir -p image

fullimage: clean_image image/fullimage.img

1355

作實驗

將 Compressors 從 lzma 換成 xz

diff --git a/proscend/Makefile b/proscend/Makefile
index 2326077..e1457b1 100644
--- a/proscend/Makefile
+++ b/proscend/Makefile
@@ -218,10 +218,10 @@ firmware_img: sysupgrade_bin

 image/root.squashfs: merge
        rm -f image/root.squashfs
-       $(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp lzma -processors 1
+       $(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp xz -processors 1

 image/rootfs.img: image/root.squashfs
-       $(MKIMAGE) -A MIPS -O Linux -C lzma -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img
+       $(MKIMAGE) -A MIPS -O Linux -C xz -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img

 image/uImage: $(LTQCPE_IMAGE_DIR)/uImage
        cp $(LTQCPE_IMAGE_DIR)/uImage image/

make 的過程出錯了

/home/user/staging_dir/host/bin/mksquashfs4 rootfs image/root.squashfs -noappend -root-owned -comp xz -processors 1
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on image/root.squashfs, block size 131072.

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments, no xattrs
        duplicates are removed
Filesystem size 14799.84 Kbytes (14.45 Mbytes)
        29.03% of uncompressed filesystem size (50986.05 Kbytes)
Inode table size 24146 bytes (23.58 Kbytes)
        22.82% of uncompressed inode table size (105790 bytes)
Directory table size 31698 bytes (30.96 Kbytes)
        44.45% of uncompressed directory table size (71316 bytes)
Number of duplicate files found 165
Number of inodes 3204
Number of files 2697
Number of fragments 139
Number of symbolic links  259
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 248
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
/home/user/staging_dir/host/bin/mkimage -A MIPS -O Linux -C xz -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img

Invalid Compression Type - valid names are: none, bzip2, gzip, lzma, lzo
Usage: /home/user/staging_dir/host/bin/mkimage -l image
          -l ==> list image header information
       /home/user/staging_dir/host/bin/mkimage [-x] -A arch -O os -T type -C comp -M magic -a addr -e ep -n name -d data_file[:data_file...] image
          -A ==> set architecture to 'arch'
          -O ==> set operating system to 'os'
          -T ==> set image type to 'type'
          -C ==> set compression type 'comp'
          -M ==> set image magic to 'magic'
          -a ==> set load address to 'addr' (hex)
          -e ==> set entry point to 'ep' (hex)
          -n ==> set image name to 'name'
          -d ==> use image data from 'datafile'
          -x ==> set XIP (execute in place)
       /home/user/staging_dir/host/bin/mkimage [-D dtc_options] -f fit-image.its fit-image
       /home/user/staging_dir/host/bin/mkimage -V ==> print version information and exit
make: *** [image/rootfs.img] Error 1
user@8de9e3d5af60:~/proscend$
[0] 0:docker* 1:git-                                                      

mksquashfs4 支援 xz Compression Type

但 mkimage 卻不支援 xz Compression Type

1405

用兩個的交集 gzip

diff --git a/proscend/Makefile b/proscend/Makefile
index 2326077..18c73f6 100644
--- a/proscend/Makefile
+++ b/proscend/Makefile
@@ -218,10 +218,10 @@ firmware_img: sysupgrade_bin

 image/root.squashfs: merge
        rm -f image/root.squashfs
-       $(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp lzma -processors 1
+       $(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp gzip -processors 1

 image/rootfs.img: image/root.squashfs
-       $(MKIMAGE) -A MIPS -O Linux -C lzma -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img
+       $(MKIMAGE) -A MIPS -O Linux -C gzip -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img

 image/uImage: $(LTQCPE_IMAGE_DIR)/uImage
        cp $(LTQCPE_IMAGE_DIR)/uImage image/

build 過了

利用 uboot 作燒錄

開機


Starting kernel ...

[    0.000000] Linux version 3.10.12 (user@8de9e3d5af60) (gcc version 4.8.1 20130401 (prerelease) (Linaro GCC 4.8-2013.04) ) #1 Tue Jul 17 02:27:28 UTC 2018
[    0.000000] SoC: xRX200 rev 1.2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019556 (MIPS 34Kc)
[    0.000000] adding memory size:66060288 from DT
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 03f00000 @ 00000000 (usable)
[    0.690000] pcie_wait_phy_link_up port 0 timeout
[    1.200000] pcie_wait_phy_link_up port 0 timeout
[    1.710000] pcie_wait_phy_link_up port 0 timeout
[    2.220000] pcie_wait_phy_link_up port 0 timeout
[    2.730000] pcie_wait_phy_link_up port 0 timeout
[    2.740000] pcie_rc_initialize port 0 link up failed!!!!!
[    2.780000] ts-xway 1f103000.ts: temp sensor not supported in this chip !!
[    2.880000] Switch API: PCE MicroCode loaded !!
[    2.890000] gphy_driver_init: fw_mode:22F-FW, no of phys:2, mode:0
[    3.110000] SQUASHFS error: Filesystem uses "zlib" compression. This is not supported
[    3.110000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,8)
[    3.110000] Rebooting in 1 seconds..
...
U-Boot 2010.06-LANTIQ-v-2.3.08 (Jun 28 2018 - 11:33:36)

一樣是開不了機

1455

目前確認以下的修改能把 rootfs 帶起來

diff --git a/proscend/Makefile b/proscend/Makefile
index 2326077..4608574 100644
--- a/proscend/Makefile
+++ b/proscend/Makefile
@@ -218,10 +218,10 @@ firmware_img: sysupgrade_bin

 image/root.squashfs: merge
        rm -f image/root.squashfs
-       $(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp lzma -processors 1
+       $(MKSQUASHFS4) rootfs image/root.squashfs -noappend -root-owned -comp xz -processors 1

 image/rootfs.img: image/root.squashfs
-       $(MKIMAGE) -A MIPS -O Linux -C lzma -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img
+       $(MKIMAGE) -A MIPS -O Linux -T filesystem -e 0x00 -a 0x00 -n "LTQCPE RootFS" -d image/root.squashfs image/rootfs.img

 image/uImage: $(LTQCPE_IMAGE_DIR)/uImage
        cp $(LTQCPE_IMAGE_DIR)/uImage image/

1500

先上 code 吧

commit 7816163750b23338ea6a58c717bf0fce2a6068b8
Refs: [develop], {origin/develop}, {origin/HEAD}
Author: jeffrey <[email protected]>
Date:   Tue Jul 17 15:00:29 2018 +0800

    use 'xz' compressor instead of 'lzma' when do mksquashfs4 or the kernel panic as following:
    [    3.110000] SQUASHFS error: Filesystem uses "lzma" compression. This is not supported
    [    3.110000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,8)
    [    3.110000] Rebooting in 1 seconds..

 proscend/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
⚠️ **GitHub.com Fallback** ⚠️