Changes between Version 20 and Version 21 of OpenWrt/building


Ignore:
Timestamp:
06/05/2019 09:59:08 PM (5 years ago)
Author:
Tim Harvey
Comment:

updated MMC disk image commands

Legend:

Unmodified
Added
Removed
Modified
  • OpenWrt/building

    v20 v21  
    224224 * The resulting flash firmware image will be {{{gateworks/images/}}}.
    225225
    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 
     226If you wish to create an MMC 'disk image' for Ventana boards that boot from eMMC or microSD:
     227{{{#!bash
    235228# create a filesystem image
    236229OUTFS=owrt.ext4
    237 SIZEMB=256M
     230SIZEFSMB=256M
    238231MNT=$(mktemp -d -p/tmp)
    239 truncate -s $SIZEMB $OUTFS
     232truncate -s $SIZEFSMB $OUTFS
    240233sudo mkfs.ext4 -q -F -O ^64bit -L rootfs $OUTFS
    241234sudo mount $OUTFS $MNT
     
    245238
    246239# create a disk image
    247 OUTIMG=ventana_emmc.img
    248 truncate -s 1M $OUTIMG
     240SIZEMB=7248M
     241OUTIMG=ventana.img
     242truncate -s $SIZEMB $OUTIMG
    249243# partition disk - single ext partition
    250 printf ",,L,,\n" | sudo sfdisk -uS $OUTIMG
     244printf "2048,,L,,\n" | sudo sfdisk -uS $OUTIMG
    251245sudo dd if=ventana/images/SPL of=$OUTIMG bs=512 seek=2
    252246sudo dd if=ventana/images/u-boot.img of=$OUTIMG bs=512 seek=138
    253247sudo dd if=$OUTFS of=$OUTIMG bs=1M seek=1
     248# create a compressed disk image that can be installed via U-Boot's gzwrite
     249gzip -f -k $OUTIMG && ls -lh $OUTIMG*
    254250
    255251# create a jtag binary image
    256252mkimage_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'
     253}}}
     254 * SIZEFSMB above is the size of the filesystem to create in MB - this needs to be large enough to accommodate the files you are putting there... a good rule of thumb is to keep it as small as possible and use {{{resize2fs}}} on it to grow it to the size of the partition you place it in after first boot
     255 * SIZEMB above is the size of the disk image to create in MB which needs to be large enough to fit the filesystem + the 1MB offset of the partition table yet small enough to fit the actual device you will copy this to in the future (such as microSD or eMMC). Note that 7248M is the appropriate size for the 8GiB eMMC's that Gateworks uses
     256 * ventana.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 via:
     257  - U-Boot with a 'mmc write'
     258  - Linux with a 'dd if=ventana.img.gz of=$blockdev'
     259 * ventana.img.gz is a compressed disk image which can be flashed onto an MMC device via:
     260  - U-Boot for example with a 'gzwrite mmc $dev $loadaddr $filesize'
     261  - Linux for example with a 'zcat ventana.img.gz | sudo dd of=$blockdev'
     262 * ventana.bin is a JTAG'able binary image containing SPL, U-Boot and the ext4 partition
    264263
    265264To flash the file to the board, please see this link: [wiki:jtag_instructions#Instructions JTAG Programming Instructions]