PeterChan

Using mkfs.vfat to format a FAT partition cannot exceed 1GB in Mfgtool -blog archive

Discussion created by PeterChan Employee on Mar 6, 2012

When using Mfgtool to update firmware to i.MX devices, it is common to use the mkfs.vfat command to format a FAT partition.

    <CMD type="push" body="$ mkfs.vfat /dev/mmcblk0p1">Formatting sd partition</CMD>

However, the size of formatted partition is limited to 1GB regardless to the size you have reserved for this partition.

 

It is because the BSP is still using an old version of dosfstools 2.11. You need to update the tool to dosfstools 3.0.1 or higher version to break this 1GB limitation. Here are the steps to update the dosfstools manually in BSP and use 3.0.1 as an example.

 

Update BSP to use dosfstools

The example here is based on BSP release L2.6.35_MX508_ER_1104 (ER6) for i.MX50 platform. These steps may vary across other i.MX platforms.

 

1. In BSP, run the following command to get the dosfstools 2.11 source code

  ./ltib -m prep -p dosfstools

2. Download the dosfstools 3.0.1 original source code from http://ftp.debian.org/debian/pool/main/d/dosfstools/dosfstools_3.0.1.orig.tar.gz

  and copy the dosfstools_3.0.1.orig.tar.gz to ltib/rpm/SOURCES

3. Modify the 2.11 spec file ltib/dist/lfs-5.1/dosfstools/dosfstools.spec to adopt the 3.0.1 source code. The modified spec file dosfstools.spec is attached here for your reference.

4. run the command to build the new dosfstools

  ./ltib -m scbuild -p dosfstools

5. run this command to deploy the new dosfstools into rootfs. If it returns success, you will see mkfs.vfat and mkdosfs under the rootfs/sbin directory, where mkfs.vfat -> mkdosfs

  ./ltib -m scdeploy -p dosfstools

 

Now, you have updated the dosfstools into rootfs. To test if it works, download this rootfs and run this command in your device

mkfs.vfat /dev/mmcblk0p1

mkdir /mnt/fat

mount -t vfat /dev/mmcblk0p1 /mnt/fat

df

 

You should see the FAT file system is greater than 1GB now. Finally, please follow the mfg firmware build procedure in user guide to update the initramfs.cpio.gz.uboot for mfgtool.

 

Reference: http://markdingst.blogspot.com/2011/04/mfgtools-mkfsvfat-format-fat-parittion.html

Original Attachment has been moved to: 60-dosfstools.spec

Outcomes