Project

General

Profile

Actions

Feature #1224

closed

Port all apps to use installed toolchain.

Added by Hammel about 1 month ago. Updated 15 days ago.

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

100%

Estimated time:
Severity:
01 - Critical

Description

This just means that the "-t" option or the TC variable should default to the installation directory for the toolchain.
However, we need to know which hardware we're building for, so all cross.sh need a -b (for "board") option added that can be one of
  1. rpi1
  2. rpi2 (for rpi2, rpi3)
  3. rpi4
  4. xeon

It might be worthwhile to add common code to a sourced script in the toolchain tree. Then all the cross.sh could do "source <toolchain>/common.sh" and Makefiles could include <toolchain>/common. Or these could go in the higher level ~/.pibox, since these would be board inspecific common bits.


Related issues

Blocked by PiBox - Feature #1225: rundock updates to avoid interactive shellClosedHammel14 Sep 2025

Actions
Actions #1

Updated by Hammel about 1 month ago

  • Blocked by Feature #1225: rundock updates to avoid interactive shell added
Actions #2

Updated by Hammel about 1 month ago

  • % Done changed from 0 to 20

Support for GNU Make builds has been added with the app-defs.mk installation via the xcc-install target. That file can be included in config.mk for GNU Make based builds. See libleak for an example. The use of this can greatly simplify the GNU Make based builds.

Support for autoconf based builds is in development. It isn't clear if the app-defs.mk can be integrated into the .am files or if a shell script will need to be created that slurps it in an parses it into something cross.sh can utilize.

Actions #3

Updated by Hammel about 1 month ago

  • Status changed from New to In Progress
Actions #4

Updated by Hammel about 1 month ago

There are now two template implementations for using the new installed toolchain and staging tree.
libleak shows how to use them with GNU Make based builds.
picam shows to use them with autoconf based builds.
The set of builds to port to each example are taken from the metabuild configurations.

GNU Make builds to port (these support -showconfig in cross.sh)

  • mjpg-streamer : cmake example
  • omxplayer
  • pmsui
  • piboxwww : supports -P for PiSentry
  • psplash : supports -T to enable for TFT displays
  • piconf : supports -S <system> - needs fix to clamp to known values
  • ironman+www : supports -S <system>
  • ironman+monitor
  • ironman+ironmancfg
  • lcdshow
  • libleak

Autoconf builds to port (these do not have -showconfig support in cross.sh)

  • appmgr : supports -P for PiPlayer
  • launcher supports
    -f             Force use of colored icons
    -k             Make a kiosk launcher
    -p             Make a piplayer launcher
    -P             Make a piplayer launcher but add terminal app
    -s             Show the config used to run the build.
    -T             Install test configs with app
    -x             Make a xeon launcher
    
  • libpibox
  • pigtk
  • piboxd
    -a             If set, then package for AutoKiosk System.
    -p             If set, then package for PiPlayer System.
    -S             If set, then package for PiSentry System.
    -x             If set, then package for Xeon System.
    
  • piclock : supports -P for PiPlayer
  • pipics
  • pnc
  • videofe
    -k num         Kiosk modes
                   0: Non-kiosk (normal media center mode)
                   1: touchscreen kiosk (video picture frame)
                   2: auto-kiosk (auto-starting, looping videos)
    
  • musicfe
  • picam : supports -P for PiSentry
  • pixm
  • pinet : supports
    -S             Set the SSID for the node.
    -x             Enable use on Xeon.
    
  • ironman+imrest
  • ironman+sensors
  • raspi2fb
  • pistore
  • pistore+pistoreweb
  • (xeon) pidialer - needs xeon build ported to install toolchain and staging tree.
After these are done, the metabuilds need to be updated to support the changed build processes, specifically by using cross.sh on all apps.
Then the various sandboxes need to be updated, rebuilt and installed.
Then the metabuilds for apps needs to be tested against each board type. A -b option for boards needs to be added, which will also determine which Systems are meaningful to the build.
  • rpi1
    • Player
    • Kiosk
    • AutoKiosk
  • rpi2
    • autokiosk
    • ironman
    • kiosk
    • media
    • pisentry
    • pistore
    • player
  • rpi4
    • media
    • pisentry
  • xeon

