[yocto] Partitioning SD cards

Maciej Pijanowski maciej.pijanowski at 3mdeb.com
Mon Oct 14 05:31:47 PDT 2019


On 14.10.2019 14:13, Andy Pont wrote:
> Hello,
>
> I am working on a custom platform where U-Boot will be programmed into
> an SPI NOR flash device and the ext4 file systems will be in a
> removable microSD card.  The Linux kernel itself will be stored in the
> /boot directory of the root file system.
>
> The customer wants the (16GB) microSD card formatted as 1GB to mount
> at / and the remaining 15GB mounted as /home.
>
> In the recipe for my image I have defined the following to try to
> create a suitable image for writing to the microSD card:
>
> IMAGE_FSTYPES_append = " wic"
> IMAGE_ROOTFS_SIZE = “1048576”
>
> The image file that is being created is bigger than 1GB even though
> the root file system is only a little over 450MB.  Looking at the
> contents of what gets written to the microSD card this looks as though
> it is, in part, because it also includes the ~20MB “boot” partition
> containing the boot files.
>
> A couple of questions…
>
> How do I stop the wic generation process including the FAT formatted
> “boot” partition?
This depends on the wic (.wks) file you are using.
>
> What is the best strategy for partitioning / formatting / mounting the
> second partition as /home?  Should it be part of the image build
> process or a one-time task run at first boot?
Use --exclude-path and --rootfs-dir flags in the .wks file.
You can look at my example, where I extract one subdir from rootfs
(/storage in this case) on a separate partition.
https://github.com/3mdeb/meta-rte/blob/master/wic/sunxi-mmc-spl.wks

The rootfs parts should be named somewhere, like in distro config:
https://github.com/3mdeb/meta-rte/blob/master/conf/distro/rte.conf#L50
>
> -Andy.
>
>
>
-- 
Maciej Pijanowski
Embedded Systems Engineer
GPG: F1401D2E1CCB19EF
https://3mdeb.com | @3mdeb_com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20191014/8716d6de/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20191014/8716d6de/attachment-0001.pgp>


More information about the yocto mailing list