calamares/src/modules
2016-10-26 21:40:14 +02:00
..
bootloader Fix VFAT filename handling in bootloader module. 2016-09-16 16:31:38 +02:00
displaymanager [displaymanager] use same pattern for all str.format calls 2016-10-26 21:40:14 +02:00
dracut Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
dracutlukscfg [dracutlukscfg] New module: pre-configuration for dracut+LUKS. 2016-10-16 19:08:16 +02:00
dummycpp New dummycpp C++ job module (ported from dummypython). 2016-09-27 17:25:09 +02:00
dummyprocess Add option to run process jobmodules in chroot. 2014-08-12 14:26:10 +02:00
dummypython Fix typo. 2016-09-26 10:57:56 +02:00
finished Force reboot with systemctl -i. 2016-06-09 17:26:26 +02:00
fstab [fstab] Write configurable options to crypttab (default: luks). 2016-10-13 19:01:13 +02:00
grubcfg [grubcfg] Compare integers to integers, not strings. 2016-10-21 00:19:22 +02:00
hwclock A little more PEP 2015-06-14 06:56:56 -04:00
initcpio Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
initcpiocfg Add openswap hook handling to initcpiocfg. 2016-05-13 16:09:35 +02:00
initramfs Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
initramfscfg [initramfscfg] New module: pre-configuration for update-initramfs. 2016-10-13 19:20:20 +02:00
interactiveterminal PluginFactory in InteractiveTerminal module. 2015-09-15 16:48:42 +02:00
keyboard Make writeEtcDefaultKeyboard an option in keyboard.conf. 2016-09-26 10:57:57 +02:00
license Port away from most cases of Q_FOREACH to C++11 ranged for loop. 2016-09-01 16:46:14 +01:00
locale Config file comment. 2016-09-26 10:57:56 +02:00
localecfg Fix localecfg to work with new locale module. 2016-08-10 12:11:48 +02:00
luksbootkeyfile Associate the crypto_keyfile with all remaining LUKS devices, if any. 2016-05-13 13:39:33 +02:00
luksopenswaphookcfg Strip leading / from openswap config path. 2016-05-13 18:13:29 +02:00
machineid [machineid] simplify code 2016-07-28 02:37:51 +02:00
mount Mount correctly. 2016-05-06 18:59:51 +02:00
netinstall In the netinstall page, always show the arrow-down button. 2016-09-21 12:56:38 +02:00
networkcfg Remove target resolv.conf before proceeding. 2016-09-22 15:43:41 +02:00
packages improve portage backend, so that it removes ALL calamares deps 2016-08-12 15:32:35 +01:00
partition Use the target system's boot name in partitioning summary widget. 2016-10-14 15:27:24 +02:00
plymouthcfg [plymouthcfg] add module to configure Plymouth (#256) 2016-09-12 07:59:17 +02:00
removeuser Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
services [services] Document that systemctl enable/disable are chroot-safe 2016-01-15 02:28:57 +01:00
summary Port away from most cases of Q_FOREACH to C++11 ranged for loop. 2016-09-01 16:46:14 +01:00
umount Try to fix umount. 2016-01-21 14:46:02 +01:00
unpackfs . 2016-06-05 13:16:31 +01:00
users users: Drop dependency on chfn. (#260) 2016-09-16 07:55:04 +02:00
webview WEBVIEW_FORCE_WEBKIT option for webview module. 2016-04-22 15:56:37 +02:00
welcome Warning in debug output when the RequirementsChecker is misconfigured. 2016-09-16 10:54:39 +02:00
CMakeLists.txt Do not build modules listed in SKIP_MODULES. 2015-08-28 17:38:36 +02:00
globalStorage.yaml Consistency: calamares_main ==> run; global_storage => globalStorage 2014-07-25 16:46:12 +02:00
README.md Update Calamares modules documentation. 2014-08-06 15:50:39 +02:00
testmodule.py Python Better Docstrings 2015-02-25 14:49:23 +01:00

Calamares modules

Calamares modules are plugins that provide features like installer pages, batch jobs, etc. Each Calamares module lives in its own directory.

All modules are installed in $DESTDIR/lib/calamares/modules.

Module directory and descriptor

A Calamares module must have a module descriptor file, named module.desc, this file must be placed in the module's directory. The module descriptor file is a YAML 1.2 document which defines the module's name, type, interface and possibly other properties. The name of the module as defined in module.desc must be the same as the name of the module's directory.

There are two types of Calamares module:

  • viewmodule,
  • jobmodule.

There are three interfaces for Calamares modules:

  • qtplugin,
  • python,
  • process.

Module-specific configuration

A Calamares module may read a module configuration file, named <modulename>.conf. If such a file is present in the module's directory, it is shipped as a default configuration file. The module configuration file, if it exists, is a YAML 1.2 document which contains a YAML map of anything. All default module configuration files are installed in $DESTDIR/share/calamares/modules but can be overridden by files with the same name placed manually (or by the packager) in /etc/calamares/modules.

Qt plugin viewmodules

Currently the only way to write a module which exposes one or more installer pages (viewmodule) is through a Qt plugin. Viewmodules should implement Calamares::ViewStep. They can also implement Calamares::Job to provide jobs.

To add a Qt plugin module, put it in a subdirectory and make sure it has a module.desc and a CMakeLists.txt with a calamares_add_plugin call. It will be picked up automatically by our CMake magic.

Python and process jobmodules

Batch jobs for Calamares can be written as Python scripts or as generic commands (shell scripts, external programs, etc.). To add a Python or process jobmodule, put it in a subdirectory and make sure it has a module.desc. It will be picked up automatically by our CMake magic.

CMakeLists.txt is not used for Python and process jobmodules.

A Python jobmodule is a Python program which imports libcalamares and has a function run() as entry point. run() must return None if everything went well, or a tuple (str,str) with an error message and description if something went wrong.

Calamares offers a Python API for module developers, the core Calamares functionality is exposed as libcalamares.job for job data, libcalamares.globalstorage for shared data and libcalamares.utils for generic utility functions. Documentation is inline.

All code in Python job modules must obey PEP8, the only exception are libcalamares.globalstorage keys, which should always be camelCaseWithLowerCaseInitial.

For testing and debugging we provide the testmodule.py script which fakes a limited Calamares Python environment for running a single jobmodule.