From c1e069c066a609103c6b880585738ecabe48ddd2 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Tue, 2 Oct 2018 08:56:56 -0400 Subject: fsmitm_romfsbuild: Extract stubs and IPS to romfs_ext dir --- src/core/file_sys/patch_manager.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/core/file_sys/patch_manager.cpp') diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 539698f6e..76b51fe56 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -162,11 +162,17 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t [](const VirtualDir& l, const VirtualDir& r) { return l->GetName() < r->GetName(); }); std::vector layers; + std::vector layers_ext; layers.reserve(patch_dirs.size() + 1); + layers_ext.reserve(patch_dirs.size() + 1); for (const auto& subdir : patch_dirs) { auto romfs_dir = subdir->GetSubdirectory("romfs"); if (romfs_dir != nullptr) layers.push_back(std::move(romfs_dir)); + + auto ext_dir = subdir->GetSubdirectory("romfs_ext"); + if (ext_dir != nullptr) + layers.push_back(std::move(ext_dir)); } layers.push_back(std::move(extracted)); @@ -175,7 +181,12 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t return; } - auto packed = CreateRomFS(std::move(layered)); + auto layered_ext = LayeredVfsDirectory::MakeLayeredDirectory(std::move(layers_ext)); + if (layered_ext == nullptr) { + return; + } + + auto packed = CreateRomFS(std::move(layered), std::move(layered_ext)); if (packed == nullptr) { return; } -- cgit v1.2.3 From d0e6b936959cf1846009f5766a6bd597401a8fa5 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 4 Oct 2018 14:09:11 -0400 Subject: patch_manager: Avoid romfs_ext requirement for patching --- src/core/file_sys/patch_manager.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/core/file_sys/patch_manager.cpp') diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 76b51fe56..d0dc731f8 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -172,7 +172,7 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t auto ext_dir = subdir->GetSubdirectory("romfs_ext"); if (ext_dir != nullptr) - layers.push_back(std::move(ext_dir)); + layers_ext.push_back(std::move(ext_dir)); } layers.push_back(std::move(extracted)); @@ -182,9 +182,6 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t } auto layered_ext = LayeredVfsDirectory::MakeLayeredDirectory(std::move(layers_ext)); - if (layered_ext == nullptr) { - return; - } auto packed = CreateRomFS(std::move(layered), std::move(layered_ext)); if (packed == nullptr) { -- cgit v1.2.3