feat(libkernel): read param.sfo when param.json is absent #5993
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5993"
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 Get-fix on 2026-10-14T18:37:03Z.
What
PS4 titles and homebrew ship
sce_sys/param.sfoinstead ofparam.json. The OpenOrbis graphics, input and pngdec samples stop right aftermain: Creating a scenewithwhat(): param.json not found. Whenparam.jsonis absent, the application metadata now reads the title, title ID, download data size and user defined parameters fromparam.sfo, and/dataand/download0are mounted for it as forparam.json.param.jsonis still preferred when both files exist.The parser checks the PSF header, the table and entry bounds, string terminators, 32-bit integer entries, repeated keys and a negative download data size, and throws on each. The localized
TITLE_00toTITLE_30are not selected by the console language; that is recorded in the libkernel debt file.Part of the PS4 homebrew work tracked in #3093.
Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, full build with
BUILD_TESTING=ON, onmaine442f4c2e:param_sfo_parser(new),guest_app_info,param_json_parserand thedownload_data_mount_*cases, including the newsfocase: 9/9.guest_app_infochecks thatparam.jsonwins overparam.sfoand that a process with onlyparam.sfogets its title ID;download_data_mount_sfostarts a process whose run directory has onlyparam.sfoand checks/data,/download0and the title ID.param.sfo; never reading it; not mounting/dataor/download0for it; ignoring integer entries; shifting the user parameters; not checking the entry count or the data length; accepting repeated keys or a negative download data size.main84b01f9cd, all together one442f4c2e): graphics, input and pngdec start with their ownparam.sfo.tools/check_conventions.py --base origin/mainpasses.Not tested on Linux.
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-14T18:42:58Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/debt/libkernel.mdL210docs/dev/debt/libkernel.mdL210core/libs/prx/libkernel/AppMetadata/include/ParamSfoParser.hppcore/libs/prx/libkernel/AppMetadata/src/ParamSfoParser.cppcore/libs/tests/ParamSfoParser.cppdocs/dev/debt/libkernel.mdL210docs/dev/debt/libkernel.mdL210docs/dev/debt/libkernel.mdL210docs/dev/debt/libkernel.mdL210docs/dev/debt/libkernel.mdL210docs/dev/debt/libkernel.mdL210docs/dev/debt/libkernel.mdL210Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/CMakeLists.txtcore/libs/tests/GuestAppInfo.cppcore/libs/tests/GuestDownloadDataMount.cppcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libkernel.mdImported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T13:35:11Z.
Rebased onto
main(now Get-fix/AnyPS5@c8d40fc48) for the needs rebase label.mainhad added a bullet at the end ofdocs/dev/debt/libkernel.md, where this pull request adds itsparam.sfobullet; both are kept. The code is unchanged. The param tests (param_sfo_parser,guest_app_info,param_json_parser,download_data_mount_*) pass on a full build of the rebased branch merged withmain92cdc7b62.I checked the overlap the bot lists. I fetched each listed pull request and, for every file it shares with this one, merged its change with
git merge-fileinto currentmain(a5e2a80c6) and intomainwith this pull request merged. A conflict that appears only in the second case is one this pull request adds.The bot lists 61 pull requests, with 88 shared files between them. This pull request adds a conflict in two:
docs/dev/debt/libkernel.md. Keeping both resolves it.mainincore/libs/prx/libkernel/CMakeLists.txt. Theparam_sfo_parserregistration of this pull request sits next to lines #6044 rewrites, so whichever merges second registers one test in the other's style.The other 59 merge the same with and without this pull request.
AI-assisted: yes (Claude Code). I ran these checks myself on Windows 11.
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T18:37:12Z.
Rebased onto
main03c4cb5e7(now Get-fix/AnyPS5@91117ec4d) for the needs rebase label.mainhad added asceKernelVirtualQueryentry at the end ofdocs/dev/debt/libkernel.md, where this one adds itsparam.sfoentry; I kept both.mainalso added a lock inensureTitleLoaded, which Git merged around this change'sparseParamscall;parseParamstakes no lock, so the title is loaded once under it. In a build ofmain03c4cb5e7with my other open pull requests,guest_app_info,param_sfo_parser,param_json_parser,param_json_utf8and the fivedownload_data_mount_*tests pass, the full ctest passes except two tests this change does not touch (agc_driver_gpu_indirect_arguments_misaligned_writer_aheaddoes not compile with MinGW onmain(#6452 fixes it), andprx_thread_local_destructorsfails as it did onmain92cdc7b62on this machine without my changes), and 15 of the 16 OpenOrbis sample programs start (networkingwas not run).AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T20:04:13Z.
Review: COMMENTED
Linux run (Ubuntu 26.04, Intel i7-8700, GCC 15.2, full build, non-GPU tests), head
91117ec4dmerged ontomain44df21632.param_sfo_parser,param_json_parser,param_json_utf8,guest_app_infoand the fivedownload_data_mount_*cases (including the newsfo) pass, 9/9.AppMetadata.cppfrommain(parser and tests kept):download_data_mount_sfoandguest_app_infoabort; the other seven pass.Non-GPU suite (
ctest -E "^agc"): same result asmain; onlyfile_writer_binaryandfile_writer_textfail, and they fail onmaintoo on this machine (Ubuntu 26.04 coreutils).Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T23:26:31Z.
Thanks for the Linux run, @jotitadev, and for checking that
download_data_mount_sfoandguest_app_infofail withmain'sAppMetadata.cpp.AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code