From d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Tue, 25 Sep 2018 09:19:42 -0400 Subject: patch_manager: Add support for packed updates Will prefer any installed update over the packed version. --- src/core/file_sys/romfs_factory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/file_sys/romfs_factory.cpp') diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index 4994c2532..a0ee16895 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -24,6 +24,7 @@ RomFSFactory::RomFSFactory(Loader::AppLoader& app_loader) { LOG_ERROR(Service_FS, "Unable to read RomFS!"); } + app_loader.ReadUpdateRaw(update_raw); updatable = app_loader.IsRomFSUpdatable(); ivfc_offset = app_loader.ReadRomFSIVFCOffset(); } @@ -35,7 +36,8 @@ ResultVal RomFSFactory::OpenCurrentProcess() { return MakeResult(file); const PatchManager patch_manager(Core::CurrentProcess()->GetTitleID()); - return MakeResult(patch_manager.PatchRomFS(file, ivfc_offset)); + return MakeResult( + patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); } ResultVal RomFSFactory::Open(u64 title_id, StorageId storage, ContentRecordType type) { -- cgit v1.2.3 From 38c2ac95af814e21e65e2785b276c4f64bfead71 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Fri, 5 Oct 2018 08:53:45 -0400 Subject: romfs_factory: Extract packed update setter to new function --- src/core/file_sys/romfs_factory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/core/file_sys/romfs_factory.cpp') diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index a0ee16895..0b645b106 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -24,13 +24,16 @@ RomFSFactory::RomFSFactory(Loader::AppLoader& app_loader) { LOG_ERROR(Service_FS, "Unable to read RomFS!"); } - app_loader.ReadUpdateRaw(update_raw); updatable = app_loader.IsRomFSUpdatable(); ivfc_offset = app_loader.ReadRomFSIVFCOffset(); } RomFSFactory::~RomFSFactory() = default; +void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) { + this->update_raw = std::move(update_raw); +} + ResultVal RomFSFactory::OpenCurrentProcess() { if (!updatable) return MakeResult(file); -- cgit v1.2.3