TinyBPT And Buildroot Binary Package Management Service (3): Server Description

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

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

Zero-threshold transition to RISC-V + Embedded Linux, follow TaiXiao Technology’s Bilibili open class, prepare a RISC-V experimental box: https://tinylab.org/tiny-riscv-box

TinyBPT And Buildroot Binary Package Management Service (3): Server Description

Introduction

TinyBPT (Tiny Buildroot Packaging Tool) is a package management tool for buildroot, mainly handling the package dependencies of buildroot, providing functions such as installation and uninstallation of packages.

This document mainly introduces the configuration and usage of the server to provide services to TinyBPT.

Configuring Buildroot Source Code on the Server Side

Using the Tool tsumugu to Update Sources

wget https://github.com/taoky/tsumugu

Configuration running script:

RUST_LOG=Error /usr/local/bin/tsumugu sync --parser lighttpd http://sources.buildroot.net /mnt/tank2/buildroot

In the web settings, add a scheduled task to update once a day, and display its path on the webpage, taking nginx as an example:

server {
···

  location ~* ^/(bmclapi|ubuntu|centos|debian-security|debian|archlinux|archlinuxcn|debian-nonfree|gentoo|manjaro|opensuse|ubuntukylin|wepe|cygwin|debian-cd|debian-multimedia|deepin-cd|openeuler|rpmfusion|ubuntukylin-cdimage|almalinux|buildroot|buildroot-pkgs|epel|rocky|radxa-apt|debian-ports) {
    include /etc/nginx/config.d/backend.conf;
    include /etc/nginx/config.d/cache.conf;
  }
···

Binary Packages

Binary Package Source

Currently, binary packages are available at https://mirrors.lzu.edu.cn/buildroot-pkgs.

Directory Structure

buildroot/ -- Source mirror, directly mirroring all official buildroot package source repositories

buildroot-pkgs/  -- Binary package release directory
  riscv64/       -- Processor architecture, independently facilitating third-party mirroring
    main/2024.02.6/   -- main for storing all buildroot lts version binary packages (dynamically compiled)
    tools/v6.10/     -- tools for storing tools binary packages under Linux lts kernel version (statically compiled)
    rootfs/<version>/   -- rootfs for storing rootfs packages, as well as corresponding compilation configuration files
                - rootfs-xxx.tar.gz
                - rootfs-xxx.config
    tinybpt/
      tinybpt-v0.1.0.tar.gz    -- tinybpt binary package
  aarch64/
    main/2024.02.6/
    tools/v6.10/
  x86_64/
    main/2024.02.6/
    tools/v6.10/

Compilation Options

If you want to compile by yourself, the compilation configuration is in the TinyBPT repository at /web/settings/.config (planned to be released along with rootfs later), replace the original configuration with the compilation configuration, or use make menuconfig to select the packages you need to compile yourself.

cd buildroot
make -j$(nproc)

Release of Binary Packages

After completion, enter the output/build directory, run the web/script/install.sh script to package the compiled binary packages into the /mnt/tinybpt directory.

List all filenames in the packaging directory into the deploy-pkgs-version.txt file, ensure that the existing dependency file packages.json is also in the running directory, and run the web/script/compare.py script and web/script/del.py script to compare and delete unnecessary packages, updating the dependency file.

Note: The compilation and release method of binary packages may cause some packages to be unable to compile due to reasons such as different directory structures.

Reminders

To solve the problems in compilation, we need to perform some configurations before compilation, such as the currently discovered:

  1. Buildroot cannot compile host-heimdal, the issue is that the configuration script of heimdal uses deleted variables, which need to be manually modified. In the buildroot-2024.02.6/package/heimdal/heimdal.mk file, add ac_cv_sys_large_files=1 ac_cv_sys_file_offset_bits=64 to the HOST_HEIMDAL_CONF_ENV variable.

The software source package size is about 468 GB.

The compiled RISC-V binary package size is about 12 GB.

References

  • TinyBPT

Original Address: https://tinylab.org/tinybpt-server-usageTechnical Service: https://tinylab.org/ruma.tech

Click on the Read Original at the bottom left to access external links. Since you’ve read this far, just casually look and share it, right? 😉

Leave a Comment