Repository navigation
Conversation
Game releases usually arrive as a RAR or ZIP. Until now they had to be extracted first, which costs time, a full extra copy of the game on disk, and a lot of manual steps for large titles. `pack folder` now accepts a `.rar` or `.zip` as the source. The archive is listed once, the game folder inside it is located automatically, and each member is streamed into the exFAT-wrapped `.ffpfsc` builder. Nothing is extracted and no temporary copy is written; the resulting image is the same one the extracted folder would produce. - RAR via the `unrar` tool (multi-volume sets and passwords supported), ZIP built in (AES with the optional `pyzipper`, extra `mkpfs[archives]`). - `--password` / `MKPFS_ARCHIVE_PASSWORD` and `--archive-root` for archives that hold several games. - The AMPR emulation index is generated in memory for emulation builds. - `batch` picks up archives next to folders and images.
Newer UnRAR builds (7.30) list the archive's quick-open record as a member of type Service. It was counted as a file, so archive listings showed one entry too many. Only File and Directory entries are members now.
A game, its update and its DLC usually arrive as separate folders or archives. Packing them meant copying every piece over the base folder first, which needs a second copy of the game and modifies the originals. pack folder now takes --layer (repeatable, bottom to top) with folders or RAR/ZIP archives. The listings are merged, the highest layer wins for each path, and contents are streamed from whichever layer provides them. The image equals the one built from the hand-merged folder, and the AMPR index of emulation builds is generated in memory from the merged listing.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Why?
mkpfs.🔧 What changed
mkpfs pack foldertakes--layer PATH(repeatable, bottom to top). Each layer is a folder or a.rar/.zip; a file in a later layer replaces the same file in the layers below it, folders are merged, and the result is streamed straight into the usual exFAT-wrapped.ffpfscbuilder.eboot.bin/sce_sys, a*-appfolder, or the single folder inside);PATH::FOLDERpicks it explicitly. Release notes (.nfo,.txt) next to it are not packed.ampr_emu.index, generated in memory from the merged listing; a stale index found in any layer is replaced.--passwordapplies to every encrypted archive among the layers.--rawis refused with layers (always exFAT-wrapped).🧪 How to test
mkpfs pack folder ./Game ./Game.ffpfsc --layer ./Game-Update --layer ./Game-DLC.zipmkpfs unpack --deep ./Game.ffpfsc ./outand compare with the folder you get by copying the update and the DLC over the game.uv run --frozen pytest tests/mkpfs/test_layered_source.py(folder+folder, folder+zip, zip base + folder layer, file/folder replacement, AMPR index, CLI round trip, and "the exFAT image of the layers equals the one of the hand-merged folder").ArchiveSubtreestreaming, now behind a smallSourceTreeinterface shared by archives and layers).💬 Notes for non-technical readers
--layeris given.--layeris on top. Put the update after the game, and the DLC after the update, unless the DLC documentation says otherwise.eboot.binreplaces the one below it, exactly as it would if you copied the folders by hand;mkpfswarns when the merged view ends up withouteboot.bin+sce_sys/param.jsonat its root.mkpfs.Builds on #139 (its commits show here until that one is merged). Related to #138.