Best pratice to Create Partition in the eMMC using Toradex BSP (OpenEmbedded)

Hi!

There’s some Toradex’s custom scripts in the Toradex BSP openembedded.
For my product I need partitioning the eMMC into

KERNEL+DTB files (Read Only) | Rootfs (Read Only) | User data (Read/Write) |

How is the best way to generate the User Data partition using the Toradex BSP ?
I would like to use the Toradex standard process to write on the System On Module eMMC ( update.sh )
Someone has a good advice?

Thank you!

Best Regards.

Caio Pereira

Hello

Please have a look at the update.sh script.
The partitioning is done here: update script mbr create

This creates an MBR with the boot and rootfs partitions. Reduce the size of the rootfs partition here and create your third one.

Now, after running update.sh and updating your module you have 3 partitions, the last one waiting for you to create a filesystem on it.

If you want to create and deploy the filesystem also on the development PC you could do something like this for the filesystem on the third partition: update script fs create

And adding it also to the flashing U-Boot script:
U-Boot script

Note that we create the rootfs smaller than the partition it lives in. The following adds a systemd task and script to expand the file system to the full size of the partition it lives in. recipe

One probably could change /etc/fstab to have /dev/mmcblk0p1 mounted read only or not mounted at all.

I have no experience for having a read only rootfs.

Max

Hi Caio, use the script provided by Max, or create your shell script, customized with your features, using sfdisk, parted between others tools native linux.

You can create partition extra to upgrade firmware only with eMMC, I like this!

Bye!

Att,
Cleiton Bueno

Blog | Linkedin | B2Open

hey ,

could you provide the script for extra partition and way to copy rootfs in it ??
regards,
nikunj patel

hi @nikunjp26

You can find the script here.

Best regards, Jaski