As of this writing, April 2015, the default sdcard image created from a Yocto Project build has all the software images nicely aligned to create a SDCARD.
10/7/2020: Update - SDCARD image names have been updated to images ending with .wic as the default from Yocto Project. The process is the same for both .sdcard and .wic files.
There are two partitions within the image:
Each partition can be mounted from your Linux host computer, then you can read or write the partition contents.
Here are the steps based on the core-image-base recipe for the imx6sxsabresd machine using Yocto Project release L3.14.28_1.0.0_GA.
The name of the image: core-image-base-imx6sxsabresd.sdcard
$ fdisk -l core-image-base-imx6sxsabresd.sdcard
Disk core-image-base-imx6sxsabresd.sdcard: 100 MB, 100663296 bytes
4 heads, 32 sectors/track, 1536 cylinders, total 196608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00074663
Device Boot Start End Blocks Id System
core-image-base-imx6sxsabresd.sdcard1 8192 24575 8192 c W95 FAT32 (LBA)
core-image-base-imx6sxsabresd.sdcard2 24576 188415 81920 83 Linux
8192 * 512 = 4194304
24576 * 512 = 12582912
First create mount points:
$ sudo mkdir /mnt/{mp1,mp2}
sdcard1 partition
$ sudo mount -o loop,offset=4194304 core-image-base-imx6sxsabresd.sdcard /mnt/mp1
NOTE: An alternate method for determining the offset, see below:
$ sudo mount -o loop,offset=$((512 * 8192)) core-image-base-imx6sxsabresd.sdcard /mnt/mp1
sdcard2 partition
$ sudo mount -o loop,offset=12582912 core-image-base-imx6sxsabresd.sdcard /mnt/mp2
$ ls /mnt/mp1
imx6sx-sdb.dtb imx6sx-sdb-lcdif1.dtb imx6sx-sdb-reva.dtb imx6sx-sdb-sai.dtb imx6sx-sdb-emmc.dtb imx6sx-sdb-m4.dtb imx6sx-sdb-reva-ldo.dtb zImage
$ ls /mnt/mp2
bin boot dev etc home lib lost+found media mnt proc run sbin sys tmp usr var
$ sudo umount /mnt/{mp1,mp2}
$ sudo rm /mnt/{mp1,mp2}