Libosinfo.InstallScript

g GObject.Object GObject.Object Libosinfo.Entity Libosinfo.Entity GObject.Object->Libosinfo.Entity Libosinfo.InstallScript Libosinfo.InstallScript Libosinfo.Entity->Libosinfo.InstallScript

Subclasses:

None

Methods

Inherited:

Libosinfo.Entity (15), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (id)

class

new_data (id, profile, templateData)

class

new_uri (id, profile, templateUri)

generate (os, config, cancellable)

generate_async (os, config, cancellable, callback, *user_data)

generate_command_line (os, config)

generate_command_line_for_media (media, config)

generate_command_line_for_tree (tree, config)

generate_finish (res)

generate_for_media (media, config, cancellable)

generate_for_media_async (media, config, cancellable, callback, *user_data)

generate_for_media_finish (res)

generate_for_tree (tree, config, cancellable)

generate_for_tree_async (tree, config, cancellable, callback, *user_data)

generate_for_tree_finish (res)

generate_output (os, config, output_dir, cancellable)

generate_output_async (os, config, output_dir, cancellable, callback, *user_data)

generate_output_finish (res)

generate_output_for_media (media, config, output_dir, cancellable)

generate_output_for_media_async (media, config, output_dir, cancellable, callback, *user_data)

generate_output_for_media_finish (res)

generate_output_for_tree (tree, config, output_dir, cancellable)

generate_output_for_tree_async (tree, config, output_dir, cancellable, callback, *user_data)

generate_output_for_tree_finish (res)

get_avatar_format ()

get_can_post_install_drivers ()

get_can_pre_install_drivers ()

get_config_param (name)

get_config_param_list ()

get_config_params ()

get_expected_filename ()

get_injection_methods ()

get_installation_source ()

get_needs_internet ()

get_output_filename ()

get_output_prefix ()

get_path_format ()

get_post_install_drivers_signing_req ()

get_pre_install_drivers_signing_req ()

get_preferred_injection_method ()

get_product_key_format ()

get_profile ()

get_template_data ()

get_template_uri ()

has_config_param (config_param)

has_config_param_name (name)

set_installation_source (source)

set_output_prefix (prefix)

set_preferred_injection_method (method)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Libosinfo.Entity (1)

Name

Type

Flags

Short Description

avatar-format

Libosinfo.AvatarFormat

r

Expected avatar format

installation-source

Libosinfo.InstallScriptInstallationSource

r

The installation source to be used

path-format

Libosinfo.PathFormat

r

Expected path format

preferred-injection-method

Libosinfo.InstallScriptInjectionMethod

r/w

The preferred injection method

product-key-format

str

r

Product key format mask

profile

str

r/w/co

Install script profile name

template-data

str

r/w/co

Data for install script template

template-uri

str

r/w/co

URI for install script template

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Libosinfo.Entity

r

Class Details

class Libosinfo.InstallScript(**kwargs)
Bases:

Libosinfo.Entity

Abstract:

No

Structure:

Libosinfo.InstallScriptClass

classmethod new(id)
Parameters:

id (str) –

Return type:

Libosinfo.InstallScript

classmethod new_data(id, profile, templateData)
Parameters:
  • id (str) – a unique identifier

  • profile (str) – the profile of script

  • templateData (str) – style sheet data

Returns:

an new install script

Return type:

Libosinfo.InstallScript

Construct a new install script from stylesheet data

New in version 0.2.0.

classmethod new_uri(id, profile, templateUri)
Parameters:
  • id (str) – a unique identifier

  • profile (str) – the profile of script

  • templateUri (str) – style sheet URI

Returns:

an new install script

Return type:

Libosinfo.InstallScript

Construct a new install script from a stylesheet URI

New in version 0.2.0.

generate(os, config, cancellable)
Parameters:
Raises:

GLib.Error

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:

str

Creates an install script.

New in version 0.2.0.

generate_async(os, config, cancellable, callback, *user_data)
Parameters:

Asynchronous variant of Libosinfo.InstallScript.generate(). From the callback, call Libosinfo.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:
Returns:

The generated command line string, None otherwise.

Return type:

str

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:
Returns:

The generated command line string, None otherwise.

Return type:

str

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:
Returns:

The generated command line string, None otherwise.

Return type:

str

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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

