Buildroot Development

Buildroot is a framework for building embedded Linux systems on Linux platforms. Buildroot consists of a Makefile(*.mk) script and a Kconfig(Config.in) configuration file. You can build a complete Linux system (including boot, kernel, rootfs, and rootfs libraries and applications) that can be burned directly into your machine, just like you would build a Linux kernel, by using the buildroot configuration, menuconfig modifications, and compiling a complete Linux system. For more information on Buildroot development, please refer to the official Buildroot Development Manual.

Hardware Configuration

Recommended hardware configuration for compiling Ubuntu development environment:

  • 64-bit CPU

  • Ubuntu 20.04, do not use Windows Subsystem (WSL)

  • 16GB of RAM

  • 250GB free space for compiling

  • Normal user to compile, do not use root user to compile

Software Configuration

Installation packages

sudo apt update
sudo apt-get install git ssh make gcc libssl-dev liblz4-tool \
expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support \
qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib \
unzip device-tree-compiler libncurses-dev

sudo pip install python-pip pyelftools

Get SDK

Email support@neardi.com for development materials

After downloading, check the MD5 code and Neardi-3588-SDK-Linux-${Version}.tar.gz.md5sum for consistency before unzipping:

$ md5sum Neardi-3588-SDK-Linux-${Version}.tar.gz
******************************** Neardi-3588-SDK-Linux-${Version}tar.gz

Unzip:

** Please use the current Ubuntu system user to unzip the file directly, avoid unzipping it in Windows and then copying it to Ubuntu. Doing so ensures that the file attributes and permissions are correct and avoids potential compatibility issues **

tar zxvf Neardi-3588-SDK-Linux-${Version}.tar.gz

Extract:

cd Neardi-3588-SDK-Linux-${Version}

# Be sure to execute it, otherwise there will only be a .git directory and no source code.
git reset --hard

Compile the SDK

Select the configuration

boardConfig explain
BoardConfig-rk3588-neardi-linux-lpa3588-f0.mk AHDx8x1080p + HDMIIN + HDMI1 + HDMI2 + HDMI3 + DP
BoardConfig-rk3588-neardi-linux-lpa3588-f2.mk AHDx8x1080p + EV101WXM 10.1inc + HDMIIN + HDMI1 + HDMI2 + HDMI3 + DP
./build.sh lunch
Default selection: BoardConfig-rk3588-neardi-linux-lpa3588-f0.mk

Fully automatic compilation

The first time you compile the SDK, make sure you compile it all at once, otherwise the package will be wrong.

Full auto-compile will perform all the compilation to generate u-boot, kernel and buildroot.

./build.sh

The generated firmware will be saved to rockdev/update.img.

FAQ

How to compile separately

  • Build u-boot

./build.sh uboot
  • Compile kernel

./build.sh kernel
  • Compiling recovery

./build.sh recovery

Compile Error

lz4 error

Incorrect parameters
Usage :
      lz4 [arg] [input] [output]

input   : a filename
          with no FILE, or when FILE is - or stdin, read standard input
Arguments :
 -1     : Fast compression (default) 
 -9     : High compression 
 -d     : decompression (default for .lz4 extension)
 -z     : force compression
 -f     : overwrite output without prompting 
 -h/-H  : display help/long help and exit
arch/arm64/boot/Makefile:31: recipe for target 'arch/arm64/boot/Image.lz4' failed
make[2]: *** [arch/arm64/boot/Image.lz4] Error 1
make[2]: *** Deleting file 'arch/arm64/boot/Image.lz4'
arch/arm64/Makefile:170: recipe for target 'Image.lz4' failed
make[1]: *** [Image.lz4] Error 2
make[1]: *** Waiting for unfinished jobs....

Solution, reinstall lz4 manually:

git clone https://github.com/lz4/lz4.git
cd lz4
make
sudo make install