224 | | |
225 | | The resulting flash firmware image will be {{{gateworks/images/}}}. |
| 224 | * The resulting flash firmware image will be {{{gateworks/images/}}}. |
| 225 | |
| 226 | If you wish to create an MMC 'disk image' for Ventana boards that boot from eMMC: |
| 227 | {{{#!bash |
| 228 | # create an ext4 filesystem image (using mkfs from Newport BSP) |
| 229 | OUT=owrt.ext4 |
| 230 | SIZEMB=256M # adjust this larger if bootfs.tar.gz and rootfs.tar.gz don't fit |
| 231 | wget https://raw.githubusercontent.com/Gateworks/bsp-newport/master/mkfs |
| 232 | chmod +x mkfs |
| 233 | sudo mkfs ext4 $OUT $SIZEMB bin/imx6/gateworks-imx6-ventana-bootfs.tar.gz bin/imx6/gateworks-imx6-ventana-rootfs.tar.gz |
| 234 | |
| 235 | # create a filesystem image |
| 236 | OUTFS=owrt.ext4 |
| 237 | SIZEMB=256M |
| 238 | MNT=$(mktemp -d -p/tmp) |
| 239 | truncate -s $SIZEMB $OUTFS |
| 240 | sudo mkfs.ext4 -q -F -O ^64bit -L rootfs $OUTFS |
| 241 | sudo mount $OUTFS $MNT |
| 242 | sudo tar -C $MNT -xf bin/imx6/gateworks-imx6-ventana-bootfs.tar.gz |
| 243 | sudo tar -C $MNT -xf bin/imx6/gateworks-imx6-ventana-rootfs.tar.gz |
| 244 | sudo umount $MNT |
| 245 | |
| 246 | # create a disk image |
| 247 | OUTIMG=ventana_emmc.img |
| 248 | truncate -s 1M $OUTIMG |
| 249 | # partition disk - single ext partition |
| 250 | printf ",,L,,\n" | sudo sfdisk -uS $OUTIMG |
| 251 | sudo dd if=ventana/images/SPL of=$OUTIMG bs=512 seek=2 |
| 252 | sudo dd if=ventana/images/u-boot.img of=$OUTIMG bs=512 seek=138 |
| 253 | sudo dd if=$OUTFS of=$OUTIMG bs=1M seek=1 |
| 254 | |
| 255 | # create a jtag binary image |
| 256 | mkimage_jtag --emmc -e --partconf=user $OUTIMG@user:erase_all:0x0- > $OUTIMG.bin |
| 257 | |
| 258 | # create a compressed disk image that can be installed via U-Boot's gzwrite |
| 259 | gzip -f -k $OUTIMG && ls -lh $OUTIMG* |
| 260 | }}} |
| 261 | * ventana_emmc.img is a non-compressed disk image containing SPL, U-Boot and the ext4 partition which can be copied directly to a microSD or eMMC |
| 262 | * ventana_emmc.bin is a JTAG'able binary image containing SPL, U-Boot and the ext4 partition |
| 263 | * ventana_emmc.img.gz is a compressed disk image which can be updated via U-Boot for example with a 'gzwrite mmc $dev $loadaddr $filesize' |