Project

General

Profile

Actions

Feature #1217

closed

Utilize latest features of Buildroot

Added by Hammel about 2 months ago. Updated 2 days ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
00 - Basic Build Issues
Target version:
Start date:
28 Jul 2025
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

There are a number of items I can use to improve PiBox.

This list will expand over time.
  1. Use a skeleton overlay directory instead of the customize package
  2. Build out of tree
  3. Add make buildroot-pkg-stats
  4. Add make buildroot-show-info
  5. Add make buildroot-graph-depends manual.html#_graphing_the_dependencies_between_packages
  6. Add make buildroot-graph-size
  7. Install toolchain to ~/toolchain/version using deb tools
  8. Install Buildroot staging tree to ~/.cache/pibox for use by package builds.
  9. Build buildroot before kernel - kernel tools often depend on sysroot/rootfs tools
  10. Use squashfs packaging of firmware and userland and add via an overlay setup
  11. Use proper package directories
  12. Use patch directories
  13. Fix rundock to run BASH from the current directory (re: use -w option).
  14. Add -targets to component and top level builds. Use .target to hide targets that shouldn't be called directly.

Related issues

Related to PiBox - Action Item #775: Check if migration to Buildroot recommended customizations is warrantedClosedHammel06 Jul 2020

Actions
Blocks launcher - Bug #1214: Ironman launcher locking up over timeIn ProgressHammel07 May 2025

Actions
Blocks PiBox - Feature #1215: Create a package for libleak and remote loggingClosedHammel12 May 2025

Actions
Actions #1

Updated by Hammel about 2 months ago

  • Related to Feature #1100: Update lightsw registration to match new imrest requirements. added
Actions #2

