问题描述
烧录GSI,执行fastboot flash system system.img时,提示Resizing 'system' FAILED (remote: 'Not enough space to resize partition')。
在项目的BoardConfig.mk里定义了BOARD_MTK_SUPER_SIZE_KB:=2560000 , BOARD_MTK_SYSTEM_SIZE_KB:=1258292,但实际system.img只有600多M。
adb shell lpdump -j ,打印如下:
...
{
"name": "system",
"group_name": "main",
"is_dynamic": true,
"size": "630095872",
"fs_size": "619220992",
"fs_used": "619220992"
},
...
"block_devices": [
{
"name": "super",
"size": "2625634304",
"block_size": "4096",
"alignment": "1048576"
}
]
super空间充足,无法烧录gsi
在项目的BoardConfig.mk里定义了BOARD_MTK_SUPER_SIZE_KB:=2560000 , BOARD_MTK_SYSTEM_SIZE_KB:=1258292,但实际system.img只有600多M。
adb shell lpdump -j ,打印如下:
...
{
"name": "system",
"group_name": "main",
"is_dynamic": true,
"size": "630095872",
"fs_size": "619220992",
"fs_used": "619220992"
},
...
"block_devices": [
{
"name": "super",
"size": "2625634304",
"block_size": "4096",
"alignment": "1048576"
}
]
super空间充足,无法烧录gsi
解决方案
若手机ROM较小(e.g. 8G ROM),刷system img可能会有not enough space的error提示
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Resizing 'system' FAILED (remote: 'Not enough space to resize partition')
fastboot: error: Command failed
这时请先执行指令"fastboot delete-logical-partition product",接着"fastboot create-logical-partition product 0", 再做"Fastboot flash system system.img"动作