Changes between Version 27 and Version 28 of provisioning


Ignore:
Timestamp:
12/28/2024 12:12:35 AM (3 weeks ago)
Author:
Ryan Erbstoesser
Comment:

add custom rootfs example

Legend:

Unmodified
Added
Removed
Modified
  • provisioning

    v27 v28  
    2323Once completed, send Gateworks support team your .img.gz compressed disk image to be applied to a large order.
    2424
    25 == More Venice Options
     25== Venice Options
    2626
    2727
     
    81811. Boot target to a Linux rescue image (below)
    82821. Run a script that creates your partition table and partition contents from scratch (using the steps from the previous option)
     83
     84=== Option C Details
     85
     86This involves a custom_rootfs script used in conjuction with the Venice BSP ([wiki:venice/bsp])
     87
     88Before doing any of the following, be sure to build the Venice BSP once successfully before injecting any changes.
     89
     90In the Venice BSP Makefile, on line 256, there is a hook for a custom_rootfs script to be ran.
     91[https://github.com/Gateworks/bsp-venice/blob/master/Makefile#L256]
     92
     93Basically, drop a file inside of the main directory when building the Venice BSP with the name starting with custom_rootfs will be ran. Example file name is custom_rootfs_test.sh
     94{{{
     95builder@jammy:~/venice$ ls
     96Makefile  buildroot              firmware-imx-8.10      ftdi-usb-spi  linux-venice.tar.xz  noble-venice.ext4.xz  setup-environment         uboot-env.bin
     97atf       cryptodev-linux        firmware-imx-8.10.bin  gnss_devkit   mkimage_jtag         noble-venice.img.gz   u-boot                    venice
     98build     custom_rootfs_test.sh  firmware.img           linux         noble-venice.ext4    nrc7292               ublox-dev-kit-README.txt  venice-imx8mm-flash.bin
     99}}}
     100
     101Inside this file, run a script that runs on the build machine to create and grab files to be placed into the Ubuntu filesystem.
     102
     103The Ubuntu filesystem is of ext2 format, and thus e2tools must be used. In the example below, e2cp is a command that ends up copying files into the /root directory (default Gateworks home directory) when the Ubuntu OS is booted.
     104
     105The below example does some random things such as grabbing a tar ball, creating a readme and then copying it into the Ubuntu OS.
     106
     107After creating this file, re-run the make argument to rebuild the Gateworks BSP with the custom changes now integrated:
     108{{{
     109make -j8 ubuntu-image
     110}}}
     111
     112The output should then be a file such as noble-venice.img.gz, which can then be flashed onto the Gateworks SBC and should contain the changes.
     113
     114
     115Example custom_rootfs_test.sh file:
     116{{{
     117#!/bin/bash
     118
     119set -x # enable script debugging (see all commands executed)
     120set -e # exit on error
     121
     122IMAGE=$1
     123KERNEL=linux
     124
     125# temp dir
     126TMP=$(mktemp -d -t tmp.XXXXXX)
     127
     128#grab a tarball of some GPS files
     129wget https://dev.gateworks.com/fae/gnss.tar -O $TMP/gnss.tar
     130
     131#create all files in TMP first
     132mkdir -p $TMP/gnss_devkit
     133tar -xvf $TMP/gnss.tar -C $TMP
     134chmod +x $TMP/gnss_devkit/setup.sh
     135
     136#Create a readme file that is going to be placed into the /root directory
     137cat <<\EOF > $TMP/ublox-dev-kit-README.txt
     138This is a basic readme file
     139EOF
     140
     141
     142rm -rf $TMP/gnss.tar
     143#now copy all TMP files into the actual Ubuntu Image at location specified
     144e2cp $TMP/* $IMAGE:/root/
     145e2mkdir $IMAGE:/root/gnss_devkit
     146chmod +x $TMP/gnss_devkit/setup.sh
     147e2cp -p $TMP/gnss_devkit/* $IMAGE:/root/gnss_devkit/
     148
     149#cleanup TMP
     150rm -rf $TMP
     151}}}
    83152
    84153=== Linux Rescue Image