Libosinfo.InstallScript¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Expected avatar format |
||
r |
The installation source to be used |
||
r |
Expected path format |
||
r/w |
The preferred injection method |
||
r |
Product key format mask |
||
r/w/co |
Install script profile name |
||
r/w/co |
Data for install script template |
||
r/w/co |
URI for install script template |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Libosinfo.InstallScript(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new_data(id, profile, templateData)¶
- Parameters:
- Returns:
an new install script
- Return type:
Construct a new install script from stylesheet data
New in version 0.2.0.
- classmethod new_uri(id, profile, templateUri)¶
- Parameters:
- Returns:
an new install script
- Return type:
Construct a new install script from a stylesheet URI
New in version 0.2.0.
- generate(os, config, cancellable)¶
- Parameters:
os (
Libosinfo.Os
) – the osconfig (
Libosinfo.InstallConfig
) – the install script configcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
the script as string.
If you are generating the script for a specific media, it is recommended that you use
Libosinfo.InstallScript.generate_for_media
() instead.If you are generating the script for a specific tree, it is recommended that you use
Libosinfo.InstallScript.generate_for_tree
() in instead.- Return type:
Creates an install script.
New in version 0.2.0.
- generate_async(os, config, cancellable, callback, *user_data)¶
- Parameters:
os (
Libosinfo.Os
) – the osconfig (
Libosinfo.InstallConfig
) – the install script configcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyuser_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.InstallScript.generate
(). From the callback, callLibosinfo.InstallScript.generate_finish
() to conclude this call and get the generated script.If you are generating the script for a specific media, it is recommended that you use
Libosinfo.InstallScript.generate_for_media_async
() instead.New in version 0.2.0.
- generate_command_line(os, config)¶
- Parameters:
os (
Libosinfo.Os
) – the os entityconfig (
Libosinfo.InstallConfig
) – the install script config
- Returns:
The generated command line string,
None
otherwise.- Return type:
Some install scripts need to pass a command line to the kernel, Such install scripts belong to OSs that provide paths to the kernel and initrd files that can be used to directly boot (http://wiki.qemu.org/download/qemu-doc.html#direct_005flinux_005fboot) the OS in order to pass the needed commandline to it.
If you are generating the command line for a specific media, it is recommended that you use
Libosinfo.InstallScript.generate_command_line_for_media
() instead.If you are generating the command line for a specific tree, it is recommended that you use
Libosinfo.InstallScript.generate_command_line_for_tree
() instead.New in version 0.2.7.
- generate_command_line_for_media(media, config)¶
- Parameters:
media (
Libosinfo.Media
) – the mediaconfig (
Libosinfo.InstallConfig
) – the install script config
- Returns:
The generated command line string,
None
otherwise.- Return type:
Some install scripts need to pass a command line to the kernel, Such install scripts belong to OSs that provide paths to the kernel and initrd files that can be used to directly boot (http://wiki.qemu.org/download/qemu-doc.html#direct_005flinux_005fboot) the OS in order to pass the needed commandline to it.
The media media must have been identified successfully using
Libosinfo.Db.identify_media
() before calling this function.New in version 0.2.12.
- generate_command_line_for_tree(tree, config)¶
- Parameters:
tree (
Libosinfo.Tree
) – the treeconfig (
Libosinfo.InstallConfig
) – the install script config
- Returns:
The generated command line string,
None
otherwise.- Return type:
Some install scripts need to pass a command line to the kernel, Such install scripts belong to OSs that provide paths to the kernel and initrd files that can be used to directly boot (http://wiki.qemu.org/download/qemu-doc.html#direct_005flinux_005fboot) the OS in order to pass the needed commandline to it.
The tree tree must have been identified successfully using
Libosinfo.Db.identify_tree
() before calling this function.New in version 1.6.0.
- generate_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
the generated script, or
None
on error- Return type:
New in version 0.2.0.
- generate_for_media(media, config, cancellable)¶
- Parameters:
media (
Libosinfo.Media
) – the mediaconfig (
Libosinfo.InstallConfig
) – the install script configcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
the script as string.
- Return type:
Creates an install script. The media media must have been identified successfully using
Libosinfo.Db.identify_media
() before calling this function.New in version 0.2.12.
- generate_for_media_async(media, config, cancellable, callback, *user_data)¶
- Parameters:
media (
Libosinfo.Media
) – the mediaconfig (
Libosinfo.InstallConfig
) – the install script configcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyuser_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.InstallScript.generate_for_media
(). From the callback, callLibosinfo.InstallScript.generate_for_media_finish
() to conclude this call and get the generated script.New in version 0.2.12.
- generate_for_media_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
the generated script, or
None
on error- Return type:
New in version 0.2.12.
- generate_for_tree(tree, config, cancellable)¶
- Parameters:
tree (
Libosinfo.Tree
) – the treeconfig (
Libosinfo.InstallConfig
) – the install script configcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
the script as string.
- Return type:
Creates an install script. The tree tree must have been identified successfully using
Libosinfo.Db.identify_tree
() before calling this function.New in version 1.6.0.
- generate_for_tree_async(tree, config, cancellable, callback, *user_data)¶
- Parameters:
tree (
Libosinfo.Tree
) – the treeconfig (
Libosinfo.InstallConfig
) – the install script configcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyuser_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.InstallScript.generate_for_tree
(). From the callback, callLibosinfo.InstallScript.generate_for_tree_finish
() to conclude this call and get the generated script.New in version 1.6.0.
- generate_for_tree_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
the generated script, or
None
or error- Return type:
New in version 1.6.0.
- generate_output(os, config, output_dir, cancellable)¶
- Parameters:
os (
Libosinfo.Os
) – the os entityconfig (
Libosinfo.InstallConfig
) – the install script configoutput_dir (
Gio.File
) – the directory where the file containing the output script will be writtencancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
a file containing the script
If you are generating the script for a specific media, it is recommended that you use
Libosinfo.InstallScript.generate_output_for_media
() instead.If you are generating the script for a specific tree, it is recommended that you use
Libosinfo.InstallScript.generate_output_for_tree
() instead.- Return type:
Creates an install script that is written to the returned file.
New in version 0.2.0.
- generate_output_async(os, config, output_dir, cancellable, callback, *user_data)¶
- Parameters:
os (
Libosinfo.Os
) – the osconfig (
Libosinfo.InstallConfig
) – the install script configoutput_dir (
Gio.File
) – the directory where the file containing the output script will be writtencancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyuser_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.InstallScript.generate_output
(). From the callback, callLibosinfo.InstallScript.generate_output_finish
() to conclude this call and get the generated script.If you are generating the script for a specific media, it is recommended that you use
Libosinfo.InstallScript.generate_output_for_media_async
() instead.New in version 0.2.0.
- generate_output_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a file containing the script, or
None
on error- Return type:
New in version 0.2.3.
- generate_output_for_media(media, config, output_dir, cancellable)¶
- Parameters:
media (
Libosinfo.Media
) – the mediaconfig (
Libosinfo.InstallConfig
) – the install script configoutput_dir (
Gio.File
) – the directory where the file containing the output script will be writtencancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
a file containing the script.
- Return type:
Creates an install script that is written to the returned file.
New in version 0.2.12.
- generate_output_for_media_async(media, config, output_dir, cancellable, callback, *user_data)¶
- Parameters:
media (
Libosinfo.Media
) – the mediaconfig (
Libosinfo.InstallConfig
) – the install script configoutput_dir (
Gio.File
) – the directory where the file containing the output script will be writtencancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyuser_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.InstallScript.generate_output_for_media
(). From the callback, callLibosinfo.InstallScript.generate_output_for_media_finish
() to conclude this call and get the generated file.New in version 0.2.12.
- generate_output_for_media_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a file containing the script, or
None
on error.- Return type:
New in version 0.2.12.
- generate_output_for_tree(tree, config, output_dir, cancellable)¶
- Parameters:
tree (
Libosinfo.Tree
) – the treeconfig (
Libosinfo.InstallConfig
) – the install script configoutput_dir (
Gio.File
) – the directory where the file containing the output script will be writtencancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
a file containing the script.
- Return type:
Creates an install script that is written to the returned file.
New in version 1.6.0.
- generate_output_for_tree_async(tree, config, output_dir, cancellable, callback, *user_data)¶
- Parameters:
tree (
Libosinfo.Tree
) – the treeconfig (
Libosinfo.InstallConfig
) – the install script configoutput_dir (
Gio.File
) – the directory where the file containing the output script will be writtencancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Function to call when result of this call is readyuser_data (
object
orNone
) – The user data to pass to callback, orNone
Asynchronous variant of
Libosinfo.InstallScript.generate_output_for_tree
(). From the callback, callLibosinfo.InstallScript.generate_output_for_tree_finish
() to conclude this call and get the generated file.New in version 1.6.0.
- generate_output_for_tree_finish(res)¶
- Parameters:
res (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a file containing the script, or
None
on error.- Return type:
New in version 1.6.0.
- get_avatar_format()¶
- Returns:
The avatar format, or
None
if there is no restrictions on the format of avatar- Return type:
Some install scripts have restrictions on the format of the user avatar. Use this method to retrieve those restrictions in the form of an
Libosinfo.AvatarFormat
instance.New in version 0.2.2.
- get_can_post_install_drivers()¶
-
Whether install script can install drivers at the very end of installation This can be used for installing devices which the OS in question does not have out of the box support.
New in version 0.2.2.
- get_can_pre_install_drivers()¶
-
Whether install script can install drivers at the very beginning of installation. This is needed for devices for which the OS in question does not have out of the box support for and devices are required/preferred to be available during actual installation.
New in version 0.2.2.
- get_config_param(name)¶
- Parameters:
name (
str
) – name of the parameter- Returns:
the sought config param, if exists.
None
otherwise.This code assumes that the ‘id’ and ‘name’ entity properties are the same.
- Return type:
Get a config param from the config param’s list
New in version 0.2.1.
- get_config_param_list()¶
- Returns:
the list of valid
Libosinfo.InstallConfigParam
parameters. Free with g_list_free() when done. The elements are owned by libosinfo.- Return type:
Get the list of valid config parameters for self.
New in version 0.2.0.
- get_config_params()¶
- Returns:
the list of valid
Libosinfo.InstallConfigParam
parameters.- Return type:
Get the list of valid config parameters for self.
New in version 0.2.3.
- get_expected_filename()¶
- Returns:
the expected script filename
- Return type:
Some operating systems (as Windows) expect that script filename has particular name to work.
New in version 0.2.1.
- get_injection_methods()¶
- Returns:
bitwise-or of supported methods for install script injection.
- Return type:
Retrieve the supported method to inject the script in to the installation process.
New in version 0.2.10.
- get_installation_source()¶
- Returns:
the installation source to be used with the script. If none is set, it defaults to
Libosinfo.InstallScriptInstallationSource.MEDIA
.- Return type:
New in version 1.3.0.
- get_needs_internet()¶
- Returns:
True
if script needs an internet connection,False
otherwise internet connection.- Return type:
Some install scripts cannot ensure that they work without an internet connection.
New in version 0.2.11.
- get_output_filename()¶
- Returns:
the output script filename
- Return type:
Some operating systems are able to use any script filename, allowing the application to set the filename as desired. libosinfo provides this functionality by set the expected filename’s prefix using
Libosinfo.InstallScript.set_output_prefix
() function.New in version 0.2.0.
- get_output_prefix()¶
- Returns:
the prefix of the file generated
- Return type:
New in version 0.2.8.
- get_path_format()¶
- Returns:
the path format to be used.
Libosinfo.PathFormat.UNIX
is the default option.- Return type:
Returns the path format to be used for the files and disks which will be used during the installation.
New in version 0.2.2.
- get_post_install_drivers_signing_req()¶
- Return type:
If install script can install drivers at the end of installation, this function retrieves the requirement about signed status of drivers.
New in version 0.2.6.
- get_pre_install_drivers_signing_req()¶
- Return type:
If install script can install drivers at the very beginning of installation, this function retrieves the requirement about signed status of drivers.
New in version 0.2.6.
- get_preferred_injection_method()¶
- Returns:
the preferred injection method for the script. If none is set and
Libosinfo.InstallScriptInjectionMethod.DISK
is supported,Libosinfo.InstallScriptInjectionMethod.DISK
is returned, otherwiseLibosinfo.InstallScriptInjectionMethod.INITRD
is returned.- Return type:
New in version 1.3.0.
- get_product_key_format()¶
-
If this function returns a non-
None
string, it means that the self requires you to specify product registration key throughLibosinfo.InstallConfig
instance passed to script generation methods.The returned string specifies the expected format of the product key like this:
@ - any character % - alphabet
- numeric character
$ - alphanumeric character
All other characters represent themselves.
For example in case of installer for Microsoft Windows XP, you’ll get “$$$$$-$$$$$-$$$$$-$$$$$-$$$$$”. That means a product key consists of 24 alphanumeric characters and 4 ‘-’ characters at (0-based) indices 5, 11, 17 and 23.
New in version 0.2.2.
- get_profile()¶
- Return type:
Returns a string representing the install script profile that’s going to be used.
The values supported are “jeos” for minimal installations and “desktop” for workstation/desktop installations.
New in version 0.2.0.
- get_template_data()¶
- Return type:
Returns the stylesheet data used to construct the install script.
New in version 0.2.0.
- get_template_uri()¶
- Return type:
Returns the stylesheet URI used to construct the install script.
New in version 0.2.0.
- has_config_param(config_param)¶
- Parameters:
config_param (
Libosinfo.InstallConfigParam
) – anLibosinfo.InstallConfigParam
- Return type:
Returns whether the self has the config_param searched or not.
This code assumes that the ‘id’ and ‘name’ entity properties are the same.
New in version 0.2.0.
- has_config_param_name(name)¶
-
Returns whether the self has a configuration parameter matching name or not.
New in version 0.2.0.
- set_installation_source(source)¶
- Parameters:
source (
Libosinfo.InstallScriptInstallationSource
) – one of the installation sources:Libosinfo.InstallScriptInstallationSource.MEDIA
,Libosinfo.InstallScriptInstallationSource.NETWORK
Set the installation source to be used with the self.
New in version 1.3.0.
- set_output_prefix(prefix)¶
- Parameters:
prefix (
str
) – a prefix to be added to the file generated
Mind that not all installers support any name for the installer scripts.
New in version 0.2.0.
- set_preferred_injection_method(method)¶
- Parameters:
method (
Libosinfo.InstallScriptInjectionMethod
) – one of the injection methods:Libosinfo.InstallScriptInjectionMethod.CDROM
,Libosinfo.InstallScriptInjectionMethod.DISK
,Libosinfo.InstallScriptInjectionMethod.FLOPPY
,Libosinfo.InstallScriptInjectionMethod.INITRD
,Libosinfo.InstallScriptInjectionMethod.WEB
Set the preferred injection method to be used with the self
New in version 1.3.0.
Property Details¶
- Libosinfo.InstallScript.props.avatar_format¶
- Name:
avatar-format
- Type:
- Default Value:
- Flags:
Expected avatar format
- Libosinfo.InstallScript.props.installation_source¶
- Name:
installation-source
- Type:
- Default Value:
- Flags:
The installation source to be used
- Libosinfo.InstallScript.props.path_format¶
- Name:
path-format
- Type:
- Default Value:
- Flags:
Expected path format
- Libosinfo.InstallScript.props.preferred_injection_method¶
- Name:
preferred-injection-method
- Type:
- Default Value:
- Flags:
The preferred injection method
- Libosinfo.InstallScript.props.product_key_format¶
-
Product key format mask
- Libosinfo.InstallScript.props.profile¶
- Name:
profile
- Type:
- Default Value:
- Flags:
Install script profile name
- Libosinfo.InstallScript.props.template_data¶
- Name:
template-data
- Type:
- Default Value:
- Flags:
Data for install script template