Chapter 2. Tutorial 1—Simple YaST Module

Lukas Ocilka

Tutorial in general, example source code, and screenshots.

Stanislav Visnovsky

Tutorial structure, correctness, and ideas.

Klara Cihlarova

Tutorial structural correctness, logical checks, ideas, and enhancements.

Table of Contents

2.1. Best Practices
2.2. What the Module Should Really Do?
2.2.1. General Project Specifications and Terms
2.2.2. Tutorial Example
2.3. Starting Up
2.3.1. Creating a New YaST Module
2.3.2. Checking the Progress
2.4. YaST Module Files
2.4.1. Project Files & YaST Layers
2.4.2. Internal Workflow Explanation
2.4.3. Familiarizing with Source Files
2.5. Cleaning Up Skeleton for the SSHD Configuration
2.5.1. Modifying Source Files
2.5.2. Checking the Progress
2.6. Creating User Interface
2.6.1. Dialog Wizard
2.6.2. Dialog Content
2.6.3. Standard Dialog Handling by a While-Loop
2.7. Creating Access to the Configuration Data
2.7.1. SCR Agent
2.8. Using the Access to the Configuration Data
2.8.1. The Data Model
2.8.2. Reading and Writing the Configuration
2.8.3. Checking the Syntax
2.8.4. YCP Module Compilation
2.9. Connecting the Configuration Data with the UI
2.9.1. Getting and Setting the Configuration Data
2.9.2. Configuration Handling
2.9.3. Adding the Complex Connection into the Dialogs
2.9.4. Checking the Progress
2.10. Mission Completed
2.10.1. Final Look & Feel
2.11. Conclusion
2.11.1. YaST Knowledge Summary
2.11.2. Downloads
2.12. Testing and Tuning

Abstract

This tutorial shows how to create your own YaST Module as simply as possible. It is supposed to be a basic tutorial for a broad, but not deep, overview of developing a new YaST module in YCP. It contains links where you can find more detailed information for the particular topic.

2.1. Best Practices

Before starting the development of a YaST module, think about the answers for these questions:

  • What do you expect from this YaST module?

  • What do you want to configure and how?

  • Is YaST suitable for that?

Understanding the service configuration or application used is essential. It avoids future problems with modifications of user interface, API, or internal data structures.