## osinfo_os osinfo_os — An operating system |

## Functions

OsinfoOs * | osinfo_os_new ()
OsinfoDeviceList * | osinfo_os_get_devices ()
OsinfoDeviceList * | osinfo_os_get_all_devices ()
OsinfoDeviceList * | osinfo_os_get_devices_by_property ()
OsinfoDeviceLinkList * | osinfo_os_get_device_links ()
OsinfoDeviceLinkList * | osinfo_os_get_all_device_links ()
OsinfoDeviceLink * | osinfo_os_add_device ()
const gchar * | osinfo_os_get_family ()
const gchar * | osinfo_os_get_distro ()
int | osinfo_os_get_release_status ()
OsinfoMediaList * | osinfo_os_get_media_list ()
void | osinfo_os_add_media ()
OsinfoTreeList * | osinfo_os_get_tree_list ()
void | osinfo_os_add_tree ()
OsinfoImageList * | osinfo_os_get_image_list ()
void | osinfo_os_add_image ()
OsinfoOsVariantList * | osinfo_os_get_variant_list ()
void | osinfo_os_add_variant ()
OsinfoResourcesList * | osinfo_os_get_network_install_resources ()
OsinfoResourcesList * | osinfo_os_get_minimum_resources ()
OsinfoResourcesList * | osinfo_os_get_recommended_resources ()
OsinfoResourcesList * | osinfo_os_get_maximum_resources ()
void | osinfo_os_add_network_install_resources ()
void | osinfo_os_add_minimum_resources ()
void | osinfo_os_add_recommended_resources ()
void | osinfo_os_add_maximum_resources ()
OsinfoInstallScript * | osinfo_os_find_install_script ()
OsinfoInstallScriptList * | osinfo_os_get_install_script_list ()
void | osinfo_os_add_install_script ()
OsinfoDeviceDriverList * | osinfo_os_get_device_drivers ()
OsinfoDeviceDriverList * | osinfo_os_get_device_drivers_prioritized ()
void | osinfo_os_add_device_driver ()
const gchar * | osinfo_os_get_kernel_url_argument ()
OsinfoFirmwareList * | osinfo_os_get_firmware_list ()
void | osinfo_os_add_firmware ()
const gchar * | osinfo_os_get_cloud_image_username ()

## Types and Values

#define | OSINFO_TYPE_OS
#define | OSINFO_OS_PROP_FAMILY
#define | OSINFO_OS_PROP_DISTRO
#define | OSINFO_OS_PROP_RELEASE_STATUS
#define | OSINFO_OS_PROP_KERNEL_URL_ARGUMENT
#define | OSINFO_OS_PROP_CLOUD_IMAGE_USERNAME
enum | OsinfoReleaseStatus

## Object Hierarchy

        GEnum
        ╰── OsinfoReleaseStatus

## Description

OsinfoOs is an entity representing an operating system. Operating systems have a list of supported devices. There are relationships amongst operating systems to declare which are newest releases, which are clones and which are derived from a common ancestry.

## Functions

### osinfo_os_new ()

    OsinfoOs *
    osinfo_os_new (const gchar *id);

Create a new operating system entity

#### Parameters

id | a unique identifier |

#### Returns

a new operating system entity.

[transfer full]

### osinfo_os_get_devices ()

    OsinfoDeviceList *
    osinfo_os_get_devices (OsinfoOs *os,
                           OsinfoFilter *filter);

Get all devices matching a given filter

#### Parameters

os | an operating system |
filter | an optional device property filter. | [allow-none][transfer none]

#### Returns

A list of devices.

[transfer full]

### osinfo_os_get_all_devices ()

    OsinfoDeviceList *
    osinfo_os_get_all_devices (OsinfoOs *os,
                               OsinfoFilter *filter);

Get all devices matching a given filter but unlike osinfo_os_get_devices this function also retrieves devices from all derived and cloned operating systems.

#### Parameters

os | an operating system |
filter | an optional device property filter. | [allow-none][transfer none]

#### Returns

A list of devices.

[transfer full]

Since: 0.0.5

