Files
firmware/mkdocs.yml
T
Oleksandr ShyshatskyiandClaude Opus 5 ebc3d60c58 Put back the one file a stock flash cannot
A printer flashed back to stock came up with the FlashForge screen and no
Klipper behind it, and stayed that way however many times the stock package
was flashed. The .cfg files were the obvious suspect and are not the fault:
stock's run.sh does `cp $WORK_DIR/klipper/config/* /usr/data/config/ -rf`, and
the printer's busybox unlinks a dangling symlink rather than writing through
it, so printer.base.cfg and the seven beside it come back on every stock
flash. The ff-*.cfg links left behind resolve to nothing and are included by
nothing. Even the SAVE_CONFIG block our Klipper wrote into printer.cfg is
harmless -- configfile.py marks every autosave section valid through
access_tracking, so `[ff_tool 0]` there is not a config error on a stock
klippy. All three were put to the printer's own binaries in the replica.

What survives is /usr/prog/klipper/klipperDaemon. Every release links it at
the mod, whose `start` does nothing on purpose -- klippy is an s6-rc longrun
and a second unsupervised one would fight it for /dev/ttyS4 -- and the stock
package has no klipperDaemon to copy over it: not in the software component,
not in its md5sum.list, no line in run.sh. Stock's start.sh ends in
`klipperDaemon start`, so the UI starts and klippy never does.

installer/recovery.sh is the repair, packed by bin/pack-recovery.sh into a
.tgz that carries no mod at all: FlashForge's own klipperDaemon, taken off a
factory /usr/prog and gated on its md5, and their Klipper configs out of the
stock package the build reads. It sweeps FlashForge's config directory by
shape rather than by a list of names -- a symlink into $MODDIR there can only
be ours -- refuses to run while the mod is still the firmware, and never
touches printer.cfg, which no package has a copy of to put back. Output goes
to work/recovery/: bin/pack.sh wipes work/out, and the replica lane installs
the newest .tgz there as the mod under test.

qa/replica/test_recovery.py holds the whole story against a real machine: the
link the mod leaves, the busybox cp, the refusal, `klipperDaemon start`
leaving no pid file, then the same command forking a real klippy once the file
is back.

Publishing lives in Klipper4FlashForge/stock-recovery, which checks this repo
out and releases there, so a repair for owners of old releases is not buried
among firmware releases they must not flash to get it.

Two things found on the way, both in the harness rather than the mod:

seed-prog.sh appended USER-CONFIG-MUST-SURVIVE as a plain comment after the
SAVE_CONFIG header, and Klipper drops the entire autosave block on the first
line there that does not start with '#*#'. Every replica ran with klippy
seeing none of the machine's saved PID, shaper, mesh or probe values, and
failing on an unrelated-looking missing option. It is written inside the block
now, an older image's copy is repaired in place, and test_install.py asserts
the invariant.

installed_image() keyed its cache on the package md5 alone, so a rebuilt
PRINTER_IMAGE silently handed back a bake from the old base -- which made the
fix above read as ineffective twice before the cache was the suspect. The tag
mixes in the base image id now, and build-printer-image.sh takes IMAGE_TAG so
a rebuilt image can be published without moving a tag ci.yml pins.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hdzEqXuFcY4xXALGPbBFV
2026-09-07 20:47:04 +03:00

128 lines
5.2 KiB
YAML

