Yocto img file deployment


Damien LEFEVRE
 

Hi,

I have a yocto image: image.img.

On my build PC I have
> file image.img
image.img: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,1), end-CHS (0x3ff,254,63), startsector 1, 802815 sectors, extended partition table (last)

> fdisk -l image.img
Disk image.img: 392 MiB, 411041792 bytes, 802816 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
Disklabel type: gpt
Disk identifier: 45C0DFD4-267E-4C4A-820F-B94F180165E7

Device     Start    End Sectors  Size Type
image.img1  2048 800767  798720  390M Linux filesystem



And I can calculate the offset (512 * 2048 = 1048576) to mount image.img1 to let say /tmp/update
mount -t ext4 -o loop,offset=1048576 image.img /tmp/update



Now on the target device (Tegra), I'd like to write the content of image.img1 to /dev/mmcblk0p38. But the output of busybox's fdisk is different

> fdisk -l image.img
Disk image.img: 392 MB, 411041792 bytes, 802816 sectors
49 cylinders, 255 heads, 63 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device   Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
image.img1    0,0,1       1023,254,63          1     802815     802815  391M ee EFI GPT
Partition 1 has different physical/logical start (non-Linux?):
     phys=(0,0,1) logical=(0,0,2)
Partition 1 has different physical/logical end:
     phys=(1023,254,63) logical=(49,248,7)

How can I deduce the offset from this output?

Better even, is there a way to dd image.img1 directly to /dev/mmcblk0p38?

Thanks,

Join yocto@lists.yoctoproject.org to automatically receive all group messages.