Prepare to Update Your AWS DeepRacer Vehicle to the Ubuntu 20.04 Software Stack - AWS DeepRacer

Prepare to Update Your AWS DeepRacer Vehicle to the Ubuntu 20.04 Software Stack

Updating your AWS DeepRacer completely wipes the data on the device and upgrades the software stack to include Ubuntu 20.04 Focal Fossa, Intel® OpenVINO™ toolkit 2021.1.110, ROS2 Foxy Fitzroy, and Python 3.8. The update is a prerequisite for AWS DeepRacer open-source robotics projects but is otherwise optional.

Prepration requires additional hardware. This topic explains what you need to get started and walks you through the process.

Prerequisites

Before you get started, make sure you have the following items ready:

  • An AWS DeepRacer vehicle

  • 1 USB flash drive that is 32 GB or larger

  • A computer to facilitate preparation; choose one of the following options:

    • Option 1: Set up your AWS DeepRacer compute module as a Linux computer with a mouse, keyboard, and monitor (connect with an HDMI type A cable).

    • Option 2: Connect AWS DeepRacer to an Ubuntu, macOS, or Windows computer.

Preparation

To prepare for the update, we walk you through how to perform the following tasks:

  • Format the USB drive into the following two partitions:

    • FAT32 of 4 GB

    • NTFS of at least 18 GB

  • Make the USB drive bootable to start the update on reboot:

    • Burn the required custom Ubuntu ISO image to the FAT32 partition

    • Copy the required update files to the NTFS partition of the USB drive

Depending on the computer you use, specific tasks may differ from one operating system to another. We present step-by-step instructions to prepare your USB drive using Ubuntu (via the computer module of the AWS DeepRacer vehicle), macOS, and Windows operating systems.

The instructions for using other Linux or Unix computers are similar to the Ubuntu instructions discussed in the following section. You need to replace the apt-get commands with the corresponding commands supported by the other Linux or Unix system that you choose to use instead.

Choose one of the following procedures according to the type of computer you use.

In the following steps, use the AWS DeepRacer vehicle computer module as an Ubuntu computer. The same instructions apply to a Linux computer running Ubuntu. The instructions on other flavors of Linux or Unix operating systems are similar. Just replace the apt-get * commands with their corresponding commands supported by the other Linux or Unix system of your choosing.

To partition the USB drive and make it bootable

  1. To format the USB drive by running Ubuntu commands on the AWS DeepRacer vehicle or a computer running Ubuntu, do the following.

    1. On the AWS DeepRacer vehicle compute module, run the following commands to install and launch GParted.

      sudo apt-get update; sudo apt-get install gparted sudo gparted
    2. On the newly created GParted console, select /dev/sda from the dropdown list and then delete all existing partitions.

      If the partitions are locked, open the context (right-click) menu and choose unmount.

    3. To create the FAT32 partition of 4 GB capacity, choose the file icon on the top-left, set the parameters similar to the following, and then choose Add.

      Free space preceding: 1

      New size: 4096

      Free space following: <remaining size>

      Align to: MiB

      Create as: Primary Partition

      Partition name::

      File system: fat32

      Label: BOOT

    4. To create the NTFS partition of at least 18 GB capacity, choose the file icon again, set the parameters similar to the following, and choose Add.

      Free space preceding: 0

      New size: <remaining size>

      Free space following: 0

      Align to: MiB

      Create as: Primary Partition

      Partition name:

      File system: nfts

      Label: Flash

    5. After you've created the FAT32 and NTFS partitions, the USB drive partition information appears in the GParted console.

  2. To make the USB drive bootable from the FAT32 partition, follow these steps.

    1. Download this customized Ubuntu ISO image .

    2. Use UNetbootin on your AWS DeepRacer device to do the following:

      1. On your AWS DeepRacer compute module, run the following command to install and launch UNetbootin.

        sudo add-apt-repository ppa:gezakovacs/ppa sudo apt-get update; sudo apt-get install unetbootin sudo unetbootin

      2. On the UNetbootin window, do the following:

        1. Check the Disk image radio button.

        2. For the disk image, choose ISO from the dropdown list.

        3. Open the file picker to choose the downloaded Ubuntu ISO file.

        4. For Type, choose USB Drive.

        5. For Drive, choose /dev/sda1.

        6. Choose OK.

        
                                        Image: Set ISO file for boot disk image
                                            (Ubuntu).

        If you get a /dev/sda1 not mounted alert message, choose OK to close the message, unplug the USB drive, plug in the drive again, and then follow the preceding steps to create the Ubuntu ISO image.

  3. To copy the Ubuntu 20.04 software stack files to the NTFS partition of the USB drive, follow these steps.

    1. Download this compressed factory restore package .

    2. Unzip the downloaded package, and copy the uncompressed files to the second (NTFS) partition of the USB drive.