# The docs are built from this repo, not a wiki, so a page and the code it
# describes move in the same commit and the same review. CI builds this with
# --strict (see .github/workflows/ci.yml): a cross-link that stops resolving
# fails the build rather than rotting in place.
site_name: Reforge
site_description: >-
Custom firmware for the FlashForge Creator 5 and Creator 5 Pro.
site_url: https://reforge.readthedocs.io/
repo_url: https://github.com/Klipper4FlashForge/firmware
repo_name: Klipper4FlashForge/firmware
edit_uri: edit/master/docs/
theme:
name: material
features:
- navigation.sections # the public/contributor split, always visible
- navigation.indexes # a section can have a page of its own
- navigation.top
- content.code.copy
- search.suggest
- toc.follow
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/weather-night
name: Dark
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-sunny
name: Light
markdown_extensions:
- admonition
- attr_list
- md_in_html # the <img> pairs in README.md and toolchange.md
- tables
- toc:
permalink: true
# GitHub's heading slugs, so an anchor written for the repo view --
# `#runout--clog` for `## Runout / clog` -- resolves on the site too.
slugify: !!python/object/apply:pymdownx.slugs.slugify {kwds: {case: lower}}
- pymdownx.details
- pymdownx.superfences
# The status checkboxes on the front page, and the checklists in
# is-this-for-you.md and first-print.md.
- pymdownx.tasklist:
custom_checkbox: true
# docs/index.md is generated from README.md at build time; see the hook.
hooks:
- hooks/mkdocs_readme.py
# Release notes are published on the Releases page, which is where the README
# sends people. They are built but stay out of the nav rather than growing it
# by one entry per tag.
not_in_nav: |
releases/*
printing.md
upgrading.md
# Three audiences, and a reader should never fall from one into the next: the
# printer's owner, someone who knows Klipper and wants to change what the
# machine does, and someone building or testing the firmware. What belongs in
# each is .claude/skills/reforge-docs/SKILL.md.
nav:
- Home: index.md
# Ordered by what the reader is doing, not by subsystem: someone whose
# printer will not boot should not have to know which subsystem owns the
# symptom table.
- Using Reforge:
- Is this for you: is-this-for-you.md
- Installing: installing.md
- Feature list: features.md
- Your first print: first-print.md
- Calibration:
- Read first: calibration-overview.md
- XYZ tool calibration: calibration.md
- Bed mesh: bed-mesh.md
- Pressure advance: pressure-advance.md
- VFA calibration: vfa-calibration.md
- Support: support.md
- Going back to stock: going-back-to-stock.md
- Known issues: known-issues.md
- Versions: versions.md
# Past the manual, short of the build system: how the machine behaves and
# how to change it, for someone who already knows Klipper.
- For experienced users:
- How a print runs: how-a-print-runs.md
- How calibration works: how-calibration-works.md
# Not yet redesigned -- these are the pages as they stand, regrouped.
- For contributors:
- Building packages: building.md
- Testing: testing.md
- The qa suite, and what it replaces: qa-migration.md
- The printer replica: printer-replica.md
- Validating a build on hardware: hardware-testing.md
- How it works: how-it-works.md
- Internals:
- The toolchanger mod: toolchange.md
- The print pipeline: print-pipeline.md
- Error code table: notes/70-error-codes.md
- Overview: notes/00-overview.md
- Hardware and MCU topology: notes/10-hardware.md
- The FlashForge Klipper fork: notes/20-klipper-fork.md
- firmwareExe vs Klipper: notes/25-app-vs-klipper-ownership.md
- Toolchange sequences: notes/30-toolchange.md
- Offsets and per-unit config: notes/40-offsets.md
- VFA calibration: notes/44-vfa-calibration.md
- Offset calibration, the port: notes/45-tool-offset-calibration.md
- Offset calibration, recovered: notes/46-offset-calibration-recovered.md
- Filament load, recovered: notes/47-filament-load-recovered.md
- Filament load, the port: notes/48-filament-load-port.md
- Runout and clog handling: notes/49-runout-recovered.md
- Print lifecycle: notes/50-print-lifecycle.md
- Nozzle clean, recovered: notes/50a-nozzle-clean-recovered.md
- Nozzle clean, the port: notes/50b-nozzle-clean-port.md
- Automatic pressure advance: notes/51-pa-calibration-recovered.md
- Cancelling an object stalls the host: notes/52-exclude-object-stall.md
- Filament, calibration, persistent state: notes/60-background.md
- Migrating to s6: notes/80-s6-migration.md
- Packaging with apk: notes/85-packaging.md
- Wipe and extract: notes/86-wipe-and-extract.md