Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hello

Authentication

The oidc-authn example will be using https://gitlab.com/perobertson-tools/oidc-authn/. When navigating to that chapter you will be redirected to a login page before you can view the content.

oidc-authn

If you can see this, then you must have logged in successfully. You can verify that by looking at the response headers for a cookie with the name oidc-authn-session.

Guides

These are various guides that I have created. They are in no specific order.

Convert MBR partition table to GPT

This guide covers how to convert a MBR disk partition table to to GPT.

When do you need this

  • You need to boot from EFI
  • You need more than 4 primary partitions
  • You have a disk larger than 2TB

Overview

  1. use gdisk to add a new partition to convert to GPT
  2. use gdisk to delete the new partition
  3. use growpart to to extend the partition to the full space
  4. grow the filesystem to fill the partition

Assumptions

  • The partition table to be converted is on the disk /dev/nvme0n1
  • The disk has 3 partitions; generally the case for arm64.raw images
    1. /boot/efi
    2. /boot
    3. /

Steps

  1. Inspect the initial block setup
    lsblk
    
  2. Inspect the initial disk setup
    sudo gdisk -l /dev/nvme0n1
    
  3. Convert MBR to GPT by adding a new partition
    sudo gdisk /dev/nvme0n1
    
    Interactive command:
    • Use n for adding a new partition
    • Use the defaults provided to add a new partition at the end
    • Use w to write the changes to disk
  4. Inspect the partition table again
    sudo gdisk -l /dev/nvme0n1
    
  5. Delete the newly created partition
    sudo gdisk /dev/nvme0n1
    
    Interactive command:
    • Use d for deleting a partition
    • Use the new partion number; see the output from the previous list command
    • Use w to write the changes to disk
  6. Tell the kernel to rescan the partition table to pick up the changes
    sudo partprobe
    

Optional steps

These steps are needed if you want to expand the last partition to fill the disk

  1. Install growpart
    sudo apt-get update
    sudo apt-get install cloud-guest-utils
    
    sudo dnf install cloud-utils-growpart
    
  2. Grow the partition to fill the space
    sudo growpart /dev/nvme0n1 3
    
  3. Grow the filesystem
    • This tends to happen the next time the OS boots. It will automatically grow the filesystem to fill the partition.

References

OrangePi5Max

Initial state:

  • able to boot from SD card
  • able to boot from USB2.0
  • only some official Linux distros work (~Ubuntu 22.04)1
  • unable to boot from NVMe
  • unable to boot from USB3.0

Initial hardware support when booted from the official Ubuntu image:

  • HDMI furthest away from USB-C power
  • 2xUSB2.0
  • 2xUSB3.0
  • Bluetooth
  • Ethernet
  • HDMI next to USB-C power
  • WiFi

Boot order

By default it can only boot from the SD card slot and USB2.0. Initial boot order:

TODO: is this order correct?

  1. SD Card
  2. USB2.0

After flashing the SPI with a new u-boot image you will be able to boot from the NVMe slot. After flashing the order is:

  1. SD Card
  2. NVMe
  3. USB2.0

OS install

Follow the OS specific guides for how to install and boot an OS from the NVMe drive.

Debugging over serial

  1. power off the orangepi
  2. plug in the wires on the USB to TTL into the orangepi. See Debug TTL UART in the top view image down below in the specs.
  3. in a terminal run
    ls -l /dev/ttyUSB*
    
    screen /dev/ttyUSB0 1500000
    
  4. power on the orangepi

Zeroing the SPI

This is to be should before flashing new bootloaders. There is ~16Mb of storage and this is a slow process. ~5min

pv /dev/zero | sudo dd iflag=fullblock oflag=direct of=/dev/mtdblock0 bs=512b
sudo sync

Specs

https://orangepi.net/product/orange-pi-5-max-16gb-ram

