TinyBPT: Client Usage Guide for Buildroot

Corrector: TinyCorrect v0.2-rc2 – [tounix spaces]Author: Chai Zixuan [email protected]: 2024/09/27Revisor: falcon [email protected]: RISC-V Linux Kernel AnalysisSponsor: PLCT Lab, ISCAS

This week continues the series of articles on TinyBPT. Remember to bookmark, share, and follow, collection: https://tinylab.org/riscv-linux

Zero-threshold transition to RISC-V + Embedded Linux, keep up with TaiXiao Technology’s 30+ lectures on Bilibili, prepare a RISC-V experimental box: https://tinylab.org/tiny-riscv-box

TinyBPT: Client Usage Guide for Buildroot

Introduction

TinyBPT (Tiny Buildroot Packaging Tool) is a package management tool for buildroot, primarily handling package dependencies in buildroot, providing functionalities such as package installation and uninstallation.

This document mainly introduces the usage of the TinyBPT client.

Installation Method

If you want to install directly in the subsystem built by buildroot, you need to download it on the host and provide it to the subsystem for download via a local HTTP service. (If you have configured HTTPS related services during the build system setup, you can directly use HTTPS service for download.)

The default download is for the RISC-V 64-bit version, which can be extracted to the / directory after downloading.

For local compilation, you need to compile OpenSSL first. After downloading the source code, execute the following command:

./Configure linux64-riscv64 no-zlib no-rc2 no-idea no-des no-bf no-cast no-md2 no-mdc2 no-dh no-err no-rc5 no-camellia no-seed no-tests  -static  --prefix=/usr/local/openssl/riscv64 --cross-compile-prefix=riscv64-linux-gnu- -flto

make -j$(nproc)
make install_sw

Using no-* configuration options aims to disable multiple encryption algorithms and functionalities to reduce the library’s size and dependencies, and using -flto enables Link Time Optimization to improve the performance of the generated code.

If these processes are completed on the host (non-riscv machine), you need to move the compiled binary files, dependency files, and CA certificates to the embedded device (the riscv machine).

If for debugging purposes, you can compile using the ARCH=x86_64 option or use CMake. After compilation, simply move the dependency files to the appropriate location or set the TINYBPT_DB_PATH in the environment variables.

Direct Installation

wget https://mirrors.lzu.edu.cn/buildroot-pkgs/riscv64/tinybpt/tinybpt-v0.1-rc1.tar.gz
mkdir -p /etc/tinybpt && mkdir -p /etc/ssl/certs
tar -xvf tinybpt-v0.1-rc1.tar.gz -C /

Local Makefile Compilation Installation

Move to the tinybpt directory and execute the following commands:

make ARCH=riscv64 -j$(nproc)
git clone https://gitee.com/tinylab/tinybpt.git
cd tinybpt
wget https://curl.se/ca/cacert.pem
make
make install

Local CMake Compilation Installation

As above, compile OpenSSL first, then execute the following commands:

git clone https://gitee.com/tinylab/tinybpt.git tinybpt
cmake -S tinybpt
    -B build \
    -G Ninja
ninja -C build
ninja -C tinybpt/build install

Using Environment Variables to Specify Dependency and Download Paths (Optional)

By default, TinyBPT will store dependencies and downloaded files in /etc/tinybpt and /var/cache/tinybpt. If you need to specify other paths, you can use the environment variables TINYBPT_DB_PATH and TINYBPT_DOWNLOAD_PATH.

export TINYBPT_DB_PATH=<your_path_to>/tinybpt_db.json
export TINYBPT_DOWNLOAD_PATH=<your_path_to_download>
</your_path_to_download></your_path_to>

Usage

# tinybpt
Tiny buildroot packaging tool

Usage: tinybpt <command/> [options]

Commands:
    install <package_name>          Install package
    uninstall <package_name> [-f]   Uninstall package (use -f to force uninstall)
    list -all/-installed            List all/installed packages
    find <package_name>             Find package

Options:
    -h, -help
           Show help information
    -V, -version
           Show version information
    -set-mirror <url>               Set mirror URL
    -get-mirror                     Show mirror URL
</url></package_name></package_name></package_name>

Basic Operations

Use tinybpt install/uninstall/list/find <package_name> for package installation, uninstallation, searching, and listing operations.

# Install package
tinybpt install <package_name>

# Uninstall package
tinybpt uninstall <package_name>

# List all packages
tinybpt list -all

# List installed packages
tinybpt list -installed

# Find package
tinybpt find <package_name>

# Set mirror URL
tinybpt -set-mirror <url>

# Get mirror URL
tinybpt -get-mirror

# Show help information
tinybpt -h

# Show version information
tinybpt -V
</url></package_name></package_name></package_name>

Other Notes

  • This tool only supports riscv64 buildroot users; support for other architectures will be carried out in due course, stay tuned!
  • This tool uses CA certificates extracted from Mozilla.
  • This project uses third-party libraries nlohmann/json and cpp-httplib under the MIT license.

References

  • TinyBPT

Original Release Address: https://tinylab.org/tinybpt-client-usageTechnical Services: https://tinylab.org/ruma.tech

Click the Read Original link at the bottom left to access the external link. If you’ve read this far, just take a moment to look and share it! 😉

Leave a Comment