OS Installation using Petitboot and USB OTG

Petitboot

Petitboot is a platform-independent bootloader based on the Linux kexec warm reboot mechanism. Petitboot supports loading kernel, initrd, and device tree files from any Linux mountable filesystem, plus can it can load files from the network using FTP, SFTP, TFTP, NFS, HTTP, and HTTPS protocols.

Version Check

To check your Petitboot version, toggle the boot mode switch to SPI boot mode and turn on the ODROID-N2.

Figure 1 - Boot toggle set to SPI mode
Figure 1 - Boot toggle set to SPI mode

Figure 2 - Version information located in the upper right
Figure 2 - Version information located in the upper right

If your Petitboot version is lower than dev.20191127, please refer to the “How to Recover or Upgrade” page available at https://wiki.odroid.com/getting_started/petitboot/recover_or_upgrade.

OS Installation via PC using ODROID-N2 OTG

This configuration will allow for OS installation directly to the memory (eMMC or uSD) on the ODROID-N2 from a PC over USB to the N2’s OTG port.

Figure 3 - Block Diagram of the connection
Figure 3 - Block Diagram of the connection

Figure 4 - PC OTG connection setup
Figure 4 - PC OTG connection setup

Petitboot Setup

Select Exit to shell, as shown in Figure 5.

Figure 5 - Select to ‘Exit to Shell’
Figure 5 - Select to ‘Exit to Shell’

Check a list of storage device nodes:

$ ls /dev/mmc*
Set the storage device on the ODROID-N2 as a mass storage device using ‘ums’ (USB Mass Storage mode). This allows the ODROID-N2 and OTG to act as a memory card reader.
$ ums
Figure 6 - Example UMS setup
Figure 6 - Example UMS setup

Wait for your PC to detect the new mass storage device.

Flash OS Image to Memory

When the device is detected, the host PC recognizes your N2 as a USB card reader. Therefore, to flash OS image into memory, refer to OS installation guide, except for some that use a memory card reader, available here: https://wiki.odroid.com/getting_started/os_installation_guide

Figure 7 - Using Etcher to write OS Image to N2
Figure 7 - Using Etcher to write OS Image to N2

When done, press Ctrl + Alt + Delete, and boot the installed OS. See the OS section below.

Direct Booting

  1. Power off ODROID
  2. Toggle the boot mode switch to MMC boot mode
  3. Power on ODROID

Booting via Petitboot

  1. Power off ODROID
  2. Toggle the boot mode switch to SPI boot mode
  3. Power on ODROID
  4. Select 'Rescan devices'
  5. Select boot partition

Set Autoboot

1. Select 'Rescan devices' 2. Select 'System configuration' 1. Set 'Autoboot' (*) Enabled 2. Set 'Boot Order' 1. Clear 2. Add Device 3. Set 'Timeout' (10 seconds or more recommended) 4. OK 3. Press Ctrl + Alt + Delete

Figure 8 - Petitboot Configuration
Figure 8 - Petitboot Configuration

The original wiki document is available at https://wiki.odroid.com/getting_started/petitboot/os_installation_using_otg.

Be the first to comment

Leave a Reply