calamares/src/modules
2016-12-19 19:40:12 +01:00
..
bootloader Modifications 2016-11-06 08:51:03 +01:00
chrootcfg [chrootcfg] add new module 2016-09-10 14:17:47 +02:00
displaymanager [displaymanager] set_autologin: Unset autologin for sddm when needed 2016-12-06 21:57:31 +01:00
dracut Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
dracutlukscfg Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
dummycpp Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
dummyprocess Add option to run process jobmodules in chroot. 2014-08-12 14:26:10 +02:00
dummypython Sleep for 3, not 30s. 2015-12-30 17:27:02 +01:00
dummypythonqt Merge pythonqt branch 2016-10-31 07:45:35 +01:00
finished Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
fstab Write Btrfs subvolume lines to fstab. 2016-11-25 22:22:27 +01:00
grubcfg [grubcfg] Compare integers to integers, not strings. 2016-10-22 11:21:41 +02:00
hwclock A little more PEP 2015-06-14 06:56:56 -04:00
initcpio [modules] adjust to Manjaro configs 2016-09-10 14:01:50 +02:00
initcpiocfg Don't include keyfile in initramfs on unencrypted /boot. 2016-11-18 09:05:15 +01:00
initramfs Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
initramfscfg [initramfscfg] Don't include keyfile in initramfs on unencrypted /boot. 2016-11-25 22:23:45 +01:00
interactiveterminal Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
keyboard Provide default for m_writeEtcDefaultKeyboard in KeyboardViewStep. 2016-12-14 09:08:25 +01:00
license Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
locale Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
localecfg Fix localecfg to work with new locale module. 2016-08-10 12:11:48 +02:00
luksbootkeyfile Only add LUKS keyfile if relevant, and with a 15s timeout. 2016-10-28 20:47:09 +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
mhwdcfg mhwdcfg:clean up imports; use target_env_call() 2016-09-12 18:51:38 +02:00
mount Special case for Btrfs root: create subvolumes and mount them. 2016-11-25 22:22:17 +01:00
netinstall Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
networkcfg Remove target resolv.conf before proceeding. 2016-09-22 20:51:27 +02:00
packages Allow try_install and try_remove entries in packages module. 2016-11-03 18:04:38 +01:00
partition API Changes, logicalSectorSize -> logicalSize, totalSectors -> totalLogical. 2016-12-19 19:40:12 +01:00
plymouthcfg [plymouthcfg] add module to configure Plymouth 2016-09-10 13:50:50 +02:00
postcfg postcfg: only attempt to rank mirrors if hasInternet 2016-09-17 23:03:55 +02:00
removeuser Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
services Document settings for services module. 2016-12-14 09:02:47 +01:00
servicescfg servicescfg: fix typo 2016-09-23 22:37:23 +02:00
summary Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
umount Try to fix umount. 2016-01-21 14:46:02 +01:00
unpackfs [unpackfs] Do not fail if rsync returns exit code 23. 2016-11-05 09:25:59 +01:00
users Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
webview Do not LINK_PUBLIC by default. 2016-12-14 09:07:41 +01:00
welcome Write hasInternet to GlobalStorage. 2016-12-14 09:08:15 +01: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.