Updated by Hammel about 2 months ago

  • Related to deleted (Feature #1100: Update lightsw registration to match new imrest requirements.)
Actions #3

Updated by Hammel about 2 months ago

  • Related to Action Item #775: Check if migration to Buildroot recommended customizations is warranted added
Actions #4

Updated by Hammel 25 days ago

  • Severity changed from 03 - Medium to 01 - Critical
Actions #5

Updated by Hammel 24 days ago

  • Description updated (diff)
Actions #6

Updated by Hammel 22 days ago

Buildroot target support

-show-info is implemented and working.
The other new targets have problems:

$ make buildroot-graph-depends
ERROR: The 'dot' program from Graphviz is needed for graph-depends
make[1]: *** [Makefile:881: graph-depends-requirements] Error 1
make: *** [configs/buildroot.mk:258: buildroot-graph-depends] Error 2
$ make buildroot-graph-size
/bin/bash: line 1: mkdir: No such file or directory
make[1]: *** [Makefile:896: graph-size] Error 127
make: *** [configs/buildroot.mk:265: buildroot-graph-size] Error 2
$ make buildroot-pkg-stats
/usr/bin/env: 'python3': No such file or directory
make[1]: *** [Makefile:925: pkg-stats] Error 127
make: *** [configs/buildroot.mk:258: buildroot-pkg-stats] Error 2

It appears these won't work with the version of Buildroot in use currently. I'll probably need to bump the Buildroot version. There are targets in place that are disabled for these features until that is done.

Actions #7

Updated by Hammel 22 days ago

  • Description updated (diff)
Actions #8

Updated by Hammel 21 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Buildroot customize overlay

To use custom skeleton overlays:

  1. Disable System>RootFS Skeleton-
  2. Remove configuration for System>custom target skeleton path-
  3. Add package/customize/skeleton as a path to System>Root filesystem overlay directories-
  4. Update buildroot.mk
    1. rebuild target deletes and recopies skeleton directory (no need to clean up target anymore)
    2. Update -preconfig-customize
    3. Update -preconfig to remove kernel modules (they will be installed as an overlay lowerdir instead)
    4. Update -preconfig to remove gles (they will be installed as an overlay lowerdir instead)

After that's done, we still need these

  1. Generate kernel modules as squashfs for use in overlay
  2. Remove GLES build - it's now handled by Buildroot with rpitools
  3. Add kernel modules squashfs to install script.
  4. Update Busybox init script to mount kernel modules squashfs file and add it to overlay.
  5. Check if CUSTOMSRC is still needed in post-build.sh

Testing

  1. Build old system that way it was for reference
  2. Build new system
  3. Compare files and SD installations
  4. Boot both on hardware (rpi3)

Notes

  • Testing buildroot.mk updates (1-4)
    • libpibox fails because of incorrect use of relative addressing when including "pibox.h" in pbgetdisplay.c. Setting #define PTESTS before including pibox.h fixes the problem.
    • libpibox fails because libpibox.mk in Buildroot package copies pbgetdisplay, but the build isn't generating it.
  • Bumping to 2015.05.01
    • glib2 build fails due to odd include path:
      • /home/mjhammel/src/ximba/raspberrypi3/src/../bld/buildroot-2025.05.1.bld/staging/arm-buildroot-linux-gnueabihf/sysroot/home/mjhammel/src/ximba/raspberrypi3/src/../bld/buildroot-2025.05.1.bld/staging/arm-buildroot-linux-gnueabihf/sysroot/home/mjhammel/src/ximba/raspberrypi3/src/../bld/buildroot-2025.05.1.bld/staging/arm-buildroot-linux-gnueabihf/sysroot/usr/include
Actions #9

Updated by Hammel 21 days ago

Building out of tree

O=$(BUILDROOT_BLDDIR)

will require changing all

$(BUILDROOT_SRCDIR)/output

to

$(BUILDROOT_BLDDIR)/output
Actions #10

Updated by Hammel 18 days ago

  • Blocks Bug #1214: Ironman launcher locking up over time added
Actions #11

Updated by Hammel 18 days ago

  • Related to Feature #1215: Create a package for libleak and remote logging added
Actions #12

Updated by Hammel 18 days ago

  • Related to deleted (Feature #1215: Create a package for libleak and remote logging)
Actions #13

Updated by Hammel 18 days ago

  • Blocked by Feature #1215: Create a package for libleak and remote logging added
Actions #14

Updated by Hammel 17 days ago

Kernel modules packaging

This might need to be split into modules and firmware to make it easier to upgrade.

  1. kernel.cfg:
    1. KERNEL_BLDDIR = $(BLDDIR)/$(KERNEL_VERSION).bld
    2. KERNEL_MODULES_PKG = modules.squashfs
  2. mkdir -p $(KERNEL_BLDDIR)/
  3. kernel-pkg:
    1. rsync -a $(KERNEL_SRCDIR)/modules/ $(BLDDIR)/$(KERNEL_VERSION).bld
    2. sudo mksquashfs $(KERNEL_BLDDIR)/ $(PKGDIR)/$(KERNEL_MODULES_PKG) -comp xz -noappend -all-root
Actions #15

Updated by Hammel 17 days ago

GLES

This is actually the rpitools that buildroot now generates. But it was a subset of that. The rpitools that was in buildroot.mk was the rest of it. The rpitools in Buildroot proper builds all of it.

That means that both the buildroot.mk:buildroot-rpitools target and the gles.cfg/gles.mk can go away now.

The rpifirmware.cfg/rpifirmware.mk are the files that go into /boot/firmware. That should stay as it is.

Update

GLES is disabled in config.mk, but .cfg/.mk files have not been deleted yet.

Actions #16

Updated by Hammel 17 days ago

  • Description updated (diff)

Installing toolchain

  • Package as .deb
    • Current packaging just includes the toolchain/bin. It needs to include all of blddir/crosstool.bld/install, sans he build.log.
  • Install to ${HOME}/.pibox/$(hw)/toolchain (re: XCC_INSTALL_DIR)
    • Include uninstall support
    • Include show installed support
  • Default PiBox builds to use installed toolchain instead of local build.
    • Do this in xcc.cfg by setting the XCC_PREFIXDIR using overrides, in this order
      • Initialize to XCC_INSTALL_DIR
      • If XCC_DIR is set, use a local build ($(XCC_BLDDIR)/install)
      • If XI is set, use that
  • Default component builds continue to use XCC_PREFIXDIR.
  • Apps will use the following, in this order of precedence
    • Default to ~/.pibox/$(HW)/toolchain (requires setting -b <rpi|rpi2|rpi4|xeon> (re: board to reference HW) option in cross.sh or BOARD= in environment for GNU Make)
    • XI if set in the environment
    • the -t option if set

This is probably where I should make apps build via the shared docker image but I'll leave that for a separate issue.

Actions #17

Updated by Hammel 17 days ago

Installing Buildroot

This is simply installing the staging tree to ~/.pibox/<HW>/squashfs. App builds will mount this and point their sysroot settings at it. For now, they simply set their -s <staging> to point to the mount point.

Actions #18

Updated by Hammel 17 days ago

Package and Patch directories

These are not necessary currently. The packages added by PiBox are correctly added by Buildroot standards. The patches applied by PiBox are to Buildroot files, not patches to packages managed by Buildroot. The latter would use the patch directories suggested by this task.

So this can be marked done too.

Actions #19

Updated by Hammel 16 days ago

  • Description updated (diff)
Actions #20

Updated by Hammel 11 days ago

  • Description updated (diff)
Actions #21

Updated by Hammel 11 days ago

  • Description updated (diff)
Actions #22

Updated by Hammel 11 days ago

  • Blocked by deleted (Feature #1215: Create a package for libleak and remote logging)
Actions #23

Updated by Hammel 11 days ago

  • Blocks Feature #1215: Create a package for libleak and remote logging added
Actions #24

Updated by Hammel 11 days ago

  • % Done changed from 10 to 70
Actions #25

Updated by Hammel 10 days ago

  • Description updated (diff)
Actions #26

Updated by Hammel 7 days ago

  • Description updated (diff)
Actions #27

Updated by Hammel 7 days ago

  • Description updated (diff)
Actions #28

Updated by Hammel 7 days ago

  • % Done changed from 70 to 90

One last full test build, then test on hardware, before closing this issue.
Build is in progress.

After this test the toolchain can be removed from the pkg target. It should be built on it's own and installed manually before the pkg target is run.

Actions #29

Updated by Hammel 5 days ago

Build completed but only after fixing toolchain to properly use build directories during build and not the install directories during the build.
Also, removed toolchain from pkg meta target. Toolchains must now be built and installed separately from the rest of PiBox.

Still requires a test on target hardware.

Actions #30

Updated by Hammel 2 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

All items are now covered. Code is build tested and build artifacts tested on hardware.
Code is committed and pushed.

Closing issue.

Actions

Also available in: Atom PDF