Difference between revisions of "BSP Linux on Orange Pi 4"

From Dejvino's Knowledge Base
Jump to navigation Jump to search
Line 33: Line 33:
 
   sudo apt-get update
 
   sudo apt-get update
 
   # additional packages not installed by the build tool
 
   # additional packages not installed by the build tool
 +
  # ...to build kernel:
 
   sudo apt-get install liblz4-tool
 
   sudo apt-get install liblz4-tool
 +
  # ...to build rootfs:
 +
  sudo apt-get install qemu-utils qemu-efi-aarch64 qemu-system-arm
 
   exit
 
   exit
 
</pre>
 
</pre>
Line 63: Line 66:
 
=== Flashing ===
 
=== Flashing ===
 
The same process applies as for the Pre-Built Images, see [[Flashing Linux to SD Card]].
 
The same process applies as for the Pre-Built Images, see [[Flashing Linux to SD Card]].
 +
 +
== Troubleshooting ==
 +
; Error: <pre>chroot: failed to run command ‘mount’: Exec format error</pre>
 +
: Solution: <pre>sudo apt-get install qemu-utils qemu-efi-aarch64 qemu-system-arm</pre>
 +
: Source: [https://github.com/orangepi-xunlong/OrangePi_Build/issues/34]
  
 
== External Links ==
 
== External Links ==

Revision as of 20:47, 31 March 2020

BSP Linux used on an Orange Pi 4

(!) Xunlong's provided Linux is an older 4.4 series kernel.

Installing Pre-Built Images

(!) Pre-Built kernel doesn't have support for CIFS (Samba file sharing)

  1. Download compressed *.img files from the vendor's page
  2. Extract the image files
  3. Flash the image to an SD Card

Building Custom Images

(!) Supplied build scripts use Rockchip's closed source binary toolkit rkbin/tools. This makes it unusable for running on the Orange Pi 4 (or any ARM device). The repository is usable only as a learning material.

[i] The build tool is designed to be executed on Ubuntu (preferably 18.04 Bionic) on a x86_64 machine.

Best option is to use vagrant and run the build OS virtually. If you by any chance run Ubuntu, feel free to ignore the vagrant-related instructions and run the other commands directly on your machine.

The build tool is using these repositories:

Vagrant setup

vagrant init hashicorp/bionic64
vagrant up
vagrant ssh
# inside vagrant:
  sudo apt-get update
  # additional packages not installed by the build tool
  # ...to build kernel:
  sudo apt-get install liblz4-tool
  # ...to build rootfs:
  sudo apt-get install qemu-utils qemu-efi-aarch64 qemu-system-arm
  exit

Build Tools

vagrant ssh
# inside vagrant:
  git clone https://github.com/orangepi-xunlong/OrangePi_Build.git
  cd OrangePi_Build
  ./Build_OrangePi.sh
  exit

Enter your (sudo) password (empty when running under vagrant), let it download the repositories (listed above).

Building

vagrant ssh
# inside vagrant:
  cd OrangePiRK3399
  ./build.sh
  exit

Select '0 Orange Pi 4', '0 Build Release Image' and wait for the image to be built. TODO: I didn't actually try this, I just built the kernel.

Flashing

The same process applies as for the Pre-Built Images, see Flashing Linux to SD Card.

Troubleshooting

Error
chroot: failed to run command ‘mount’: Exec format error
Solution:
sudo apt-get install qemu-utils qemu-efi-aarch64 qemu-system-arm
Source: [1]

External Links