Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:development:build-ubuntu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
products:sbc:common:development:build-ubuntu [2022/07/05 03:53]
nick
products:sbc:common:development:build-ubuntu [2022/08/07 22:03]
ruby [Preparation]
Line 1: Line 1:
-====== Build Ubuntu OS Image======+====== Build Ubuntu ======
  
 ===== Introduction ===== ===== Introduction =====
  
-We provided [[kg>fenix|Fenix]] for you to build the Ubuntu OS images easily. \\+[[kg>fenix|Fenix]] guide you to compile the Ubuntu OS SDK easily. \\
 You can follow the steps below to build the Ubuntu OS image. You can follow the steps below to build the Ubuntu OS image.
  
Line 9: Line 9:
 ===== Preparation ===== ===== Preparation =====
  
-Install ecessial dependencies.+Install essential dependencies.
  
-```sh+```shell
 $ sudo apt update $ sudo apt update
 $ sudo apt install git make lsb-release qemu-user-static $ sudo apt install git make lsb-release qemu-user-static
Line 18: Line 18:
 ===== Get Fenix Source Code ===== ===== Get Fenix Source Code =====
  
-Clone the Fenix repository to somewhere, e.g. `~/project`+Clone the Fenix repository to somewhere, e.g. ''~/project''
  
-```sh +```shell 
-$mkdir ~/project+$ mkdir ~/project
 $ cd ~/project/ $ cd ~/project/
 $ git clone --depth 1 https://github.com/khadas/fenix $ git clone --depth 1 https://github.com/khadas/fenix
Line 30: Line 30:
 You should setup the build environment first. \\ You should setup the build environment first. \\
  
-For example: ''Board type'', ''Linux version'', ''distribution'', etc.+For example: ''Board type'', ''Linux version'', ''distribution''.
  
-```sh+```shell
 $ cd ~/project/fenix $ cd ~/project/fenix
 $ source env/setenv.sh $ source env/setenv.sh
Line 43: Line 43:
  
 <WRAP tip > <WRAP tip >
-If this is your first time building an image, the script will check your host's environment and install some essential packages. In addition, repositories (U-Boot, Linux) will be cloned automatically from the Khadas GitHub.+If it's the first time to build an image, the script will check your host's environment and install some essential packages. In addition, repositories (U-Boot, Linux) will be cloned automatically from the Khadas GitHub.
 </WRAP> </WRAP>
  
Line 51: Line 51:
 ==== Build U-Boot ==== ==== Build U-Boot ====
  
-```sh+```shell
 $ make uboot $ make uboot
 ``` ```
Line 57: Line 57:
 ==== Build U-Boot Debian Package ==== ==== Build U-Boot Debian Package ====
  
-```sh+```shell
 $ make uboot-deb $ make uboot-deb
 ``` ```
Line 63: Line 63:
 ==== Build Linux ==== ==== Build Linux ====
  
-```sh+```shell
 $ make kernel $ make kernel
 ``` ```
Line 69: Line 69:
 ==== Build Linux Debian Package ==== ==== Build Linux Debian Package ====
  
-```sh+```shell
 $ make kernel-deb $ make kernel-deb
 ``` ```
Line 75: Line 75:
 ==== Build GPU Debian Package ==== ==== Build GPU Debian Package ====
  
-```sh+```shell
 $ make gpu-deb $ make gpu-deb
 ``` ```
Line 81: Line 81:
 ==== Build the Board Debian Package ==== ==== Build the Board Debian Package ====
  
-```sh+```shell
 $ make board-deb $ make board-deb
 ``` ```
Line 87: Line 87:
 ==== Build all Debian Packages ==== ==== Build all Debian Packages ====
  
-```sh+```shell
 $ make debs $ make debs
 ``` ```
Line 93: Line 93:
 ==== Build U-Boot Image ==== ==== Build U-Boot Image ====
  
-```sh+```shell
 $ make uboot-image $ make uboot-image
 ``` ```
Line 99: Line 99:
 ==== Clean Linux Source Tree ==== ==== Clean Linux Source Tree ====
  
-```sh+```shell
 $ make kernel-clean $ make kernel-clean
 ``` ```
Line 105: Line 105:
 ==== Show Linux Menuconfig ==== ==== Show Linux Menuconfig ====
  
