mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-21 21:02:16 -05:00
Builds a modified FlashForge update package that the printer installs by itself from a USB stick, reusing FlashForge's own updater rather than a parallel one. Integration is a single file: /usr/prog/PROGRAM/software/firmwareExe is replaced with a shell script. Everything funnels through that binary, so app_startup.sh, rcS and the init chain stay completely stock. The genuine binary is kept as firmwareExe.stock and remains the default UI. Key findings from the stock firmware, each enforced by a test: - components named *.tar.xz are PLAIN tar; the installer runs bare `tar -xvf` - the .tgz is DES3-encrypted plain tar, not gzip - nothing in init starts Klipper -- firmwareExe runs start.sh, so replacing the UI without S70klipper leaves a printer that cannot move - the installer wipes the software dir before run.sh, so an uninstall package must ship the genuine firmwareExe rather than back one up - ssh already works: stock ships dropbear + an enabled S50dropbear, only the root password is missing Brick-safety is designed in, not bolted on: a five-rung profile ladder starting with a probe that changes nothing, a container-based simulation that actually runs the installer and asserts the printer would still boot, an uninstall round-trip test, and a SAFE-MODE latch for UI crash loops. 75 checks pass. Not yet run on hardware.
64 lines
2.1 KiB
YAML
64 lines
2.1 KiB
YAML
name: ci
|
|
|
|
# The stock FlashForge firmware is proprietary and ~93MB, so it is never in
|
|
# the repo. Every job below runs against a synthetic fixture that reproduces
|
|
# the package STRUCTURE (see test/fixtures/make-stock-fixture.sh), which is
|
|
# enough to exercise the entire pipeline and every brick-safety check.
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
openssl xz-utils unzip binutils file squashfs-tools
|
|
|
|
- name: Shell syntax + brick-risk lint
|
|
run: |
|
|
for f in bin/*.sh payload/*.sh payload/init.d/S* test/*.sh test/fixtures/*.sh; do
|
|
[ -f "$f" ] || continue
|
|
sh -n "$f" || bash -n "$f" || { echo "syntax error in $f"; exit 1; }
|
|
done
|
|
./test/lint-danger.sh payload payload/init.d
|
|
|
|
- name: shellcheck
|
|
run: |
|
|
sudo apt-get install -y shellcheck
|
|
# payload scripts run under busybox ash on the printer
|
|
shellcheck -s sh -S warning payload/*.sh payload/init.d/S* payload/firmwareExe || true
|
|
shellcheck -s bash -S error bin/*.sh || true
|
|
|
|
- name: Full test suite (fixture-based)
|
|
run: ./test/run-tests.sh
|
|
|
|
- name: Upload built fixture packages
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: fixture-packages
|
|
path: work/out/*.tgz
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
|
|
abi:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install qemu-user-static + binutils
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends qemu-user-static binutils file
|
|
- name: MIPS ABI checks
|
|
# Skips cleanly when no MIPS binaries are present (they are build
|
|
# artifacts and are never committed).
|
|
run: ./test/test-abi.sh
|