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/04 23:41] nick |
products:sbc:common:development:build-ubuntu [2022/08/07 22:01] 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 |
- | ```bash | + | Install ecessial dependencies. |
- | sudo apt-get update | + | |
- | sudo apt-get upgrade | + | ```shell |
- | sudo apt-get | + | $ sudo apt update |
+ | $ sudo apt install git make lsb-release qemu-user-static | ||
``` | ``` | ||
- | ===== Clone the Fenix Repository | + | ===== Get Fenix Source Code ===== |
+ | Clone the Fenix repository to somewhere, e.g. '' | ||
- | Clone the Fenix repository to: `~/project` | + | ```shell |
- | + | ||
- | ```sh | + | |
$ mkdir ~/project | $ mkdir ~/project | ||
$ cd ~/project/ | $ cd ~/project/ | ||
Line 26: | Line 26: | ||
``` | ``` | ||
- | ### Setup the Build Environment | + | ===== Setup the Build Environment |
- | You should setup the build environment first. | + | You should setup the build environment first. |
- | For example: Board type, Linux version, distribution, etc. | + | For example: |
- | ```sh | + | ```shell |
$ cd ~/ | $ cd ~/ | ||
$ source env/ | $ source env/ | ||
``` | ``` | ||
- | ### Build the Image | + | ===== Build the OS Image ===== |
- | As root, build the image with Fenix. | + | Just type '' |
- | ```sh | ||
- | $ make | ||
- | ``` | ||
- | **Tip: | + | <WRAP tip > |
+ | 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. | ||
+ | </ | ||
- | ### Build U-Boot | + | ===== Other Build Commands ===== |
- | ``` | + | |
+ | |||
+ | ==== Build U-Boot | ||
+ | |||
+ | ```shell | ||
$ make uboot | $ make uboot | ||
``` | ``` | ||
- | ### Build the 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 the Linux Debian Package | + | ==== Build Linux Debian Package |
- | ``` | + | |
+ | ```shell | ||
$ make kernel-deb | $ make kernel-deb | ||
``` | ``` | ||
- | ### Build the 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 the 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 the 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 | + | |
- | ```sh | + | You can get help messages by executing |
+ | |||
+ | ```shell | ||
$ make help | $ make help | ||
Fenix scripts help messages: | Fenix scripts help messages: | ||
Line 131: | Line 149: | ||
``` | ``` | ||
- | ### Build Options | + | ==== Build Options |
Options for building: | Options for building: | ||
- | * `NO_CCACHE` - ccache option | + | |
+ | * '' | ||
+ | * '' | ||
- | * Enable ccache (default) | + | * '' |
- | * NO_CCACHE=no make | + | * '' |
- | | + | * '' |
- | * NO_CCACHE=yes make | + | |
- | * `COMPRESS_IMAGE` | + | |
- | * Don't compress (default) | + | * '' |
- | * COMPRESS_IMAGE=no make | + | * '' |
- | * Compress image with xz | + | |
- | * COMPRESS_IMAGE=yes make | + | |
- | * `BUILD_TYPE` - image build type option | + | ===== Build in Docker ===== |
- | * Develop build | + | |
- | * BUILD_TYPE=develop make | + | |
- | * Release build | + | |
- | * BUILD_TYPE=release make | + | |
- | ### Build Fenix in Docker | + | You can also choose to build the OS image in a Docker |
- | Fenix is supported by Docker. We provide a `Ubuntu 20.04` build host, so you can build all images in Docker. | + | ==== Install |
- | #### Install | + | Please refer to [[https:// |
- | Please refer to [Docker | + | ==== Add User to a Docker |
- | #### Add User to a Docker Group | + | ```shell |
- | + | ||
- | ``` | + | |
$ sudo usermod -aG docker $USER | $ sudo usermod -aG docker $USER | ||
``` | ``` | ||
- | *Note: | + | <WRAP important > |
+ | You need to logout or reboot the system for changes to take effect. | ||
+ | </ | ||
- | #### 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 print-out, Docker has installed successfully: | ||
- | ``` | + | |
+ | ```txt | ||
Unable to find image ' | Unable to find image ' | ||
latest: Pulling from library/ | latest: Pulling from library/ | ||
Line 204: | 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/ | ||
Line 212: | Line 231: | ||
Build image in Docker: | Build image in Docker: | ||
- | ``` | + | |
+ | ```shell | ||
$ docker run -it --name fenix -v $(pwd):/ | $ docker run -it --name fenix -v $(pwd):/ | ||
-v / | -v / | ||
Line 222: | Line 242: | ||
``` | ``` | ||
Start your build from inside the Docker container. | Start your build from inside the Docker container. | ||
- | ``` | + | |
+ | ```shell | ||
khadas@919cab43f66d: | khadas@919cab43f66d: | ||
khadas@919cab43f66d: | khadas@919cab43f66d: | ||
Line 229: | Line 250: | ||
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:// | ||
- | - Release Build, Test Build Ubuntu, Test Build Debian | ||
- | ![image](/ | ||
- | - You can see the firmware page when you click on the latest workflow | ||
- | |||
- | ### See Also | ||
- | [Docker](https:// |