Internal Variable Initialisation

Oh hello, you might be wondering “What the heck is this?” and that is totally understandable. The following is information about how the internal device and global variable system works. Upon startup of the device through /opt/muos/script/system/startup.sh at the top we initialise both the device specific variables and global variables.

Device Specific Initialisation

  • First, we run /opt/muos/script/var/init.sh init device which runs through the config.ini file at the specific device at /opt/muos/device.
    • At this stage we have yet to copy the specific device to /opt/muos/device/current so we rely on the device name at /opt/muos/config/device.txt which is initialised through /opt/muos/script/var/func.sh.
      • Still following?..
  • These variables are now at /run/muos/device ready for any scripts or the muX frontend to use.
  • All of the variables can be changed at runtime by running printf 10 /run/muos/device/blah/yeah (as an example).
    • If you did run the above you will find that it will save the following to the device specific configuration
[blah]
yeah = 10
  • If you do modify these values ensure that you use printf and not echo as we do not want a newline to be present.
  • Upon safe reboot, or shutdown, these variables are then saved back into the device specific config.ini file. Changing some of these values, or deleting them altogether, may cause a non-working device.

Global Variable Initialisation

  • Similar to the above device specific initialisation the global file at /opt/muos/config/config.ini holds all the specifics for user changeable configuration.
  • This is started within the startup as /opt/muos/script/var/init.sh init global
  • Most of the values can be changed within the frontend configuration module.
  • These values are used by the frontend, emulators, and applications.
  • You can find these values at /opt/muos/global and can be changed at runtime and will be reflected in the frontend.

Kiosk Initialisation

  • Towards the later stages of the startup script we look for a specific file at /opt/muos/config/kiosk.ini and if it exists, we process that file.
  • The startup script runs /opt/muos/script/var/init.sh init kiosk and places the values at, you guessed it, /run/muos/kiosk and is primarily used by the muX frontend but I suppose it can be read by any emulator or application too.
  • Again, these values can be changed during runtime.
  • More information about Kiosk Mode can be found here, Kiosk Mode | muOS.

The information provided here is current and will be updated periodically.

3 Likes