### osinfo_os_get_devices_by_property ()

    OsinfoDeviceList *
    osinfo_os_get_devices_by_property (OsinfoOs *os,
                                       const char *property,
                                       const char *value,
                                       gboolean inherited);

A utility function that gets devices found from the list of devices `os` supports, for which the value of `property` is `value` .

#### Parameters

os | an operating system |
property | the property of interest |
value | the required value of property `property` |
inherited | Should devices from inherited and cloned OSs be included in the search. |

#### Returns

The found devices.

[transfer full]

Since: 0.0.6

### osinfo_os_get_device_links ()

    OsinfoDeviceLinkList *
    osinfo_os_get_device_links (OsinfoOs *os,
                                OsinfoFilter *filter);

Get all devices matching a given filter. The filter matches against the links, not the devices.

#### Parameters

os | an operating system |
filter | an optional device property filter. | [allow-none][transfer none]

#### Returns

A list of device links.

[transfer full]

### osinfo_os_get_all_device_links ()

    OsinfoDeviceLinkList *
    osinfo_os_get_all_device_links (OsinfoOs *os,
                                    OsinfoFilter *filter);

Get all devicelinks matching a given filter but unlike osinfo_os_get_device_links this function also retrieves devices from all derived and cloned operating systems.

#### Parameters

os | an operating system |
filter | an optional device property filter. | [allow-none][transfer none]

#### Returns

A list of OsinfoDeviceLink.

[transfer full]

Since: 1.3.0

### osinfo_os_add_device ()

    OsinfoDeviceLink *
    osinfo_os_add_device (OsinfoOs *os,
                          OsinfoDevice *dev);

Associated a device with an operating system. The returned OsinfoDeviceLink can be used to record extra metadata against the link

#### Parameters

os | an operating system |
dev | the device to associate with. | [transfer none]

#### Returns

the device association.

[transfer none]

### osinfo_os_get_family ()

    const gchar *
    osinfo_os_get_family (OsinfoOs *os);

Retrieves the generic family the OS `os` belongs to, based upon its kernel, for example linux, winnt, solaris, freebsd etc.

#### Parameters

os | an OsinfoOs |

#### Returns

the family of this os.

[transfer none]

### osinfo_os_get_distro ()

    const gchar *
    osinfo_os_get_distro (OsinfoOs *os);

Retrieves the generic family the OS `os` belongs to, for example fedora, ubuntu, windows, solaris, freebsd etc.

#### Parameters

os | an OsinfoOs |

#### Returns

the distro of this os.

[transfer none]

### osinfo_os_get_release_status ()

    int
    osinfo_os_get_release_status (OsinfoOs *os);

Use this to determine the release status of the `os` .

#### Parameters

os | an OsinfoOs |

#### Returns

release status of `os` .

[type OsinfoReleaseStatus]

Since: 0.2.9

### osinfo_os_get_media_list ()

    OsinfoMediaList *
    osinfo_os_get_media_list (OsinfoOs *os);

Get all installation medias associated with operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of medias.

[transfer full]

### osinfo_os_add_media ()

    void
    osinfo_os_add_media (OsinfoOs *os,
                         OsinfoMedia *media);

Adds installation media `media` to operating system `os` .

#### Parameters

os | an operating system |
media | the media to add. | [transfer none]

### osinfo_os_get_tree_list ()

    OsinfoTreeList *
    osinfo_os_get_tree_list (OsinfoOs *os);

Get all installation trees associated with operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of trees.

[transfer full]

### osinfo_os_add_tree ()

    void
    osinfo_os_add_tree (OsinfoOs *os,
                        OsinfoTree *tree);

Adds installation tree `tree` to operating system `os` .

#### Parameters

os | an operating system |
tree | the tree to add. | [transfer none]

### osinfo_os_get_image_list ()

    OsinfoImageList *
    osinfo_os_get_image_list (OsinfoOs *os);

Get all installed images associated with operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of images.

[transfer full]

Since: 1.3.0

### osinfo_os_add_image ()

    void
    osinfo_os_add_image (OsinfoOs *os,
                         OsinfoImage *image);

