May 5, 2026

Orange Pi PC 2 - setup for network boot

Get a boot image from this site. Get a debian image too if you want it, but that is not the topic here. He is keeping these updated. As I write this, the latest images are 5 days old (from May 1)!! The latest boot image for the PC2 is based on U-boot v2026.04 and ATF v2.9.0.

You need only the boot image for this. This is only 480K and downloads almost instantaneously.

I use gunzip to decompress the image. It becomes 33M. I use dd to put it onto an SD card.

You will want to be able to use saveenv, and that involves a small change. If you run fdisk, you will see:

/dev/sdf1        8192   65535   57344   28M  c W95 FAT32 (LBA)
/dev/sdf2  *    65536 7419903 7354368  3.5G 83 Linux
The problem is the boot flag needs to be moved to the FAT partition. The logic in U-boot to find the mmc partition for saveenv looks at the bootflag.

Use the "a" command in fdisk to remove it from partition 2 and then place it on partition 1. Note that the linux partition is empty and does not even contain a filesystem.

Put the card into the h5 board, type any key to interrupt the boot sequence and get to the U-boot prompt.

You can use printenv to look at the env settings. You will see in particular: pre> bootcmd=run distro_bootcmd This would be fine if we wanted to boot linux (and if there was a linux to boot in the linux partition), but we will make changes as follows:

setenv bootaddr 0x40000000
setenv kyu_bootcmd "echo Booting Kyu via dhcp ; dhcp ${bootaddr}; go ${bootaddr}"
setenv bootcmd "run kyu_bootcmd"
saveenv
After you do this, it will use dhcp and then tftp to boot the Kyu image. You do of course need to set up your DHCP server. There are notes on this elsewhere, somewhere.


Have any comments? Questions? Drop me a line!

Tom's electronics pages / tom@mmto.org