What I have found to be a wonderful way to do this is to set up the OrangePi to do diskless booting via TFTP.
Note that I have already set up my linux system to run dhcp and tftp along with adjusting firewall rules for those services. I have notes on that elsewhere.
=> printenv ethaddr ethaddr=ca:61:5c:2b:c0:a8I add an entry to my /etc/dhcp/dhcpd.conf file like this:
# Entry for the Orange Pi 4 (RK3399) with eMMC host rock { hardware ethernet ca:61:5c:2b:c0:a8; fixed-address 192.168.0.34; option host-name "rock"; server-name "trona"; filename "rock.bin"; }I also add the hostname "rock" with the IP number shown above to my /etc/hosts file.
/bin/systemctl restart dhcpd.service
bootcmd=run distro_bootcmdThis means that one I define my own "kyu_bootcmd", I can switch back to booting debian easily by just changing the bootcmd variable. I add the following to the U-Boot setup:
setenv bootaddr 0x02000000 setenv kyu_bootcmd "echo Booting Kyu via dhcp ; dhcp ${bootaddr}; go ${bootaddr}" setenv bootcmd "run kyu_bootcmd" saveenvI have no idea at this point whether this "bootaddr" is appropriate, it is simply a first guess.
A quick side note. If you somehow create a U-Boot environment variable you don't want, you can delete it by simply using setenv with no value given, as:
setenv xyz
su cd /var/lib/tftpboot cp fire3.bin rock.bin chown tom:tom rock.binThe file "fire3.bin" was just something handy from a prior project. It clearly will not work on the RockPi hardware, but I just wanted some file there in order to test the tftp booting setup.
U-Boot 2020.04-orangepi (Mar 04 2021 - 09:49:58 +0800) Model: OrangePi 4 AI board DRAM: 3.9 GiB PMIC: RK808 MMC: dwmmc@fe320000: 1, sdhci@fe330000: 0 Loading Environment from MMC... OK In: serial@ff1a0000 Out: serial@ff1a0000 Err: serial@ff1a0000 Model: OrangePi 4 AI board Net: eth0: ethernet@fe300000 Hit any key to stop autoboot: 0 Booting Kyu via dhcp ethernet@fe300000 Waiting for PHY auto negotiation to complete........ done Speed: 1000, full duplex BOOTP broadcast 1 DHCP client bound to address 192.168.0.34 (6 ms) Using ethernet@fe300000 device TFTP from server 192.168.0.5; our IP address is 192.168.0.34 Filename 'rock.bin'. Load address: 0x2000000 Loading: ############ 5 MiB/s done Bytes transferred = 166616 (28ad8 hex) ## Starting application at 0x02000000 ...
Tom's electronics pages / tom@mmto.org