Follow the instructions here to use a macOS computer to prepare the USB drive for the software update.

To partition the USB drive and make it bootable by using a macOS computer

  1. To format the USB drive, follow these steps.

    1. Plug in the USB drive to your macOS computer.

    2. Press the Command key and the spacebar to open the search tool bar and then enter Disk Utility.

      Alternatively, you can choose Finder->Applications->Utilities->Disk Utility to open the Disk Utility.

    3. Under External, choose your USB drive, and then choose Erase.

      
                                    Image: Open the macOS Disk Utility console.
    4. A new window asks you to confirm that you want to erase your USB drive and present you with some options. Choose Mac OS Extended (Journaled) for Format, choose GUID Partition Map for Scheme, and then choose Erase.

      
                                    Image: Clean up USB drive on the macOS Disk Utility
                                            console.

      After the USB drive is refreshed, choose Done on the dialog window.

    5. On the Disk Utility console, choose the USB drive on the left navigation pane, choose Partition from the menu on the top, and then choose the + button on the Partition device … pop-up.

    6. To create the FAT32 partition of 4 GB capacity, under Partition Information, enter Boot (or another name of your choosing) for Name, choose MS-DOS (FAT) for Format, and set Size to 4 GB. Do not choose Apply yet.

      
                                    Image: Create the FAT32 partition on the macOS Disk
                                            Utility console.
    7. To create the partition for the updated AWS DeepRacer image, choose a point in the other (Untitled) partition. Under Partition Information, enter Flash (or another name of your choosing) for Name, choose ExFat for Format, leave the remaining capacity (in GB) of the USB drive in Size. Choose Apply.

      
                                    Image: Create the ExFAT partition on the macOS
                                                Disk Utility console.
    8. On the following pop-up window, choose Partition to confirm creation of the specified new partitions.

      
                                    Image: Confirm FAT32 and ExFAT partitions on the macOS
                                                Disk Utility console.
    9. On the Disk Utility console, choose the BOOT partition on the left pane, and then choose Info from the menu on the top. Make note of the BSD device node value. In this tutorial, the value is disk2s2. You need to supply this path when making the USB drive bootable from the FAT32 partition.

  2. To make the USB drive bootable from the FAT32 partition, follow these steps.

    1. Download this customized Ubuntu ISO image .

    2. Go to https://unetbootin.github.io/ to download the UNetbootin software. Then start the UNetbootin console.

    3. On the UNetbootin console, do the following:

      1. Check the Disk image radio button.

      2. For the disk image, choose ISO from the dropdown list.

      3. Open the file picker to choose the downloaded Ubuntu ISO file.

      4. For Type, choose USB Drive.

      5. For Drive, choose /dev/disk2s2.

      6. Choose OK.

      
                                    Image: Set ISO file for boot disk image
                                        (Ubuntu).

      If you get a /dev/disk2s2 not mounted alert message, choose OK to close the message, unplug the USB drive, replug the drive, and then follow the steps above create the Ubuntu ISO image.

  3. To copy the software update files to the ExFAT partition of the USB drive, follow these steps.

    1. Download this compressed software update package.

    2. Unzip the downloaded package, and copy the uncompressed files to the second (ExFAT) partition of the USB drive. It's about 12 GB in size.

    3. Unzip the downloaded package.

Follow the instructions here to use a Windows computer to clean and prepare your USB drive for an Ubuntu 20.04 software stack update.

