Hakchi:Variables and Functions
There are a number of functions and variables available in hakchi for use in scripts.
- 1 Variables
- 2 Functions
- 2.1 b0010_functions
- 2.1.1 squashDevice
- 2.1.2 unmountSquash
- 2.1.3 mountSquash
- 2.1.4 mount_base
- 2.1.5 unmount_base
- 2.1.6 remove_old
- 2.1.7 mod_repair_etc
- 2.1.8 mod_repair_modules
- 2.1.9 mount_move
- 2.1.10 remount_root
- 2.1.11 checkFirmware
- 2.1.12 currentFirmware
- 2.1.13 overmountModules
- 2.1.14 loadFirmware
- 2.1.15 shutdown
- 2.1.16 reboot
- 2.1.17 early_getty
- 2.1.18 copy
- 2.1.19 copy_mask
- 2.1.20 restore
- 2.1.21 mount_bind
- 2.1.22 overmount
- 2.1.23 containsGames
- 2.1.24 linkGames
- 2.1.25 softwareCheck
- 2.1.26 repair_fonts
- 2.1.27 checkGamepath
- 2.1.28 checkPath
- 2.1.29 findGameSyncStorage
- 2.1.30 findGameStorage
- 2.1.31 overmount_games
- 2.1.32 uilist
- 2.1.33 uikill
- 2.1.34 uistop
- 2.1.35 uistart
- 2.1.36 uipause
- 2.1.37 uiresume
- 2.1.38 gameover
- 2.1.39 printSoftwareInfo
- 2.1.40 stopTask
- 2.1.41 waitTask
- 2.1.42 showImage
- 2.1.43 playSound
- 2.1.44 hwmon
- 2.1.45 usedBlockSpace
- 2.1.46 freeBlockSpace
- 2.1.47 usedSpace
- 2.1.48 usedBy
- 2.2 b0020_backup
- 2.3 b0030_package
- 2.4 b0040_usb
- 2.1 b0010_functions
If you have a standalone script and would like to read one of these variables,
/bin/hakchi get can be used with the variable name as the first parameter.
If you're in a preinit.d script, you can access the variable directly.
The name of the mod, this is set to
The mod path, this is set to
Depending on if the system is in preinit or normal boot, this can be one of two values,
/newroot or nothing
The location that hakchi is installed to, set to
The location on nand that hakchi will search for the default hsqs image in, set to
The location on external storage that hakchi will search for the default hsqs image in, set to
The rootfs folder containing folders that get overmounted on top of the stock ones, set to
A mount point containing the original squashfs image, set to
The location of the preinit loader file, set to
The location of the preinit.d folder, set to
The type of system currently booted, it can be one of two values:
The region of the system currently booted, it can be one of the following values:
The location of the original game path that gets overmounted with the custom games
The location of the user profile containing save data among other things, set to
The temporary directory, set to
If you have a standalone script and would like to run one of these functions,
/bin/hakchi can be used with the function name as the first parameter.
If you're in a preinit.d script, you can call the function directly.
Checks for the existence of the path passed as the first argument and if it exists, prints the path and returns an exit code of 0
If the path doesn't exist, nothing will be printed and the function will return an exit code of 1
Prints the base directory that games should be synced to.
Prints the path that is currently being used for the games or returns an exit code of 1 if no custom games are found.
Lists all processes currently using the display.
Kills all processes currently using the display.
Stops all processes currently using the display.
Starts the Nintendo UI
Suspends all processes using the display.
Resumes all processes using the display.
Powers down the system.
Prints the system type and region
Displays the png image file passed as the first argument.
Plays the wav sound file passed as the first argument.
Displays the number of 1024KB blocks used by the volume passed as the first argument.
Displays the remaining number of 1024KB blocks for the volume passed as the first argument.
Prints the amount of space used by a folder.
A helper function that accepts one of the following variables and calls
usedSpace with the corresponding path.
The functions in b0030_package are used during hmod installation and management.