Feature #1224
closedPort all apps to use installed toolchain.
100%
Description
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
- rpi1
- rpi2 (for rpi2, rpi3)
- rpi4
- 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
Updated by Hammel about 1 month ago
- Blocked by Feature #1225: rundock updates to avoid interactive shell added
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.
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 exampleomxplayerpmsuipiboxwww: supports -P for PiSentrypsplash: supports -T to enable for TFT displayspiconf: supports -S <system> - needs fix to clamp to known valuesironman+www: supports -S <system>ironman+monitorironman+ironmancfglcdshowlibleak
Autoconf builds to port (these do not have -showconfig support in cross.sh)
appmgr: supports -P for PiPlayerlaunchersupports-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
libpiboxpigtkpiboxd-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 PiPlayerpipicspncvideofe-k num Kiosk modes 0: Non-kiosk (normal media center mode) 1: touchscreen kiosk (video picture frame) 2: auto-kiosk (auto-starting, looping videos)musicfepicam: supports -P for PiSentrypixmpinet: supports-S Set the SSID for the node. -x Enable use on Xeon.
ironman+imrestironman+sensorsraspi2fbpistorepistore+pistoreweb- (xeon) pidialer - needs xeon build ported to install toolchain and staging tree.
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.
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)
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.
- The /media/<> shortcut paths were not created. So /media/data is not there.
- This should have happened in firstboot. Rebuild just the dev system to retest that.
- This may have happened because /sbin/ldconfig was missing so firstboot init script died.
- Configuring mjpg-streamer: //etc/opkg/info/mjpg-streamer.postinst: line 4: /sbin/ldconfig: not found
- This should come from the toolchain sysroot: bld/crosstool-ng-1.25.0.bld/install/arm-unknown-linux-gnueabi/sysroot/sbin/ldconfig
- None of the sysroot is in the target tree.
- 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
- Launcher segfaults. This is because /etc/pibox-config is not properly setup.
$ cat /etc/pibox-config 1600x900 NOTOUCH
- 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.
- Installation of xcc-debug fails due to missing /home symlink to /media/data/home.
- These should have been created in firstboot but that probably crashed due to the missing /sbin/ldconfig.
- 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.- 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.
- The template config should have BR2_ROOTFS_OVERLAY="[SKELETON]"
- buildroot.mk:$(BUILDROOT_T)-config should have: @sed -i 's%\[SKELETON\]%'"$(BUILDROOT_SRCDIR)/package/customize/source/"'%g' $(BUILDROOT_SRCDIR)/.config
- buildroot.mk:$(BUILDROOT_T)-preconfig-customize should build /etc/os-version into $(BUILDROOT_SRCDIR)/package/customize/source/etc/os-version
- 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.
Updated by Hammel 19 days ago
Ironman¶
- Launcher is not displaying network or pairing icons (RM #1232).
- The former appears to flash on the screen but then it goes away.
- 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.
- 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.
Updated by Hammel 18 days ago
PiSentry¶
- 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.