[virt-tools-list] [libosinfo 09/10] install-config: API to specify drivers disk & location

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Wed Dec 5 14:03:05 UTC 2012


From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>

Add API for apps to be able to tell where pre- and post-installation
drivers are available.
---
 osinfo/libosinfo.syms          |   8 +++
 osinfo/osinfo_install_config.c | 143 +++++++++++++++++++++++++++++++++++++++++
 osinfo/osinfo_install_config.h |  20 ++++++
 3 files changed, 171 insertions(+)

diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
index 6a8f725..fe1ac16 100644
--- a/osinfo/libosinfo.syms
+++ b/osinfo/libosinfo.syms
@@ -353,6 +353,14 @@ LIBOSINFO_0.2.2 {
 	osinfo_install_config_set_target_disk;
 	osinfo_install_config_get_script_disk;
 	osinfo_install_config_set_script_disk;
+	osinfo_install_config_set_pre_install_drivers_disk;
+	osinfo_install_config_get_pre_install_drivers_disk;
+	osinfo_install_config_set_pre_install_drivers_location;
+	osinfo_install_config_get_pre_install_drivers_location;
+	osinfo_install_config_set_post_install_drivers_disk;
+	osinfo_install_config_get_post_install_drivers_disk;
+	osinfo_install_config_set_post_install_drivers_location;
+	osinfo_install_config_get_post_install_drivers_location;
 
 	osinfo_install_script_get_avatar_format;
 	osinfo_install_script_get_path_format;
diff --git a/osinfo/osinfo_install_config.c b/osinfo/osinfo_install_config.c
index adbf9df..16faed9 100644
--- a/osinfo/osinfo_install_config.c
+++ b/osinfo/osinfo_install_config.c
@@ -461,6 +461,149 @@ const gchar *osinfo_install_config_get_avatar_disk(OsinfoInstallConfig *config)
                                          OSINFO_INSTALL_CONFIG_PROP_AVATAR_DISK);
 }
 
