mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-22 05:12:16 -05:00
Drop bin/make-uninstall.sh. Diffing its output against FlashForge's own
software component showed it differed in exactly two files -- run.sh (22
appended lines) and the md5sum.list that changed because of it. Everything
doing the actual reverting was FlashForge's. So recovery is simply "flash the
stock package you already have"; the leftover /usr/data/mod payload is inert
once firmwareExe is the genuine binary again.
test/sim-roundtrip.sh now proves that path instead: install the mod, flash the
stock package, assert firmwareExe matches the stock binary byte-for-byte, the
boot scripts are restored, and no stock script references the payload.
That test immediately surfaced a real problem. Packages carry a model gate --
runFirmwareExe.sh has MACHINE=/PID= baked in and refuses to install when they
do not match what app_startup.sh passes from the installed firmware:
Creator5 / 0028
Creator5Pro / 0029
The stock package in use here is the non-Pro build (MACHINE=Creator5), while
the target printer reports "Creator 5 Pro" in general.json. Anything built
from it would be refused by the printer, and it is not a valid recovery image
for a Pro either.
unpack.sh now reports the gate, verify.sh fails on a mismatch against
TARGET_MACHINE in config.env, and the ladder doc leads with checking it.
65 lines
3.1 KiB
Bash
65 lines
3.1 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=c5mod # 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=""
|
|
|
|
# ---- which printer is this for? --------------------------------------------
|
|
# Creator5Pro / 0029 or Creator5 / 0028
|
|
# Find it on the printer: Settings -> About, or in
|
|
# /usr/data/firmwareRes/config/general.json ("machineName").
|
|
#
|
|
# This MUST match the model the stock package was built for. A package's
|
|
# runFirmwareExe.sh carries its own MACHINE=/PID= gate and refuses to install
|
|
# on the other model, so a Pro cannot be recovered or modded with a non-Pro
|
|
# package (and vice versa).
|
|
TARGET_MACHINE=Creator5Pro
|
|
|
|
# ---- 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'
|