Adds an installed image `image` to operating system `os` .

#### Parameters

os | an operating system |
image | the image to add. | [transfer none]

Since: 1.3.0

### osinfo_os_get_variant_list ()

    OsinfoOsVariantList *
    osinfo_os_get_variant_list (OsinfoOs *os);

Gets all known variants of operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of variants.

[transfer full]

Since: 0.2.9

### osinfo_os_add_variant ()

    void
    osinfo_os_add_variant (OsinfoOs *os,
                           OsinfoOsVariant *variant);

Adds a variant `variant` to operating system `os` .

#### Parameters

os | an operating system |
variant | the variant to add. | [transfer none]

Since: 0.2.9

### osinfo_os_get_network_install_resources ()

    OsinfoResourcesList *
    osinfo_os_get_network_install_resources
                                   (OsinfoOs *os);

Get the list of resources needed for network installing an operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of resources.

[transfer full]

Since: 1.3.0

### osinfo_os_get_minimum_resources ()

    OsinfoResourcesList *
    osinfo_os_get_minimum_resources (OsinfoOs *os);

Get the list of minimum required resources for the operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of resources.

[transfer full]

### osinfo_os_get_recommended_resources ()

    OsinfoResourcesList *
    osinfo_os_get_recommended_resources (OsinfoOs *os);

Get the list of recommended resources for the operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of resources.

[transfer full]

### osinfo_os_get_maximum_resources ()

    OsinfoResourcesList *
    osinfo_os_get_maximum_resources (OsinfoOs *os);

Get the list of maximum resources for the operating system `os` .

#### Parameters

os | an operating system |

#### Returns

A list of resources.

[transfer full]

Since: 1.3.0

### osinfo_os_add_network_install_resources ()

    void
    osinfo_os_add_network_install_resources
                                   (OsinfoOs *os,
                                    OsinfoResources *resources);

Adds `resources` to list of resources needed for network installing an operating system `os` .

#### Parameters

os | an operating system |
resources | the resources to add. | [transfer none]

Since: 1.3.0

### osinfo_os_add_minimum_resources ()

    void
    osinfo_os_add_minimum_resources (OsinfoOs *os,
                                     OsinfoResources *resources);

Adds `resources` to list of minimum resources of operating system `os` .

#### Parameters

os | an operating system |
resources | the resources to add. | [transfer none]

### osinfo_os_add_recommended_resources ()

    void
    osinfo_os_add_recommended_resources (OsinfoOs *os,
                                         OsinfoResources *resources);

Adds `resources` to list of recommended resources of operating system `os` .

#### Parameters

os | an operating system |
resources | the resources to add. | [transfer none]

### osinfo_os_add_maximum_resources ()

    void
    osinfo_os_add_maximum_resources (OsinfoOs *os,
                                     OsinfoResources *resources);

Adds `resources` to list of maximum resources of operating system `os` .

#### Parameters

os | an operating system |
resources | the resources to add. | [transfer none]

Since: 1.3.0

### osinfo_os_find_install_script ()

    OsinfoInstallScript *
    osinfo_os_find_install_script (OsinfoOs *os,
                                   const gchar *profile);

#### Parameters

os | an operating system |
profile | the install script profile that must be either OSINFO_INSTALL_SCRIPT_PROFILE_DESKTOP or OSINFO_INSTALL_SCRIPT_PROFILE_JEOS |

#### Returns

A new OsinfoInstallScript for the `os` `profile` .

[transfer none]

Since: 0.2.0

### osinfo_os_get_install_script_list ()

    OsinfoInstallScriptList *
    osinfo_os_get_install_script_list (OsinfoOs *os);

#### Parameters

os | an operating system |

#### Returns

a list of the install scripts for the specified os.

[transfer full]

Since: 0.2.0

### osinfo_os_add_install_script ()

    void
    osinfo_os_add_install_script (OsinfoOs *os,
                                  OsinfoInstallScript *script);

Adds `script` to the list of scripts of operating system `os` .

