mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-26 17:02:20 +08:00
feat(boards/modalai/voxl2): add Debian packaging framework
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>
This commit is contained in:
@@ -207,6 +207,47 @@ for manufacturer in sorted(os.scandir(os.path.join(source_dir, '../boards')), ke
|
||||
if t not in companions
|
||||
]
|
||||
|
||||
# Append _deb targets for boards that have cmake/package.cmake
|
||||
for manufacturer in sorted(os.scandir(os.path.join(source_dir, '../boards')), key=lambda e: e.name):
|
||||
if not manufacturer.is_dir():
|
||||
continue
|
||||
if manufacturer.name in excluded_manufacturers:
|
||||
continue
|
||||
for board in sorted(os.scandir(manufacturer.path), key=lambda e: e.name):
|
||||
if not board.is_dir():
|
||||
continue
|
||||
board_name = manufacturer.name + '_' + board.name
|
||||
if board_name in excluded_boards:
|
||||
continue
|
||||
package_cmake = os.path.join(board.path, 'cmake', 'package.cmake')
|
||||
if os.path.exists(package_cmake):
|
||||
deb_target = board_name + '_deb'
|
||||
if target_filter and not any(deb_target.startswith(f) for f in target_filter):
|
||||
continue
|
||||
# Determine the container and group for this board
|
||||
container = default_container
|
||||
if board_name in board_container_overrides:
|
||||
container = board_container_overrides[board_name]
|
||||
target_entry = {'target': deb_target, 'container': container}
|
||||
if args.group:
|
||||
# Find the group where this board's _default target already lives
|
||||
default_target = board_name + '_default'
|
||||
group = None
|
||||
for g in grouped_targets:
|
||||
targets_in_group = grouped_targets[g].get('manufacturers', {}).get(manufacturer.name, [])
|
||||
if default_target in targets_in_group:
|
||||
group = g
|
||||
break
|
||||
if group is None:
|
||||
group = 'base'
|
||||
target_entry['arch'] = group
|
||||
if group not in grouped_targets:
|
||||
grouped_targets[group] = {'container': container, 'manufacturers': {}}
|
||||
if manufacturer.name not in grouped_targets[group]['manufacturers']:
|
||||
grouped_targets[group]['manufacturers'][manufacturer.name] = []
|
||||
grouped_targets[group]['manufacturers'][manufacturer.name].append(deb_target)
|
||||
build_configs.append(target_entry)
|
||||
|
||||
if(verbose):
|
||||
import pprint
|
||||
print("============================")
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
mkdir artifacts
|
||||
cp **/**/*.px4 artifacts/ 2>/dev/null || true
|
||||
cp **/**/*.elf artifacts/ 2>/dev/null || true
|
||||
cp **/**/*.deb artifacts/ 2>/dev/null || true
|
||||
for build_dir_path in build/*/ ; do
|
||||
build_dir_path=${build_dir_path::${#build_dir_path}-1}
|
||||
build_dir=${build_dir_path#*/}
|
||||
|
||||
Reference in New Issue
Block a user