Component
Master ChipRockchip RK3588 (8nm LP process)
CPU8-core 64-bit processor
CPU4 Cortex-A76 and 4 Cortex-A55 with independent NEON coprocessor
CPUCortex-A76 at 2.4GHz, Cortex-A55 at 1.8GHz
GPUIntegrated ARM Mali-G610
GPUBuilt-in 3D GPU
GPUFully compatible with OpenGL ES1.1/2.0/3.2, OpenCL 2.2 and Vulkan 1.2.
NPUEmbedded NPU supports INT4/INT8/INT16/FP16 hybrid computing with up to 6TOPS.
PMURK806-1
RAMLPDDR5 496PIN:4GB,8GB,16GB optional
MemoryeMMC Flash Sockets(default)
MemoryOnboard eMMC(customizable)
MemoryNote: Either eMMC socket or on-board eMMC, support: 32GB, 64GB, 128GB, 256GB optional
MemoryQSPI Nor FLASH: 16MB
MemoryMicroSD card slot
MemoryM.2 M-KEY slot: Support NVMe SSD (PCIe 3.0 4Lane)
USB2xUSB3.0;2xUSB2.0
Video2xHDMI 2.1, up to 8k@60FPS
Video1x MIPI DSI TX 4 Lane
Camera2x MIPI CSI 4 Lane
Camera1x MIPI D-PHY RX 4 Lane
AudioCODEC:ES8388
Audio1xAudio 3.5mm jack with mic
Audio1xMIC In
Audio1xHDMI 2.1 eARC
Ethernet1xPCIe 2.5G LAN(RTL8125BG)
Wi-Fi+BT ModuleOnboard Wi-Fi 6E+BT 5.3/BLE module: AP6611
Wi-Fi interfaceSDIO3.0
BT interfaceUART/PCM
Expansion PortDual-row pin: 2.54mm 40Pin
Expansion PortSupports DC 5V and 3.3V power output
Expansion PortConfigurable UART, PWM, I2C, SPI, CAN, GPIO and other functional interfaces.
Button1x BOOT key, 1x On/Off key
Power SourceSupports Type-C power supply, 5V @ 5A
LEDRGB LED Side Illumination
FAN5V 2PIN 1.25mm socket
RTC3V 2PIN 1.25mm socket
DebuggingDebug serial UART included in 40PIN expansion port
Supported OSOrangepi OS(Droid), Orangepi OS(Arch), Orangepi OS(OH), Ubuntu, Debian, Android12

References

Primary site1; uses http; not always available


  1. http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Max.html ↩2

OrangePi5Max - Ubuntu

The steps listed here are how to get the official ubuntu image1 running from the NVMe drive.

SPI Flash

Flashing the SPI is for changing the bootloader to support different disks. The official OrangePi image and u-boot support booting off the NVMe disk.

Bootloader from Official Image

  1. Download Ubuntu from the OrangePi site1

    • This goes to a shared Google Drive
    • You need to be signed in with a Google account to be able to download
    • Download Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z
      • Date modified: 2024-07-18
      • Size: 1.36GB
      • SHA256 of the 7z archive: ba429281271680455e9b73e3548d97f63268a259424f52b4020f407c05a2b015
  2. Verify the download

    echo "ba429281271680455e9b73e3548d97f63268a259424f52b4020f407c05a2b015  Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z" > CHECKSUMS
    sha256sum -c CHECKSUMS Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z
    
  3. Extract the image

    7z e Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z
    
  4. Verify the image

    sha256sum -c Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.img.sha
    
  5. Flash the image to a class 10 SD card or a USB drive.

    ⚠️ This assumes /dev/sda is where the SD card is. Update accordingly.

    output=/dev/sda
    pv Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.img | sudo dd iflag=fullblock oflag=direct of="${output}" bs=512b
    sudo sync
    
  6. Insert the SD card into the orangepi and boot up the device. If you used a USB drive make sure that you plug it into the USB 2.0 ports.

    NOTE: Use the HDMI port next to the USB-C power.

  7. Once booted, open a terminal and run

    # user:pass is orangepi:orangepi
    sudo nand-sata-install
    
  8. Then choose 7 Install/Update the bootloader on SPI Flash and pres <OK>

  9. Then choose <Yes>

  10. Wait for the burning to complete. Done will appear in the bottom left corner after the burning is completed.

  11. Power off the orangepi

  12. You will now be able to boot off of the SD card and the NVMe drive. Boot order:

    1. SD Card
    2. NVMe

