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
-
To format the USB drive by running Ubuntu commands on the AWS DeepRacer vehicle or a computer running Ubuntu, do the following.
-
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
-
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.
-
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
-
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
-
After you've created the FAT32 and NTFS partitions, the USB drive partition information appears in the GParted console.
-
To make the USB drive bootable from the FAT32 partition, follow these steps.
Download this customized Ubuntu ISO image
. -
Use UNetbootin on your AWS DeepRacer device to do the following:
-
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
-
On the UNetbootin window, do the following:
-
Check the Disk image radio button.
-
For the disk image, choose ISO from the dropdown list.
-
Open the file picker to choose the downloaded Ubuntu ISO file.
-
For Type, choose USB Drive.
-
For Drive, choose
/dev/sda1
. -
Choose OK.
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.
-
-
To copy the Ubuntu 20.04 software stack files to the NTFS partition of the USB drive, follow these steps.
Download this compressed factory restore package
. -
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
To format the USB drive, follow these steps.
Plug in the USB drive to your macOS computer.
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.
-
Under External, choose your USB drive, and then choose Erase.
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.
After the USB drive is refreshed, choose Done on the dialog window.
-
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.
To create the FAT32 partition of 4 GB capacity, under Partition Information, enter
Boot
(or another name of your choosing) for Name, chooseMS-DOS (FAT)
for Format, and set Size to4 GB
. Do not choose Apply yet.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, chooseExFat
for Format, leave the remaining capacity (in GB) of the USB drive in Size. Choose Apply.On the following pop-up window, choose Partition to confirm creation of the specified new partitions.
-
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.
To make the USB drive bootable from the FAT32 partition, follow these steps.
Download this customized Ubuntu ISO image
. -
Go to https://unetbootin.github.io/
to download the UNetbootin software. Then start the UNetbootin console. -
On the UNetbootin console, do the following:
-
Check the Disk image radio button.
-
For the disk image, choose ISO from the dropdown list.
-
Open the file picker to choose the downloaded Ubuntu ISO file.
-
For Type, choose USB Drive.
-
For Drive, choose
/dev/disk2s2
. -
Choose OK.
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.
-
To copy the software update files to the ExFAT partition of the USB drive, follow these steps.
-
Download this compressed software update package
. -
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.
-
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
-
Open the Windows command prompt, enter
diskpart
, and choose OK to launch Windows DiskPart. -
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. -
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. -
Once you are sure that you've selected the correct disk, enter
Clean
after the DISKPART> prompt. -
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. 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
To format the USB drive, follow these steps.
Open the Windows command prompt, enter
diskmgmt.msc
, and choose OK to launch the Windows Disk Management Console.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.
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.
On the New Simple Volume Wizard, choose 4096 for Simple volume size in MB and then choose Next.
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.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.
To make the USB drive bootable from the FAT32 partition, follow these steps.
-
Download this customized Ubuntu ISO image
. -
Go to https://unetbootin.github.io/
to download the UNetbootin software. Then start the UNetbootin console. -
On the UNetbootin console, do the following:
-
Check the Diskimage radio button.
-
For the diskimage, choose ISO from the dropdown list.
-
Open the file picker to choose the downloaded Ubuntu ISO file.
-
For Type, choose USB Drive.
-
For Drive, choose the drive corresponding to the FAT32 partition you create. In our example, it's
F:\
. -
Choose OK.
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.
-
-
To copy the software update files to the NTFS partition of the USB drive, follow these steps.
Download this compressed software update package
. -
Unzip the downloaded package. If your favorite tool can't unzip the file successfully, try using the PowerShell Expand-Archive
command.