Misc |
Misc.ycp Purpose: miscellaneous definitions for installation |
|
|
This module has an unstable interface. |
- Parameters:
-
first string name of first file to try second string name of second file to try
- Return value:
-
content of file try to read first file, if it doesn't exist, read second files must reside below /usr/lib/YaST2 files must have ycp syntax
- Parameters:
-
hardware_entry map map of .probe entry
- Return value:
-
vendor and device name common function to extract 'name' of hardware
- Parameters:
-
lmap map map of language codes and translations e.g. $[ "default" : "Defaultstring", "de" : "German....", ...] lang string language as ISO code, either 2 chars (de) or 5 chars (de_DE)
- Return value:
-
translation Define a macro that looks up a localized string in a language map of the form $[ "default" : "Defaultstring", "de" : "German....", ...]
SysconfigWrite()
- Parameters:
-
level values
- Return value:
-
false if SCR::Write reported error write list of sysyconfig entries via rcconfig agent
MergeOptions Merges "opt1=val1 opt2=val2 ..." and $["opta":"vala", ..."] to $["opt1":"val1", "opt2":"val2", "opta":"vala", ...] as needed by modules.conf agent
- Parameters:
-
options string module options, e.g. "opt1=val1 opt2=val2 ..." optmap map possible old options $["opta":"vala", ...]
- Return value:
-
$["opt1":"val1", "opt2":"val2", ...]
SysconfigRead()
Try an SCR::Read(...) and return the result if successful. On failure return the the second parameter (default value)
- Parameters:
-
sysconfig_path Sysconfig SCR path. defaultv Default value
- Return value:
-
Success --> Result of SCR::Read
Failure --> Default value
Try to read value from sysconfig file and return the result if successful. Function reads from arbitrary sysconfig file, for which the agent doesn't exist: e.g. from different partition like /mnt/etc/sysconfig/file.
- Parameters:
-
key Key of the value we want to read from sysconfig file. defval location Full path to target sysconfig file.
- Return value:
-
Success --> Result of SCR::Read
Failure --> Default value
- Example
-
Misc::CustomSysconfigRead ("INSTALLED_LANGUAGES", "", Installation::destdir + "/etc/sysconfig/language");
Runs a bash command with timeout.
Structure Returns map $[
"exit" : int_return_code, "stdout" : [ "script", "stdout", "lines" ], "stderr" : [ "script", "stderr", "lines" ], ]
- Parameters:
-
run_command what to run log_command what to log (passwords masked) script_time_out in sec.
- Return value:
-
with out, err and ret_code
Run - with a timeout - on dumb terminal to disable colors etc - using 'exit $?' because of buggy behavior '.background vs. ZMD' (FIXME still needed???)
- Parameters:
-
command a command log_command a command to log seconds timeout
- Return value:
-
with out, err and ret_code