Hakchi:Variables and Functions

From hakchi
Revision as of 19:51, 30 May 2018 by DanTheMan827 (talk | contribs) (findGameStorage)
Jump to: navigation, search

There are a number of functions and variables available in hakchi for use in scripts.

Contents

Variables

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.

modname

The name of the mod, this is set to hakchi

modpath

The mod path, this is set to /$modname

mountpoint

Depending on if the system is in preinit or normal boot, this can be one of two values, /newroot or nothing

installpath

The location that hakchi is installed to, set to $mountpoint/var/lib/$modname

firmwarepath

The location on nand that hakchi will search for the default hsqs image in, set to $installpath/firmware

extfirmwarepath

The location on external storage that hakchi will search for the default hsqs image in, set to $mountpoint/media/$modname/firmware

rootfs

The rootfs folder containing folders that get overmounted on top of the stock ones, set to $installpath/rootfs

squashfs

A mount point containing the original squashfs image, set to $mountpoint/var/squashfs

preinit

The location of the preinit loader file, set to $rootfs/etc/preinit

preinitpath

The location of the preinit.d folder, set to $preinit.d

sftype

The type of system currently booted, it can be one of two values: nes or snes

sfregion

The region of the system currently booted, it can be one of the following values:

  • usa
  • eur
  • jpn

gamepath

The location of the original game path that gets overmounted with the custom games

profilepath

The location of the user profile containing save data among other things, set to /var/lib/clover/profiles/0

temppath

The temporary directory, set to /tmp

Functions

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.

b0010_functions

squashDevice

unmountSquash

mountSquash

mount_base

unmount_base

remove_old

mod_repair_etc

mod_repair_modules

mount_move

remount_root

checkFirmware

currentFirmware

overmountModules

loadFirmware

shutdown

reboot

early_getty

copy

copy_mask

restore

mount_bind

overmount

containsGames

linkGames

softwareCheck

repair_fonts

checkGamepath

checkPath

findGameSyncStorage

findGameStorage

Prints the path that is currently being used for the games or returns an exit code of 1 if no custom games are found.

overmount_games

uilist

uikill

uistop

uistart

uipause

uiresume

gameover

printSoftwareInfo

stopTask

waitTask

showImage

playSound

hwmon

usedBlockSpace

freeBlockSpace

usedSpace

usedBy

b0020_backup

backup_one

backup_nandb

backup_nandc

backup

dumpFirmware

b0030_package

transfer_file

transfer_default

transfer_path

pack_upath

pack_install

pack_list

pack_uninstall

packs_install

packs_uninstall

b0040_usb

disableUsbDevice

switchToUsbDevice

switchToUsbHost

getUsbStorageIds

waitForStorageDevice

waitForUsbDevice

waitForMmcDevice

checkStorageDevice

checkExtStorage