docs(usage): say that app0 must not contain symbolic links on Linux #7592

Merged
CPritch merged 1 commit from upstream-pr/7592 into main 2026-10-19 17:35:43 +00:00
CPritch commented 2026-10-18 16:08:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-18T16:08:51Z.


What

Adds one sentence to the runtime layout section of USAGE.md: on Linux, app0/ must not contain symbolic links; use copies or hard links.

sceKernelGetdirentries passes the host d_type through, so a symbolic link is listed as DT_LNK rather than as the file or directory it points to. A title that walks its directories and descends only into DT_DIR entries skips the linked directories. Linking a dump's top-level entries into app0/ instead of copying them is an easy thing to do with a large dump, and the result is a crash with no AnyPS5 message.

Seen with PPSA04263 (GTA V) 01.010.002. With every top-level entry of app0/ a symbolic link, the title lists /app0, descends only into sce_module/ (the relinker's real directory), and segfaults in title code within seconds. With the same entries as hard links it lists /app0, descends into update/, ps5/ and sce_sys/, and runs. strace -e trace=openat,getdents64 of both runs shows the difference.

This documents the current behaviour and does not change it. #4936 and #7273 report host symbolic links to titles as links.

Tested

Linux Mint 22.2, build of main 91ddd9e3a (no changes to libkernel/File between that and this branch's base, 81cb86339), PPSA04263 relinked with --to-intel: two game folders that differ only in symbolic links versus hard links under app0/, as above. The symbolic-link folder crashes at start-up, the hard-link folder does not. Not tested on Windows or macOS. tools/check_conventions.py passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (documentation only)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4910645446 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7592). Originally posted by [CPritch](https://github.com/CPritch) on 2026-10-18T16:08:51Z. --- ### What Adds one sentence to the runtime layout section of `USAGE.md`: on Linux, `app0/` must not contain symbolic links; use copies or hard links. `sceKernelGetdirentries` passes the host `d_type` through, so a symbolic link is listed as `DT_LNK` rather than as the file or directory it points to. A title that walks its directories and descends only into `DT_DIR` entries skips the linked directories. Linking a dump's top-level entries into `app0/` instead of copying them is an easy thing to do with a large dump, and the result is a crash with no AnyPS5 message. Seen with PPSA04263 (GTA V) 01.010.002. With every top-level entry of `app0/` a symbolic link, the title lists `/app0`, descends only into `sce_module/` (the relinker's real directory), and segfaults in title code within seconds. With the same entries as hard links it lists `/app0`, descends into `update/`, `ps5/` and `sce_sys/`, and runs. `strace -e trace=openat,getdents64` of both runs shows the difference. This documents the current behaviour and does not change it. #4936 and #7273 report host symbolic links to titles as links. ### Tested Linux Mint 22.2, build of main 91ddd9e3a (no changes to `libkernel/File` between that and this branch's base, 81cb86339), PPSA04263 relinked with `--to-intel`: two game folders that differ only in symbolic links versus hard links under `app0/`, as above. The symbolic-link folder crashes at start-up, the hard-link folder does not. Not tested on Windows or macOS. `tools/check_conventions.py` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a (documentation only) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-18 16:28:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T16:28:54Z.


Some 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.

Pull request Shared files not compared
PR 5021 docs/user/USAGE.md
PR 5925 docs/user/USAGE.md
PR 6171 docs/user/USAGE.md
PR 6788 docs/user/USAGE.md
PR 6946 docs/user/USAGE.md
PR 6947 docs/user/USAGE.md
PR 7332 docs/user/USAGE.md
PR 7417 docs/user/USAGE.md
PR 7642 docs/user/USAGE.md
PR 7800 docs/user/USAGE.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252299201 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7592#issuecomment-6252299201). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T16:28:54Z. --- <!-- pr-overlap --> Some 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. | Pull request | Shared files not compared | |---|---| | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/user/USAGE.md` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `docs/user/USAGE.md` | | [PR 6171](https://www.github.com/boykopovar/AnyPS5/pull/6171) | `docs/user/USAGE.md` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `docs/user/USAGE.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/user/USAGE.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/user/USAGE.md` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `docs/user/USAGE.md` | | [PR 7417](https://www.github.com/boykopovar/AnyPS5/pull/7417) | `docs/user/USAGE.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `docs/user/USAGE.md` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `docs/user/USAGE.md` |
jotitadev commented 2026-10-18 18:35:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T18:35:49Z.

Review: COMMENTED


The same applies to macOS hosts once the macOS series lands, so "On Linux" may be too narrow.

  • #7332 (head 605298a4e) adds an __APPLE__ sceKernelGetdirentries in core/libs/prx/libkernel/File/src/Stdio.cpp that lists through fdopendir/readdir and copies the host type unchanged (out[6] = static_cast<char>(entry->d_type);). Its debt entry says so too: "d_type is the host's, whose values equal FreeBSD's".
  • APFS reports a symbolic link to a directory as DT_LNK, not DT_DIR. A minimal readdir probe (arm64, macOS 27.2, APFS) over app0/{real/, linked -> real}:
real     d_type=4 (DT_DIR)
linked   d_type=10 (DT_LNK)

So a title that descends only into DT_DIR entries skips a linked directory on macOS as well. On APFS, cp -c clones are an extra option besides copies and hard links: they take no extra space.

Suggestion: "On Linux and macOS, app0/ must not contain symbolic links ...". Windows not checked.

Written with AI assistance (Claude Code). I ran the checks above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5564306811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7592#pullrequestreview-5564306811). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-18T18:35:49Z. **Review:** COMMENTED --- The same applies to macOS hosts once the macOS series lands, so "On Linux" may be too narrow. - #7332 (head 605298a4e) adds an `__APPLE__` `sceKernelGetdirentries` in `core/libs/prx/libkernel/File/src/Stdio.cpp` that lists through `fdopendir`/`readdir` and copies the host type unchanged (`out[6] = static_cast<char>(entry->d_type);`). Its debt entry says so too: "`d_type` is the host's, whose values equal FreeBSD's". - APFS reports a symbolic link to a directory as `DT_LNK`, not `DT_DIR`. A minimal `readdir` probe (arm64, macOS 27.2, APFS) over `app0/{real/, linked -> real}`: ``` real d_type=4 (DT_DIR) linked d_type=10 (DT_LNK) ``` So a title that descends only into `DT_DIR` entries skips a linked directory on macOS as well. On APFS, `cp -c` clones are an extra option besides copies and hard links: they take no extra space. Suggestion: "On Linux and macOS, `app0/` must not contain symbolic links ...". Windows not checked. Written with AI assistance (Claude Code). I ran the checks above on my machine.
CPritch commented 2026-10-18 18:59:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-18T18:59:46Z.


Thanks for checking APFS. macOS support isn’t in main yet, so I’d keep this sentence to Linux for now and widen it to “On Linux and macOS” when #7332 lands, either here if this is still open or as a one-line follow-up. The cp -c clone note fits better in that change too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253852034 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7592#issuecomment-6253852034). Originally posted by [CPritch](https://github.com/CPritch) on 2026-10-18T18:59:46Z. --- Thanks for checking APFS. macOS support isn’t in main yet, so I’d keep this sentence to Linux for now and widen it to “On Linux and macOS” when #7332 lands, either here if this is still open or as a one-line follow-up. The cp -c clone note fits better in that change too.
adriadam10 commented 2026-10-19 17:37:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T17:37:08Z.


Checked the claim against sceKernelGetdirentries (Stdio.cpp:1078 copies the host d_type, so a symlink is listed as DT_LNK); the sentence is accurate and docs-only; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273346789 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7592#issuecomment-6273346789). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T17:37:08Z. --- Checked the claim against `sceKernelGetdirentries` (`Stdio.cpp:1078` copies the host `d_type`, so a symlink is listed as `DT_LNK`); the sentence is accurate and docs-only; merged.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7592
No description provided.