mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #2305] linux-boot: harden boot-inner.sh and configure-worktree.sh #2309
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#2309
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/2305
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/linux-boot-inner-configure-safety📝 Commits (1)
9a2ac71linux-boot: harden boot-inner.sh and configure-worktree.sh📊 Changes
3 files changed (+397 additions, -23 deletions)
View changed files
📝
scripts/linux-boot/boot-inner.sh(+99 -18)📝
scripts/linux-boot/configure-worktree.sh(+46 -5)➕
tests/test_linux_boot_inner_and_configure.py(+252 -0)📄 Description
Claimed in the coordination issue as: LINUX-BOOT-INNER-AND-CONFIGURE-WORKTREE-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193109369)
What and why
scripts/linux-boot/boot-inner.sh:BOOT_AGENT,BOOT_N,BOOT_SECS,GTA6RT) upfront (single path segment checks forBOOT_AGENT/BOOT_N, non-negative integer checks forBOOT_SECS/WAIT_ITERS/LEONIDA_BOOT_MIN_FREE_MB) with exit code2before creating or truncating files, andmkdir -pwork/root directories before opening logs or locks.flockwithcommand -v flock, select the cgroup v20::entry cleanly from/proc/self/cgroup, coerce non-digit cgroup values such as"max"to0viaread_uint()before shell arithmetic, and register a signal-safecleanup()trap (EXIT,INT,TERM) to reap the background sampler subshell immediately.LEONIDA_BOOT_ROOT,LEONIDA_BOOT_WORK,BOOT_SH,NVIDIA_SMI,LEONIDA_MEMINFO_PATH,LEONIDA_SELF_CGROUP_PATH,LEONIDA_CGROUP_ROOT,LEONIDA_WAIT_SLEEP_SECS,LEONIDA_SAMPLE_SLEEP_SECS, andLEONIDA_WAIT_ITERSoverrides for testing.scripts/linux-boot/configure-worktree.sh:-h/--help(exit0), validate argument count, worktree directory existence,runtime/CMakeLists.txt,runtime/cmake/clang-cl-xwin.cmake,CMAKEexecutable availability, and optionalSDL3_SRCdirectory upfront with exit code2.cmake_argsarray so paths andSDL3_SRCcontaining spaces remain intact single argv tokens instead of undergoing unquoted word splitting.tests/test_linux_boot_inner_and_configure.py(verifying LF line endings,bash -nsyntax, validation exits, cgroup"max"sampling, exit124mapping, and spaced worktree/SDL3_SRCpaths).Tested
python -I tests/test_linux_boot_inner_and_configure.py -v(via Git Bash): 4 passed, 0 failed (detachedupstream/mainbaseline with only the new test file fails with 8 subtest/test failures).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tests/test_linux_boot_inner_and_configure.py, andgit diff --cached --check: passed.GPUs 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.