This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:common:development:build-ubuntu [2022/07/05 00:02] nick [Run Fenix in Docker] |
products:sbc:common:development:build-ubuntu [2026/05/11 02:13] (current) nick |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Build Ubuntu | + | ====== Build Ubuntu ====== |
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | We provided | + | We provide |
| - | You can follow the steps below to build the Ubuntu OS image. | + | You can follow the steps below. |
| - | ===== Host Setup ===== | + | ===== Preparation |
| - | Install | + | Install |
| - | ```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 a directory, e.g., '' |
| - | ```sh | + | ```shell |
| - | mkdir ~/project | + | $ mkdir ~/project |
| - | cd ~/ | + | $ cd ~/ |
| - | git clone --depth 1 https:// | + | $ git clone --depth 1 https:// |
| ``` | ``` | ||
| - | ===== 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: '' | + | For example: '' |
| - | ```sh | + | ```shell |
| - | cd ~/ | + | $ cd ~/ |
| - | source env/ | + | $ source env/ |
| ``` | ``` | ||
| - | ===== Build the OS Image ===== | + | ===== Build the OS image ===== |
| - | Just type '' | + | Simply |
| - | + | <WRAP tip > | |
| - | <WRAP tip > | + | If this is your first time building an image, the script will check your host environment and install essential packages. |
| - | If this is your first time building an image, the script will check your host' | + | |
| </ | </ | ||
| + | |||
| + | ===== Other build commands ===== | ||
| - | ===== Build U-Boot | + | ==== Build U-Boot ==== |
| - | ```sh | + | ```shell |
| - | make uboot | + | $ make uboot |
| ``` | ``` | ||
| - | ===== Build U-Boot Debian | + | ==== Build U-Boot Debian |
| - | ```sh | + | ```shell |
| - | make uboot-deb | + | $ make uboot-deb |
| ``` | ``` | ||
| - | ===== Build Linux ===== | + | ==== Build Linux ==== |
| - | ```sh | + | ```shell |
| - | make kernel | + | $ make kernel |
| ``` | ``` | ||
| - | ===== Build Linux Debian | + | ==== Build Linux Debian |
| - | ```sh | + | ```shell |
| - | make kernel-deb | + | $ make kernel-deb |
| ``` | ``` | ||
| - | ===== Build GPU Debian | + | ==== Build GPU Debian |
| - | ```sh | + | ```shell |
| - | make gpu-deb | + | $ make gpu-deb |
| ``` | ``` | ||
| - | ===== Build the Board Debian | + | ==== Build the board Debian |
| - | ```sh | + | ```shell |
| - | make board-deb | + | $ make board-deb |
| ``` | ``` | ||
| - | ===== Build all Debian | + | ==== Build all Debian |
| - | ```sh | + | ```shell |
| - | make debs | + | $ make debs |
| ``` | ``` | ||
| - | ===== Build U-Boot | + | ==== Build U-Boot |
| - | ```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 | + | ==== Clean U-Boot |
| - | ```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 148: | ||
| ``` | ``` | ||
| - | ===== Build Options ===== | + | ==== Build options |
| Options for building: | Options for building: | ||
| * '' | * '' | ||
| - | * Enable ccache (default) | + | * '' |
| - | | + | * '' |
| - | * Disable ccache | + | |
| - | * NO_CCACHE=yes make | + | |
| * '' | * '' | ||
| - | * Don't compress (default) | + | * '' |
| - | * 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 177: | Line 172: | ||
| Please refer to [[https:// | Please refer to [[https:// | ||
| - | ==== Add User to a Docker | + | ==== Add user to a Docker |
| - | ```sh | + | ```shell |
| - | sudo usermod -aG docker $USER | + | $ sudo usermod -aG docker $USER |
| ``` | ``` | ||
| <WRAP important > | <WRAP important > | ||
| - | You need to logout | + | You must log out or reboot the system for this change |
| </ | </ | ||
| Line 190: | Line 185: | ||
| ==== Check Docker ==== | ==== Check Docker ==== | ||
| - | ```sh | + | ```shell |
| - | docker run hello-world | + | $ docker run hello-world |
| ``` | ``` | ||
| - | If you see the following | + | If you see the following |
| - | ``` | + | ```txt |
| Unable to find image ' | Unable to find image ' | ||
| latest: Pulling from library/ | latest: Pulling from library/ | ||
| Line 224: | Line 219: | ||
| | | ||
| ``` | ``` | ||
| - | ==== Run Fenix in Docker ==== | ||
| - | Get Docker | + | ==== Build Fenix in Docker |
| - | ``` | + | Pull the Docker image: |
| - | cd ~/ | + | |
| - | docker pull numbqq/ | + | ```shell |
| + | $ cd ~/ | ||
| + | $ docker pull numbqq/ | ||
| ``` | ``` | ||
| - | Build image in Docker: | + | Build the image in Docker: |
| - | ```sh | + | ```shell |
| - | docker run -it --name fenix -v $(pwd):/ | + | $ docker run -it --name fenix -v $(pwd):/ |
| -v / | -v / | ||
| -v / | -v / | ||
| Line 244: | Line 240: | ||
| | | ||
| ``` | ``` | ||
| - | 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: | ||
| ``` | ``` | ||
| - | 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 |
| ``` | ``` | ||