Skip to contentSkip to conversation

adjust image partitions for imx6ulevk

DISCUSSION Oliver Graute 3 participants 6 messages Jan 28, 2016 – Jan 29, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

whats is the right way to adjust the flash partitions for my imx6ulevk?

I need a bootstream partition, two rootfs partitions with 125 MB each and a data partitions with 730 MB.

during some code investigation I found image_types_fsl.bbclass where some partitioning seems to happen. Is this the point to start?

Can you give me some instructions, how to do that the right way in yocto.

Best Regards,

Oliver

#1 lore raw

Hello Oliver,

2016-01-28 12:37 GMT+01:00 Oliver Graute <[email protected]>:

Quoted 3 lines

Hello,

whats is the right way to adjust the flash partitions for my imx6ulevk?

There are several possibilities I think.

- Either by defining an own image class like this:
https://github.com/Freescale/meta-fsl-arm/blob/master/classes/image_types_fsl.bbclass
I never tried but I guess you can inherit this class and overload the functions you wish to extend.
- Create a script which adds those partitions during the first boot. I did something similar to resize the rootfs:
https://github.com/graugans/meta-udoo/blob/jethro/recipes-core/resize-rootfs/resize-rootfs.bb
- Use swupdate by stefano babic and create the partiion during installation of the image. This is how we do it in the office.
https://github.com/sbabic/meta-swupdate
https://github.com/sbabic/swupdate

Quoted 5 lines

I need a bootstream partition, two rootfs partitions with 125 MB each and a data partitions with 730 MB.

during some code investigation I found image_types_fsl.bbclass where some partitioning seems to happen. Is this the point to start?

You have to provide your own. I can not see any hooks to change the layout. For me your request is very specific and could be hardly handled by a generic approach.

You can check how they did it in the RPI
http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/classes/sdcard_image-rpi.bbclass

Quoted 1 line

Can you give me some instructions, how to do that the right way in yocto.

I would prefer to use swupdate. But I am unsure about dual bootimage support

Regards,
Christian

Quoted 9 lines

Best Regards,

Oliver
--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

Signature · 1 line
http://ch.ege.io/
#3 lore raw
In reply to Oliver Graute
Quoted 7 lines · Oliver Graute

whats is the right way to adjust the flash partitions for my imx6ulevk?

I need a bootstream partition, two rootfs partitions with 125 MB each and a data partitions with 730 MB.

during some code investigation I found image_types_fsl.bbclass where some partitioning seems to happen. Is this the point to start?

For this kind of use-case the wic is better.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#4 lore raw
Quoted 10 lines · Otavio Salvador
Quoted 7 lines · Oliver Graute

whats is the right way to adjust the flash partitions for my imx6ulevk?

I need a bootstream partition, two rootfs partitions with 125 MB each and a data partitions with 730 MB.

during some code investigation I found image_types_fsl.bbclass where some partitioning seems to happen. Is this the point to start?

For this kind of use-case the wic is better.

ok thanks for the hint. I read the wic part in the dev-manual of yocto

https://www.yoctoproject.org/docs/1.5.2/dev-manual/dev-manual.html

after that I tried to write my own imx-test.wks for wic.

# short-description: Create SD card image with a boot partition and two rootfs # long-description:
# Create an image that can be written onto a SD card using dd for use

# with i.MX SoC family
# It uses u-boot
#
# The disk layout used is:
#  - --------- --------- ------------ ------------ -----------
# | | u-boot  |  /boot  |  rootfs 1  |  rootfs 2  |   data   |
#  - --------- --------- ------------ ------------ -----------
# ^ ^         ^         ^              ^
# | |         |         |              |
# 0 1kiB    4MiB   4MiB + 8MiB    4MiB + 8Mib + rootfs 1 + rootfs 2 + data  IMAGE_EXTRA_SPACE (default 10MiB)
#
part u-boot --source rawcopy --sourceparams="file=u-boot.img" --ondisk mmcblk --no-table --align 1
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 8M --extra-space 0
part / --source rootfs --rootfs-dir=rootfs1 --ondisk mmcblk --fstype=ext4 --label platform --align 4096
part /rescue --source rootfs --rootfs-dir=rootfs2 --ondisk mmcblk --fstype=ext4 --label secondary --align 4096

I also added to my build-imx6ulevk/conf/local.conf

IMAGE_BOOT_FILES = "u-boot.img zImage:kernel"

then I execute:

wic create imx-test.wks -e fsl-image

and get the follwing output:

Done.
Creating image(s)...

Couldn't get 'bitbake -e rootfs1' output.
Bitbake failed with error:
Loading cache...done.
Loaded 2378 entries from dependency cache.
ERROR: Nothing PROVIDES 'rootfs1'

Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Couldn't get 'bitbake -e rootfs1' output.
Bitbake failed with error:
Loading cache...done.
Loaded 2378 entries from dependency cache.
ERROR: Nothing PROVIDES 'rootfs1'

Where do I need to provide rootfs1 and rootfs2. Can you comment my first try :)