Finally, the new builds + apps need to be tested on hardware.

RM #1224: Migrated to app-defs.mk + docker + cross.sh usage.
RM #1224: Disable AC features of app-defs.mk.

Build:
./cross.sh -b rpi2
./cross.sh -s -b rpi2
./cross.sh -d -b rpi2
./cross.sh -b rpi -t "clobber app-init"
./cross.sh -c

Other options are app specific, such as -T or -S.

Actions #5

Updated by Hammel about 1 month ago

cmake programs need to be told where the toolchain stuff is.

First, take a look at these examples and this explanation. The latter gives an example that could be turned into a template under $(HOME)/.pibox. The app-defs.mk can copy this to the top of the build directory and replace tags with build specifics, like the toolchain and staging tree locations based on select board for the build. Then cmake builds can references it

-DCMAKE_TOOLCHAIN_FILE=$(stage)/$1/toolchain.cmake

But this doesn't actually set the pkg-config stuff, just the toolchain stuff.

If it can be set in the environment and used by cmake, try this.

    PKG_CONFIG_LIBDIR=${STAGING_DIR}/usr/lib/pkgconfig:${STAGING_DIR}/usr/share/pkgconfig
    PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR

Alternatively, try modifying this and passing it as

-DCMAKE_TOOLCHAIN_FILE=$(stage)/$1/toolchain.cmake
string(REPLACE "/share/cmake" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSROOT ${RELOCATED_HOST_DIR}/sysroot)
set(CMAKE_FIND_ROOT_PATH ${RELOCATED_HOST_DIR}/sysroot)
set(CMAKE_PROGRAM_PATH ${RELOCATED_HOST_DIR}/../tools/bin)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_C_COMPILER aarch64-qsys-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-qsys-linux-gnu-g++)
set(PKG_CONFIG_EXECUTABLE aarch64-qsys-linux-gnu-pkg-config)
Actions #6

Updated by Hammel 21 days ago

All system builds via metabuild are complete and ready for testing.

Media System Test

