|
| 1 | +--- |
| 2 | +title: "ODroid HC4" |
| 3 | +description: "Installing Talos on an ODroid HC4 SBC using raw disk image." |
| 4 | +aliases: |
| 5 | + - ../../../single-board-computers/odroid_hc4 |
| 6 | +--- |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +You will need: |
| 10 | + |
| 11 | +- `talosctl` |
| 12 | +- A microSD card to prepare the unit with |
| 13 | +- An additional microSD card, USB stick, or SATA drive to boot Talos from |
| 14 | + |
| 15 | +Download the latest `talosctl`: |
| 16 | + |
| 17 | +```shell |
| 18 | +curl -Lo /usr/local/bin/talosctl https://github.com/siderolabs/talos/releases/download/v1.4.0/talosctl-$(uname -s | tr "[:upper:]" "[:lower:]")-amd64 |
| 19 | + |
| 20 | +chmod +x /usr/local/bin/talosctl |
| 21 | +``` |
| 22 | + |
| 23 | +## Download and Write the Image |
| 24 | + |
| 25 | +Download the image and decompress it: |
| 26 | + |
| 27 | +```shell |
| 28 | +curl -LO https://github.com/siderolabs/talos/releases/download/v1.4.0/metal-odroid_hc4-arm64.img.xz | xz -d - |
| 29 | + |
| 30 | +xz -d metal-odroid_hc4-arm64.img.xz |
| 31 | +``` |
| 32 | + |
| 33 | +Write the image to the chosen boot media via [BalenaEtcher](https://www.balena.io/etcher) or `dd`. |
| 34 | + |
| 35 | +## Prepare the Unit |
| 36 | + |
| 37 | +### Erase factory bootloader |
| 38 | + |
| 39 | +- Boot device to petitboot (no USB, SDCard, etc.), the default bootloader |
| 40 | +- In petitboot menu, select `Exit to shell` |
| 41 | +- Run the following: |
| 42 | + |
| 43 | +```shell |
| 44 | +flash_eraseall /dev/mtd0 |
| 45 | +flash_eraseall /dev/mtd1 |
| 46 | +flash_eraseall /dev/mtd2 |
| 47 | +flash_eraseall /dev/mtd3 |
| 48 | +``` |
| 49 | + |
| 50 | +- Power cycle the device |
| 51 | + |
| 52 | +### Install u-boot to SPI |
| 53 | + |
| 54 | +- Flash [Armbian](https://www.armbian.com/odroid-hc4/) to a micro SD card with `dd` or [BalenaEtcher](https://www.balena.io/etcher). |
| 55 | + **A bootable USB stick or SATA drive will not work for this step** |
| 56 | +- Insert the Armbian micro SD card into the unit and power it on. |
| 57 | +- Once Armbian is booted, install `crane` via the following commands. |
| 58 | + Make sure the unit is connected to the Internet: |
| 59 | + |
| 60 | +```shell |
| 61 | +curl -L https://api.github.com/repos/google/go-containerregistry/releases/latest | |
| 62 | + jq -r '.assets[] | select(.name | contains("Linux_arm64")) | .browser_download_url' | |
| 63 | + xargs curl -sL | |
| 64 | + tar zxvf - && \ |
| 65 | + install crane /usr/bin |
| 66 | +``` |
| 67 | + |
| 68 | +- Extract the `u-boot` image from the Talos installer: |
| 69 | + |
| 70 | +```shell |
| 71 | +mkdir _out |
| 72 | +crane --platform=linux/arm64 export ghcr.io/siderolabs/u-boot:v1.4.0 - | tar xf - --strip-components=1 -C _out odroid_hc4/u-boot.bin |
| 73 | +``` |
| 74 | + |
| 75 | +- Write `u-boot.bin` to the HC4's SPI/bootloader: |
| 76 | + |
| 77 | +```shell |
| 78 | +dd if=_out/u-boot.bin of=/dev/mtdblock0 conv=fsync status=progress |
| 79 | +``` |
| 80 | + |
| 81 | +- Power off the unit |
| 82 | + |
| 83 | +## Recover Factory Bootloader |
| 84 | + |
| 85 | +**Note:** Only perform these steps if you want to use Hardkernel-published distributions. |
| 86 | +Performing these actions will render the unit unable to boot Talos unless the steps in this guide are repeated. |
| 87 | + |
| 88 | +Taken from [the ODroid forums](https://forum.odroid.com/viewtopic.php?t=40906): |
| 89 | + |
| 90 | +- Download the latest `spiupdate` and `spiboot` archives from [here](http://ppa.linuxfactory.or.kr/images/petitboot/odroidhc4/). |
| 91 | +- Flash the `spiupdate` image to a microSD card via `dd` or `dd` or [BalenaEtcher](https://www.balena.io/etcher). |
| 92 | +- Decompress the `spiboot` archive and copy the file it contains to the flashed SD card. |
| 93 | + Ensure the file is named `spiboot.img`. |
| 94 | +- Insert the microSD card into the unit and power it on |
0 commit comments