Skip to content
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

loader: add SetExternalContentSource extension #225

Merged
merged 3 commits into from
Oct 28, 2018

Conversation

misson20000
Copy link
Contributor

Currently WIP, as I've not yet finished writing anything to test this. Posting here for review.

One thing that I'm noticing is that the content management code is becoming very convoluted. Perhaps there should be a different design where there is a stack of content providers that are queried for a given TID+NSO index, where each content provider can either supply the file, reject the file, or pass the request along to the next content provider.

  • ExternalContentSource provider overrides everything
  • HBL content provider
  • SD content provider
  • ExeFS content provider

This type of design would also allow a more powerful extension so that rather than using SetExternalContentSource to override a specific title's contents, a sysmodule could use a more powerful AddExternalContentProvider and use its own logic (rather than the limited logic available in loader) to determine override behavior. I'd like to hear your thoughts on this @SciresM.

@misson20000
Copy link
Contributor Author

I've had to change the original design of the command from SetExternalContentSource(u64 tid, handle<clientsession<IFileSystem>, move>) to SetExternalContentSource(u64 tid) -> handle<serversession<IFileSystem>, move>. This is similar to the design of AtmosphereInstallMitm in SM.

@misson20000 misson20000 changed the title [WIP] loader: add SetExternalContentSource extension loader: add SetExternalContentSource extension Oct 13, 2018
@misson20000
Copy link
Contributor Author

misson20000 commented Oct 13, 2018

Tested working on 3.0.0. (nevermind. I was accidentally using SD card override) I'm having some issues using it on 5.0.0 (0xce01 on svcSendSyncRequest for IFileSystem#Open) but I don't think the cause of that issue lies in loader.

@misson20000 misson20000 changed the title loader: add SetExternalContentSource extension [WIP] loader: add SetExternalContentSource extension Oct 13, 2018
@misson20000 misson20000 changed the title [WIP] loader: add SetExternalContentSource extension loader: add SetExternalContentSource extension Oct 25, 2018
@misson20000
Copy link
Contributor Author

Tested working on 5.0.0, for real this time. Some things that are a little bit dirty about this are that since I mount ECS on code:, I have to short circuit all the override checks to false for the currently ECS'd title and I have to keep it mounted until process launch completes, since normal process launch flow actually mounts ExeFS twice, but we can't get the ECS-Filesystem handle back once we close it like we can for actual ExeFS.

@misson20000
Copy link
Contributor Author

misson20000 commented Oct 25, 2018

Changed to mount ECS as ecs-<title.id> and use the same content-overriding patterns as HBL/SD. Also now supports up to 16 external content sources at a time. Tested still working on 5.0.0.

@SciresM SciresM merged commit 5c147e5 into Atmosphere-NX:master Oct 28, 2018
@misson20000 misson20000 deleted the ldr-externalcontent branch October 28, 2018 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants