Delta Patches in a Development Environment

What are Delta Patches?

A delta patch is an update that uses only the data that was updated rather than the entire data set. With the Wii U, delta patches can only be used with a patch update.

As the name suggests, delta patches are made with only the differences in the data, which makes it possible to reduce the data size and the installation time, compared to the typical process of rewriting all of the data. This is the mechanism that is actually used when Wii U patch updates are performed commercially.

Only use this feature for debugging purposes. When making master submissions, submit a wumad file of the patch to the data used in the previous master submission.

When Delta Patches Can Be Used

Delta patches can only be used with the wumad file that was used to create the patch specified with makecfmaster patch -p, or with a wumad file that follows from it. When reverting to a previous version, if the update is made from a patch that is not in a parent-child relationship (as shown in the relationships between the A's and B's in the figure), it is necessary to delete the data and restart the installation.

Examples of when delta patches can and cannot be used are provided below. The blue lines indicate references to the wumad file specified in makecfmaster patch -p.

Delta patches can be used in states that follow the blue arrows. For example, updates to 4.0 are possible from 3.0 (B), 2.0 (B), and 1.0. Conversely, delta patches cannot be made from 5.0, 3.0 (A) or 2.0 (A).

Creating Data for Delta Patches

When making a delta patch, it is necessary to extract only the files that are needed rather than the full data set that would be used for a normal installation image (the data created when running makecfdownloadimage.sh on the wumad file). Also, the data set required depends on the versions being updated from and updated to, so it is not possible to create a data set that would enable delta patches from any version. If updates must be possible from any state, install a full data set.

For example, to create the data for a delta patch to version 4.0 shown in the diagram, it would be necessary to prepare the following three sets of data.

Each of these data sets would be a subset of the installation image created with makecfdownloadimage.sh. It is not necessary to redo the build for each set of differential data.

The extraction of the differential data requires an installation image created with makecfdownloadimage.sh for each version. The extraction is performed as follows using cafe_extractDifferecne.exe.

$ cafe_extractDifference.exe -install -base ./v2B_p01/ -target ./v4_p01/ -output ./output_v2B_to_v4/

In this example, the data set for the installation from the v2B state to v4 is extracted and output to the output_v2B_to_v4 directory. The delta patch can be performed by installing this output_v2B_to_v4 directory with the System Config Tool.

NOTE:
Installation usually ends successfully even when an incorrect delta data set is applied. For example, this might be a case where the patch installed is v1, but v2B_to_v4 was applied. In this case the installed ROM set would be incorrect.

Conversely, if v1_to_v4 were to be applied in a state where v2B was installed, it would be applied correctly, although the time required for the update would be longer. Use this approach if having multiple data sets requires a large amount of effort or if the individual differences are small.

Envisioned Usage

This section explains specifically how differential updates are used in application development.

When debugging a patch that is a delta patch from the patch you put through debugging previously. You need to retain the patch that you are debugging as the wumad file and installation image. If you are only testing the patch by installing it in the System Config Tool, it is not necessary to update the version number. You can increment it after the master submission.

Create the new patch by specifying -p on the wumad file of the previous patch. Run makecfdownloadimage on the new patch to make the installation image. Next, run cafe_extractDifference.exe with the installation image from the previous patch to extract the delta patch data. Use this data as the new patch for debugging. Always use this delta patch data on the console that has the previous patch installed. Otherwise, the ROM will not be in the expected state. In such cases, Nintendo recommends redoing the installation from the beginning using an installation image with the full set of data for the new patch.

If you are unsure about the new patch and are reverting to a previous patch, you cannot use this delta patch data method to do so. Delete the patch and redo the installation.

Notes on Making the Master Submission

The feature for delta patches described here is for shortening the time required for development. When actually submitting master data, be sure to submit a wumad file that was built by specifying makecfmaster patch -p on the previously released master data. Patches that are created specifying a patch that is currently in development will not be accepted.

See Also

Application Mastering Overview
Application Patches

Revision History

2014/07/08 Replaced makecfmaster.sh with makecfmaster.exe.
2013/05/08 Automated cleanup pass.
2013/02/19 Initial version.


CONFIDENTIAL