Linux: guest paths are resolved case-sensitively, so titles miss files the console would find #1047

Closed
opened 2026-10-07 04:24:09 +00:00 by fisherjoey · 3 comments
fisherjoey commented 2026-10-07 04:24:09 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-07T04:24:09Z.


Summary

ResolvePath (core/libs/prx/libc/src/General.cpp) turns a guest path into a host path without looking at case. The PS5 file system and Windows hosts ignore case, but Linux does not, so a title that opens a package file with different casing gets ENOENT on Linux only.

The APR size cache already compares names case-insensitively (libkernel/Apr/src/Apr.cpp, "like the host file system"), so APR reads work. sceKernelOpen, stat and the other paths that go through ResolvePath do not.

Example

Demon's Souls (PPSA01341 v1.07) ships app0/PackageCmdLineArgs.txt and opens /app0/packagecmdlineargs.txt:

[src/Open.cpp:100 sceKernelOpen] path=/app0/packagecmdlineargs.txt flags=0x0 nativeFlags=0x0 mode=00

The open fails on Linux, so +cp11_callHomeLockDownEnabled=false is never applied and the title waits forever for a developer tools connection (details in #1025). Its front-end script also names movies with mixed case and backslashes, for example $\Movies\Main_Menu.bk2 while the file is movies/main_menu.bk2, so the same problem returns once the menu is reached.

A lowercase symlink to the file is enough to confirm it: the title then shows the SIE logo and plays its first movie.

Proposed fix

On Linux, when the exact path does not exist, resolve each component with a case-insensitive match against the directory listing, and cache listings per directory as the APR cache does. Exact matches stay on the fast path, so titles with correct casing pay nothing. Ambiguous matches (two names that differ only in case) prefer the exact name and otherwise fail as before.

Found on Linux 7.2 (Nobara 44), GCC 16, RTX 5070 Ti, with Demon's Souls PPSA01341 v1.07.

I can send a PR for this if the approach looks right.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5739337166 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1047). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-07T04:24:09Z. --- ### Summary `ResolvePath` (`core/libs/prx/libc/src/General.cpp`) turns a guest path into a host path without looking at case. The PS5 file system and Windows hosts ignore case, but Linux does not, so a title that opens a package file with different casing gets `ENOENT` on Linux only. The APR size cache already compares names case-insensitively (`libkernel/Apr/src/Apr.cpp`, "like the host file system"), so APR reads work. `sceKernelOpen`, `stat` and the other paths that go through `ResolvePath` do not. ### Example Demon's Souls (PPSA01341 v1.07) ships `app0/PackageCmdLineArgs.txt` and opens `/app0/packagecmdlineargs.txt`: ``` [src/Open.cpp:100 sceKernelOpen] path=/app0/packagecmdlineargs.txt flags=0x0 nativeFlags=0x0 mode=00 ``` The open fails on Linux, so `+cp11_callHomeLockDownEnabled=false` is never applied and the title waits forever for a developer tools connection (details in #1025). Its front-end script also names movies with mixed case and backslashes, for example `$\Movies\Main_Menu.bk2` while the file is `movies/main_menu.bk2`, so the same problem returns once the menu is reached. A lowercase symlink to the file is enough to confirm it: the title then shows the SIE logo and plays its first movie. ### Proposed fix On Linux, when the exact path does not exist, resolve each component with a case-insensitive match against the directory listing, and cache listings per directory as the APR cache does. Exact matches stay on the fast path, so titles with correct casing pay nothing. Ambiguous matches (two names that differ only in case) prefer the exact name and otherwise fail as before. Found on Linux 7.2 (Nobara 44), GCC 16, RTX 5070 Ti, with Demon's Souls PPSA01341 v1.07. I can send a PR for this if the approach looks right. AI-assisted: yes.
klosixgaming-arch commented 2026-10-08 11:53:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:53:21Z.


This is an important compatibility issue for Linux. Based on my review of recent PRs related to libc and filesystem handling (including #1512 for swprintf formatting and #1507 for wcsrtombs implementation), I can provide some context:

The fact that the PS5 file system and Windows hosts ignore case, but Linux does not, is a well-known source of compatibility issues. The APR size cache already comparing names case-insensitively (as noted in the issue) suggests this pattern should be extended to path resolution as well.

Some observations based on similar issues I've seen:

  1. This could affect many titles that use different casing for file paths than what's actually on disk
  2. The fix would likely involve modifying ResolvePath in core/libs/prx/libc/src/General.cpp to perform case-insensitive matching on Linux
  3. This should be coordinated with any other filesystem-related changes to ensure consistency

I'd suggest implementing this fix, as it addresses a real compatibility issue that affects titles running on Linux hosts.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059270486 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1047#issuecomment-6059270486). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T11:53:21Z. --- This is an important compatibility issue for Linux. Based on my review of recent PRs related to libc and filesystem handling (including #1512 for swprintf formatting and #1507 for wcsrtombs implementation), I can provide some context: The fact that the PS5 file system and Windows hosts ignore case, but Linux does not, is a well-known source of compatibility issues. The APR size cache already comparing names case-insensitively (as noted in the issue) suggests this pattern should be extended to path resolution as well. Some observations based on similar issues I've seen: 1. This could affect many titles that use different casing for file paths than what's actually on disk 2. The fix would likely involve modifying `ResolvePath` in `core/libs/prx/libc/src/General.cpp` to perform case-insensitive matching on Linux 3. This should be coordinated with any other filesystem-related changes to ensure consistency I'd suggest implementing this fix, as it addresses a real compatibility issue that affects titles running on Linux hosts.
NahuelGenchi commented 2026-10-08 15:52:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by NahuelGenchi on 2026-10-08T15:52:33Z.


This looks fixed on main already. #1321 (commit 4f23830d) made ResolveHostPath in libc/src/General.cpp match each missing component against the directory listing with a case-insensitive compare, and the guest_path_case test covers mixed-case reads and mounts. An exact match still takes the fast path, and two names that differ only in case throw as ambiguous. I haven't tried Demon's Souls itself, but /app0/packagecmdlineargs.txt against PackageCmdLineArgs.txt is the case it handles. Could the issue be closed, or is something still failing for you after pulling that?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6063754216 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1047#issuecomment-6063754216). Originally posted by [NahuelGenchi](https://github.com/NahuelGenchi) on 2026-10-08T15:52:33Z. --- This looks fixed on main already. #1321 (commit 4f23830d) made `ResolveHostPath` in `libc/src/General.cpp` match each missing component against the directory listing with a case-insensitive compare, and the `guest_path_case` test covers mixed-case reads and mounts. An exact match still takes the fast path, and two names that differ only in case throw as ambiguous. I haven't tried Demon's Souls itself, but `/app0/packagecmdlineargs.txt` against `PackageCmdLineArgs.txt` is the case it handles. Could the issue be closed, or is something still failing for you after pulling that?
fisherjoey commented 2026-10-08 16:41:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T16:41:54Z.


Thanks, that's the case. #1321 handles /app0/packagecmdlineargs.txt against PackageCmdLineArgs.txt the same way the fix proposed here did, so I'm closing this. I haven't booted Demon's Souls on a main that includes #1321 yet; I'll reopen if it doesn't get past the black screen.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6064627938 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1047#issuecomment-6064627938). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T16:41:54Z. --- Thanks, that's the case. #1321 handles `/app0/packagecmdlineargs.txt` against `PackageCmdLineArgs.txt` the same way the fix proposed here did, so I'm closing this. I haven't booted Demon's Souls on a main that includes #1321 yet; I'll reopen if it doesn't get past the black screen.
Sign in to join this conversation.
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#1047
No description provided.