the generated script, or None on error

Return type:

str

New in version 0.2.0.

generate_for_media(media, config, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the script as string.

Return type:

str

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:

Asynchronous variant of Libosinfo.InstallScript.generate_for_media(). From the callback, call Libosinfo.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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

the generated script, or None on error

Return type:

str

New in version 0.2.12.

generate_for_tree(tree, config, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the script as string.

Return type:

str

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:

Asynchronous variant of Libosinfo.InstallScript.generate_for_tree(). From the callback, call Libosinfo.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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

the generated script, or None or error

Return type:

str

New in version 1.6.0.

generate_output(os, config, output_dir, cancellable)
Parameters:
Raises:

GLib.Error

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:

Gio.File

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:

Asynchronous variant of Libosinfo.InstallScript.generate_output(). From the callback, call Libosinfo.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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a file containing the script, or None on error

Return type:

Gio.File

New in version 0.2.3.

generate_output_for_media(media, config, output_dir, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a file containing the script.

Return type:

Gio.File

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:

Asynchronous variant of Libosinfo.InstallScript.generate_output_for_media(). From the callback, call Libosinfo.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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a file containing the script, or None on error.

Return type:

Gio.File

New in version 0.2.12.

generate_output_for_tree(tree, config, output_dir, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a file containing the script.

Return type:

Gio.File

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:

Asynchronous variant of Libosinfo.InstallScript.generate_output_for_tree(). From the callback, call Libosinfo.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) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a file containing the script, or None on error.

Return type:

Gio.File

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:

Libosinfo.AvatarFormat

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()
Returns:

True if install script supports post-installable drivers, False otherwise.

Return type:

bool

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()
Returns:

True if install script supports pre-installable drivers, False otherwise.

Return type:

bool

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:

Libosinfo.InstallConfigParam

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:

[Libosinfo.InstallScript]

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:

Libosinfo.InstallConfigParamList

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:

str

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:

Libosinfo.InstallScriptInjectionMethod

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:

Libosinfo.InstallScriptInstallationSource

New in version 1.3.0.

get_needs_internet()
Returns:

True if script needs an internet connection, False otherwise internet connection.

Return type:

bool

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:

str

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:

str

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:

Libosinfo.PathFormat

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:

Libosinfo.DeviceDriverSigningReq

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:

Libosinfo.DeviceDriverSigningReq

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, otherwise Libosinfo.InstallScriptInjectionMethod.INITRD is returned.

Return type:

Libosinfo.InstallScriptInjectionMethod

New in version 1.3.0.

get_product_key_format()
Returns:

Product key format mask, or None.

Return type:

str

If this function returns a non-None string, it means that the self requires you to specify product registration key through Libosinfo.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:

str

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:

str

Returns the stylesheet data used to construct the install script.

New in version 0.2.0.

get_template_uri()
Return type:

str

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) – an Libosinfo.InstallConfigParam

Return type:

bool

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)
Parameters:

name (str) – the configuration parameter name

Return type:

bool

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:

Libosinfo.AvatarFormat

Default Value:

None

Flags:

READABLE

Expected avatar format

Libosinfo.InstallScript.props.installation_source
Name:

installation-source

Type:

Libosinfo.InstallScriptInstallationSource

Default Value:

Libosinfo.InstallScriptInstallationSource.MEDIA

Flags:

READABLE

The installation source to be used

Libosinfo.InstallScript.props.path_format
Name:

path-format

Type:

Libosinfo.PathFormat

Default Value:

Libosinfo.PathFormat.UNIX

Flags:

READABLE

Expected path format

Libosinfo.InstallScript.props.preferred_injection_method
Name:

preferred-injection-method

Type:

Libosinfo.InstallScriptInjectionMethod

Default Value:

Libosinfo.InstallScriptInjectionMethod.DISK

Flags:

READABLE, WRITABLE

The preferred injection method

Libosinfo.InstallScript.props.product_key_format
Name:

product-key-format

Type:

str

Default Value:

None

Flags:

READABLE

Product key format mask

Libosinfo.InstallScript.props.profile
Name:

profile

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Install script profile name

Libosinfo.InstallScript.props.template_data
Name:

template-data

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Data for install script template

Libosinfo.InstallScript.props.template_uri
Name:

template-uri

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

URI for install script template