Forum Discussion
Altera_Forum
Honored Contributor
8 years agoThis is an old thread, but since I faced similar problems and found a solution, here's a reply anyway.
I had parameters to make_sdimage.py for four partitions: sudo $(PATH_HPS_BIN)/make_sdimage.py
-s 7464M
-n $(SD_IMG)
-P $(DIR_BSP)/preloader-mkpimage.bin,$(DIR_BSP)/uboot-socfpga/u-boot.img,num=3,format=raw,size=1M,type=A2
-P zImage,$(DIR_IMG)/socfpga.dtb,num=2,format=ext3,size=1023M
-P rootfs,num=1,format=ext3,size=1G
-P num=4,format=ext3,size=5G
I found, by instrumenting make_sdimage.py, that it correctly computes sizes and offsets, and passes them to fdisk. The actual layout created by fdisk differs from the requested parameters, and has gaps between the end of one partition and the start of the next: Disk /dev/sdb: 7.3 GiB, 7826571264 bytes, 15286272 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: dos
Disk identifier: 0xf5526d7a
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 2099199 2097152 1G 83 Linux
/dev/sdb2 2099201 4194303 2095103 1023M 83 Linux
/dev/sdb3 4194306 4196351 2046 1023K a2 unknown
/dev/sdb4 4196355 14682111 10485757 5G 83 Linux
Changing the requested partitioning slightly (1G instead of 1023M, the "-s 7200M" was done for other reasons): sudo $(PATH_HPS_BIN)/make_sdimage.py
-s 7200M
-n $(SD_IMG)
-P $(DIR_BSP)/preloader-mkpimage.bin,$(DIR_BSP)/uboot-socfpga/u-boot.img,num=3,format=raw,size=1M,type=A2
-P zImage,$(DTB_BASE).dtb,num=2,format=ext3,size=1G
-P rootfs,num=1,format=ext3,size=1G
-P num=4,format=ext3,size=5G
gives a regular partitioning (and working EXT3 file systems): Command (m for help): p
Disk ../build/QWG/sd_image_yocto.bin: 7 GiB, 7549747200 bytes, 14745600 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: dos
Disk identifier: 0xd784cd63
Device Boot Start End Sectors Size Id Type
../build/QWG/sd_image_yocto.bin1 2048 2099199 2097152 1G 83 Linux
../build/QWG/sd_image_yocto.bin2 2099200 4196351 2097152 1G 83 Linux
../build/QWG/sd_image_yocto.bin3 4196352 4198399 2048 1M a2 unknown
../build/QWG/sd_image_yocto.bin4 4198400 14684159 10485760 5G 83 Linux