To clean your USB drive before creating partitions

  1. Open the Windows command prompt, enter diskpart, and choose OK to launch Windows DiskPart.

    
                             Image: Open the Windows DiskPart console.
  2. Once the terminal for Microsoft DiskPart opens, list the available disks to find the USB drive you want to clean by entering list disk after the DISKPART> prompt.

    
                             Image: This image is a screenshot of the Microsoft
                                        DiskPart console showing the output of
                                    typing "list disk" after the DISKPART>
                                    prompt, which is a list of the current disks, Disk 0, Disk, 1,
                                    and Disk 2.
  3. Select the disk corresponding to your USB drive. For example, we entered select Disk 2 after the DISKPART> prompt. Read the output carefully to verify that you have chosen the disk you want to clean because the next step is irreversible.

    
                             Image: This image is a screenshot of the Microsoft
                                        DiskPart console showing the output of
                                    the "select disk 2" command. It says, "Disk 2 is now the
                                    selected disk."
  4. Once you are sure that you've selected the correct disk, enter Clean after the DISKPART> prompt.

  5. Enter list disk after the DISKPART> prompt again. Find the disk you cleaned on the table and compare the disk size to the free disk space. If the two values match, the cleaning was successful.

    
                             Image: This image is a screenshot of the Microsoft DiskPart
                                 console showing the output of running the "clean" command. It
                                 says, "DiskPart has succeeded in cleaning the disk." It also
                                 shows the output of running the "List Disk" command, which shows
                                 that Disk 2 which is 29 GB in size and now has 29 GB of free
                                 space.
  6. Exit the Windows DiskPart console by entering Exit after the DISKPART> prompt.

To partition the USB drive and make it bootable by using a Windows computer

  1. To format the USB drive, follow these steps.

    1. Open the Windows command prompt, enter diskmgmt.msc, and choose OK to launch the Windows Disk Management Console.

      
                                    Image: Open the Windows Disk
                                                Management console.
    2. From the Disk Management console, choose the USB drive. Delete all the partitions and make the drive unallocated. The example in the screenshot here shows Disk 2 Removable (E:) as the USB drive.

      
                                    Image: Clean up USB drive on the Windows Disk Management console.
    3. To create the FAT32 partition of 4 GB capacity, open the Disk Management console and choose the USB drive. Open the context (right-click) menu and choose New Simple Volume from the context menu.

      
                                    Image: Create the FAT32 partition on the Windows Disk Management console.
    4. On the New Simple Volume Wizard, choose 4096 for Simple volume size in MB and then choose Next.

      
                                    Image: Create the FAT32 partition on the Windows Disk Management console.
    5. On the New Simple Volume Wizard page and under Format Partition, choose the Format this volume with the following settings. Then, choose FAT32 for File system, Default for Allocation unit size and any label (e.g., BOOT) for Volume label. Finally, choose Next to create the FAT32 partition.

      
                                    Image: Create the FAT32 partition on the Windows Disk Management console.
    6. To create the NTFS partition of the remaining disk capacity, open the Disk Management console. Choose the USB drive and open the context (right-click) menu to choose New Simple Volume. Choose the Format this volume with the following settings option. Choose NTFS for File system, Default for Allocation unit size, and a label (for example, Flash) for Volume label. Finally, choose Next to start creating the NTFS partition.

      
                                    Image: Create the NTFS partition on the Windows Disk Management console.
  2. To make the USB drive bootable from the FAT32 partition, follow these steps.

    1. Download this customized Ubuntu ISO image .

    2. Go to https://unetbootin.github.io/ to download the UNetbootin software. Then start the UNetbootin console.

    3. On the UNetbootin console, do the following:

      1. Check the Diskimage radio button.

      2. For the diskimage, choose ISO from the dropdown list.

      3. Open the file picker to choose the downloaded Ubuntu ISO file.

      4. For Type, choose USB Drive.

      5. For Drive, choose the drive corresponding to the FAT32 partition you create. In our example, it's F:\.

      6. Choose OK.

      
                                    Image: Set ISO file for boot disk image
                                        (Ubuntu).

      If you get a /dev/sda1 not mounted alert message, choose OK to close the message, unplug the USB drive, plug in the drive, and then follow the preceding steps to create the Ubuntu ISO image.

  3. To copy the software update files to the NTFS partition of the USB drive, follow these steps.

    1. Download this compressed software update package .

    2. Unzip the downloaded package. If your favorite tool can't unzip the file successfully, try using the PowerShell Expand-Archive command.