Using WIC to format FAT32 partition to expose via USB mass storage

612 views Asked by At

I have a partition on an eMMC in an embedded linux device that I would like to expose as storage through the g_mass_storage USB gadget. Everything is being build via yocto/bitbake and mostly works; where I am stumbling is in the configuration of the wic (kickstart) description of this so as to make it formatted as a FAT32 drive in a way that windows can understand.

My WIC configuration (.wks file) appears to put a FAT32 partition starting at 0 whereas if I initialise and format a bare partition using windows the FAT appears at 0x10000 (sector 128 with 512byte sectors) with what looks to be an MBR starting at 0.

Now I can work around this by treating the thing as a black box and using dd, however I would greatly prefer if this could be described in the wic descriptor for my image.

my current wks contains

part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --fixed-size 16
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4 --fixed-size 512
part  --ondisk mmcblk0 --fixed-size 3072 --fstype=vfat --label data --align 4 --use-uuid 

any suggestions would be really appreciated

Thanks

-sdude

0

There are 0 answers