diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a248526b521..22ed6297ec5 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -55,7 +55,6 @@ jobs: name: IO Firmware Up To Date runs-on: [runs-on,runner=2cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache] container: - # keep in sync with the image named in the warning below image: ghcr.io/px4/px4-dev:v1.17.0-rc2 steps: - uses: runs-on/action@v2 @@ -65,29 +64,10 @@ jobs: - name: Configure Git Safe Directory run: git config --system --add safe.directory '*' - - name: Build px4io firmware + - name: Build and compare px4io firmware env: PX4_SBOM_DISABLE: 1 - run: make px4io_update - - - name: Compare with committed binaries - env: - PX4_SBOM_DISABLE: 1 - run: | - if ! make check_px4io; then - image="ghcr.io/px4/px4-dev:v1.17.0-rc2" - echo "::error title=px4io firmware out of date::The committed px4io firmware does not match the current sources. Regenerate it with: PX4_DOCKER_REPO=${image} ./Tools/docker_run.sh 'make px4io_update'" - { - echo "### px4io firmware out of date" - echo - echo "The committed px4io firmware does not match what the current sources build to. Regenerate and commit it:" - echo - echo '```' - echo "PX4_DOCKER_REPO=${image} ./Tools/docker_run.sh 'make px4io_update'" - echo '```' - } >> "$GITHUB_STEP_SUMMARY" - exit 1 - fi + run: make check_px4io tests: name: Unit Tests diff --git a/Makefile b/Makefile index c5d03b9cfba..5f738a4c5f6 100644 --- a/Makefile +++ b/Makefile @@ -340,19 +340,20 @@ uorb_graphs: # toolchain, so regenerate it in the px4-dev image used by the check_px4io CI job # (.github/workflows/checks.yml): # PX4_DOCKER_REPO= ./Tools/docker_run.sh 'make px4io_update' -.PHONY: px4io_update check_px4io -PX4IO_FIRMWARE_BINS := \ - boards/px4/io-v2/extras/px4_io-v2_default.bin \ - boards/cubepilot/io-v2/extras/cubepilot_io-v2_default.bin +.PHONY: px4io_build px4io_update check_px4io -px4io_update: +px4io_build: @$(MAKE) --no-print-directory px4_io-v2_default @$(MAKE) --no-print-directory cubepilot_io-v2_default + +px4io_update: px4io_build cp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/io-v2/extras/ cp build/cubepilot_io-v2_default/cubepilot_io-v2_default.bin boards/cubepilot/io-v2/extras/ -check_px4io: px4io_update - @git diff --exit-code --stat -- $(PX4IO_FIRMWARE_BINS) \ +# compares without touching the committed binaries +check_px4io: px4io_build + @cmp build/px4_io-v2_default/px4_io-v2_default.bin boards/px4/io-v2/extras/px4_io-v2_default.bin \ + && cmp build/cubepilot_io-v2_default/cubepilot_io-v2_default.bin boards/cubepilot/io-v2/extras/cubepilot_io-v2_default.bin \ || { echo "px4io firmware is out of date, regenerate it with 'make px4io_update' (see Makefile)"; exit 1; } bootloaders_update: \ diff --git a/ROMFS/CMakeLists.txt b/ROMFS/CMakeLists.txt index 0a2a870a77c..aac70d7e180 100644 --- a/ROMFS/CMakeLists.txt +++ b/ROMFS/CMakeLists.txt @@ -296,6 +296,11 @@ foreach(board_extra_file ${OPTIONAL_BOARD_EXTRAS}) # remove bootloader from extras list(REMOVE_ITEM OPTIONAL_BOARD_EXTRAS ${board_extra_file}) endif() + elseif(${extra_file_base_name} MATCHES "_io-v[0-9]+_default\\.bin$") + # px4io firmware is no longer kept per board, see CONFIG_BOARD_IO below + file(RELATIVE_PATH extra_file_relative_source ${PX4_SOURCE_DIR} ${board_extra_file}) + message(FATAL_ERROR "Delete ${extra_file_relative_source}: the px4io firmware is now taken from " + "boards///extras/ via CONFIG_BOARD_IO and must not be kept per board.") endif() endforeach()