mirror of
https://github.com/ruppert/fmini-1.git
synced 2026-12-06 12:54:23 +01:00
Name the build outputs fmini-1-fm1-<version>
The package and app are now build/fmini-1-fm1-<version>.fwsc and .bin (version from FMINI_VERSION; a release build uses its X.Y). The FM-1 binary, package and loader are byte-identical to before: the same SHA-256 for the app, the package and the loader. Consumers follow the new names: run_tests.sh, install_test.py, test_web.mjs, the installer workflow, the installer page's usage line, BUILDING.md and CLAUDE.md. install_test.py: the sample upload checks are removed with the SAMPLE engine (tools/fm1_sample_upload.py was deleted in 1.13.0). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
This commit is contained in:
8 files changed
+32
-34
No files matched your search
@@ -47,8 +47,8 @@ jobs:
|
||||
run: |
|
||||
VERSION=$(sed -n 's/^#define FMINI_VERSION "v\(.*\)"/\1/p' firmware/src/fmini_app.c)
|
||||
mkdir -p _site
|
||||
python3 web/make_fmini_installer.py build/felucca.fwsc _site/index.html "$VERSION"
|
||||
cp build/felucca.fwsc "_site/fmini-1-$VERSION.fwsc"
|
||||
python3 web/make_fmini_installer.py "$(ls build/fmini-1-fm1-*.fwsc | head -1)" _site/index.html "$VERSION"
|
||||
cp "$(ls build/fmini-1-fm1-*.fwsc | head -1)" "_site/fmini-1-$VERSION.fwsc"
|
||||
cp docs/fmini-ad.mp4 docs/fmini-ad-poster.jpg _site/
|
||||
mkdir -p _site/editor && cp web/editor_fmini.html _site/editor/index.html # the patch editor (web/test_editor_fmini.py)
|
||||
cp -r docs/emu _site/emu # the browser emulator (web/emu/build_wasi.sh builds docs/emu)
|
||||
|
||||
+5
-5
@@ -4,9 +4,9 @@ The build makes three files in `build/`:
|
||||
|
||||
| File | What |
|
||||
| --- | --- |
|
||||
| `felucca.bin` | the firmware app |
|
||||
| `fmini-1-fm1-<version>.bin` | the firmware app |
|
||||
| `loader/ota.bin` | the update loader |
|
||||
| `felucca.fwsc` | the installable package (app + loader) |
|
||||
| `fmini-1-fm1-<version>.fwsc` | the installable package (app + loader) |
|
||||
|
||||
## Get the source
|
||||
|
||||
@@ -132,7 +132,7 @@ Use the web installer in Chrome or Edge:
|
||||
From the command line (needs `pip3 install mido python-rtmidi`):
|
||||
|
||||
```
|
||||
python3 tools/fm1_install.py build/felucca.fwsc
|
||||
python3 tools/fm1_install.py build/fmini-1-fm1-<version>.fwsc
|
||||
python3 tools/fm1_install.py --info # identity of the connected FM-1
|
||||
```
|
||||
|
||||
@@ -140,8 +140,8 @@ Or, to install your own build from the web installer, make a local copy of the s
|
||||
(Web MIDI needs a secure context):
|
||||
|
||||
```
|
||||
python3 web/make_site.py build/felucca.fwsc dev /tmp/felucca-site
|
||||
cd /tmp/felucca-site && python3 -m http.server 8000
|
||||
python3 web/make_site.py build/fmini-1-fm1-<version>.fwsc dev /tmp/fmini-1-fm1-site
|
||||
cd /tmp/fmini-1-fm1-site && python3 -m http.server 8000
|
||||
# open http://localhost:8000/webapp/installer/
|
||||
```
|
||||
|
||||
|
||||
@@ -24,13 +24,13 @@ toolchain setup.
|
||||
|
||||
```
|
||||
export JIELI_TOOLCHAIN=<dir with pi32v2/bin/clang> AC79_SDK=<AC79 SDK checkout with cpu/wl82/tools/uboot.boot>
|
||||
./build.sh # build/felucca.bin, build/loader/ota.bin, build/felucca.fwsc (~30 s)
|
||||
./build.sh # build/fmini-1-fm1-<version>.bin, build/loader/ota.bin, build/fmini-1-fm1-<version>.fwsc (~30 s)
|
||||
sh tests/run_tests.sh > /tmp/tests.log 2>&1 # the whole host suite, 20-30 minutes; run it in the background
|
||||
python3 tools/fmini_filter.py # regenerate firmware/src/eng_fmini_filter.h (filter laws and tables)
|
||||
python3 tools/gen_fmini_presets.py # regenerate firmware/src/eng_fmini_presets.h from tools/fmini_bank.py
|
||||
python3 tools/preset_lab.py --wasm docs/emu/felucca.wasm --out DIR # render and measure the 100 factory patches
|
||||
WASI_SDK=<wasi-sdk-25.0 dir> sh web/emu/build_wasi.sh # docs/emu (the browser emulator)
|
||||
python3 web/make_fmini_installer.py build/felucca.fwsc docs/index.html X.Y.Z # the installer page (docs/index.html)
|
||||
python3 web/make_fmini_installer.py build/fmini-1-fm1-<version>.fwsc docs/index.html X.Y.Z # the installer page (docs/index.html)
|
||||
```
|
||||
|
||||
A single host test is one `cc` line (they are in `tests/run_tests.sh`); `tests/fmini_filter_test.c` and `tests/fmini_app_test.c`
|
||||
|
||||
+3
-11
@@ -6,7 +6,7 @@ The fake device is the one in web/test_web.mjs: identity on the handshake,
|
||||
then "device asks, host answers" reads of the logical image. Run from the repo root:
|
||||
python3 tests/install_test.py
|
||||
Also checks logical_image/product_of against web/fm1pkg.js (needs node and
|
||||
build/felucca.fwsc, skipped otherwise)."""
|
||||
build/fmini-1-fm1-<version>.fwsc, skipped otherwise)."""
|
||||
import io
|
||||
import queue
|
||||
import shutil
|
||||
@@ -210,14 +210,6 @@ def installs():
|
||||
rc, out, err = cli(["--info"], dev)
|
||||
ok(rc == 0 and "FM-1_905" in out and not any(c in out for c in "\x1b\x07"),
|
||||
"--info: control bytes in the device's identity are not printed")
|
||||
import fm1_sample_upload as U
|
||||
lines = U.slot_info([3, 80, 2, 0x41, 0x1B, 0x5B, 0x32, 0x4A, 0, 40, 0, 0, 0, 0, 0, 0])
|
||||
ok(lines[0] == "USR1: 2 zones, A?[2J, 40 KiB" and lines[1] == "USR2: empty", "sample upload: slot names printable only")
|
||||
try:
|
||||
U.slot_info([3, 80, 2, 0x41])
|
||||
ok(False, "sample upload: a malformed SMP_INFO reply is an error")
|
||||
except ValueError:
|
||||
ok(True, "sample upload: a malformed SMP_INFO reply is an error")
|
||||
|
||||
|
||||
def errors():
|
||||
@@ -274,9 +266,9 @@ def errors():
|
||||
|
||||
|
||||
def against_js():
|
||||
clean = ROOT / "build/felucca.fwsc"
|
||||
clean = next(iter(sorted((ROOT / "build").glob("fmini-1-fm1-*.fwsc"))), ROOT / "build/none.fwsc")
|
||||
if not shutil.which("node") or not clean.exists():
|
||||
print("logical image vs fm1pkg.js: skipped (needs node and build/felucca.fwsc)")
|
||||
print("logical image vs fm1pkg.js: skipped (needs node and build/fmini-1-fm1-*.fwsc)")
|
||||
return
|
||||
js = ("import { logicalImage, productOf } from %r; import { readFileSync } from 'node:fs';"
|
||||
"const p = readFileSync(process.argv[1]); process.stderr.write(productOf(p));"
|
||||
|
||||
+8
-6
@@ -234,15 +234,17 @@ EOF
|
||||
"$OUT/usb_desc_test"
|
||||
done
|
||||
|
||||
[ -f build/felucca.fwsc ] || { echo "run ./build.sh first"; exit 1; }
|
||||
PKG=$(ls build/fmini-1-fm1-*.fwsc 2>/dev/null | head -1)
|
||||
APP=$(ls build/fmini-1-fm1-*.bin 2>/dev/null | grep -v -- -app.bin | head -1)
|
||||
[ -f "$PKG" ] || { echo "run ./build.sh first"; exit 1; }
|
||||
|
||||
$CC -DOWN_PKG=1 -o "$OUT/ota_test" tests/ota_test.c
|
||||
run "M-UPGRADE entry (own loader)" "$OUT/ota_test" build/felucca.fwsc
|
||||
run "M-UPGRADE entry (own loader)" "$OUT/ota_test" "$PKG"
|
||||
|
||||
head -c 200000 build/felucca.bin > "$OUT/old_app.bin"
|
||||
head -c 200000 "$APP" > "$OUT/old_app.bin"
|
||||
python3 tools/fm1pkg_make.py "$OUT/old_app.bin" build/loader/ota.bin "$OUT/old.fwsc" >/dev/null
|
||||
$CC -o "$OUT/ldr_test" tests/ldr_test.c
|
||||
run "update loader: other app -> this build" "$OUT/ldr_test" "$OUT/old.fwsc" build/felucca.fwsc
|
||||
run "update loader: other app -> this build" "$OUT/ldr_test" "$OUT/old.fwsc" "$PKG"
|
||||
|
||||
if [ -f build/gen/felucca_tables.h ]; then
|
||||
$CC -O2 -w -Ibuild/gen -Ifirmware/src -o "$OUT/hostsim" tests/hostsim.c -lm
|
||||
@@ -451,9 +453,9 @@ else
|
||||
SCC="${CC%% *} $SAN -Ibuild/gen -Ifirmware/src"
|
||||
export ASAN_OPTIONS="${ASAN_OPTIONS:-detect_leaks=0}"
|
||||
$SCC -o "$A/ldr_test" tests/ldr_test.c
|
||||
run "ASan/UBSan: update loader (other app -> this build)" "$A/ldr_test" "$OUT/old.fwsc" build/felucca.fwsc
|
||||
run "ASan/UBSan: update loader (other app -> this build)" "$A/ldr_test" "$OUT/old.fwsc" "$PKG"
|
||||
$SCC -DOWN_PKG=1 -o "$A/ota_test" tests/ota_test.c
|
||||
run "ASan/UBSan: M-UPGRADE entry (own loader)" "$A/ota_test" build/felucca.fwsc
|
||||
run "ASan/UBSan: M-UPGRADE entry (own loader)" "$A/ota_test" "$PKG"
|
||||
for t in editor_test project_test backup_test robust_test fun10_test fm6bank_test; do
|
||||
$SCC -o "$A/$t" tests/$t.c -lm
|
||||
run "ASan/UBSan: $t" "$A/$t"
|
||||
|
||||
+9
-5
@@ -51,6 +51,7 @@ SDK_SHA256 = {
|
||||
|
||||
PRODUCT = "FM-1_900" # package identity; release builds are FM-1_9XY
|
||||
VERSION = None # FELUCCA_VERSION for release builds (default: firmware/src/felucca.c)
|
||||
STEM = "fmini-1-fm1" # output stem: fmini-1-fm1-<version> (set by main)
|
||||
# FELUCCA_CPU2 (firmware/src/felucca.c), unset or 1, the default (1.6.1): the second core is built in, its entry and
|
||||
# stacks (firmware/hal/fm1_cpu1.S) linked and its waiting loop (.c1_text) checked; MENU > SYSTEM > 2ND CORE starts it
|
||||
# (OFF by default: one core, as 1.6). FELUCCA_CPU2=0: none of it is built (1.6's one-core code and RAM)
|
||||
@@ -251,7 +252,7 @@ def build_app():
|
||||
img += b"\xff" * (load - APP_XIP - len(img))
|
||||
img += blob
|
||||
img += b"\xff" * (-len(img) % 4)
|
||||
(OUT / "felucca.bin").write_bytes(img)
|
||||
(OUT / f"{STEM}.bin").write_bytes(img)
|
||||
return bytes(img), syms, dis, rt
|
||||
|
||||
|
||||
@@ -376,14 +377,17 @@ def main():
|
||||
ap.add_argument("--release", metavar="X.Y", help="release build: identity FM-1_9XY, version string vX.Y")
|
||||
ap.add_argument("--sdk", type=Path, help="JieLi AC79 SDK checkout (default: $AC79_SDK)")
|
||||
a = ap.parse_args()
|
||||
name = "felucca.fwsc"
|
||||
global STEM
|
||||
m0 = re.search(r'#define FMINI_VERSION "v(\d+\.\d+\.\d+)"', (FW / "src" / "fmini_app.c").read_text())
|
||||
STEM = "fmini-1-fm1-" + (m0[1] if m0 else "dev") # the FMini-1-fm1 package: fmini-1-fm1-<version>.fwsc
|
||||
if a.release: # one digit each: the identity has room for two (X.Y.Z and X.Y.Z.W keep X.Y's)
|
||||
m = re.fullmatch(r"(\d)\.(\d)(?:\.\d){0,2}(-[A-Za-z0-9]+)?", a.release)
|
||||
if not m:
|
||||
raise SystemExit(f"--release {a.release}: use X.Y, X.Y.Z, X.Y.Z.W or X.Y-suffix, one digit each")
|
||||
PRODUCT = "FM-1_9" + m[1] + m[2]
|
||||
VERSION = "v" + a.release.lower() # e.g. v1.0, v1.1-rc1
|
||||
name = f"felucca-{a.release}.fwsc"
|
||||
STEM = f"fmini-1-fm1-{a.release}"
|
||||
name = STEM + ".fwsc"
|
||||
if not (FW / "engines" / "src" / "felucca_engine.h").exists():
|
||||
raise SystemExit("firmware/engines is empty: the Felucca-Engines submodule "
|
||||
"(git submodule update --init, or clone with --recurse-submodules)")
|
||||
@@ -410,14 +414,14 @@ def main():
|
||||
raise SystemExit("build: checks failed")
|
||||
pkg = fm1pkg_make.ufw(fm1pkg_make.flash_image(img, fm1pkg_make.KEY), ota, PRODUCT)
|
||||
(OUT / name).write_bytes(pkg)
|
||||
print(f"app {OUT / 'felucca.bin'} {len(img)} B")
|
||||
print(f"app {OUT / (STEM + '.bin')} {len(img)} B")
|
||||
print(f"loader {LDR / 'ota.bin'} {len(ota)} B")
|
||||
print(f"package {OUT / name} {len(pkg)} B, identity {PRODUCT}")
|
||||
if a.release: # what a release carries: the package, the app and every licence they need
|
||||
rel = OUT / f"release-{a.release}"
|
||||
shutil.rmtree(rel, ignore_errors=True)
|
||||
(rel / "LICENSES").mkdir(parents=True)
|
||||
app = f"felucca-{a.release}-app.bin"
|
||||
app = f"{STEM}-app.bin"
|
||||
(rel / name).write_bytes(pkg)
|
||||
(rel / app).write_bytes(img)
|
||||
(rel / "SHA256SUMS").write_text("".join(f"{hashlib.sha256(b).hexdigest()} {n}\n"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
# FMini-1: the official site, one self-contained page (site_fmini.html: the Minimoog-styled site with the screens, the presets,
|
||||
# MIDI and the Felucca installer's logic; the firmware package and every picture are embedded).
|
||||
# web/make_fmini_installer.py build/felucca.fwsc OUT.html [VERSION]
|
||||
# web/make_fmini_installer.py build/fmini-1-fm1-<version>.fwsc OUT.html [VERSION]
|
||||
# Serve it over https or http://localhost (Web MIDI with SysEx needs a secure context), in Chrome / Edge.
|
||||
import base64
|
||||
import json
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
// - fm1ota.js: a full install and an unplug during the write against a simulated FM-1
|
||||
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { existsSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { existsSync, mkdtempSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import vm from "node:vm";
|
||||
@@ -1622,7 +1622,7 @@ function samplesMatch() {
|
||||
|
||||
/* ------------------------------------------------------- packages: JS == Python --- */
|
||||
async function packages() {
|
||||
const pkg = join(FW_ROOT, "build/felucca.fwsc");
|
||||
const pkg = readdirSync(join(FW_ROOT, "build")).filter(f => /^fmini-1-fm1-.*\.fwsc$/.test(f)).map(f => join(FW_ROOT, "build", f))[0];
|
||||
if (!existsSync(pkg)) {
|
||||
console.log("packages: skipped (run ./build.sh first)");
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user