This failed because launcher failed.

  1. The /media/<> shortcut paths were not created. So /media/data is not there.
    1. This should have happened in firstboot. Rebuild just the dev system to retest that.
    2. This may have happened because /sbin/ldconfig was missing so firstboot init script died.
  2. Configuring mjpg-streamer: //etc/opkg/info/mjpg-streamer.postinst: line 4: /sbin/ldconfig: not found
    1. This should come from the toolchain sysroot: bld/crosstool-ng-1.25.0.bld/install/arm-unknown-linux-gnueabi/sysroot/sbin/ldconfig
    2. None of the sysroot is in the target tree.
    3. This is due to commit #23053e21b42, where the following line was removed from preconfig-customize :
      -       @rsync -ar $(XCC_PREFIXDIR)/$(XCC_PREFIX)/sysroot/* $(BUILDROOT_SRCDIR)/package/customize/source
      
  3. Launcher segfaults. This is because /etc/pibox-config is not properly setup.
    $ cat /etc/pibox-config 
    
    1600x900
    NOTOUCH
    
    1. This probably happens because the functions script expects tvservice to be in /opt/vc/bin but since the RPi Userland is now handled by Buildroot it's actually in /usr/bin.
  4. Installation of xcc-debug fails due to missing /home symlink to /media/data/home.
    1. These should have been created in firstboot but that probably crashed due to the missing /sbin/ldconfig.
  5. References to /opt/vc also include hello_pi/hello_font in the firstboot script because it includes Vera.ttf. This file can be added to pmsui:src/fonts/pibox and then the reference in the firstboot script can be removed.

Update

Fixes applied to dev platform build. Need to retest against a vanilla dev platform before retrying with Media System.

Update 2

Still not working.
  1. configs/buildroot.mk is not setting BR2_ROOTFS_OVERLAY to the skeleton tree. This causes the skeleton tree to not get added to the final target image, so ldconfig and the sysroot are still missing.
    1. The template config should have BR2_ROOTFS_OVERLAY="[SKELETON]"
    2. buildroot.mk:$(BUILDROOT_T)-config should have: @sed -i 's%\[SKELETON\]%'"$(BUILDROOT_SRCDIR)/package/customize/source/"'%g' $(BUILDROOT_SRCDIR)/.config
    3. buildroot.mk:$(BUILDROOT_T)-preconfig-customize should build /etc/os-version into $(BUILDROOT_SRCDIR)/package/customize/source/etc/os-version
    4. buildroot.mk:$(BUILDROOT_T)-saveconfig should have: @sed -i 's%BR2_ROOTFS_OVERLAY=.*%BR2_ROOTFS_OVERLAY="\[SKELETON\]"%g' $(BUILDROOT_CONFIG)

Update 3

Dev platform worked fine after making these fixes. Installed media player. All apps worked as expected except for some unrelated (not associated with the switch to the new build processes) bugs in VideoFE.

Actions #7

Updated by Hammel 21 days ago

  • % Done changed from 20 to 40
Actions #8

Updated by Hammel 19 days ago

AutoKiosk

Works exactly as it should.

Actions #9

Updated by Hammel 19 days ago

Ironman

  1. Launcher is not displaying network or pairing icons (RM #1232).
    1. The former appears to flash on the screen but then it goes away.
    2. On boot, the network icon is red (not wifi enabled) and the pairing icon is not displayed. The network icon is cleared when the time bar is displayed.
    3. This is probably a launcher bug for Ironman, but I need to check that the launcher build is correct for Ironman when done via metabuild.

Update

Verified that the build is the same before and after this update. It may be a bug in launcher but I've not identified what it might be just via inspection. It might be that the text needs to be done first because it translates the cairo_t* which might be moving the icons off screen.

So try drawing the text for time/date first, then do the icons for apps and network.

Actions #10

Updated by Hammel 18 days ago

  • % Done changed from 40 to 50

Kiosk

  1. Touchscreen is not responding for pipics but is working for launcher and videofe. The build appears correct. This would be a new bug (RM #1234).
Actions #11

Updated by Hammel 18 days ago

PiSentry

  1. picam doesn't appear to be working. mjpg-streamer starts and I can view video from it with mpv on my desktop. But it looks like the display resolution is too large for the pisentry tft. It should be 480x320.
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: starting application
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: MJPG Streamer Version.: 2.0
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: Using V4L2 device.: /dev/video0
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: Desired Resolution: 1280 x 1024
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: Frames Per Second.: 33
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: Format............: JPEG
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: TV-Norm...........: DEFAULT
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: www-folder-path......: disabled
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: HTTP TCP port........: 9090
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: HTTP Listen Address..: (null)
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: username:password....: disabled
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: commands.............: enabled
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: starting input plugin input_uvc.so
    Oct 12 22:33:17 (none) user.info MJPG-streamer [1423]: starting output plugin: output_http.so (ID: 00)
    

The running process for mjpg-streamer shows this command line.

mjpg_streamer -i input_uvc.so -d /dev/video0 -r SXGA -f 33 -o output_http.so -p 9090

Build looks okay, I think, but need to make sure PISENTRY env var is being set correctly when building.

Update

Looks like raspi2fb didn't get built with metabuild, but it didn't error out either. The reason it didn't build was because the cdtools function didn't do a recursive submodule checkout of the updated app build.

Update 2

Adding raspi2fb package fixed the problem. PiSentry is working again.

Actions #12

Updated by Hammel 15 days ago

PiStore

  1. Also missing an app: pistore. Also not build because the cdtools function was not updated to use recursive git checkout.

Update

Fixed the build and PiStore works fine.

Actions #13

Updated by Hammel 15 days ago

  • % Done changed from 50 to 90

PiPlayer

Worked fine with no additional changes.

Actions #14

Updated by Hammel 15 days ago

  • % Done changed from 90 to 100

While the builds are not tested on Pi1, Pi4 or Xeon yet, I feel that new build method of installing the toolchain and staging trees works fine.

This issue can be closed.

Actions #15

Updated by Hammel 15 days ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF