calamares/src/modules
Kevin Kofler a54067f709 displaymanager: Don't run xdg-icon-resource and update-desktop-database.
Don't run xdg-icon-resource and update-desktop-database in the basic
setup for KDM. These tools have absolutely nothing to do with KDM. KDM
does not ship any icons in the hicolor theme, nor a .desktop file (let
alone one that handles any MIME type, the only case in which
update-desktop-database is needed).

I know the original shell script from Manjaro called these when setting
up KDM, but this is really the wrong place. If you need to call these,
they need to go into another module, and you also have to call them
independently of the selected display manager.
2014-12-01 03:25:44 +01:00
..
bootloader bootloader: Allow overriding the bootloaderEntryName setting. 2014-11-19 17:01:02 +01:00
displaymanager displaymanager: Don't run xdg-icon-resource and update-desktop-database. 2014-12-01 03:25:44 +01:00
dracut check_chroot_call does not actually return a error code, use chroot_call 2014-11-12 18:54:26 +01:00
dummyprocess Add option to run process jobmodules in chroot. 2014-08-12 14:26:10 +02:00
dummypython Big configuration overhaul. 2014-08-06 11:54:45 +02:00
fstab Big configuration overhaul. 2014-08-06 11:54:45 +02:00
greeting Unbreak build. Sorry. 2014-11-20 17:21:10 +01:00
grub grub, bootloader: Make the grub-* and /boot/grub names configurable. 2014-11-13 00:19:24 +01:00
grubcfg Merge pull request #155 from calamares/fix-issue-128 2014-11-19 17:20:06 +01:00
hwclock New hwclock module, ported from Thus. 2014-08-12 11:03:03 +02:00
initcpio Big configuration overhaul. 2014-08-06 11:54:45 +02:00
initcpiocfg Fix copyright holder 2014-11-10 15:45:40 +01:00
initramfs check_chroot_call does not actually return a error code, use chroot_call 2014-11-12 18:54:26 +01:00
keyboard Fix focus handling in Keyboard page. 2014-11-26 18:56:09 +01:00
locale Remove unnecessary debug output. 2014-11-26 19:10:17 +01:00
localecfg localecfg: only restore locale.gen.bak if available 2014-11-28 20:05:54 +01:00
machineid machineid: Add modules.desc. 2014-11-27 22:18:34 +01:00
mount mount: Fix /run mount. 2014-11-29 05:07:40 +01:00
networkcfg New networkcfg module, based on Thus. 2014-08-11 16:30:01 +02:00
packages packages: add --noconfirm arg for pacman, also remove unneeded deps 2014-11-28 20:54:35 +01:00
partition Hook up ClearMountsJob in PartitionCoreModule. 2014-11-28 15:52:18 +01:00
prepare Finish up retranslation in PreparePage. 2014-11-13 16:52:32 +01:00
services Make networkmanager service example optional. 2014-11-27 10:57:09 +01:00
summary Big configuration overhaul. 2014-08-06 11:54:45 +02:00
umount [umount] use lazy switch 2014-11-28 22:32:38 +01:00
unpackfs unpackfs: Add a trailing '/' to the excludes. 2014-11-28 18:33:31 +01:00
users Reimplement onActivate in UsersViewStep for focus handling. 2014-11-26 18:41:35 +01:00
CMakeLists.txt Add CalamaresAddModuleSubdirectory, a CMake function for modules that 2014-07-14 16:26:10 +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 Initialize globalstorage before loading custom configuration 2014-08-20 19:24:07 +02: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.