hmod

From hakchi
Revision as of 17:14, 4 June 2019 by Beardgoggles3000 (talk | contribs) (Added example of hmod structure.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

An hmod is either a folder ending in ".hmod" or a gzip-compressed tar archive with the ".hmod" file extension.

Installation[edit | edit source]

All folders and files in the hmod with the exception of any readme, install, or uninstall script will be copied to $rootfs unless the install script for the hmod returns a non-zero exit code.

Install script[edit | edit source]

A script file named install can be made and make use of any hakchi function provided by files in the /etc/preinit.d folder.

If this script returns a non-zero exit code, the hmod files will not be copied to $rootfs

Uninstall script[edit | edit source]

A script file named uninstall can be made and make use of any hakchi function provided by files in the /etc/preinit.d folder.

This script will be run during hmod uninstall, and a list of files copied to $rootfs will automatically be appended to the uninstall script for removal.

If you do not wish to have an uninstall script generated, you can make a file with the contents of no-uninstall

Variables[edit | edit source]

transferpath[edit | edit source]

During hmod install, a variable of $transferpath will be available and will contain the path containing the data for the hmod currently being installed.

Structure[edit | edit source]

As an example, the advanced_music_hack.hmod is structured as follows:

advanced_music_hack.hmod
│   readme.md
│
├───etc
│   └───preinit.d
│           bb223_advanced_music_hack
│           pb223_advanced_music_hack
│
└───usr
    └───share
        └───advanced_music_hack
                bgm_boot.wav

In this example, the hmod's structure matches that of the SNES Mini's file structure and, as there is no install script, the structure will be directly replicated on $rootfs.

In other cases, an install script can be used to copy files to other folders, such as those where the path is region-specific and a custom variable needs to be defined.

See also[edit | edit source]