+/**
+ * osinfo_install_config_set_pre_install_drivers_disk:
+ * @config: the install config
+ *
+ * Specify the disk on which drivers to be installed at the very beginning of
+ * installation, are available. This is usually needed for devices for which the
+ * OS in question does not have out of the box support for and devices are
+ * required/prefered to be available during actual installation.
+ *
+ * Please read documentation on #osinfo_install_config_set_target_disk() for
+ * explanation on the format of @disk string.
+ *
+ * NOTE: Not every install script supports pre-installation of drivers. Use
+ * #osinfo_install_script_get_can_pre_install_drivers() to find out if an
+ * installer script supports it.
+ *
+ * NOTE: Microsoft Windows XP requires pre-installation driver files to be
+ * present in the script disk under the toplevel directory.
+ */
+void osinfo_install_config_set_pre_install_drivers_disk(OsinfoInstallConfig *config,
+                                                        const gchar *disk)
+{
+    osinfo_entity_set_param(OSINFO_ENTITY(config),
+                            OSINFO_INSTALL_CONFIG_PROP_PRE_INSTALL_DRIVERS_DISK,
+                            disk);
+}
+
+/**
+ * osinfo_install_config_get_pre_install_drivers_disk:
+ *
+ * Returns: The disk on which pre-installation drivers are located, or NULL if
+ * its not set using #osinfo_install_config_set_pre_install_drivers_disk().
+ */
+const gchar *osinfo_install_config_get_pre_install_drivers_disk(OsinfoInstallConfig *config)
+{
+    return osinfo_entity_get_param_value
+            (OSINFO_ENTITY(config),
+             OSINFO_INSTALL_CONFIG_PROP_PRE_INSTALL_DRIVERS_DISK);
+}
+
+/**
+ * osinfo_install_config_set_pre_install_drivers_location:
+ * @config: the install config
+ *
+ * Specify the location on which drivers to be installed at the very beginning of
+ * installation, are available. Please read documentation on
+ * #osinfo_install_config_set_pre_install_drivers_disk() for more information
+ * about pre-installation of drivers.
+ *
+ * Please read documentation on #osinfo_install_config_set_avatar_location() for
+ * explanation on the format of @location string.
+ */
+void osinfo_install_config_set_pre_install_drivers_location(OsinfoInstallConfig *config,
+                                                            const gchar *location)
+{
+    osinfo_entity_set_param(OSINFO_ENTITY(config),
+                            OSINFO_INSTALL_CONFIG_PROP_PRE_INSTALL_DRIVERS_LOCATION,
+                            location);
+}
+
+/**
+ * osinfo_install_config_get_pre_install_drivers_location:
+ *
+ * Returns: The location on which pre-installation drivers are located, or NULL if
+ * its not set using #osinfo_install_config_set_pre_install_drivers_location().
+ */
+const gchar *osinfo_install_config_get_pre_install_drivers_location(OsinfoInstallConfig *config)
+{
+    return osinfo_entity_get_param_value
+            (OSINFO_ENTITY(config),
+             OSINFO_INSTALL_CONFIG_PROP_PRE_INSTALL_DRIVERS_LOCATION);
+}
+
+/**
+ * osinfo_install_config_set_post_install_drivers_disk:
+ * @config: the install config
+ *
+ * Specify the disk on which drivers to be installed at the end of installation,
+ * are available.
+ *
+ * Please read documentation on #osinfo_install_config_set_target_disk() for
+ * explanation on the format of @disk string.
+ *
+ * NOTE: Not every install script supports post-installation of drivers. Use
+ * #osinfo_install_script_get_can_post_install_drivers() to find out if an
+ * install script supports it.
+ */
+void osinfo_install_config_set_post_install_drivers_disk(OsinfoInstallConfig *config,
+                                                         const gchar *disk)
+{
+    osinfo_entity_set_param(OSINFO_ENTITY(config),
+                            OSINFO_INSTALL_CONFIG_PROP_POST_INSTALL_DRIVERS_DISK,
+                            disk);
+}
+
+/**
+ * osinfo_install_config_get_post_install_drivers_disk:
+ *
+ * Returns: The disk on which post-installation drivers are located, or NULL if
+ * its not set using #osinfo_install_config_set_post_install_drivers_disk().
+ */
+const gchar *osinfo_install_config_get_post_install_drivers_disk(OsinfoInstallConfig *config)
+{
+    return osinfo_entity_get_param_value
+            (OSINFO_ENTITY(config),
+             OSINFO_INSTALL_CONFIG_PROP_POST_INSTALL_DRIVERS_DISK);
+}
+
+/**
+ * osinfo_install_config_set_post_install_drivers_location:
+ * @config: the install config
+ *
+ * Specify the disk on which drivers to be installed at the end of installation,
+ * are available.
+ *
+ * Please read documentation on #osinfo_install_config_set_avatar_location() for
+ * explanation on the format of @location string.
+ *
+ * NOTE: Not every install script supports post-installation of drivers. Use
+ * #osinfo_install_script_get_can_post_install_drivers() to find out if an
+ * install script supports it.
+ */
+void osinfo_install_config_set_post_install_drivers_location(OsinfoInstallConfig *config,
+                                                             const gchar *location)
+{
+    osinfo_entity_set_param(OSINFO_ENTITY(config),
+                            OSINFO_INSTALL_CONFIG_PROP_POST_INSTALL_DRIVERS_LOCATION,
+                            location);
+}
+
+/**
+ * osinfo_install_config_get_post_install_drivers_location:
+ *
+ * Returns: The disk on which post-installation drivers are located, or NULL if
+ * its not set using #osinfo_install_config_set_post_install_drivers_location().
+ */
+const gchar *osinfo_install_config_get_post_install_drivers_location(OsinfoInstallConfig *config)
+{
+    return osinfo_entity_get_param_value
+            (OSINFO_ENTITY(config),
+             OSINFO_INSTALL_CONFIG_PROP_POST_INSTALL_DRIVERS_LOCATION);
+}
+
 /*
  * Local variables:
  *  indent-tabs-mode: nil
diff --git a/osinfo/osinfo_install_config.h b/osinfo/osinfo_install_config.h
index 788d464..18c2c2f 100644
--- a/osinfo/osinfo_install_config.h
+++ b/osinfo/osinfo_install_config.h
@@ -61,6 +61,12 @@
 #define OSINFO_INSTALL_CONFIG_PROP_AVATAR_LOCATION "avatar-location"
 #define OSINFO_INSTALL_CONFIG_PROP_AVATAR_DISK     "avatar-disk"
 
+#define OSINFO_INSTALL_CONFIG_PROP_PRE_INSTALL_DRIVERS_DISK "pre-install-drivers-disk"
+#define OSINFO_INSTALL_CONFIG_PROP_PRE_INSTALL_DRIVERS_LOCATION "pre-install-drivers-location"
+
+#define OSINFO_INSTALL_CONFIG_PROP_POST_INSTALL_DRIVERS_DISK "post-install-drivers-disk"
+#define OSINFO_INSTALL_CONFIG_PROP_POST_INSTALL_DRIVERS_LOCATION "post-install-drivers-location"
+
 typedef struct _OsinfoInstallConfig        OsinfoInstallConfig;
 typedef struct _OsinfoInstallConfigClass   OsinfoInstallConfigClass;
 typedef struct _OsinfoInstallConfigPrivate OsinfoInstallConfigPrivate;
@@ -172,6 +178,20 @@ void osinfo_install_config_set_avatar_disk(OsinfoInstallConfig *config,
                                            const gchar *disk);
 const gchar *osinfo_install_config_get_avatar_disk(OsinfoInstallConfig *config);
 
+void osinfo_install_config_set_pre_install_drivers_disk(OsinfoInstallConfig *config,
+                                                        const gchar *disk);
+const gchar *osinfo_install_config_get_pre_install_drivers_disk(OsinfoInstallConfig *config);
+void osinfo_install_config_set_pre_install_drivers_location(OsinfoInstallConfig *config,
+                                                            const gchar *location);
+const gchar *osinfo_install_config_get_pre_install_drivers_location(OsinfoInstallConfig *config);
+
+void osinfo_install_config_set_post_install_drivers_disk(OsinfoInstallConfig *config,
+                                                         const gchar *disk);
+const gchar *osinfo_install_config_get_post_install_drivers_disk(OsinfoInstallConfig *config);
+void osinfo_install_config_set_post_install_drivers_location(OsinfoInstallConfig *config,
+                                                             const gchar *location);
+const gchar *osinfo_install_config_get_post_install_drivers_location(OsinfoInstallConfig *config);
+
 #endif /* __OSINFO_INSTALL_CONFIG_H__ */
 /*
  * Local variables:
-- 
1.8.0.1




More information about the virt-tools-list mailing list