Skip to main content

Build RadxaOS

Using rsdk

rsdk is the build environment for RadxaOS, which has the following features:

  1. Containerized build environment. No need to manage the build dependencies.
  2. Modularized build scripts that is easy to modify.
  3. Support for x86 and ARM64 platforms.

Here is a brief introduction to how to install and use it rsdk

  1. First, please install the required dependencies:
sudo apt-get update
sudo apt-get install git qemu-user-static binfmt-support
sudo apt-get install npm docker.io
sudo usermod -a -G docker $USER
  1. Then clone the project with git and install devcontainer:
git clone --recurse-submodules https://github.com/RadxaOS-SDK/rsdk.git
cd rsdk
npm install @devcontainers/cli
export PATH="$PWD/src/bin:$PWD/node_modules/.bin:$PATH"
rsdk devcon up
rsdk devcon

When the end point appears as follows, you are now inside the rsdk's devcontainer shell.

██████╗ ███████╗██████╗ ██╗  ██╗
██╔══██╗██╔════╝██╔══██╗██║ ██╔╝
██████╔╝███████╗██║ ██║█████╔╝
██╔══██╗╚════██║██║ ██║██╔═██╗
██║ ██║███████║██████╔╝██║ ██╗
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═╝ ╚═╝
RadxaOS Software Development Kit

Please run `rsdk shell` to enter the full development shell.

direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DETERMINISTIC_BUILD +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_RUNTIME
+DEVENV_STATE +DEVENV_TASKS +HOST_PATH +IN_NIX_SHELL +LD +LOCALE_ARCHIVE +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
+NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS
+NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_STORE +NM +NODE_PATH +OBJCOPY +OBJDUMP +PKG_CONFIG +PKG_CONFIG_PATH +PYTHONHASHSEED +PYTHONNOUSERSITE
+PYTHONPATH +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STARSHIP_SESSION_KEY +STRINGS +STRIP +_PYTHON_HOST_PLATFORM +_PYTHON_SYSCONFIGDATA_NAME +__structuredAttrs +buildInputs
+buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated
+depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +hardeningDisable +mesonFlags +name +nativeBuildInputs +out +outputs +patches
+phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

vscode ➜ /workspaces/rsdk (main) $

3.Start TUI Wizard by running rsdk in the terminal.

┌─────────────────┤ RSDK ├──────────────────┐
│ Please select a task: │
│ │
│ Build system image │
│ ========= │
│ About │
│ │
│ <Ok> <Cancel> │
│ │
└───────────────────────────────────────────┘

Select the task you want to run.

┌─────────────────┤ RSDK ├──────────────────┐
│ Please select a product: │
│ │
│ ( ) rock-5a ▒ │
│ (*) rock-5b ▒ │
│ ( ) rock-5c ▒ │
│ │
│ <Ok> <Cancel> │
│ │
└───────────────────────────────────────────┘

Select Yes to start the build process. rsdk-tui will then run the associated CLI commands to complete the task:

┌─────────────────┤ RSDK ├──────────────────┐
│ │
│ Are you sure to build for 'rock-5b'? │
│ │
│ │
│ <Yes> <No> │
│ │
└───────────────────────────────────────────┘

After compilation, an out directory will be generated, and output.img is the final generated image

vscode ➜ /workspaces/rsdk (main) $ ls out/rock-5b_bookworm_kde/
build-image config.yaml debs manifest output.img rootfs.tar seed.tar.xz

Please refer to the rsdk page for detailed use of the warehouse.

If you need to conduct secondary development on the basis of rsdk, please continue reading the documentation Build customization

Common issues

  1. devcontainer setup paused with You might be rate limited by GitHub. message

You might be rate limited by GitHub. Please follow the instruction listed in the output.

  1. Failed to launch devcontainer.

Please edit .devcontainer/devcontainer.json, and adjust runArgs property.