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.
54 lines
2.6 KiB
Bash
54 lines
2.6 KiB
Bash
# creator5-fw-builder — build configuration
|
|
# Edit paths to match your machine, then run ./build.sh
|
|
|
|
# ---- identity of the package you are building -------------------------------
|
|
MOD_NAME=anvil # goes into the .tgz filename
|
|
MOD_VER=1.0.0 # your mod version
|
|
|
|
# Version stamped on the software component. Empty = keep the stock number
|
|
# (recommended). The installer wipes every other version dir before renaming
|
|
# its temp dir, so a collision is not a problem; a suffix like 1.9.7-mod is
|
|
# only useful if you want to see at a glance that a machine is modded.
|
|
SW_VER=""
|
|
|
|
# ---- inputs (sources you already have on this machine) ----------------------
|
|
DESKTOP="$HOME/Desktop"
|
|
|
|
# Stock OTA package (encrypted). Used for start.img/end.img/play.
|
|
STOCK_TGZ="$DESKTOP/Creator5-1.9.7-1.2.9-20260810/Creator5-1.9.7-1.2.9-20260810"
|
|
|
|
# Extracted stock software component -- the BASE our overlay is applied onto.
|
|
STOCK_SOFTWARE="$DESKTOP/software-1.9.8.tar_2026-08-21_7045c47d__md5-8e12dbbd961f0821bd7895f902563238/software-1.9.8"
|
|
|
|
# Your Klipper fork (branch creator5) -- klippy tree + prebuilt MIPS c_helper.so
|
|
KLIPPER_FORK="$DESKTOP/klipper"
|
|
|
|
# Toolchanger mod repo (klippy-extras + configs + helixscreen db entry)
|
|
TOOLCHANGE="$DESKTOP/creator5-toolchange"
|
|
|
|
# HelixScreen release tarball for the Creator 5 (MIPS static)
|
|
HELIX_TGZ="$DESKTOP/helixscreen-creator5-v0.99.115.tar.gz"
|
|
|
|
# Optional extras -- leave empty to skip that feature
|
|
MAINSAIL_ZIP="$PWD/assets/mainsail.zip" # scripts/fetch-mainsail.sh writes vendor/mainsail.zip
|
|
BUSYBOX_BIN="$DESKTOP/creator5/busybox" # optional richer busybox
|
|
|
|
# ---- what the installed image does at boot (defaults baked into mod.conf) --
|
|
MOD_UI=stock # stock | helix -- which UI owns the screen
|
|
MOD_KLIPPER=fork # stock | fork -- which klippy tree runs
|
|
MOD_WEB=1 # 1 = start nginx (Mainsail) + moonraker
|
|
MOD_SSH=1 # 1 = start dropbear on port 22
|
|
MOD_TOOLCHANGE=1 # 1 = install ff_* extras and configs
|
|
|
|
# ---- root login shipped in the image ---------------------------------------
|
|
# This is the whole "enable ssh" feature. The stock rootfs already runs
|
|
# dropbear from /etc/init.d/S50dropbear, so port 22 is ALREADY open on a
|
|
# stock printer -- there is simply no published root password.
|
|
#
|
|
# Empty = keep FlashForge's stock hash (nobody can log in).
|
|
# Generate one with: openssl passwd -6 'yourpassword'
|
|
ROOT_PW_HASH=""
|
|
|
|
# ---- crypto (from /usr/prog/bin/unTar on the printer) -----------------------
|
|
FF_KEY='FFP0331&*%root'
|