-```sh+```shell
 $ make kernel-config $ make kernel-config
 ``` ```
Line 111: Line 111:
 ==== Save Linux Defconfig ==== ==== Save Linux Defconfig ====
  
-```sh+```shell
 $ make kernel-saveconfig $ make kernel-saveconfig
 ``` ```
Line 117: Line 117:
 ==== Clean U-Boot Source Tree ==== ==== Clean U-Boot Source Tree ====
  
-```sh+```shell
 $ make uboot-clean $ make uboot-clean
 ``` ```
Line 125: Line 125:
 You can get help messages by executing ''make help'': You can get help messages by executing ''make help'':
  
-```sh+```shell
 $ make help $ make help
 Fenix scripts help messages: Fenix scripts help messages:
Line 154: Line 154:
  
   * ''NO_CCACHE'' - ccache option   * ''NO_CCACHE'' - ccache option
-    * ''NO_CCACHE=no make'' - Enable ccache (default+    * ''NO_CCACHE=no make'' - Enable ccache **default** 
     * ''NO_CCACHE=yes make'' - Disable ccache      * ''NO_CCACHE=yes make'' - Disable ccache 
  
   * ''COMPRESS_IMAGE'' - compress build image option   * ''COMPRESS_IMAGE'' - compress build image option
-    * Don't compress (default) +    * ''COMPRESS_IMAGE=no make''Don't compress **default** 
-      * COMPRESS_IMAGE=no make +    ''COMPRESS_IMAGE=yes make''Compress image with xz
-    * Compress image with xz +
-      * COMPRESS_IMAGE=yes make+
  
   * ''BUILD_TYPE'' - image build type option   * ''BUILD_TYPE'' - image build type option
-    * Develop build +    * ''BUILD_TYPE=develop make'' - Develop build 
-      * BUILD_TYPE=develop make +    * ''BUILD_TYPE=release make'' - Release build
-    * Release build +
-      * BUILD_TYPE=release make+
  
 ===== Build in Docker ===== ===== Build in Docker =====
Line 179: Line 175:
 ==== Add User to a Docker Group ==== ==== Add User to a Docker Group ====
  
-```sh+```shell
 $ sudo usermod -aG docker $USER $ sudo usermod -aG docker $USER
 ``` ```
Line 190: Line 186:
 ==== Check Docker ==== ==== Check Docker ====
  
-```sh+```shell
 $ docker run hello-world $ docker run hello-world
 ``` ```
Line 196: Line 192:
 If you see the following print-out, Docker has installed successfully: If you see the following print-out, Docker has installed successfully:
  
-```+```txt
 Unable to find image 'hello-world:latest' locally Unable to find image 'hello-world:latest' locally
 latest: Pulling from library/hello-world latest: Pulling from library/hello-world
Line 224: Line 220:
  https://docs.docker.com/engine/userguide/  https://docs.docker.com/engine/userguide/
 ``` ```
 +
 ==== Build Fenix in Docker ==== ==== Build Fenix in Docker ====
  
 Get Docker image: Get Docker image:
  
-```+```shell
 $ cd ~/project/fenix $ cd ~/project/fenix
 $ docker pull numbqq/fenix:latest $ docker pull numbqq/fenix:latest
Line 235: Line 232:
 Build image in Docker: Build image in Docker:
  
-```sh+```shell
 $ docker run -it --name fenix -v $(pwd):/home/khadas/fenix \ $ docker run -it --name fenix -v $(pwd):/home/khadas/fenix \
              -v /etc/localtime:/etc/localtime:ro \              -v /etc/localtime:/etc/localtime:ro \
Line 246: Line 243:
 Start your build from inside the Docker container. Start your build from inside the Docker container.
  
-```sh+```shell
 khadas@919cab43f66d:~/fenix$ source env/setenv.sh khadas@919cab43f66d:~/fenix$ source env/setenv.sh
 khadas@919cab43f66d:~/fenix$ make khadas@919cab43f66d:~/fenix$ make
Line 253: Line 250:
 Restart the Docker container. Restart the Docker container.
  
-```sh+```shell
 $ docker start fenix $ docker start fenix
 $ docker exec -ti fenix bash $ docker exec -ti fenix bash
 ``` ```
Last modified: 2022/08/07 22:18 by ruby