This zipfile contains disk image of the KOS node manager, intended for copying onto the system's
primary disk. For the Flex, the primary disk is the eMMC, and there are two methods to
install the image.

Using the Raspberry Pi Imager

1. Copy the disk.img.gz file onto a USB disk

2. Follow the directions under 'Steps to Flash the eMMC' at 
      https://www.raspberrypi.org/documentation/computers/compute-module.html
   to build/install the rpiboot program on your local Linux machine. Do not execute the final
   command to start rpiboot. Instead, use:
      sudo ./rpiboot -d rpi-imager-embedded

3. A text prompt on the Flex's connected monitor will prompt you to detach the USB micro cable and
   attach a mouse. Follow the direction and wait for the imager UI to appear on the screen.

4. Insert the USB disk containing disk.img.gz

5. Select the 'CHOOSE OS' box. Choose 'Use custom'. Select 'disk.img.gz'

6. Select the 'CHOOSE STORAGE' box. Choose 'Internal SD card reader'

7. Select the 'WRITE' box. Confirm you want to continue.

8. Wait approximately 5 minutes for the image to install. At the end of the process, a box may
   appear and report, 'Error resizing ext4 partition'. You can ignore this warning.

9. Disconnect power from the Flex. Remove the USB disk and the nRPI_BOOT jumper.

10. Attach a network cable to the Flex ethernet port 1.

11. Re-attach power to the Flex. You should see the device boot to a command prompt. The login
    user ID is 'kos'

Using USB mass-storage device mode

1. Follow the directions under 'Steps to Flash the eMMC' at 
      https://www.raspberrypi.org/documentation/computers/compute-module.html
   to build/install the rpiboot program on your local Linux machine and boot the Flex into
   mass storage mode

2. Make ABSOLUTELY CERTAIN that you have identified the correct block device for the Flex
   mass storage device. If you perform the next command to the wrong location, you may destroy
   your host PC's disk

3. Use the following command to write the FOS image to the Flex
      zcat disk.img.gz | sudo dd of=/dev/<YOUR RPI DISK HERE> bs=4MiB status=progress oflag=sync

   For example, if the Flex eMMC enumerated as /dev/sda, the command would be:
      zcat disk.img.gz | sudo dd of=/dev/sda bs=4MiB status=progress oflag=sync

4. Once the command is complete, unplug the USB, remove the jumper on nRPI_BOOT, and power-cycle
   the Flex. You should see it boot to a command prompt while running node manager.