best regards,

Oliver

#2 lore raw
In reply to Christian Ege
Quoted 29 lines · Christian Ege

Hello Oliver,

2016-01-28 12:37 GMT+01:00 Oliver Graute <[email protected]>:

Quoted 3 lines

Hello,

whats is the right way to adjust the flash partitions for my imx6ulevk?

There are several possibilities I think.

- Either by defining an own image class like this:
https://github.com/Freescale/meta-fsl-arm/blob/master/classes/image_types_fsl.bbclass
I never tried but I guess you can inherit this class and overload the functions you wish to extend.
- Create a script which adds those partitions during the first boot. I did something similar to resize the rootfs:
https://github.com/graugans/meta-udoo/blob/jethro/recipes-core/resize-rootfs/resize-rootfs.bb
- Use swupdate by stefano babic and create the partiion during installation of the image. This is how we do it in the office.
https://github.com/sbabic/meta-swupdate
https://github.com/sbabic/swupdate

Quoted 5 lines

I need a bootstream partition, two rootfs partitions with 125 MB each and a data partitions with 730 MB.

during some code investigation I found image_types_fsl.bbclass where some partitioning seems to happen. Is this the point to start?

You have to provide your own. I can not see any hooks to change the layout. For me your request is very specific and could be hardly handled by a generic approach.

Quoted 5 lines

You can check how they did it in the RPI
http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/classes/sdcard_image-rpi.bbclass

Quoted 1 line

Can you give me some instructions, how to do that the right way in yocto.

I would prefer to use swupdate. But I am unsure about dual bootimage support

thx for the links, I come back to this if its not working with wic

best regards,

Oliver

#5 lore raw
In reply to Oliver Graute
Quoted 27 lines · Oliver Graute
Quoted 10 lines · Otavio Salvador
Quoted 7 lines · Oliver Graute

whats is the right way to adjust the flash partitions for my imx6ulevk?

I need a bootstream partition, two rootfs partitions with 125 MB each and a data partitions with 730 MB.

during some code investigation I found image_types_fsl.bbclass where some partitioning seems to happen. Is this the point to start?

For this kind of use-case the wic is better.

wic create imx-test.wks -e fsl-image

and get the follwing output:

Done.
Creating image(s)...

Couldn't get 'bitbake -e rootfs1' output. Bitbake failed with error:
Loading cache...done.
Loaded 2378 entries from dependency cache.
ERROR: Nothing PROVIDES 'rootfs1'

Quoted 8 lines

Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Couldn't get 'bitbake -e rootfs1' output. Bitbake failed with error:
Loading cache...done.
Loaded 2378 entries from dependency cache.
ERROR: Nothing PROVIDES 'rootfs1'

I updated my imx-test.wks file, I replaced rootfs1 and rootfs2 by my fsl-image

# short-description: Create SD card image with a boot partition and two rootfs # long-description:
# Create an image that can be written onto a SD card using dd for use

# with i.MX SoC family
# It uses u-boot
#
# The disk layout used is:
#  - --------- --------- ------------ ------------ -----------
# | | u-boot  |  /boot  |  rootfs 1  |  rootfs 2  |   data   |
#  - --------- --------- ------------ ------------ -----------
# ^ ^         ^         ^              ^
# | |         |         |              |
# 0 1kiB    4MiB   4MiB + 8MiB    4MiB + 8Mib + rootfs 1 + rootfs 2 + data  IMAGE_EXTRA_SPACE (default 10MiB)
#
part u-boot --source rawcopy --sourceparams="file=u-boot-imx6ulevk.img" --ondisk mmcblk --no-table --align 1
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 8M --extra-space 0
part / --source rootfs --rootfs-dir=fsl-image --ondisk mmcblk --fstype=ext4 --label platform --align 4096
part /rescue --source rootfs --rootfs-dir=fsl-image --ondisk mmcblk --fstype=ext4 --label secondary --align 4096

wic create imx-test.wks -e fsl-image
Checking basic build environment...
Done.

Creating image(s)...

Info: The new image(s) can be found here:
/var/tmp/wic/build/imx-test-201601291301-mmcblk.direct

The following build artifacts were used to create the image(s):
ROOTFS_DIR: build-imx6ulevk/tmp/work/imx6ulevk-poky-linux-gnueabi/fsl-image/1.0-r0/rootfs
ROOTFS_DIR["/rescue"]: build-imx6ulevk/tmp/work/imx6ulevk-poky-linux-gnueabi/fsl-image/1.0-r0/rootfs
BOOTIMG_DIR:
KERNEL_DIR: build-imx6ulevk/tmp/deploy/images/imx6ulevk
NATIVE_SYSROOT: build-imx6ulevk/tmp/sysroots/x86_64-linux

The image(s) were created using OE kickstart file:

then I write the image to my sdcard with:

dd if=imx-test-201601291200-mmcblk.direct of=sdb bs=4M && sync

something is booting from that sd image. Is this the way to go? some further hints or corrections? how do I define the partition size?

best regards,

Oliver