mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #2274] linux-boot: harden boot-digest/run-boot dedup, empty-stats, and argument checks #2276
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2276
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2274
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/linux-boot-scripts-safety📝 Commits (1)
bfde05dlinux-boot: harden boot-digest/run-boot dedup, empty-stats, and argument checks📊 Changes
3 files changed (+175 additions, -18 deletions)
View changed files
📝
scripts/linux-boot/boot-digest.sh(+20 -11)📝
scripts/linux-boot/run-boot.sh(+23 -7)➕
tests/test_linux_boot_scripts.py(+132 -0)📄 Description
Claimed in the coordination issue as: LINUX-BOOT-SCRIPTS-EXACT-DEDUP-EMPTY-STATS-AND-ARG-GUARDS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191439979)
What and why
scripts/linux-boot/boot-digest.shandscripts/linux-boot/run-boot.shpreviously:/opt/leonidainstead of defaulting viaLEONIDA_BOOT_ROOT, lacked directory creation before digest/ledger writes inboot-digest.sh, and ranflockwithout checking availability.grep -q -P "^[^\t]*\t$AGENT\t$N\t"for ledger deduplication, allowing regex metacharacters in agent names (e.g.a.bmatchingaxb).[ -f "$CAP/index.txt" ](emitting broken counts for 0-byteindex.txt) and ignored sample row counts inawkoverresources.tsv(printing empty MB stats and0peak MB on header-only files), while leavingsedstderr unguarded whenboot-<n>.metawas missing.AGENT,N,SECS(<= 0or non-numeric), and malformedKEY=VALUEenvironment overrides without upfront validation.This adds
LEONIDA_BOOT_ROOTsupport, upfront argument validation, literalawkledger deduplication,[ -s "$CAP/index.txt" ]andawksample-count checks,flock/.metaguards, LF preservation, and stdlib bash regression tests intests/test_linux_boot_scripts.py.Tested
python -I tests/test_linux_boot_scripts.py -v(3 passed)upstream/mainbaseline negative control: failed withtests/test_linux_boot_scripts.pybefore the fixpython -I tests/test_ci_registration.py,python -I tests/test_text_write_line_endings.py,python -I scripts/check_no_game_data.py,python -I -m compileall -q, andgit diff --cached --checkGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.