Changes between Version 6 and Version 7 of provisioning

07/14/2020 08:29:54 PM (4 years ago)
Cale Collins

added newport provisiong section. Removed arbitrary search terms.


  • provisioning

    v6 v7  
    187 Other key words
    188  * procure, procurement , copy , jtag upload , production
     187= Provisioning root file system from live Newport board
     189It's always best to create your rootfs from scratch when able.  If you're prevented from doing so it is possible to provision the root file system from some Newport boards without too much difficulty.  Newport SBC's are capable of booting from both eMMC and MMC.  The boot device can be selected by the GSC performing a 5x press on the power button.  To provision the root filesystem of located on the eMMC boot from MMC, create an image of the eMMC partition 2 on the MMC, then compress so it can be loaded on other boards. 
     191== Requirements
     193* A Newport board with MMC card slot and push button (GSC must be configured to accept push button input—this is default)
     194* A MMC with capacity enough to accommodate full size of eMMC (8GB) along with BSP for performing recovery.  Recommended would be a minimum 16GB or 32GB card.   
     195* A desktop computer with Linux natively installed. This workstation must have a drive capable of accepting an MMC and have packages for DD and Mount. 
     198== On your workstation
     200Download a Gateworks pre-built image.  All of our images include the tools necessary to perform this operation, though Ubuntu will likely be the easiest to work with. 
     202wget -N
     205Insert a micro SD card into your workstation and identify the device name it's been assigned.  This can be done using a variety of methods, for example the "dmesg" output.  In this example the MMC is "/dev/sdb"
     207Image the MMC.
     209zcat focal-newport.img.gz | sudo dd of=/dev/sdb bs=4M
     212Remove the SD card from your workstation.
     214== On your Newport SBC
     216Insert the SD card into the SD card reader, then apply power to the SBC (or otherwise turn it on).  5x press the power button, you will see the status LED turn off and back on.  The BDK will display microSD as MMC0.
     218Example output:
     221        Gateworks Newport SPL (12.7.0-96865d0 Tue Jul 7 21:19:32 UTC 2020)
     223        GSC     : v55 0xe7e2 RST:BOOT_WDT2 Thermal Protection Enabled
     224        Temp    : Board:34C/86C CPU:42C/100C
     225        Model   : GW6400-B1
     226        MFGDate : 09-23-2019
     227        Serial  : 802864
     228        RTC     : 8
     229        SoC     : CN8020-800BG676-SCP-P12-G 1024KB 800/550MHz 0xa2 Pass 1.2
     230        MMC0    : microSD
     231        MMC1    : eMMC
     234Proceed to boot to Linux user-space.  Once there if you would like to check the rootfs you're about to image the rootfs of the eMMC is located at /dev/mmcblk1p2.
     236** Optional: **
     238mount /dev/mmcblk1p2 /mnt
     240ls /mnt #this will display the eMMC's rootfs
     242umount /mnt
     245Image the partition to a file.
     247dd if=/dev/mmcblk1p2 of=myrootfs.img
     250"sync" the filesystem and power board off
     253#remove power
     256Remove MMC from the SBC. 
     258== Create an image
     260Navigate to the "/tmp" directory on your workstation.  In actuality this can be any directory that you have read and write permissions, "/tmp" should only be used if you don't care what happens to these files later.   
     262cd /tmp
     265Insert the MMC into the SD card reader on your workstation, as before note the the name the device is assigned.  Because we created our image in within the rootfs we will need to mount the second partition, for example "/dev/sdb2":
     267sudo mount /dev/sdb2 /mnt/
     269ls /mnt/
     271Copy the image you created of mmcblk1p2 into "/tmp"
     273cp /mnt/myrootfs.img .
     275Executing the command "file" on this file will return that it is ext4 filesystem data and the volume name is "rootfs".
     279        user@workstation:/tmp$ file myrootfs.img
     280        myrootfs.img: Linux rev 1.0 ext4 filesystem data, UUID=951f19a1-cc54-4a07-9b7f-41a54ea8acb4, volume name "rootfs" (needs journal recovery) (extents) (64bit) (large files) (huge files)
     283Add boot firmware and create a gzipped image. 
     284* Download boot firmware
     288* name it however you please
     290cp firmware-newport.img myimg-newport.img
     292* Create a disk image containing the root filesystem and boot firmware.  The boot firmware is 16M so we will "dd" the rootfs using this offset. 
     294dd if=myrootfs.img of=myimg-newport.img bs=16M seek=1
     296* gzip the image so it can be installed using standard methods on other Newport boards.
     298gzip -k -f myimg-newport.img
     300Be mindful that the image size can't exceed the total DRAM of the board you plan to install it on if you're using the bootloader command "tftpboot".  The "update_all", and "update_rootfs" scripts both use this command
     302ls -lh myimg-newport.img.gz #size must be less than total DRAM of board
     305== Flash this image to a Newport SBC:
     307In the bootloader:
     309GW6400-B1> setenv ipaddr
     310GW6400-B1> setenv serverip
     311GW6400-B1> setenv image myimg-newport.img.gz
     312GW6400-B1> setenv dev 0
     313GW6400-B1> run update_all