Compile Debian 10 From Source Code

Compile Debian 10 From Source Code

It is suggested to using Ubuntu, the distribution version of Linux, to compile Debian firmware. To compile Debian firmware, you need to build a suitable environment on Ubuntu PC as required.

Preparation to Compile

Recommended computer configuration as below:

64-bit CPU (Open System Setting –> About –> xx-bit system to check this)

16GB physical memory + swap memory (Open System Setting –> About –> xx memory to check this)

250GB of free disk space (Open terminal –> type “df -h” command to check this) The official recommendation is the Ubuntu 20.04 operating system. (Open System Setting –> About –> System Version to check this)

Download Source Code

Download the Edge 2 Debian SDK compressed package, then decompress it and generate repo-edge2 directory, it is recommended to use the download tool of http (such as freedownloadmanager) to download compressed package.

Our support team will send the downlink of Edge 2 Debian SDK to your email.

tar -xzvf mixtile-edge2_debian_sdk.tar.gz

Build Compiler Environment

In order to get rid of other effects of host environment, it is recommended using docker

Installing Docker on Ubuntu

Remove old docker if exist

sudo apt-get remove docker docker-engine containerd runc

Install docker

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce

Test docker

sudo docker run hello-world

Below is the result after running above command:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:bfea6278a0a267fad2634554f4f0c6f31981eea41c553fdf5a83e95a41d40c38
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
  executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
  to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
For more examples and ideas, visit:

Use Dockerfile we prepared

The Dockerfile is attached in the same folder and named Please download it from this link If necessary, you can refer to and modify the Dockerfile to meet your requirements.

Generate Docker image

After download correct dockerfile, follow the below steps. 1、Unzip the which you downloaded just now. 2、Enter the linux-buildenv folder which you just unzipped 3、Please perform the following operations in the same directory as “Dockerfile” sudo docker build -t edge2_build_env . If generating is successful, the following information will be printed to the terminal and it’s the last sentence: Successfully tagged edge2_build_env:latest

Boot Compile Environment

Create scrpit

chmod +x
( could be created in any folder)

the content of this script can be referred to as follows, you can copy the following content into the script

export ANDROID_BUILD_TOP=/home/userx/xxx/debian_edge2
sudo docker run --privileged -it --rm -v $ANDROID_BUILD_TOP:/build edge2_build_env:latest


ANDROID_BUILD_TOP: absolute path of local source code
/build: absolute path of source code in docker environment
edge2_build_env:latest: docker image for build aosp

Boot script



Compile unified firmware After booting script, the sdk is expanded in /build directory which on docker environment.

./ allsave

sdk compilation requires a long wait,after successful compilation, serval image files will be generated in directory rockdev/update.img

ls rockdev/


Image description

update.img is a unified firmware,this firmware needs to be upgraded by RKDevTool or making sd card that by Rockchip Create Upgrade Disk Tool,after upgrading this firmware, all user data will be lost,The field description is as follows:

Compile u-boot

./ uboot

Compile kernel

./ kernel

Packing update.img

./ update.img