This shows you the differences between two versions of the page.
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 00:01] nick |
products:sbc:common:development:build-ubuntu [2022/08/07 22:02] ruby [Introduction] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Build Ubuntu | + | ====== Build Ubuntu ====== |
===== Introduction ===== | ===== Introduction ===== | ||
- | We provided | + | [[kg> |
You can follow the steps below to build the Ubuntu OS image. | You can follow the steps below to build the Ubuntu OS image. | ||
- | ===== Host Setup ===== | + | ===== Preparation |
Install ecessial dependencies. | Install ecessial 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 |
``` | ``` | ||
===== 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. '' |
- | ```sh | + | ```shell |
- | mkdir ~/project | + | $ mkdir ~/project |
- | cd ~/ | + | $ cd ~/ |
- | git clone --depth 1 https:// | + | $ git clone --depth 1 https:// |
``` | ``` | ||
Line 30: | Line 30: | ||
You should setup the build environment first. \\ | You should setup the build environment first. \\ | ||
- | For example: '' | + | For example: '' |
- | ```sh | + | ```shell |
- | cd ~/ | + | $ cd ~/ |
- | source env/ | + | $ source env/ |
``` | ``` | ||
Line 43: | Line 43: | ||
<WRAP tip > | <WRAP tip > | ||
- | If this is your first time building | + | 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. |
</ | </ | ||
+ | ===== Other Build Commands ===== | ||
- | ===== Build U-Boot ===== | ||
- | ```sh | + | ==== Build U-Boot ==== |
- | make uboot | + | |
+ | ```shell | ||
+ | $ make uboot | ||
``` | ``` | ||
- | ===== Build U-Boot Debian Package | + | ==== Build U-Boot Debian Package ==== |
- | ```sh | + | ```shell |
- | make uboot-deb | + | $ make uboot-deb |
``` | ``` | ||
- | ===== Build Linux ===== | + | ==== Build Linux ==== |
- | ```sh | + | ```shell |
- | make kernel | + | $ make kernel |
``` | ``` | ||
- | ===== Build Linux Debian Package | + | ==== Build Linux Debian Package ==== |
- | ```sh | + | ```shell |
- | make kernel-deb | + | $ make kernel-deb |
``` | ``` | ||
- | ===== Build GPU Debian Package | + | ==== Build GPU Debian Package ==== |
- | ```sh | + | ```shell |
- | make gpu-deb | + | $ make gpu-deb |
``` | ``` | ||
- | ===== Build the Board Debian Package | + | ==== Build the Board Debian Package ==== |
- | ```sh | + | ```shell |
- | make board-deb | + | $ make board-deb |
``` | ``` | ||
- | ===== Build all Debian Packages | + | ==== Build all Debian Packages ==== |
- | ```sh | + | ```shell |
- | make debs | + | $ make debs |
``` | ``` | ||
- | ===== Build U-Boot Image ===== | + | ==== Build U-Boot Image ==== |
- | ```sh | + | ```shell |
- | make uboot-image | + | $ make uboot-image |
``` | ``` | ||
- | ===== Clean Linux Source Tree ===== | + | ==== Clean Linux Source Tree ==== |
- | ```sh | + | ```shell |
- | make kernel-clean | + | $ make kernel-clean |
``` | ``` | ||
- | ===== Show Linux Menuconfig | + | ==== Show Linux Menuconfig ==== |
- | ```sh | + | ```shell |
- | make kernel-config | + | $ make kernel-config |
``` | ``` | ||
- | ===== Save Linux Defconfig | + | ==== Save Linux Defconfig ==== |
- | ```sh | + | ```shell |
- | make kernel-saveconfig | + | $ make kernel-saveconfig |
``` | ``` | ||
- | ===== Clean U-Boot Source Tree ===== | + | ==== Clean U-Boot Source Tree ==== |
- | ```sh | + | ```shell |
$ make uboot-clean | $ make uboot-clean | ||
``` | ``` | ||
- | ===== Help Messages | + | ==== Help Messages ==== |
You can get help messages by executing '' | You can get help messages by executing '' | ||
- | ```sh | + | ```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 147: | Line 149: | ||
``` | ``` | ||
- | ===== Build Options | + | ==== Build Options ==== |
Options for building: | Options for building: | ||
* '' | * '' | ||
- | * Enable ccache (default) | + | * '' |
- | * NO_CCACHE=no make | + | * '' |
- | * Disable ccache | + | |
- | * NO_CCACHE=yes make | + | |
* '' | * '' | ||
- | * Don't compress | + | * '' |
- | * COMPRESS_IMAGE=no make | + | * '' |
- | * Compress image with xz | + | |
- | * COMPRESS_IMAGE=yes make | + | |
* '' | * '' | ||
- | * Develop build | + | * '' |
- | * BUILD_TYPE=develop make | + | * '' |
- | * Release build | + | |
- | * BUILD_TYPE=release make | + | |
- | ===== Build Fenix in Docker ===== | + | ===== Build in Docker ===== |
You can also choose to build the OS image in a Docker container. | You can also choose to build the OS image in a Docker container. | ||
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 |
``` | ``` | ||
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 ' | Unable to find image ' | ||
latest: Pulling from library/ | latest: Pulling from library/ | ||
Line 224: | Line 220: | ||
| | ||
``` | ``` | ||
- | ==== Run Fenix in Docker ==== | + | |
+ | ==== Build Fenix in Docker ==== | ||
Get Docker image: | Get Docker image: | ||
- | ``` | + | ```shell |
- | cd ~/ | + | $ cd ~/ |
- | docker pull numbqq/ | + | $ docker pull numbqq/ |
``` | ``` | ||
Build image in Docker: | Build image in Docker: | ||
- | ```sh | + | ```shell |
$ docker run -it --name fenix -v $(pwd):/ | $ docker run -it --name fenix -v $(pwd):/ | ||
-v / | -v / | ||
Line 246: | Line 243: | ||
Start your build from inside the Docker container. | Start your build from inside the Docker container. | ||
- | ```sh | + | ```shell |
khadas@919cab43f66d: | khadas@919cab43f66d: | ||
khadas@919cab43f66d: | khadas@919cab43f66d: | ||
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 | ||
``` | ``` |