mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-23 10:03:41 +08:00
Add a scalable .deb packaging framework for VOXL2, built on the existing cmake/package.cmake CPack infrastructure. The framework handles multi-processor boards by having the POSIX (_default) build own the .deb and pull in the companion SLPI build's artifacts. Board-specific files: - cmake/package.cmake: CPack variable overrides (name, deps, version) - cmake/install.cmake: install() rules for all .deb contents - debian/postinst: px4-* symlinks, DSP signature, directory setup - debian/prerm: service stop, symlink cleanup - debian/voxl-px4.service: systemd unit (after sscrpcd) Infrastructure changes: - cmake/package.cmake: hook for board-specific CPack overrides - platforms/posix/CMakeLists.txt: hook for board install.cmake - Makefile: %_deb pattern rule (build _default, then cpack -G DEB) - CI: auto-discover _deb targets, collect .deb artifacts, upload to GitHub Releases Future boards: add cmake/package.cmake + cmake/install.cmake and CI discovers it automatically. No new file formats or tools needed. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
37 lines
1.2 KiB
Bash
Executable File
37 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Create px4-* symlinks from px4-alias.sh
|
|
# The alias format is: alias <module>='px4-<module> --instance $px4_instance'
|
|
# We extract the px4-<module> command name and symlink it to the px4 binary
|
|
if [ -f /usr/bin/px4-alias.sh ]; then
|
|
grep "^alias " /usr/bin/px4-alias.sh | \
|
|
sed -n "s/.*'\(px4-[a-zA-Z0-9_]*\).*/\1/p" | while read cmd; do
|
|
ln -sf px4 "/usr/bin/${cmd}"
|
|
done
|
|
fi
|
|
|
|
# Detect platform and generate DSP test signature if needed
|
|
if ! /bin/ls /usr/lib/rfsa/adsp/testsig-*.so &> /dev/null; then
|
|
echo "[INFO] Generating DSP test signature..."
|
|
if [ -f /share/modalai/qcs6490-slpi-test-sig/generate-test-sig.sh ]; then
|
|
/share/modalai/qcs6490-slpi-test-sig/generate-test-sig.sh || true
|
|
elif [ -f /share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh ]; then
|
|
/share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh || true
|
|
else
|
|
echo "[WARNING] Could not find DSP signature generation script"
|
|
fi
|
|
fi
|
|
|
|
# Create required data directories
|
|
mkdir -p /data/px4/param
|
|
mkdir -p /data/px4/etc/extras
|
|
chown -R root:root /data/px4
|
|
|
|
# Reload systemd if available
|
|
if command -v systemctl > /dev/null 2>&1; then
|
|
systemctl daemon-reload
|
|
fi
|
|
|
|
echo "voxl-px4 installed successfully"
|