### Start Electron Quick Start Demo Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Starts the Electron quick-start application after dependencies have been installed. ```shell npm start ``` -------------------------------- ### Rootfs Creation: QEMU Setup Source: https://context7.com/spacemit-com/docs-bianbu/llms.txt Install a customized QEMU version with RISC-V Vector support on an x86 host for root filesystem creation. This involves purging existing binfmt-support and installing the QEMU deb package. ```bash # Install customized QEMU with RISC-V Vector support (on x86 host) sudo apt-get purge binfmt-support wget https://archive.spacemit.com/qemu/qemu-user-static_8.0.4%2Bdfsg-1ubuntu3.23.10.1_amd64.deb sudo dpkg -i qemu-user-static_8.0.4+dfsg-1ubuntu3.23.10.1_amd64.deb sudo systemctl restart systemd-binfmt.service ``` -------------------------------- ### Dockerfile Example Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/docker.md Defines a Docker image based on a specific base image, installs packages, copies application code, and sets the entry point. ```Dockerfile # Dockerfile FROM harbor.spacemit.com/bianbu/bianbu:latest RUN apt-get update && apt-get install -y python3 COPY . /app WORKDIR /app CMD ["python3", "app.py"] ``` -------------------------------- ### Start sm-sdk Server from Source Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/speechsdk.md Starts the sm-sdk service when running from source code. This command assumes the environment is set up and dependencies are installed. ```bash python main.py --start-server ``` -------------------------------- ### Run Qt Example Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/qt.md Executes the compiled 'animatedtiles' Qt example application. ```shell $ ./animatedtiles ``` -------------------------------- ### Install and Run Application from .deb Package Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Install the .deb package using dpkg and then run the application from its installation path. ```shell cd build sudo dpkg -i electron-quick-start_1.0.0_riscv64.deb /opt/demo/electron-quick-start ``` -------------------------------- ### Build Example Project with make Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/qt.md Compiles the Qt example project using the generated Makefile. ```shell $ make ``` -------------------------------- ### Install and Configure GRUB within Rootfs Workspace Source: https://github.com/spacemit-com/docs-bianbu/blob/main/zh/system_integration/uefi_image.md This comprehensive script mounts necessary system resources, prepares a temporary ESP image for GRUB installation within a chroot environment, installs GRUB, updates its configuration, cleans up, and unmounts resources. It also appends a USB start command and sets the ESP UUID. ```shell cd $ROOTFS_WORKSPACE # 挂载系统资源 mount -t proc /proc rootfs/proc mount -t sysfs /sys rootfs/sys mount -o bind /dev rootfs/dev mount -o bind /dev/pts rootfs/dev/pts mkdir -p rootfs/boot/efi # 创建临时ESP分区镜像文件,用于grub-install操作 # 这个临时文件仅用于满足grub-install的安装要求,让它能够在chroot环境中正确安装GRUB相关文件到rootfs中 # 实际使用的ESP分区文件是从真实Bianbu 2.2系统中提取的efi.img dd if=/dev/zero of=tmp.img bs=1M count=200 apt update apt install -y dosfstools mkfs.fat -F32 tmp.img mount tmp.img rootfs/boot/efi/ chroot rootfs /bin/bash -c "apt update" chroot rootfs /bin/bash -c "apt install -y grub-efi" chroot rootfs /bin/bash -c "grub-install riscv-efi" chroot rootfs /bin/bash -c "update-grub" chroot rootfs /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get clean" # 卸载并删除临时ESP分区文件,因为实际的ESP分区使用的是从真实系统提取的efi.img umount tmp.img rm tmp.img # 卸载系统资源 mount | grep "rootfs/proc" > /dev/null && umount -l rootfs/proc mount | grep "rootfs/sys" > /dev/null && umount -l rootfs/sys mount | grep "rootfs/dev/pts" > /dev/null && umount -l rootfs/dev/pts mount | grep "rootfs/dev" > /dev/null && umount -l rootfs/dev echo 'usb_start=usb start' >> rootfs/boot/env_k1-x.txt export UUID_ESP=$(blkid efi.img | grep -o 'UUID="[^" ]*"' | cut -d '"' -f 2) ``` -------------------------------- ### Install Zenow and Dependencies Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/zenow.md Run these commands in the terminal to install Zenow and its required SDKs. ```bash sudo apt update sudo apt install zenow llm-sdk sm-sdk ``` -------------------------------- ### Install Bianbu LXQt Desktop Variant Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/bianbu_2.1_rootfs_create.md Installs the LXQt desktop variant of Bianbu. Requires manual user creation and setup before entering the desktop environment. This variant is supported in Bianbu 2.2 and later. ```shell chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install bianbu-minimal" chroot $TARGET_ROOTFS /bin/bash -c "apt-get -y install adduser" chroot $TARGET_ROOTFS /bin/bash -c "adduser --gecos \"\" --disabled-password bianbu" chroot $TARGET_ROOTFS /bin/bash -c "echo bianbu:bianbu | chpasswd" chroot $TARGET_ROOTFS /bin/bash -c "usermod -aG adm,cdrom,sudo,plugdev bianbu" chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install bianbu-desktop-lite" ``` -------------------------------- ### ROS2 Humble Installation Source: https://context7.com/spacemit-com/docs-bianbu/llms.txt Install ROS2 Humble on Bianbu, including setting the locale, enabling the ROS2 repository, and installing the desktop development environment. ```bash # Set UTF-8 locale sudo apt update && sudo apt install locales sudo locale-gen en_US en_US.UTF-8 sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 export LANG=en_US.UTF-8 # Enable ROS2 repository grep -q '^Suites:.*noble-ros' /etc/apt/sources.list.d/bianbu.sources || \ sudo sed -i '0,/^Suites:/s//& noble-ros/' /etc/apt/sources.list.d/bianbu.sources # Install ROS2 development tools sudo apt update && sudo apt install ros-dev-tools # Install ROS2 Humble desktop (recommended) sudo apt install ros-humble-desktop # Or install minimal base sudo apt install ros-humble-ros-base # Setup ROS2 environment (add to ~/.bashrc for persistence) source /opt/ros/humble/setup.bash ``` -------------------------------- ### Install Bianbu LXQt Desktop Variant Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/bianbu_3.0_rootfs_create.md Installs the LXQt Desktop variant of Bianbu. Ensure the minimal variant is installed first. ```shell chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install bianbu-minimal" chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install bianbu-desktop-lite" ``` -------------------------------- ### Install Signing Tools Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/dak.md Installs necessary tools for package signing. Run this on your development board. ```bash apt install gpg devscripts ``` -------------------------------- ### Install Dependencies and Run clumsy-bird Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Installs project dependencies using npm, installs grunt, and then starts the clumsy-bird service. The service is typically available at http://0.0.0.0:8001. ```shell cd clumsy-bird npm install sudo apt install grunt grunt connect ``` -------------------------------- ### Create ESP Partition and Install GRUB Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/uefi_image.md Execute these commands to update package lists, install necessary tools, create a 200MB FAT32 formatted ESP image, mount it, install GRUB for riscv64-efi, update GRUB configuration, unmount, and check the filesystem. ```shell sudo apt update sudo apt install -y dosfstools sudo dd if=/dev/zero of=~/efi.img bs=1M count=200 sudo mkfs.fat -F32 ~/efi.img sudo mkdir -p /boot/efi sudo mount ~/efi.img /boot/efi sudo apt install -y grub-efi sudo grub-install riscv64-efi sudo update-grub sudo umount /boot/efi sudo fsck.vfat -a ~/efi.img ``` -------------------------------- ### Generate Makefile with qmake Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/qt.md Navigates to the example directory and generates a Makefile using qmake for the 'animatedtiles' Qt example. ```shell $ cd qtbase-opensource-src-gles-5.15.13+dfsg/examples/widgets/animation/animatedtiles $ qmake ``` -------------------------------- ### Install Rust Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/langchain.md Installs Rust using the official script and configures the environment. Verifies the Rust installation. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable source ~/.cargo/env rustc --version ``` -------------------------------- ### Install VSCodium and code-server Source: https://context7.com/spacemit-com/docs-bianbu/llms.txt Provides instructions for installing VSCodium via apt or manual download, and for installing code-server for browser-based remote development. Includes commands to run code-server with network access. ```bash # Install VSCodium from repository sudo apt-get update sudo apt-get install -y codium # Or download and install manually wget https://github.com/VSCodium/vscodium/releases/download/1.94.2.24286/VSCodium-linux-riscv64-1.94.2.24286.tar.gz sudo mkdir /opt/vscodium sudo tar xf VSCodium-linux-riscv64-1.94.2.24286.tar.gz -C /opt/vscodium # Install browser-based VS Code (code-server) sudo apt-get install code-server # Run code-server with network access code-server --host --port 8080 # Access from browser: http://:8080 ``` -------------------------------- ### Install code-server via APT Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/ide.md Install the code-server package on Bianbu v2.0rc1 or later using the apt-get command. ```shell sudo apt-get install code-server ``` -------------------------------- ### Set Up and Install LlamaIndex Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/llamaindex.md Creates a Python virtual environment named 'llamaindex_venv', activates it, and then installs the LlamaIndex library using pip. Always activate the virtual environment before installing or running Python packages. ```bash python3 -m venv ./llamaindex_venv source llamaindex_venv/bin/activate pip install llama-index ``` -------------------------------- ### Install Docker Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/docker.md Installs Docker and Docker Buildx on Debian-based systems. ```bash sudo apt-get update sudo apt-get install -y docker.io docker-buildx ``` -------------------------------- ### Create and Start Docker Container Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/bianbu_1.0_rootfs_create.md Create and start a privileged Docker container for building the Bianbu rootfs, mounting the workspace. ```shell docker run --privileged -itd -v ~/bianbu-workspace:/mnt --name build-bianbu-rootfs ubuntu:24.04 ``` -------------------------------- ### Install Python Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/speechsdk.md Installs Python on Ubuntu systems. This is a prerequisite for using the sm-sdk from source. ```bash sudo apt update sudo apt install python ``` -------------------------------- ### Install Qt5 Wayland Plugin Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/qt.md Installs the Wayland plugin for Qt5, enabling Wayland as a display server protocol. ```shell $ sudo apt-get install qtwayland5 ``` -------------------------------- ### Install Open-WebUI Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/openwebui.md Installs the Open-WebUI package using apt. Requires system version 2.1.1 or later. ```shell sudo apt update sudo apt install openwebui ``` -------------------------------- ### Install Ollama Toolkit Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/ollama.md Installs the spacemit-ollama-toolkit using apt. Ensure your system is updated first. ```shell sudo apt update sudo apt install spacemit-ollama-toolkit ``` -------------------------------- ### Install Thonny IDE Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/python.md Installs the Thonny Python IDE and its Tkinter dependency using apt. ```shell sudo apt install python3-tk thonny ``` -------------------------------- ### Button Press Output Example Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/python.md Example output when running the button state reading script and interacting with the button. ```shell ➜ testmy python3 testbutton.py Button 77 Hello! Pressed Goodbye! Released Hello! Pressed Goodbye! Released ``` -------------------------------- ### Install Basic Dependencies Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/llamaindex.md Installs essential packages required for Python development and LlamaIndex. Ensure you have sudo privileges. ```bash sudo apt update sudo apt install python3-venv python3-dev libffi-dev libssl-dev pkg-config libjpeg-dev zlib1g-dev libtiff-dev libfreetype6-dev liblcms2-dev libwebp-dev ``` -------------------------------- ### Install System Dependencies Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/langchain.md Installs essential system packages required for LangChain. Ensure you have sudo privileges. ```bash sudo apt update sudo apt install python3-venv libffi-dev libssl-dev pkg-config ``` -------------------------------- ### Install glmark2-es2-wayland Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/single_app_rootfs_create.md Installs the glmark2-es2-wayland package within the chroot environment, which is used as an example application to autostart with Labwc. ```shell chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install glmark2-es2-wayland" ``` -------------------------------- ### Start llama-server (Buildroot) Source: https://github.com/spacemit-com/docs-bianbu/blob/main/zh/ai/llama-cpp.md Launches the llama-server in the background from the extracted Buildroot llama.cpp directory. Configure parameters like host, port, and context size. ```bash ./bin/llama-server -m ../Qwen3-30B-A3B-Instruct-2507-Q4_0.gguf -t 8 --host 127.0.0.1 --port 8080 --ctx-size 15360 --n-gpu-layers 0 --batch-size 512 --metrics --no-mmap & ``` -------------------------------- ### Create a ROS Package Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/robot/ros.md This command creates a new ROS package named 'beginner_tutorials' with specified dependencies. Run this command within the 'src' directory of your workspace. ```shell cd ~/catkin_ws/src catkin_create_pkg beginner_tutorials std_msgs rospy roscpp ``` -------------------------------- ### Install OpenCode Dependencies Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/opencode.md Installs necessary dependencies for building OpenCode from source. Ensure you have `apt` package manager available. ```shell sudo apt install golang-go ripgrep fzf ``` -------------------------------- ### clumsy-bird Service Output Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Example output indicating the clumsy-bird service has started successfully and is listening on http://0.0.0.0:8001. ```shell $ grunt connect Running "connect:root" (connect) task Waiting forever... Started connect web server on http://0.0.0.0:8001 ``` -------------------------------- ### Create and Format Filesystems Source: https://github.com/spacemit-com/docs-bianbu/blob/main/zh/system_integration/uefi_image.md This script prepares the filesystem by creating bootfs and rootfs directories, moving boot content, and then formatting them into ext4 filesystems with specified UUIDs and sizes. Note the size adjustment for Bianbu Minimal. ```shell cd $ROOTFS_WORKSPACE # 创建bootfs目录并移动boot内容 mkdir -p bootfs mv rootfs/boot/* bootfs/ # 生成新的文件系统 mke2fs -d bootfs -L bootfs -t ext4 -U $UUID_BOOTFS bootfs.ext4 "256M" mke2fs -d rootfs -L rootfs -t ext4 -N 524288 -U $UUID_ROOTFS rootfs.ext4 "2048M" ``` -------------------------------- ### GET /api/models/server_status/stream (SSE) Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/llmsdk.md SSE stream for server status, with frequency adjusted based on status (0.5s for starting, 3s for running, 2s for others). ```APIDOC ## GET /api/models/server_status/stream (SSE) ### Description SSE stream for server status, with frequency adjusted based on status (0.5s for starting, 3s for running, 2s for others). ### Method GET ### Endpoint /api/models/server_status/stream ### Parameters #### Query Parameters - **model_type** (string) - Optional - The type of the model. Defaults to `llm`. ### SSE Event Format ``` data: {"status": "running", "model_name": "...", "model_path": "...", "error_message": null, "timestamp": 12345.0} ``` ``` -------------------------------- ### Complete package.json Example Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md This is a complete example of a package.json file incorporating all the necessary configurations for building a RISC-V adapted Electron application. ```json { "name": "electron-quick-start", "version": "1.0.0", "description": "A minimal Electron application", "main": "main.js", "scripts": { "start": "electron .", "pack-dir": "ELECTRON_MIRROR=http://archive.spacemit.com/electron/ electron-builder --linux --dir", "pack-tgz": "ELECTRON_MIRROR=http://archive.spacemit.com/electron/ electron-builder --linux tar.gz" }, "repository": "https://github.com/electron/electron-quick-start", "keywords": [ "Electron", "quick", "start", "tutorial", "demo" ], "author": "GitHub", "license": "CC0-1.0", "build": { "productName": "demo", "directories": { "output": "build" }, "linux": { "category": "Utility" } }, "devDependencies": { "electron": "29.3.1", "@electron/electron-builder": "25.0.0-alpha.5" } } ``` -------------------------------- ### Start OpenCode Interactive Session Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/opencode.md Launches the OpenCode AI coding assistant in an interactive terminal session. This command assumes OpenCode has been successfully compiled and installed. ```shell opencode ``` -------------------------------- ### Install npm Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/claude.md Installs Node Package Manager (npm) on Debian-based systems. This is a prerequisite for installing Claude Code. ```shell sudo apt install npm ``` -------------------------------- ### Install RISC-V Accelerated llama.cpp Backend Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/localai.md Navigates to the backend directory and executes an installation script. This script is responsible for downloading the RISC-V accelerated llama-cpp-grpc-server binary, quantized models, setting up directories, and generating configuration files. ```bash cd backend/cpp/spacemit-llama-cpp bash install.sh ``` -------------------------------- ### Start llama-server (K3) Source: https://github.com/spacemit-com/docs-bianbu/blob/main/zh/ai/llama-cpp.md Launches the llama-server in the background. Configure host, port, context size, and GPU layers. --metrics enables Prometheus endpoints. ```bash llama-server -m Qwen3-30B-A3B-Instruct-2507-Q4_0.gguf -t 8 --host 127.0.0.1 --port 8080 --ctx-size 15360 --n-gpu-layers 0 --batch-size 512 --metrics --no-mmap & ``` -------------------------------- ### Verify Ollama Installation Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/ollama.md Checks if Ollama is installed by listing available models. A successful installation will show model information. ```shell ollama list ``` -------------------------------- ### Install GRUB EFI Bootloader Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/uefi_image.md Installs the GRUB EFI bootloader to the mounted ESP. This command specifies the target architecture for the installation. ```bash chroot rootfs /bin/bash -c "grub-install riscv-efi" ``` -------------------------------- ### Install Software with apt-get Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/system-restore.md Use this command to install software packages. Ensure you are in a writable filesystem environment before enabling read-only mode. ```bash sudo apt-get install -y glmark2-es2-wayland ``` -------------------------------- ### Verify Claude Code Installation Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/claude.md Checks if the Claude Code tool has been installed correctly by displaying its version. Run this command after installation. ```shell claude --version ``` -------------------------------- ### Verify installed Python versions with pyenv Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/python.md List all installed Python versions managed by pyenv to confirm that the new version has been successfully installed. ```shell ➜ ~ pyenv versions * system (set by /home/zq/.pyenv/version) 3.10.0 ``` -------------------------------- ### Compile LocalAI from Source Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/localai.md Downloads the LocalAI source code, navigates to the project directory, sets the Go binary path and Aliyun proxy for faster downloads, and then compiles the project using 'make build'. Includes a note to run 'make clean' before rebuilding if errors occur. ```bash wget https://archive.spacemit.com/spacemit-ai/localai/localai.tar.gz tar xvzf localai.tar.gz # Navigate to project directory cd localai # Add Go binary path to environment export PATH=$PATH:$(go env GOPATH)/bin # Use Aliyun proxy for faster module downloads export GOPROXY=https://mirrors.aliyun.com/goproxy/,direct # Compile make build # If errors occur, run make clean before rebuilding ``` -------------------------------- ### Configure Bianbu APT Sources Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/dak.md Configure the apt sources list to include the experimental suite for Bianbu. Ensure the sources file is correctly set up before updating. ```bash # Existing content... # experimental suite Types: deb URIs: http://archive.spacemit.com/bianbu-community/ Suites: experimental Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/bianbu-archive-keyring.gpg ``` -------------------------------- ### Install a package in a virtual environment Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/python.md Install packages using pip within the active virtual environment. Packages installed here are isolated to this environment. ```shell (myenv) ➜ ~ pip install wheel Collecting wheel Downloading wheel-0.44.0-py3-none-any.whl.metadata (2.3 kB) Downloading wheel-0.44.0-py3-none-any.whl (67 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 67.1/67.1 kB 27.9 kB/s eta 0:00:00 Installing collected packages: wheel Successfully installed wheel-0.44.0 ``` -------------------------------- ### Install Customized QEMU Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/bianbu_2.0_rootfs_create.md Install the downloaded customized qemu-user-static package using dpkg. This step is crucial for enabling RISC-V binary execution. ```shell sudo dpkg -i qemu-user-static_8.0.4+dfsg-1ubuntu3.23.10.1_amd64.deb ``` -------------------------------- ### Install labwc in chroot Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/single_app_rootfs_create.md Updates package lists and installs the labwc display server within the chroot environment. Ensures the system is up-to-date before installation. ```shell chroot $TARGET_ROOTFS /bin/bash -c "apt-get update" chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades upgrade" chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install labwc" ``` -------------------------------- ### Configure APT sources.list for Bianbu OS Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/bianbu_1.0_rootfs_create.md Set up the main APT sources list to include Bianbu repositories for different distributions and security updates. The `trusted=yes` option bypasses GPG verification for these specific entries. ```shell cat < value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. -- Using CATKIN_DEVEL_PREFIX: /home/zq-pi2/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic CMake Warning (dev) at /opt/ros/noetic/share/catkin/cmake/python.cmake:4 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): /opt/ros/noetic/share/catkin/cmake/all.cmake:164 (include) /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:20 (include) CMakeLists.txt:58 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. -- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/zq-pi2/catkin_ws/build/test_results -- gtest not found, C++ tests can not be built. Please install the gtest headers globally in your system or checkout gtest (by running 'git clone https://github.com/google/googletest.git -b release-1.8.0' in the source space '/home/zq-pi2/catkin_ws/src' of your workspace) to enable gtests -- Using Python nosetests: /usr/bin/nosetests3 -- catkin 0.8.10 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 1 packages in topological order: -- ~~ - beginner_tutorials -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'beginner_tutorials' -- ==> add_subdirectory(beginner_tutorials) CMake Deprecation Warning at beginner_tutorials/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions. -- Configuring done (10.0s) -- Generating done (0.1s) -- Build files have been written to: /home/zq-pi2/catkin_ws/build #### #### Running command: "make -j8 -l8" in "/home/zq-pi2/catkin_ws/build" #### ``` -------------------------------- ### Set Up JupyterLab Development Environment Source: https://context7.com/spacemit-com/docs-bianbu/llms.txt Installs system dependencies, configures pip sources for faster downloads, creates a virtual environment, and installs JupyterLab with essential libraries. Launch JupyterLab for web-based IDE access. ```bash # Install system dependencies sudo apt install python3-pip python3-venv libxrender1 libgl1 libglib2.0-0t64 # Configure pip sources pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ pip config set global.extra-index-url https://git.spacemit.com/api/v4/projects/33/packages/pypi/simple # Create virtual environment and install JupyterLab python3 -m venv ~/jupyter-env source ~/jupyter-env/bin/activate pip install pip -U pip install ipykernel jupyterlab opencv-python matplotlib scipy # Launch JupyterLab (accessible from network) jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --notebook-dir=~/ # Access from browser: http://:8888/lab?token= # Find board IP with: ip addr ``` -------------------------------- ### Install Python Packages in Virtual Environment Source: https://context7.com/spacemit-com/docs-bianbu/llms.txt Installs the `wheel` package, which is often a prerequisite for installing other Python packages. This command should be run after activating a virtual environment. ```bash # Install packages in virtual environment pip install wheel ``` -------------------------------- ### Install Bianbu GNOME Desktop Variant Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/bianbu_3.0_rootfs_create.md Installs the GNOME Desktop variant of Bianbu, including minimal, desktop, and development packages. Ensure the minimal variant is installed first. ```shell chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install bianbu-minimal" chroot $TARGET_ROOTFS /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y --allow-downgrades install bianbu-desktop bianbu-desktop-zh bianbu-desktop-en bianbu-desktop-minimal-en bianbu-standard bianbu-development" ``` -------------------------------- ### Install ROS2 Humble Desktop Package Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/robot/ros2.md Installs the recommended desktop version of ROS2 Humble, which includes ROS, RViz, demos, and tutorials. ```shell sudo apt install ros-humble-desktop ``` -------------------------------- ### Start Model Server Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/llmsdk.md Starts the llama-server for a specific model identified by its ID. ```bash curl -X POST http://localhost:8050/api/models/start \ -H "Content-Type: application/json" \ -d "{\"model_id\": 1}" ``` -------------------------------- ### Install FPM Tool Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Install Ruby and the FPM gem to package applications. ```shell sudo apt install ruby3.1 sudo gem install fpm ``` -------------------------------- ### Install JupyterLab and Core Libraries Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/python.md Creates a Python virtual environment, activates it, upgrades pip, and installs JupyterLab along with essential scientific libraries like OpenCV, Matplotlib, and SciPy. ```bash python3 -m venv ~/jupter-env source ~/jupter-env/bin/activate pip install pip -U pip install ipykernel jupyterlab opencv-python matplotlib scipy ``` -------------------------------- ### Clone Electron Quick Start Project Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Clones the official electron-quick-start repository to a specified directory. ```shell git clone https://github.com/electron/electron-quick-start.git ~/electron-quick-start ``` -------------------------------- ### Start All Model Servers Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/llmsdk.md Initiates the model servers for all types (llm, embed, rerank) in the background. ```bash curl -X POST http://localhost:8050/api/models/start_all ``` -------------------------------- ### Verify NVM Installation Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Checks the installed version of Node Version Manager (NVM). ```shell nvm -v ``` -------------------------------- ### Install Build Dependencies for Qt5 Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/qt.md Installs the necessary build dependencies for the qtbase-opensource-src-gles package. ```shell $ sudo apt-get build-dep qtbase-opensource-src-gles ``` -------------------------------- ### Create and Activate LangChain Virtual Environment Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/langchain.md Sets up a Python virtual environment named 'langchain_venv' and activates it. Installs LangChain using a specific PyPI mirror. ```bash python3 -m venv ./langchain_venv source langchain_venv/bin/activate pip install langchain -i https://pypi.tuna.tsinghua.edu.cn/simple ``` -------------------------------- ### Download Customized QEMU Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/system_integration/bianbu_2.0_rootfs_create.md Download the customized qemu-user-static package required for Bianbu ROOTFS creation. Ensure you have wget installed. ```shell wget https://archive.spacemit.com/qemu/qemu-user-static_8.0.4%2Bdfsg-1ubuntu3.23.10.1_amd64.deb ``` -------------------------------- ### Configure System and Generate Partition Images Source: https://context7.com/spacemit-com/docs-bianbu/llms.txt Configures the system by setting the root password and generates partition images for bootfs and rootfs using mke2fs. Ensure the TARGET_ROOTFS variable is correctly set before execution. ```bash chroot $TARGET_ROOTFS /bin/bash -c "echo root:bianbu | chpasswd" UUID_BOOTFS=$(uuidgen) && UUID_ROOTFS=$(uuidgen) mke2fs -d bootfs -L bootfs -t ext4 -U $UUID_BOOTFS bootfs.ext4 "256M" mke2fs -d $TARGET_ROOTFS -L rootfs -t ext4 -N 524288 -U $UUID_ROOTFS rootfs.ext4 "2048M" ``` -------------------------------- ### Install virtualenv Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/python.md Install the virtualenv tool on your system's Python environment using apt. ```shell sudo apt install python3-virtualenv ``` -------------------------------- ### Install llama.cpp-tools-spacemit for Bianbu Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/speechsdk.md Installs llama.cpp-tools-spacemit on Bianbu systems, which is a dependency for HY-MT-1.5 and Qwen3-ASR models. ```bash sudo apt update sudo apt install llama.cpp-tools-spacemit ``` -------------------------------- ### Clone Electron Quick Start for Builder Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Clones the electron-quick-start project, which will be used with electron-builder. ```shell git clone https://github.com/electron/electron-quick-start.git cd electron-quick-start ``` -------------------------------- ### Install Package using apt Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/dak.md Install a package using apt after updating the package index. ```bash apt install xxx ``` -------------------------------- ### Run Application from Unpacked Directory Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/javascript.md Navigate to the unpacked application directory and execute the application binary. ```shell cd build/linux-riscv64-unpacked/ ./electron-quick-start ``` -------------------------------- ### Configure dput.cf for Bianbu Uploads Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/development/dak.md Sets up the dput configuration file to specify the Bianbu package hosting service details for uploads. ```bash [bianbu] fqdn = ftp.upload.spacemit.com incoming = /UploadQueue/ login = anonymous allow_dcut = 1 method = ftp allowed_distributions = (experimental) ``` -------------------------------- ### Install Python Prerequisites Source: https://github.com/spacemit-com/docs-bianbu/blob/main/en/ai/onnxruntime.md Installs necessary Python packages for ONNX, Pillow, Matplotlib, and OpenCV. ```shell sudo apt-get install -y python3-onnx python3-pillow python3-matplotlib python3-opencv ```