NOTE: this bootloader did not allow me to boot other operating systems. I believe its because it ends up booting from the /boot partition instead of /boot/efi.

References

Primary site1; uses http; not always available


  1. http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Max.html ↩2 ↩3

OrangePi5Max - Fedora

The steps listed here are how to get Fedora1 running from the NVMe drive.

Steps

NOTE: this is still a draft but the gist is to use the u-boot image that Talos2 uses and then install Fedora to the NVMe

Prepare Ubuntu image for SPI flashing

The first step here is to boot into an OS so that the SPI can be flashed. For this the official Ubuntu image is being used because it works out of the box.

  1. Download Ubuntu from the OrangePi site3

    • This goes to a shared Google Drive
    • You need to be signed in with a Google account to be able to download
    • Download Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z
      • Date modified: 2024-07-18
      • Size: 1.36GB
      • SHA256 of the 7z archive: ba429281271680455e9b73e3548d97f63268a259424f52b4020f407c05a2b015
  2. Verify the download

    echo "ba429281271680455e9b73e3548d97f63268a259424f52b4020f407c05a2b015  Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z" > CHECKSUMS
    sha256sum -c CHECKSUMS Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z
    
  3. Extract the image

    7z e Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.7z
    
  4. Verify the image

    sha256sum -c Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.img.sha
    
  5. Flash the image to a class 10 SD card or a USB drive.

    ⚠️ This assumes /dev/sda is where the SD card is. Update accordingly.

    output=/dev/sda
    pv Orangepi5max_1.0.0_ubuntu_jammy_desktop_xfce_linux6.1.43.img | sudo dd iflag=fullblock oflag=direct of="${output}" bs=512b
    sudo sync
    
  6. Insert the SD card into the orangepi and boot up the device. If you used a USB drive make sure that you plug it into the USB 2.0 ports.

    NOTE: Use the HDMI port next to the USB-C power.

Flash SPI

While booted into Ubuntu run these steps to flash the SPI with a new u-boot image. This will allow for booting off of the NVMe drive.

  1. Download and extract the u-boot SPI image

    VERSION=$(curl -sSi "https://github.com/siderolabs/sbc-rockchip/releases/latest" \
        | grep ^location \
        | tr -d '[:cntrl:]'
    )
    crane --platform=linux/arm64 export "ghcr.io/siderolabs/sbc-rockchip:${VERSION}" | tar x --strip-components=4 artifacts/arm64/u-boot/orangepi-5-max/u-boot-rockchip-spi.bin
    
  2. Flash the SPI flash with the u-boot SPI image

    ⚠️ This assumes /dev/mtdblock0 is where the SPI is. Update accordingly.

    sudo dd if=/dev/zero iflag=fullblock oflag=direct of=/dev/mtdblock0 bs=512b status=progress
    sudo sync
    pv u-boot-rockchip-spi.bin | sudo dd iflag=fullblock oflag=direct of=/dev/mtdblock0 bs=512b
    sudo sync
    

Install Fedora

While booted into Ubuntu run these steps to install Fedora to the NVMe drive.

  1. Find a Fedora image for for ARM® aarch64 systems4

    1. This must be the raw.xz disk image
  2. Extract the image

    xz --decompress --keep Fedora-MiracleWM-Disk-44-1.7.aarch64.raw.xz
    
  3. Flash the raw image to the NVMe or USB drive

    ⚠️ This assumes /dev/nvme0n1 is where the NVMe card is. Update accordingly.

    pv Fedora-MiracleWM-Disk-44-1.7.aarch64.raw | sudo dd iflag=fullblock oflag=direct of=/dev/nvme0n1 bs=512b
    sudo sync
    

Convert to GPT and grow filesystem

The raw disk image used an MBR partitioning scheme. It also limits the filesystem size to about 8GB.

Follow the steps outlined in Convert MBR to GPT.

References


  1. https://fedoraproject.org/

  2. https://docs.siderolabs.com/talos/v1.13/platform-specific-installations/single-board-computers/orangepi_5

  3. http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-5-Max.html

  4. https://fedoraproject.org/spins/

Source

The content for this site is available at: https://gitlab.com/perobertson-tools/www-perobertson-com/