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
products:sbc:common:development:build-ubuntu [2022/07/04 23:54]
nick
products:sbc:common:development:build-ubuntu [2026/05/11 02:13] (current)
nick
Line 1: Line 1:
-====== Build Ubuntu OS Images======+====== Build Ubuntu ======
  
 ===== Introduction ===== ===== Introduction =====
  
-We provided [[kg>fenix|Fenix]] for you to build the Ubuntu OS images easily. \\ +We provide [[kg>fenix|Fenix]] to help you build Ubuntu OS images easily. \\ 
-You can follow the steps below to build the Ubuntu OS image.+You can follow the steps below.
  
  
-===== Host Setup =====+===== Preparation =====
  
-Install ecessial dependencies.+Install essential dependencies.
  
-``` +```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
 ``` ```
  
-===== Get Fenix Source Code =====+===== Get Fenix source code =====
  
-Clone the Fenix repository to somewhere, e.g. `~/project`+Clone the Fenix repository to a directory, e.g., ''~/project''.
  
-``` +```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
 ``` ```
  
-===== Setup the Build Environment =====+===== Setup the build environment =====
  
-You should setup the build environment first. \\+You must set up the build environment first. \\
  
-For example: ''Board type'', ''Linux version'', ''distribution'', etc.+For example: ''Board type'', ''Linux version'', ''distribution''.
  
-``` +```shell 
-cd ~/project/fenix +cd ~/project/fenix 
-source env/setenv.sh+source env/setenv.sh
 ``` ```
  
-===== Build the OS Image =====+===== Build the OS image =====
  
-Just type ''make'' to start build.+Simply type ''make'' to start the build.
  
-``` +<WRAP tip >  
-make +If this is your first time building an image, the script will check your host environment and install essential packages. Additionally, repositories (such as U-Boot and Linux) will be automatically cloned from the Khadas GitHub.  
-```+</WRAP>
  
 +===== Other build commands =====
  
-<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. 
-</WRAP> 
  
 +==== Build U-Boot ====
  
-===== Build U-Boot ===== +```shell 
- +make uboot
-``` +
-make uboot+
 ``` ```
  
-===== Build U-Boot Debian Package =====+==== Build U-Boot Debian package ====
  
-``` +```shell 
-make uboot-deb+make uboot-deb
 ``` ```
  
-===== Build Linux =====+==== Build Linux ====
  
-``` +```shell 
-make kernel+make kernel
 ``` ```
  
-===== Build Linux Debian Package =====+==== Build Linux Debian package ====
  
-``` +```shell 
-make kernel-deb+make kernel-deb
 ``` ```
  
-===== Build GPU Debian Package =====+==== Build GPU Debian package ====
  
-``` +```shell 
-make gpu-deb+make gpu-deb
 ``` ```
  
-===== Build the Board Debian Package =====+==== Build the board Debian package ====
  
-``` +```shell 
-make board-deb+make board-deb
 ``` ```
  
-===== Build all Debian Packages =====+==== Build all Debian packages ====
  
-``` +```shell 
-make debs+make debs
 ``` ```
  
-===== Build U-Boot Image =====+==== Build U-Boot image ====
  
-``` +```shell 
-make uboot-image+make uboot-image
 ``` ```
  
-===== Clean Linux Source Tree =====+==== Clean Linux source tree ====
  
-``` +```shell 
-make kernel-clean+make kernel-clean
 ``` ```
  
-===== Show Linux Menuconfig =====+==== Show Linux menuconfig ====
  
-``` +```shell 
-make kernel-config+make kernel-config
 ``` ```
  
-===== Save Linux Defconfig =====+==== Save Linux defconfig ====
  
-``` +```shell 
-make kernel-saveconfig+make kernel-saveconfig
 ``` ```
  
-===== Clean U-Boot Source Tree =====+==== Clean U-Boot source tree ====
  
-```+```shell
 $ make uboot-clean $ make uboot-clean
 ``` ```
  
-===== Help Messages =====+==== Help messages ====
  
 You can get help messages by executing ''make help'': You can get help messages by executing ''make help'':
  
-``` +```shell 
-make help+make help
 Fenix scripts help messages: Fenix scripts help messages:
   all                   - Create image according to environment.   all                   - Create image according to environment.
Line 151: Line 148:
 ``` ```
  
-===== Build Options =====+==== Build options ====
  
 Options for building: Options for building:
  
   * ''NO_CCACHE'' - ccache option   * ''NO_CCACHE'' - ccache option
-    * Enable ccache (default) +    * ''NO_CCACHE=no make''Enable ccache **(default)* 
-      NO_CCACHE=no make +    * ''NO_CCACHE=yes make'' - Disable ccache 
-    * Disable ccache +
-      * NO_CCACHE=yes make+
  
   * ''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 Fenix in Docker =====+===== Build in Docker =====
  
-Fenix is supported by Docker. We provide a `Ubuntu 20.04` build host, so you can build all images in Docker.+You can also choose to build the OS image in Docker container.
  
-#### Install Docker+==== Install Docker ====
  
-Please refer to [Docker Documentation](https://docs.docker.com/engine/install/).+Please refer to [[https://docs.docker.com/engine/install/|Docker Documentation]].
  
-#### Add User to a Docker Group+==== Add user to a Docker group ====
  
-```+```shell
 $ sudo usermod -aG docker $USER $ sudo usermod -aG docker $USER
 ``` ```
  
-*Note: You need to logout or reboot the system for changes to take effect.*+<WRAP important > 
 +You must log out or reboot the system for this change to take effect.  
 +</WRAP>
  
-#### Run Docker + 
-```+==== Check Docker ==== 
 + 
 +```shell
 $ docker run hello-world $ docker run hello-world
 ``` ```
  
-If you see the following print-out, Docker has installed successfully: +If you see the following output, Docker has been 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 223: Line 219:
  https://docs.docker.com/engine/userguide/  https://docs.docker.com/engine/userguide/
 ``` ```
-#### Run Fenix in Docker + 
-Get Docker image: +==== Build Fenix in Docker ==== 
-```+ 
 +Pull the Docker image: 
 + 
 +```shell
 $ cd ~/project/fenix $ cd ~/project/fenix
 $ docker pull numbqq/fenix:latest $ docker pull numbqq/fenix:latest
 ``` ```
  
-Build image in Docker: +Build the image in Docker: 
-```+ 
 +```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 240: Line 240:
              numbqq/fenix              numbqq/fenix
 ``` ```
-Start your build from inside the Docker container. +Start your build from inside the Docker container
-```+ 
 +```shell
 khadas@919cab43f66d:~/fenix$ source env/setenv.sh khadas@919cab43f66d:~/fenix$ source env/setenv.sh
 khadas@919cab43f66d:~/fenix$ make khadas@919cab43f66d:~/fenix$ make
 ``` ```
  
-Restart the Docker container.+Restart the Docker container:
  
-```bash+```shell
 $ docker start fenix $ docker start fenix
 $ docker exec -ti fenix bash $ docker exec -ti fenix bash
 ``` ```
- 
-### Get the Latest Nightly build 
-- See [Fenix](https://github.com/khadas/fenix)(one-stop script) 
-- Release Build, Test Build Ubuntu, Test Build Debian 
-![image](/linux/images/vim1/fenix_script.png) 
-- You can see the firmware page when you click on the latest workflow 
- 
-### See Also 
-[Docker](https://www.docker.com/) 
Last modified: 2022/07/04 23:54 by nick