feat(cargo-nx): pack a homebrew title into an installable NSP - #76
Merged
Merged
Conversation
Building an NSP was the one step of the homebrew pipeline this workspace could not do, so it was left to an external binary; `nx-object` now carries the containers, and what remains here is the keyset, the ciphers, and the orchestration none of it belongs in a format crate. - Add `cargo nx tool hacbrewpack`, building the program, control, manual and metadata NCAs in memory and packing them into `<titleid>.nsp`, with the individual archives written out only under `--keepncadir` - Add `keyset`, which reads a keyset file and derives the header key and the application key area key from a master key when the file does not list them, stopping short of the console-unique chain a packing keyset never carries - Add `crypto`, holding the three AES modes the containers need, including the big-endian XTS tweak the console uses in place of the standard's - Validate and patch `main.npdm` and `control.nacp` in place, backing each original up first, and advertise the key that signs the program NCA header so the console's second signature check passes - Move the pinned `nx-object` revision to the one carrying the NCA and CNMT builders Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
The subcommand was added without being written into either place a reader looks for the set of utilities, so it was reachable only by already knowing it existed. - Add `hacbrewpack` to the utility list `cargo nx tool --help` prints - Document the subcommand in the README, covering the directories it reads, the keys it needs and where it looks for them, and the files it patches in place - Record the two ways it departs from what it replaces: intermediates are built in memory, so `--tempdir` is accepted and ignored, and key derivation stops at the master keys - Move the pinned `nx-object` revision to the one whose field names follow the format Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
The revision the packing subcommand was built against lived on a branch, so the pin would have dangled the moment that branch was deleted. - Move the pinned revision to the squashed commit now on `nx-object`'s `main` Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
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.
Building an NSP was the one step of the homebrew pipeline this workspace could not do, so it was left to an external binary;
nx-objectnow carries the containers, and what remains here is the keyset, the ciphers, and the orchestration none of it belongs in a format crate.cargo nx tool hacbrewpack, building the program, control, manual and metadata NCAs in memory and packing them into<titleid>.nsp, with the individual archives written out only under--keepncadirkeyset, which reads a keyset file and derives the header key and the application key area key from a master key when the file does not list them, stopping short of the console-unique chain a packing keyset never carriescrypto, holding the three AES modes the containers need, including the big-endian XTS tweak the console uses in place of the standard'smain.npdmandcontrol.nacpin place, backing each original up first, and advertise the key that signs the program NCA header so the console's second signature check passesnx-objectrevision to the one carrying the NCA and CNMT builders