feat(libkernel_sys): add chroot that keeps the guest root #5191
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5191"
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?
Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T14:13:45Z.
What
Carries @screamm's two
chrootcommits fromscreamm:feat/libkernel-sys-chroot(059d98cf,15f673ee, author kept), which they offered in #3632 for anyone eligible to carry.Porpoise (PPSA99764, catalog release) imports
chroot(AKknh8Cx-V8) fromlibkernel_sys.prx. On Windows, currentmainrefuses to load it:chrootfollows FreeBSD 11.4sys_chroot/change_dirup to the lookup:EFAULTfor a null path,ENOENTfor an empty or missing one, andENOTDIRfor a file or a path through a file.put_root_back(Porpoisesrc/porpoise_jailbreak.cpp). It callsfchdiron the/it opened at start, thenchroot("."). So a directory that is already the guest root succeeds without a change, as FreeBSD'spwd_chrootwould leavefd_rdirwhere it is. Any other directory still throws, because the resolver's root and mount aliases are fixed.libkernel_sysdebt entry.Tested
main3faa9cb40with #4863 (its next stop isVideoOut: port already open). Before, it does not load. After, it loads and runs for the whole 60 s run with no exception. On Linux the weak import already resolves; the same title stops there on the VideoOut open that #4863 fixes.guest_kernel_sys(from the commits) andguest_filesystempass on Windows;python tools/check_conventions.py --base origin/mainpasses. The commits apply to currentmainwithout changes.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T14:15:06Z.
Progress report (
8c772ad→41b0ca5)➖ System libraries: 88.04% (+0.0%, +1 implemented functions)
✅ 1 implemented
chroot_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:17:10Z.
Checked on main merged with the PR:
guest_kernel_syspasses (partial build, 24 libs tests green) and fails to link without the change. Thechrooterrors, the root-no-op and the throw for other directories match the debt entry. The Porpoise log in the description covers the only call site. Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T14:17:39Z.
Linux validation on the exact PR head: GCC 12.2, Release,
BUILD_TESTING=ON; builtguest_kernel_sys_tests, and CTestguest_kernel_syspassed (1/1). This confirms the focused guest test on Linux; it does not add Windows or console coverage.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:32:41Z.
Checked on main merged with the PR:
guest_kernel_syspasses (24 libs tests green) and fails to link without the change. Thechrooterrors, the no-op for the guest root and the throw for other directories match the FreeBSD references and the debt entry. Porpoise's only call site (fchdirthenchroot(".")) is covered. Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T14:34:53Z.
Linux run: Ubuntu in WSL2, GCC 15.2.0, Ninja Release,
BUILD_TESTING=ON, full build of a local test head838d4fd85. That head ismain3faa9cb40with this PR, my other open libkernel PRs (#5013, #5061, #5078, #5098, #5183–#5187, #5191) and the open PRs the catalog titles need (#4377, #4379, #4374, #4383, #3798, #4467, #4863, #4105). All 123 libkernel and 69 libc tests pass, includingguest_system_configuration,guest_getrlimit,guest_kernel_fcntl,guest_freebsd_clocks,guest_kernel_sysandguest_filesystem. Not built alone on Linux; no title run on Linux.