-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS/FS: Reimplement many functions in a more accurate way #8539
Commits on Jan 25, 2020
-
IOS/FS: Move path validity check functions
They will be used in more places than just HostBackend/FS.cpp. Also fix the check and make it accurate while we're at it.
Configuration menu - View commit details
-
Copy full SHA for d185bc6 - Browse repository at this point
Copy the full SHA d185bc6View commit details -
IOS/FS: Add base FST functions
Some official titles rely on implementation details of Nintendo's FS sysmodule and will not work properly if those are changed. Notably, some games and older versions of the System Menu appear to be relying on the order of files returned by FS::ReadDirectory and will either fail to find their save data (for Bolt) or outright crash (for the System Menu). Some titles also actually expect filesystem metadata to be correct. One title that has been confirmed to do this is DQX, which generates paths based on the GID of files within its own title directory. While it is easy to make workarounds for these issues -- and in fact we already do have some for the sysmenu and DQX, having hacks is obviously nonideal and adding yet another hack would be required to fix Bolt -- one that would be even uglier. Furthermore, while it is currently unknown whether any official title cares about permissions, the lack of FS metadata means that we are unable to implement them if that turns out to be desirable or necessary. By adding a FST, we can implement things correctly and solve all those problems without hacks. Apart from DQX, the sysmenu and Bolt, this changeset also fixes the Photo Channel complaining about corrupted system files on the initial launch. This first commit adds the basic structures and functions that are necessary to load, save, query and update our version of the FST. For simplicity, a binary format that is inspired from Nintendo's FST structure was chosen for serialization. It is not expected to ever receive an update. PS: an update on the NAND image backend: A long time ago I had planned to add another FS backend which would be using a NAND image/blob as the storage. While I have already written an implementation that has been tested, solves all the aforementioned issues and more, produces images that are fully compatible with IOS's FS driver, I feel like NAND images raise too many issues: savestate sizes, code complexity and maintenance cost. Since many fixes and additions that are part of that implementation (e.g. FS timings, utility structures, FST) have already been merged or will be submitted as part of this changeset, I will likely not submit the branch.
Configuration menu - View commit details
-
Copy full SHA for f743f10 - Browse repository at this point
Copy the full SHA f743f10View commit details -
IOS/FS: Move /tmp clearing back to the IPC interface
Prevents /tmp from being cleared unnecessarily; clearing /tmp is normally only done once every time IOS is reloaded.
Configuration menu - View commit details
-
Copy full SHA for 0543598 - Browse repository at this point
Copy the full SHA 0543598View commit details -
IOS/FS: Make sure FS root directory exists
Previously, the FS root directory would get created as a side effect of calling CreateDirectory during boot (since the implementation was sloppy and used File::CreateFullDir). Since CreateDirectory no longer does that, it is necessary to ensure that the FS root directory does exist by creating it explicitly.
Configuration menu - View commit details
-
Copy full SHA for a83d9e5 - Browse repository at this point
Copy the full SHA a83d9e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36676d2 - Browse repository at this point
Copy the full SHA 36676d2View commit details -
Core: Fix a few misuses of FS::CreateDirectory
CreateDirectory does not create missing parent directories. If that behaviour is desired, CreateFullPath should be used instead. (These small misuses went unnoticed since the previous implementation of CreateDirectory automatically created parent directories.)
Configuration menu - View commit details
-
Copy full SHA for 8f74d02 - Browse repository at this point
Copy the full SHA 8f74d02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8517528 - Browse repository at this point
Copy the full SHA 8517528View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53ceb6c - Browse repository at this point
Copy the full SHA 53ceb6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a40f297 - Browse repository at this point
Copy the full SHA a40f297View commit details -
IOS/FS: Implement ReadDirectory properly and remove sorting hack
With the CreateFile/CreateDirectory fix and this commit, we can finally return correct results in ReadDirectory and the sorting hack -- whose purpose was to prevent certain versions of the System Menu from crashing -- can be removed too.
Configuration menu - View commit details
-
Copy full SHA for 396429d - Browse repository at this point
Copy the full SHA 396429dView commit details -
IOS/FS: Implement GetMetadata properly and remove GID hack
Now that all FS functions that create new inodes are properly implemented, we can make GetMetadata actually return correct file metadata rather than giving fixed information. The hack for the DQX installer can also be removed now since our ES and FS keep track of caller UID/GIDs now.
Configuration menu - View commit details
-
Copy full SHA for e4dd582 - Browse repository at this point
Copy the full SHA e4dd582View commit details -
Configuration menu - View commit details
-
Copy full SHA for 142b7e0 - Browse repository at this point
Copy the full SHA 142b7e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 484cfb9 - Browse repository at this point
Copy the full SHA 484cfb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4ba0ac - Browse repository at this point
Copy the full SHA d4ba0acView commit details -
UnitTests/FS: Fix file rename tests
Files cannot be given a different file name, only moved across directories. Add a test for that behaviour and fix the existing RenameWithExistingTargetFile test.
Configuration menu - View commit details
-
Copy full SHA for 8789a6d - Browse repository at this point
Copy the full SHA 8789a6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for af416c6 - Browse repository at this point
Copy the full SHA af416c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 150c832 - Browse repository at this point
Copy the full SHA 150c832View commit details -
UnitTests/FS: Improve deletion test
* Test recursive directory deletion * Test "in use" check for both files and directories
Configuration menu - View commit details
-
Copy full SHA for 031c63e - Browse repository at this point
Copy the full SHA 031c63eView commit details -
IOS/ES: Remove now unnecessary title sorting hack
ES now uses FS to access the filesystem and FS's ReadDirectory now returns file lists that are correctly ordered.
Configuration menu - View commit details
-
Copy full SHA for c02e7de - Browse repository at this point
Copy the full SHA c02e7deView commit details