How to create new partition in imx8(yocto build)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create new partition in imx8(yocto build)

3,572 Views
MuthukumarSEKAR
Contributor I

Hello,

 

Platform: imx8

Environment: Yocto

 

We have 8GB emmc flash memory in our custom board, yocto builld rootfs take 400MB, we want to create separate partition for unused space in emmc in yocto build. We are using sdcard image format.

We can able to create new partition(mmcblk0p3) through fdisk manually, How to create new partition in yocto build?

 

BRs,

Muthukumar.S

0 Kudos
Reply
9 Replies

3,467 Views
edwardtyrrell
Senior Contributor I

Hi @MuthukumarSEKAR 

I recently added a new partition into my eMMc successfully, here's what I did. I wanted an ext4 partition off my main rootfs partition since there was so much unused space. 

In your Yocto source find the *.wks.in files. In one (even a few of them - I was lazy and did the lot!) add the line below: 

part / --ondisk mmcblk --fstype=ext4 --label mynewpartition --align 4096 --size 32

Then rebuild. Mount the new /dev/mmcblk*p* in the normal way. Mine popped up as mmcblk0p3 off the main root space.

 

NOTE: I only use a wic image for UUU downloading not the sdcard image. I know you mentioned that you're not using wic images but it might be worth giving them a try. The UUU tool is much better than the MFGTool etc. I use a board with same boot switches as the EVK. flick sw1101 switches 1 and 2 the opposite way then UUU the image.

Wic image generation in local.conf   IMAGE_FSTYPES += " wic tar.bz2" 

To download -> sudo uuu -b emmc_all imx-boot-imx8mmevk-sd.bin-flash_evk core-image-base-imx8mmevk.wic

 

Hope this helps!

 

Section 4.1   https://www.nxp.com/docs/en/application-note/AN13706.pdf

 

 

 

0 Kudos
Reply

3,438 Views
MuthukumarSEKAR
Contributor I

Thanks for the input @edwardtyrrell


Yes, We are trying to create partition for the sdcard image in yocto build.
Small query, after add new partition in wic image, image sized increased?

0 Kudos
Reply

3,432 Views
edwardtyrrell
Senior Contributor I

Hi @MuthukumarSEKAR 

Sorry, didn't notice that. I did enlarge my rootfs space by another 500MB as well and that took longer to download, but that could be just formatting time. 

If you have boot switches and a spare hour it might be worth trying UUU even for experience sakes. 

Cheers.

0 Kudos
Reply

3,560 Views
MuthukumarSEKAR
Contributor I

I have read https://www.nxp.com/docs/en/application-note/AN13706.pdf document, In this document, rootfs partition increase method and wks image method explained, But we need to create new partition in sdcard image for data usage and build final image size will not increase more.

0 Kudos
Reply

3,496 Views
joanxie
NXP TechSupport
NXP TechSupport

pls refer to the chapter 4.3 Preparing an SD/MMC card to boot

"https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf"

0 Kudos
Reply

3,487 Views
MuthukumarSEKAR
Contributor I

Thanks for the reply.

I checked the 4.3 session in the above document link.

It described about the prepare and partition in Linux host machine manually, But our query is create new partition in yocto build itself for xyz.sdcard image without increase the image size more, not in xyz.wic image format.

 

We have identified partition creation option in meta-fsl-bsp-release/imx/meta-bsp/classes/image_types_fsl.bbclass, but if we add new 1GB partition, then image size increased +1GB.

Do we have any way to create new partition in yocto build itself for xyz.sdcard image without increase the image size more?

hope you got our query.

0 Kudos
Reply

3,479 Views
joanxie
NXP TechSupport
NXP TechSupport

what OS do you use?android or linux?

0 Kudos
Reply

3,170 Views
MuthukumarSEKAR
Contributor I

linux 4.14.98

@joanxie Kindly check and update.

0 Kudos
Reply

3,477 Views
MuthukumarSEKAR
Contributor I

linux 4.14.98

0 Kudos
Reply