#### Parameters

os | an operating system |
script | the install script to add. | [transfer none]

Since: 0.2.0

### osinfo_os_get_device_drivers ()

    OsinfoDeviceDriverList *
    osinfo_os_get_device_drivers (OsinfoOs *os);

Gets list of all available device drivers for OS `os` .

#### Parameters

os | an operating system |

#### Returns

A list of device drivers.

[transfer none]

Since: 0.2.2

### osinfo_os_get_device_drivers_prioritized ()

    OsinfoDeviceDriverList *
    osinfo_os_get_device_drivers_prioritized
                                   (OsinfoOs *os);

Gets list of the highest priority device drivers for OS `os` .

#### Parameters

os | an operating system |

#### Returns

A list of device drivers.

[transfer full]

Since: 1.7.0

### osinfo_os_add_device_driver ()

    void
    osinfo_os_add_device_driver (OsinfoOs *os,
                                 OsinfoDeviceDriver *driver);

Adds `driver` to the list of device drivers of operating system `os` .

#### Parameters

os | an operating system |
driver | the device driver to add. | [transfer none]

Since: 0.2.2

### osinfo_os_get_kernel_url_argument ()

    const gchar *
    osinfo_os_get_kernel_url_argument (OsinfoOs *os);

Gets the argument expected to be passed to the kernel command line when performing a tree based installation.

#### Parameters

os | an operating system |

#### Returns

the kernel url argument, if present. Otherwise, NULL.

[transfer none]

### osinfo_os_get_firmware_list ()

    OsinfoFirmwareList *
    osinfo_os_get_firmware_list (OsinfoOs *os,
                                 OsinfoFilter *filter);

Get all firmwares matching a given filter

#### Parameters

os | an operating system |
filter | an optional firmware property filter. | [allow-none][transfer none]

#### Returns

A list of firmwares.

[transfer full]

Since: 1.7.0

### osinfo_os_add_firmware ()

    void
    osinfo_os_add_firmware (OsinfoOs *os,
                            OsinfoFirmware *firmware);

### osinfo_os_get_cloud_image_username ()

    const gchar *
    osinfo_os_get_cloud_image_username (OsinfoOs *os);

Gets the username expected to be passed to the cloud image when performing installation.

#### Parameters

os | an operating system |

#### Returns

ther username, if present. Otherwise, NULL.

[transfer none]

## Types and Values

### OSINFO_TYPE_OS

    # define OSINFO_TYPE_OS (osinfo_os_get_type ())

### OSINFO_OS_PROP_FAMILY

    # define OSINFO_OS_PROP_FAMILY                 "family"

### OSINFO_OS_PROP_DISTRO

    # define OSINFO_OS_PROP_DISTRO                 "distro"

### OSINFO_OS_PROP_RELEASE_STATUS

    # define OSINFO_OS_PROP_RELEASE_STATUS         "release-status"

### OSINFO_OS_PROP_KERNEL_URL_ARGUMENT

    # define OSINFO_OS_PROP_KERNEL_URL_ARGUMENT    "kernel-url-argument"

### OSINFO_OS_PROP_CLOUD_IMAGE_USERNAME

    # define OSINFO_OS_PROP_CLOUD_IMAGE_USERNAME   "cloud-image-username"

### enum OsinfoReleaseStatus

#### Members

OSINFO_RELEASE_STATUS_RELEASED | A released OS. (Since: 0.2.9) |
OSINFO_RELEASE_STATUS_SNAPSHOT | A continuous integration snapshot and not an actual released product yet. For example, gnome-continuous images for development snapshots of GNOME and nightly build ISOs of Fedora etc. (Since: 0.2.9) |
OSINFO_RELEASE_STATUS_PRERELEASE | A pre-release. For example, alpha and beta pre-releases of Fedora etc. (Since: 0.2.9) |
OSINFO_RELEASE_STATUS_ROLLING | A rolling version of an OS and thus with no actual releases. For example, Gentoo, Arch Linux, etc. (Since: 1.4.0) |

## See Also

OsinfoOs, OsinfoDeployment