diff --git a/AMMC/linux_x86-64/ammc-amb b/AMMC/linux_x86-64/ammc-amb old mode 100644 new mode 100755 diff --git a/README.md b/README.md index d013616..4764d08 100644 --- a/README.md +++ b/README.md @@ -578,6 +578,8 @@ npm --version Node.js 22 or 24 LTS is recommended. Node.js 18 and 20 are not supported by the current native SQLite dependency. +The bundled x86-64 Linux binary at `AMMC/linux_x86-64/ammc-amb` requires **GLIBC 2.39 or newer**. Check the host before race day with `ldd --version` and `npm run verify`. Older distributions can still run RC RaceCore, but must use an AMMC binary built for their GLIBC version or run AMMC on another compatible host. + #### 3. Clone, install, and start ```bash @@ -595,7 +597,7 @@ curl http://127.0.0.1:8081/api/health `npm start` launches RC RaceCore in the background. Open `http://localhost:8081`, or find the Linux server address with `hostname -I` and open `http://:8081` from another computer. -If the bundled Linux AMMC binary reports a missing `GLIBC` version, use an AMMC build compatible with the host distribution. Do not manually replace the operating system's glibc. +If the bundled AMMC reports `version 'GLIBC_2.39' not found`, the host is too old for that binary. Use a compatible AMMC build or a Linux distribution with GLIBC 2.39+. Do not manually replace the operating system's GLIBC because that can break the whole system. ### Runtime commands diff --git a/README.sv.md b/README.sv.md index d355985..aaea007 100644 --- a/README.sv.md +++ b/README.sv.md @@ -567,6 +567,8 @@ npm --version Node.js 22 eller 24 LTS rekommenderas. Node.js 18 och 20 stöds inte av nuvarande native SQLite-dependency. +Den bundlade Linux-binären för x86-64, `AMMC/linux_x86-64/ammc-amb`, kräver **GLIBC 2.39 eller senare**. Kontrollera servern före racedagen med `ldd --version` och `npm run verify`. Äldre distributioner kan fortfarande köra RC RaceCore, men måste använda en AMMC-binär byggd för deras GLIBC-version eller köra AMMC på en annan kompatibel dator. + #### 3. Klona, installera och starta ```bash @@ -584,7 +586,7 @@ curl http://127.0.0.1:8081/api/health `npm start` kör RC RaceCore i bakgrunden. Öppna `http://localhost:8081`, eller hitta Linux-serverns adress med `hostname -I` och öppna `http://:8081` från en annan dator. -Om den bundlade Linux-versionen av AMMC rapporterar att en `GLIBC`-version saknas behöver du en AMMC-binär som är byggd för hostens Linuxdistribution. Byt inte operativsystemets glibc manuellt. +Om den bundlade AMMC-binären rapporterar `version 'GLIBC_2.39' not found` är hostens Linux för gammalt för just den binären. Använd en kompatibel AMMC-build eller en distribution med GLIBC 2.39+. Byt inte operativsystemets GLIBC manuellt eftersom hela systemet kan sluta fungera. ### Driftkommandon diff --git a/docs/decoder-setup.md b/docs/decoder-setup.md index a3a631e..2dc0f39 100644 --- a/docs/decoder-setup.md +++ b/docs/decoder-setup.md @@ -69,6 +69,8 @@ Each physical decoder needs a unique IP. Each enabled AMMC process needs a uniqu AMMC runs on the computer started with `npm start` or `npm.cmd start`, not on a remote browser laptop. +On x86-64 Linux, the bundled `AMMC/linux_x86-64/ammc-amb` requires GLIBC 2.39 or newer. Check with `ldd --version` or `npm run verify`. RC RaceCore itself may run on an older host, but this bundled AMMC binary will not. + 1. Start the backend and open `Settings`. 2. From remote devices use backend URL `http://192.168.1.100:8081`. 3. Enable `Managed AMMC`. @@ -151,6 +153,7 @@ This opens TCP `8081` and `9000-9003`. Use these ports only on a trusted LAN. Ne |---|---|---| | Decoder offline | Main WebSocket unavailable | AMMC main, port `9000`, firewall | | AMMC starts then exits | Decoder IP, binary, or library error | AMMC log and ping from backend | +| `GLIBC_2.39 not found` | Bundled Linux AMMC is newer than the host GLIBC | Use GLIBC 2.39+ or a compatible AMMC build; never replace system GLIBC manually | | Remote laptop opens UI but receives no timing | URL uses `127.0.0.1` | Use `ws://:9000` | | Main works but Split does not | Split disabled or port blocked | Decoder `.11`, port `9001`, Timing status | | Pit entry works but no stop closes | Pit exit missing/wrong role | Decoder `.13`, port `9003`, separate loop | diff --git a/docs/decoder-setup.sv.md b/docs/decoder-setup.sv.md index f32bf71..6eb8b11 100644 --- a/docs/decoder-setup.sv.md +++ b/docs/decoder-setup.sv.md @@ -80,6 +80,8 @@ Varje fysisk decoder ska ha en unik IP. Varje aktiverad AMMC-process ska ha en u AMMC körs på samma dator som startats med `npm start` eller `npm.cmd start`. Webbläsaren kan köras på en annan dator. +På Linux x86-64 kräver den bundlade `AMMC/linux_x86-64/ammc-amb` GLIBC 2.39 eller senare. Kontrollera med `ldd --version` eller `npm run verify`. RC RaceCore kan köras på en äldre host, men just denna bundlade AMMC-binär fungerar då inte. + 1. Starta backend. 2. Öppna `Inställningar`. 3. Kontrollera `Backend URL`: `http://192.168.1.100:8081` från andra datorer. @@ -186,6 +188,7 @@ Det öppnar TCP `8081` och `9000-9003`. Öppna endast portarna på ett betrott L |---|---|---| | `Decoder offline` | Main WebSocket kan inte nås | AMMC main kör, port `9000`, brandvägg | | AMMC startar men stannar | Fel decoder-IP, binär eller bibliotek | AMMC-logg och ping från backend | +| `GLIBC_2.39 not found` | Bundlad Linux-AMMC är nyare än hostens GLIBC | Använd GLIBC 2.39+ eller kompatibel AMMC-build; byt aldrig systemets GLIBC manuellt | | Laptop når sidan men inte tider | WS-url använder `127.0.0.1` | Byt till `ws://:9000` | | Main fungerar men split saknas | Split ej aktiverad eller port blockerad | `.11`, port `9001`, status i Tidtagning | | Depå in visas men inget stopp skapas | Depå ut saknas eller använder fel roll | `.13`, port `9003`, separat fysisk loop | diff --git a/docs/javascript-architecture.md b/docs/javascript-architecture.md index 2d38f58..11727fc 100644 --- a/docs/javascript-architecture.md +++ b/docs/javascript-architecture.md @@ -238,7 +238,8 @@ flowchart LR AllowScripts --> Native[better-sqlite3 v12 Windows prebuilt] NpmCi --> Postinstall[scripts/verify-install.js] Postinstall --> SQLite[SQLite in-memory query] - Postinstall --> AMMC[AMMC/windows64 runtime check] + Postinstall --> AMMC[Platform AMMC runtime check] + AMMC --> Glibc[Linux x64 GLIBC >= 2.39 warning] SetupPs --> ServerCtl[scripts/serverctl.js] ``` @@ -247,6 +248,7 @@ Important constraints: - `better-sqlite3` is pinned to v12.11.x because its prebuilt Windows binary works with the supported Node.js releases; npm 12 is permitted to run only this dependency installer through `package.json#allowScripts` - `npm ci --ignore-scripts` is unsupported because it leaves the native SQLite binding uninstalled - AMMC Windows binaries and DLLs must remain together in `AMMC\\windows64` +- the bundled Linux x86-64 AMMC requires GLIBC 2.39+; `verify-install.js` reports host compatibility and executable permission without blocking the RC RaceCore server - `npm start` is already a background start; batch wrappers must not create a second detached npm process - server process identity is stored in `data\\server.pid` - Windows stdout/stderr use `logs\\server.out.log` and `logs\\server.err.log` diff --git a/scripts/verify-install.js b/scripts/verify-install.js index c2358f5..e311b62 100644 --- a/scripts/verify-install.js +++ b/scripts/verify-install.js @@ -15,6 +15,21 @@ function fail(message, error) { process.exit(1); } +function warn(message) { + console.warn(`[verify] WARNING: ${message}`); +} + +function compareVersions(left, right) { + const leftParts = String(left || "").split(".").map((part) => Number(part) || 0); + const rightParts = String(right || "").split(".").map((part) => Number(part) || 0); + const length = Math.max(leftParts.length, rightParts.length); + for (let index = 0; index < length; index += 1) { + const difference = (leftParts[index] || 0) - (rightParts[index] || 0); + if (difference !== 0) return difference; + } + return 0; +} + try { require("express"); } catch (error) { @@ -47,5 +62,28 @@ if (process.platform === "win32") { console.log(`[verify] AMMC Windows runtime: ${ammcDir}`); } +if (process.platform === "linux" && process.arch === "x64") { + const ammcPath = path.join(root, "AMMC", "linux_x86-64", "ammc-amb"); + const requiredGlibc = "2.39"; + if (!fs.existsSync(ammcPath)) { + warn(`Bundled Linux AMMC binary is missing: ${ammcPath}`); + } else { + try { + fs.accessSync(ammcPath, fs.constants.X_OK); + } catch { + warn(`Bundled Linux AMMC is not executable. Run: chmod +x AMMC/linux_x86-64/ammc-amb`); + } + + const glibcVersion = process.report?.getReport?.().header?.glibcVersionRuntime || ""; + if (!glibcVersion) { + warn(`Could not detect the host GLIBC version. The bundled Linux AMMC requires GLIBC ${requiredGlibc} or newer.`); + } else if (compareVersions(glibcVersion, requiredGlibc) < 0) { + warn(`Host GLIBC ${glibcVersion} is too old for the bundled Linux AMMC (requires >= ${requiredGlibc}). RC RaceCore can still run, but use a compatible AMMC build or a newer Linux distribution. Do not replace the system GLIBC manually.`); + } else { + console.log(`[verify] AMMC Linux runtime: ${ammcPath} (GLIBC ${glibcVersion}, requires >= ${requiredGlibc})`); + } + } +} + console.log(`[verify] Express and SQLite: OK (${process.platform}/${process.arch}, Node ${process.version})`); console.log(`[verify] Installation is ready. Start with: ${process.platform === "win32" ? "npm.cmd start" : "npm start"}`); diff --git a/src/app.js b/src/app.js index 38d6ddf..694d4f8 100644 --- a/src/app.js +++ b/src/app.js @@ -1653,7 +1653,7 @@ const TRANSLATIONS = { "guide.windows_5": "5. Från andra enheter används `http://:8081` och `ws://:9000`. Se `windows/README.md` för brandvägg och felsökning.", "guide.linux_title": "Linux + npm", "guide.linux_1": "1. Installera Node 22 LTS, build-essential och python3 på Linux-hosten.", - "guide.linux_2": "2. Standardbinär för Managed AMMC på Linux-host: `AMMC/linux_x86-64/ammc-amb`.", + "guide.linux_2": "2. Standardbinären `AMMC/linux_x86-64/ammc-amb` kräver GLIBC 2.39 eller senare. Kontrollera med `ldd --version` eller `npm run verify`.", "guide.linux_3": "3. Kör `npm install`, `npm start`. Servern lyssnar på 0.0.0.0:8081. Öppna ev. brandvägg: `sudo ufw allow 8081/tcp` och använd `ws://:9000` i klienten.", "guide.sqlite_title": "SQLite-lagring", "guide.sqlite_1": "Databasfil: data/rc_timing.sqlite", @@ -2975,7 +2975,7 @@ const TRANSLATIONS = { "guide.windows_5": "5. Other devices use `http://:8081` and `ws://:9000`. See `windows/README.md` for firewall and troubleshooting.", "guide.linux_title": "Linux + npm", "guide.linux_1": "1. Install Node 22 LTS, build-essential and python3 on the Linux host.", - "guide.linux_2": "2. Default Managed AMMC binary on a Linux host: `AMMC/linux_x86-64/ammc-amb`.", + "guide.linux_2": "2. The default `AMMC/linux_x86-64/ammc-amb` binary requires GLIBC 2.39 or newer. Check with `ldd --version` or `npm run verify`.", "guide.linux_3": "3. Run `npm install`, `npm start`. Server listens on 0.0.0.0:8081. Open firewall if needed: `sudo ufw allow 8081/tcp` and use `ws://:9000` in the client.", "guide.sqlite_title": "SQLite storage", "guide.sqlite_1": "Database file: data/rc_timing.sqlite",