YaST2 Documentation

Novell, Inc.

YaST2 Team

Novell, Inc.

This document is not to be construed as a promise by any participating company to develop, deliver, or market a feature or a product.

SUSE LINUX AG makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness or any particular purpose. Further, SUSE LINUX AG reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes.

You are allowed to distribute unchanged copies of this document.


Table of Contents

Preface
1. What's Inside
2. Style Conventions
1. Introduction
2. YaST - The Big Picture
2.1. Overview
2.1.1. Access To The System
2.1.2. Reasonable Suggestions
2.1.3. Workflows
2.1.4. Modules And The YCP-Language
2.1.5. User Interface
2.1.6. Summary
2.2. YaST Architecture
2.2.1. The SCR (System Configuration Repository)
2.2.2. The UI (User Interface)
2.2.3. YaST Core Engine
2.2.4. External Programs
3. The YaST Language - YCP
3.1. The First YCP Program
3.1.1. YCP Source
3.1.2. The YCP compiler
3.1.3. Running YCP
3.2. YCP Data Types
3.2.1. Data Type void (nil)
3.2.2. Data Type symbol
3.2.3. Data Type boolean
3.2.4. Data Type integer
3.2.5. Data Type float
3.2.6. Data Type string
3.2.7. Data Type byteblock
3.2.8. Data Type list
3.2.9. Data Type map
3.2.10. Data Type path
3.2.11. Data Type term
3.2.12. Data Type any
3.3. More YCP types
3.3.1. Data Type block
3.4. YCP Type System
3.4.1. Data Type any And Type Checking
3.5. YCP Expression Evaluation
3.5.1. Evaluation Of Blocks
3.5.2. Evaluation Of Basic Data Types
3.6. YCP Operators
3.6.1. Comparison Operators
3.6.2. Boolean Operators
3.6.3. Bit Operators
3.6.4. Math Operators
3.6.5. Triple Operator
3.6.6. Operators Precedence
3.6.7. The bracket operator
3.6.7.1. Introduction
3.6.7.2. Access variant
3.6.7.2.1. Accessing lists
3.6.7.2.2. Accessing maps
3.6.7.2.3. Mixed map/list access
3.6.7.3. Assign variant
3.7. Data Type locale
3.8. YCP Program Structure
3.8.1. Comments
3.8.2. Variable Declaration
3.8.3. Variable Assignment
3.8.4. Conditional Branch
3.8.5. while() Loop
3.8.6. do..while() Loop
3.8.7. repeat..until() Loop
3.8.8. break Statement
3.8.9. continue Statement
3.8.10. return Statement
3.8.11. Function definition
3.8.12. Function declaration
3.8.13. include Statement
3.8.14. import Statement
3.8.15. Variable Scopes and blocks
3.8.16. Applying Expressions To Lists And Maps
3.8.16.1. foreach() Statement
3.8.16.2. listmap() Statement
3.8.16.3. maplist() Statement
3.8.16.4. mapmap() Statement
3.9. Controlling The User Interface
3.10. The YaST Wizard
4. Running y2base Stand-Alone
5. SCR Details
5.1. SCR Agents
5.2. SCR Tree
5.3. Accessing SCR
5.4. Using SCR From Within YCP
5.5. Using SCR From The Command Line
5.6. Useful SCR Agents
6. YaST Modules
6.1. YCP Modules Overview
6.2. True YCP Modules
6.2.1. Included Modules
6.2.2. True Modules (Imported Modules)
6.2.3. True Modules And Constructors
6.3. Some Rules
6.3.1. Usability
6.4. Module Layout
6.4.1. Module Skeleton
6.4.2. Module Example
7. YaST2 UI Layout and Events
7.1. YaST2 Layout
7.1.1. Summary: What's This All About?
7.1.2. Basics and Terms
7.1.2.1. The UI
7.1.2.2. Widgets
7.1.2.3. UI Independence and the libyui
7.1.2.4. The Nice Size
7.1.2.5. Initial Dialog Sizes
7.1.2.6. Full Screen Dialogs: `opt(`defaultsize)
7.1.3. Layout Building Blocks
7.1.3.1. Layout Boxes: HBox and VBox
7.1.3.2. Specifying Proportions: HWeight and VWeight
7.1.3.3. Rubber Bands: HStretch and VStretch
7.1.3.4. Making Common Widgets Stretchable: `opt(`hstretch) and `opt(`vstretch)
7.1.3.5. Spacings: HSpacing and VSpacing
7.1.3.6. Alignments: Left, Right, HCenter, Top, Bottom, VCenter, HVCenter
7.1.3.7. Compressing Excess Space: HSquash, VSquash, HVSquash
7.1.3.8. Optical Grouping: Frame
7.1.3.9. Grouping RadioButtons: RadioButtonGroup
7.1.3.10. The Esoterics: ReplacePoint
7.1.3.11. Obsolete: Split
7.1.4. Common Layout Techniques
7.1.4.1. Creating Widgets of Equal Size
7.1.4.2. Creating Widgets of Equal Size that don't Grow
7.1.4.3. Creating Widgets of Equal Size that don't Grow - with Spacings in between
7.1.4.4. Specifying the Size of Scrollable Widgets
7.1.5. Hints and Tips
7.1.5.1. Debugging Aids: The Log File
7.1.5.2. Keep it Simple - Do not Overcrowd Dialogs!
7.1.5.3. Always Keep Other UIs in Mind - What does it Look Like with NCurses?
7.1.5.4. Do not Neglect Mouseless Users - Always Provide Keyboard Shortcuts!
7.1.6. The Layout Algorithm - How the Layout Engine Works Internally
7.1.6.1. Primary and Secondary Dimensions
7.1.6.2. Calculating the Nice Size
7.1.6.2.1. Secondary Nice Size
7.1.6.2.2. Primary Nice Size
7.1.6.3. Setting the Size of a Layout - SetSize()
7.1.6.3.1. Running out of Space - the Pathological Cases
7.1.6.3.2. Centering in the Secondary Dimension
7.2. UI Events
7.2.1. Introduction
7.2.1.1. The YaST2 Event Model
7.2.1.1.1. Classic GUI Event Loops
7.2.1.1.2. The YaST2 Approach
7.2.1.1.3. Simplicity vs. Features
7.2.1.1.4. The notify Option
7.2.1.1.5. Downsides and Discussions
7.2.1.1.6. Design Alternatives
7.2.1.2. Event Delivery
7.2.1.2.1. Event Queues vs. One Single Pending Event
7.2.1.2.2. Event Reliability
7.2.1.2.3. Defensive Programming
7.2.2. Event-related UI Builtin Functions
7.2.3. Event Reference
7.2.3.1. Event Maps in General
7.2.3.2. Event Types
7.2.3.2.1. WidgetEvent
7.2.3.2.2. Activated WidgetEvent
7.2.3.2.3. ValueChanged WidgetEvent
7.2.3.2.4. SelectionChanged WidgetEvent
7.2.3.2.5. MenuEvent
7.2.3.2.6. TimeoutEvent
7.2.3.2.7. CancelEvent
7.2.3.2.8. KeyEvent
7.2.3.2.9. DebugEvent
8. Modules and Libraries
8.1. Using the package manager
8.1.1. Introduction
8.1.2. Implementation
8.1.3. Querying the package manager
8.1.3.1. Checking an installed package
8.1.3.2. Checking the installation sources
8.1.3.3. Deleting a package
8.1.3.4. Installing a package
8.1.3.5. Solving dependencies
8.1.3.6. Committing the changes
8.1.4. Example code
9. Installation Frameworks and Installation Process
9.1. Product Installation Control
9.1.1. Functionality
9.1.2. Implementation
9.1.3. Configuration
9.1.3.1. workflows
9.1.3.2. Proposals
9.1.3.3. Installation and Product Variables
9.1.3.4. Software
9.1.3.5. Partitioning
9.1.3.5.1. Algorithm for space allocation
9.1.3.5.2. Configuration Options
9.1.3.6. Hooks
9.2. Firstboot Configuration
9.2.1. Enabling Firstboot
9.2.2. Customizing YaST Firstboot
9.2.2.1. Customizing Messages
9.2.2.2. License Action
9.2.2.3. Release Notes
9.2.2.4. Customizing Workflow Components
9.2.3. Scripting
10. YaST Development And Tools
10.1. YaST2 Development Tools
10.1.1. Quick Start
10.1.2. What is it?
10.1.3. Migration
10.1.4. Translation (po) Modules)
10.1.5. create-spec: Automatic creation of the .spec file
10.1.6. Overview of Paths
10.1.7. Toplevel make Targets in Detail
10.1.7.1. make package-local
10.1.7.2. make package
10.1.7.3. make check-tagversion
10.1.7.4. make check-up-to-date
10.1.7.5. make checkin-stable
10.1.7.6. make stable
10.2. YaST2 Logging
10.2.1. Introduction
10.2.2. Quick start
10.2.3. Logging levels
10.2.4. Logging functions
10.2.5. Additional functions
10.2.5.1. Setting the logfile name
10.2.5.2. Universal logging functions:
10.2.6. Components
10.2.7. Logfiles
10.2.8. Log entries
10.2.9. Logging control
10.2.10. Environment control
10.3. Coding In YCP
10.3.1. Coding Rules
10.3.1.1. The file header
10.3.1.2. Indendation
10.3.1.3. Whitespace
10.3.1.4. Naming of variables
10.3.1.5. Naming of functions
10.3.1.6. Blocks and Braces
10.3.1.7. if-then-else, while, etc.
10.3.1.8. Comments
10.3.1.9. Other habits
10.3.2. Examples of bad code
10.4. Check YCP Syntax
10.4.1. Quick Start
10.4.2. Why this Document?
10.4.3. Header Comment Checks
10.4.4. Filename Check
10.4.5. Author / Maintainer Entry Check
10.4.6. CVS Id: Marker Check
10.4.7. Translatable Messages Checks
10.4.7.1. textdomain Check
10.4.8. RichText / HTML Sanity Check
10.4.8.1. Completeness of <p> / </p> Paragraph Tags
10.4.8.2. Text Before, After, Between Paragraphs
10.4.8.3. No More Than One Paragraph per Message
10.4.8.4. Excess Forced Line Breaks <br> after Paragraphs
10.4.9. Widget / UI Function Parameter Checks
10.4.9.1. Keyboard Shortcut Check
10.4.9.2. Translatable Messages Check
10.4.10. Standardized Lib Function Checks
10.4.10.1. Duplicate Definitions of Wizard Lib Functions
10.4.10.2. Definitions and Usage of Obsolete Functions
10.4.10.3. Usage of Predefined Messages
10.4.11. Alternative Variable Declarations
10.4.12. Checking YCP Examples
10.4.13. check_ycp and Emacs
10.4.14. Extending check_ycp
10.4.14.1. Adding new Widgets / UI Functions
10.4.14.2. Other Extensions
10.5. The YaST2 Macro Recorder
10.5.1. Introduction
10.5.2. Quick Start
10.5.3. Purpose
10.5.4. What it is not
10.5.5. Quirks and Limitations
10.5.6. Anatomy of a Macro
1. YCP Reference
2. User Interface Reference
1. Event-related UI Builtin Functions
UI::UserInput - Waits for user input and returns a widget ID.
UI::PollInput - Checks for pending user input. Does not wait. Returns a widget ID or nil if no input is available.
UI::TimeoutUserInput - Waits for user input and returns a widget ID. Returns ID `timeout if no input is available for timeout milliseconds.
UI::WaitForEvent - Waits for user input and returns an event map. Returns ID `timeout if no input is available for timeout milliseconds.
2. UI builtin commands
UI::SetModulename - Sets Module Name
UI::GetModulename - Gets the name of a Module
UI::SetLanguage - Sets the language of the UI
UI::GetProductName - Gets Product Name
UI::SetProductName - Sets Product Name
UI::SetConsoleFont - Sets Console Font
UI::SetKeyboard - Sets Keyboard
UI::GetLanguage - Gets Language
UI::UserInput - User Input
UI::PollInput - Poll Input
UI::TimeoutUserInput - User Input with Timeout
UI::WaitForEvent - Waits for Event
UI::OpenDialog - Opens a new dialog.
UI::OpenDialog - Opens a Dialog with options
UI::CloseDialog() - Closes an open dialog
UI::ChangeWidget - Changes widget contents
UI::QueryWidget - Queries Widget contents
UI::ReplaceWidget -
UI::WizardCommand - Runs a wizard command
UI::SetFocus - Sets Focus to the specified widget
UI::BusyCursor - Sets the mouse cursor to the busy cursor
UI::RedrawScreen - Redraws the screen
UI::NormalCursor - Sets the mouse cursor to the normal cursor
UI::MakeScreenShot - Makes Screen Shot
UI::DumpWidgetTree - Debugging function
UI::RecordMacro - Records Macro into a file
UI::StopRecordingMacro - Stops recording macro
UI::PlayMacro - Plays a recorded macro
UI::FakeUserInput - Fakes User Input
UI::Glyph - Returns a special character ( a 'glyph' )
UI::GetDisplayInfo - Gets Display Info
UI::RecalcLayout - Recalculates Layout
UI::PostponeShortcutCheck - Postpones Shortcut Check
UI::CheckShortcuts - Performs an explicit shortcut check after postponing shortcut checks.
UI::WidgetExists - Checks whether or not a widget with the given ID currently exists
UI::RunPkgSelection - Initializes and run the PackageSelector widget
UI::AskForExistingDirectory - Opens a directory selection box and prompt the user for an existing directory.
UI::AskForExistingFile - Opens a file selection box and prompt the user for an existing file.
UI::AskForSaveFileName - Opens a file selection box and prompt the user for a file to save data to.
UI::SetFunctionKeys - Sets the ( default ) function keys for a number of buttons.
UI::WFM/SCR - callback
UI::Recode - Recodes encoding of string from or to "UTF-8" encoding.
3. Standard (mandatory) widgets
AAA_All-Widgets - Generic options for all widgets
ReplacePoint - Pseudo widget to replace parts of a dialog
Empty - Stretchable space for layout
HSpacing - Fixed size empty space for layout
Left - Layout alignment
MinWidth - Layout minimum size
MarginBox - Margins around one child widget
Frame - Frame with label
HSquash - Layout aid: Minimize widget to its nice size
HWeight - Control relative size of layouts
HBox - Generic layout: Arrange widgets horizontally or vertically
Label - Simple static text
RichText - Static text with HTML-like formatting
LogView - scrollable log lines like "tail -f"
PushButton - Perform action on click
MenuButton - Button with popup menu
CheckBox - Clickable on/off toggle button
RadioButton - Clickable on/off toggle button for radio boxes
RadioButtonGroup - Radio box - select one of many radio buttons
TextEntry - Input field
MultiLineEdit - multiple line text edit field
SelectionBox - Scrollable list selection
MultiSelectionBox - Selection box that allows selecton of multiple items
ComboBox - drop-down list selection (optionally editable)
Tree - Scrollable tree selection
Table - Multicolumn table widget
ProgressBar - Graphical progress indicator
Image - Pixmap image
IntField - Numeric limited range input field
PackageSelector - Complete software package selection
PkgSpecial - Package selection special - DON'T USE IT
4. Special (optional) widgets
HasSpecialWidget - Checks for support of a special widget type.
BarGraph - Horizontal bar graph (optional widget)
ColoredLabel - Simple static text with specified background and foreground color
DownloadProgress - Self-polling file growth progress indicator (optional widget)
DumbTab - Simplistic tab widget that behaves like push buttons
VMultiProgressMeter - Progress bar with multiple segments (optional widget)
Slider - Numeric limited range input (optional widget)
PartitionSplitter - Hard disk partition splitter tool (optional widget)
Date - Date input field
Time - Time input field
Wizard - Wizard frame - not for general use, use the Wizard:: module instead!
3. Reference of Interface to YaST2 Package Manager
4. Frameworks Reference
5. YaST2 Library Reference
1. UI Richtext
2. ChangeLog

