Yocto WIC image creator with fixed partition sizes

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Yocto WIC image creator with fixed partition sizes

28,858 次查看
adrianmcgrath
Contributor III

Hi All

I've successfully used Yocto 'wic' to create an image for my imx6 based system with 4x partitions {Boot, Rootfs, Rootfs-bkup, Userdata}. My .wks file is shown below:

# Image Creator .wks

part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1

# Boot partition

part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 8M --extra-space 0

# Rootfs partition

part / --source rootfs --ondisk mmcblk --fstype=ext3 --label root --align 4096 --size 1024M

# Rootfs backup partition

part /rootfs-bkup --source rootfs --ondisk mmcblk --fstype=ext3 --label rootfs-bkup --align 4096 --size 1024M

# User data partition

part /userdata --ondisk mmcblk --fstype=vfat --label userdata --align 4096 --size 1024M

The .wks file above uses "--size 1024M". I had expected this to create partitions with a fixed partition size of 1024M. However, it appears that this actually adds 1024M to the size of the ext3 rootfs images created by Yocto.

My question is, how can I edit my .wks file to create 3x fixed partitions of size 1024M?

Many thanks

Adrian

标签 (3)
2 回复数

16,105 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Adrian McGrath,

The size option defines a minimum partition size, not the total size of the partition. If the size parameter is smaller than the source the partition will have the size of the source.

You may use the extra-space (to add extra space at the end of the space filled by the content of the partition) or overhead-factor (to multiply the size of the partition by this factor, which has to be at least 1)

These parameters are similar to the ones used in the .sdcard format used by bitbake, so you may find the following document useful:

Guide to the .sdcard format

On the latest revisions of wic you may use the the parameters --grow  and  --maxsize, the first tells the partition to grow to fill available space up to the maximum size setting, which is set by the latter.

You can see how they work on the Kickstart documentation (below), but I haven’t tested it. It is probably not available on the BSP Release I’m using, you may want to check on the latest Community BSP Branch.

https://github.com/rhinstaller/pykickstart/blob/master/docs/kickstart-docs.rst#id36

I hope this helps!

Regards,

16,105 次查看
adrianmcgrath
Contributor III

Many thanks for the information.

I'll have a look over those links and try some of the parameters.

Thanks again

0 项奖励
回复