Re: [問題] mtdblock 到 file system的大小變化
: [ 0.710000] Creating 5 MTD partitions on "spi0.0":
: [ 0.720000] 0x000000000000-0x000000020000 : "u-boot"
: [ 0.720000] 0x000000020000-0x00000012ed38 : "kernel"
: [ 0.730000] mtd: partition "kernel" must either start or end on erase
: block boundary or be smaller than an erase block -- forcing read-only
: [ 0.740000] 0x00000012ed38-0x0000007f0000 : "rootfs"
: [ 0.750000] mtd: partition "rootfs" must either start or end on erase
: block boundary or be smaller than an erase block -- forcing read-only
: [ 0.760000] mtd: device 2 (rootfs) set to be root filesystem
: [ 0.770000] 1 squashfs-split partitions found on MTD device rootfs
: [ 0.770000] 0x000000300000-0x0000007f0000 : "rootfs_data"
: [ 0.780000] 0x0000007f0000-0x000000800000 : "art"
: [ 0.790000] 0x000000020000-0x0000007f0000 : "firmware"
以下所說,都沒去trace code, 不保證都對(不負責任的心得
先講結論:
rootfs這個partition的每個檔案大小加起來,總合是2048K
把這些檔案壓起來的root.squashfs image, 大小是1860K,直接放在mtd
openwrt在打包images(含kernel和rootfs),
是使用piggy back的方式,把rootfs接在kernel的後面,
|magic_header|kernel|rootfs|....
所以從上面來看,kernel一定是從0x000000020000開始放
問題1,kernel實際有多大? 我不知道"實際"有多大
但至少用掉 (0x00000012ed38-0x000000020000)空間來放kernel
剩下的區塊(0x00000012ed38-0x0000007f0000)來放rootfs.
問題2, rootfs實際有多大? 我不知道"實然"有多大
但我知道(0x000000300000-0x0000007f0000)會拿來放rootfs_data (overlayfs)
所以我知道rootfs至少用掉:
(0x000000300000-0x00000012ed38)=0x1D12C8=1905352=1860K
注意,openwrt沒有限定kernel和rootfs的大小
有可能image中的kernel變大,rootfs也跟著往後移
同時rootfs_data可用的空間就跟著變小
所以"實際"上的kernel"大小,要看build code後,kernel image大小 (檔名忘了)
同樣地,"實際"上rootfs大小,會有個rootfs.squashfs檔案,
這個檔案,就是實際的rootfs大小 (檔名不確定)
※ 編輯: qsort (210.61.29.28), 11/05/2014 12:54:35
推
11/05 12:57, , 1F
11/05 12:57, 1F
→
11/05 12:58, , 2F
11/05 12:58, 2F
→
11/05 13:10, , 3F
11/05 13:10, 3F
→
11/05 13:12, , 4F
11/05 13:12, 4F
→
11/05 13:13, , 5F
11/05 13:13, 5F
→
11/05 13:15, , 6F
11/05 13:15, 6F
推
11/05 20:13, , 7F
11/05 20:13, 7F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
LinuxDev 近期熱門文章
PTT數位生活區 即時熱門文章