List of Figures

2.1. The YaST Architecture
3.1. Output of the “Hello, World!”-program
5.1. SCR Hierarchy Tree

List of Tables

3.1. Special characters in strings
3.2. Special characters in paths
5.1. SCR Node Types
5.2. The SCR-commands

List of Examples

3.1. Hello World” in YCP
3.2. Symbol constants
3.3. Integer constants
3.4. Float constants
3.5. String constants
3.6. Byteblock constants
3.7. List constants
3.8. Map constants
3.9. Path constants
3.10. Term constants
3.11. Block constants
3.12. Type checking and data type any
3.13. Locale constants
3.14. Comments
3.15. Variable Declaration
3.16. Variable Assignment
3.17. Conditional branch
3.18. while() Loop
3.19. do...while() Loop
3.20. repeat...until() Loop
3.21. break statement
3.22. continue statement
3.23. return statement
3.24. Function definition
3.25. Function declaration
3.26. Include a file
3.27. Variable scopes and blocks
3.28. foreach() Loop
3.29. listmap() statement
3.30. maplist() statement
3.31. mapmap() statement
5.1. Operating the SCR from the command line
7.1. Specifying Proportions 1
7.2. Specifying Proportions 2
7.3. Specifying Proportions 3
7.4. Spacings
7.5. Grouping RadioButtons
7.6. Specifying the Size of Scrollable Widgets
7.7. The notify option
9.1. Flexible Partitioning
10.1. YaST2 UI macro file