Changes between Version 6 and Version 7 of provisioning


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

added newport provisiong section. Removed arbitrary search terms.

Legend:

Unmodified
Added
Removed
Modified
  • provisioning

    v6 v7  
    185185}}}
    186186
    187 Other key words
    188  * procure, procurement , copy , jtag upload , production
     187= Provisioning root file system from live Newport board
     188
     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. 
     190
     191== Requirements
     192
     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. 
     196
     197
     198== On your workstation
     199
     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. 
     201{{{
     202wget -N http://dev.gateworks.com/newport/images/focal-newport.img.gz
     203}}}
     204
     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"
     206
     207Image the MMC.
     208{{{
     209zcat focal-newport.img.gz | sudo dd of=/dev/sdb bs=4M
     210}}}
     211
     212Remove the SD card from your workstation.
     213
     214== On your Newport SBC
     215
     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.
     217
     218Example output:
     219
     220{{{
     221        Gateworks Newport SPL (12.7.0-96865d0 Tue Jul 7 21:19:32 UTC 2020)
     222
     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
     232}}}
     233
     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.
     235
     236** Optional: **
     237{{{
     238mount /dev/mmcblk1p2 /mnt
     239
     240ls /mnt #this will display the eMMC's rootfs
     241
     242umount /mnt
     243}}}
     244
     245Image the partition to a file.
     246{{{
     247dd if=/dev/mmcblk1p2 of=myrootfs.img
     248}}}
     249
     250"sync" the filesystem and power board off
     251{{{
     252sync
     253#remove power
     254}}}
     255
     256Remove MMC from the SBC. 
     257
     258== Create an image
     259
     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.   
     261{{{
     262cd /tmp
     263}}}
     264
     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":
     266{{{
     267sudo mount /dev/sdb2 /mnt/
     268
     269ls /mnt/
     270}}}
     271Copy the image you created of mmcblk1p2 into "/tmp"
     272{{{
     273cp /mnt/myrootfs.img .
     274}}}
     275Executing the command "file" on this file will return that it is ext4 filesystem data and the volume name is "rootfs".
     276
     277Example:
     278{{{
     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)
     281}}}
     282
     283Add boot firmware and create a gzipped image. 
     284* Download boot firmware
     285{{{
     286wget http://dev.gateworks.com/newport/boot_firmware/firmware-newport.img
     287}}}
     288* name it however you please
     289{{{
     290cp firmware-newport.img myimg-newport.img
     291}}}
     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. 
     293{{{
     294dd if=myrootfs.img of=myimg-newport.img bs=16M seek=1
     295}}}
     296* gzip the image so it can be installed using standard methods on other Newport boards.
     297{{{
     298gzip -k -f myimg-newport.img
     299}}}
     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
     301{{{
     302ls -lh myimg-newport.img.gz #size must be less than total DRAM of board
     303}}}
     304
     305== Flash this image to a Newport SBC:
     306
     307In the bootloader:
     308{{{
     309GW6400-B1> setenv ipaddr 192.168.1.52
     310GW6400-B1> setenv serverip 192.168.1.56
     311GW6400-B1> setenv image myimg-newport.img.gz
     312GW6400-B1> setenv dev 0
     313GW6400-B1> run update_all
     314}}}
     315
     316
     317