[Libosinfo] [PATCH 4/8] installer: API to query supported device driver formats

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Mon Jan 28 03:18:43 UTC 2013


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

---
 data/install-scripts/windows-sif.xml      |  2 ++
 data/install-scripts/windows-unattend.xml |  2 ++
 data/schemas/libosinfo.rng                | 10 ++++++++++
 osinfo/libosinfo.syms                     |  2 ++
 osinfo/osinfo_install_script.c            | 18 ++++++++++++++++++
 osinfo/osinfo_install_script.h            |  5 +++++
 osinfo/osinfo_loader.c                    |  2 ++
 7 files changed, 41 insertions(+)

diff --git a/data/install-scripts/windows-sif.xml b/data/install-scripts/windows-sif.xml
index 3f947d0..8634e3a 100644
--- a/data/install-scripts/windows-sif.xml
+++ b/data/install-scripts/windows-sif.xml
@@ -6,6 +6,7 @@
     <product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
     <expected-filename>winnt.sif</expected-filename>
     <can-pre-install-drivers>true</can-pre-install-drivers>
+    <pre-install-driver-format>windows</pre-install-driver-format>
     <config>
       <param name="admin-password" policy="optional"/>
       <param name="reg-product-key" policy="required"/>
@@ -73,6 +74,7 @@
     <product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
     <expected-filename>winnt.sif</expected-filename>
     <can-pre-install-drivers>true</can-pre-install-drivers>
+    <pre-install-driver-format>windows</pre-install-driver-format>
     <config>
       <param name="admin-password" policy="optional"/>
       <param name="reg-product-key" policy="required"/>
diff --git a/data/install-scripts/windows-unattend.xml b/data/install-scripts/windows-unattend.xml
index e140617..e306ec4 100644
--- a/data/install-scripts/windows-unattend.xml
+++ b/data/install-scripts/windows-unattend.xml
@@ -5,6 +5,7 @@
     <product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
    <expected-filename>autounattend.xml</expected-filename>
    <can-pre-install-drivers>true</can-pre-install-drivers>
+   <pre-install-driver-format>windows</pre-install-driver-format>
     <config>
       <param name="admin-password" policy="optional"/>
       <param name="hardware-arch" policy="optional"/>
@@ -220,6 +221,7 @@
    <product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
    <expected-filename>autounattend.xml</expected-filename>
    <can-pre-install-drivers>true</can-pre-install-drivers>
+   <pre-install-driver-format>windows</pre-install-driver-format>
    <config>
     <param name="admin-password" policy="optional"/>
     <param name="hardware-arch" policy="required"/>
diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
index 05a34be..c193bcc 100644
--- a/data/schemas/libosinfo.rng
+++ b/data/schemas/libosinfo.rng
@@ -580,10 +580,20 @@
           </element>
         </optional>
         <optional>
+          <element name='pre-install-driver-format'>
+            <ref name='driver-formats'/>
+          </element>
+        </optional>
+        <optional>
           <element name='can-post-install-drivers'>
             <ref name='bool'/>
           </element>
         </optional>
+        <optional>
+          <element name='post-install-driver-format'>
+            <ref name='driver-formats'/>
+          </element>
+        </optional>
         <element name='template'>
           <choice>
             <group>
diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
index 41d3756..3e71d9e 100644
--- a/osinfo/libosinfo.syms
+++ b/osinfo/libosinfo.syms
@@ -403,6 +403,8 @@ LIBOSINFO_0.2.4 {
     global:
 	osinfo_device_driver_format_get_type;
 	osinfo_device_driver_get_format;
+	osinfo_install_script_get_pre_install_driver_format;
+	osinfo_install_script_get_post_install_driver_format;
 } LIBOSINFO_0.2.3;
 
 /* Symbols in next release...
diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
index 7105430..ca45b60 100644
--- a/osinfo/osinfo_install_script.c
+++ b/osinfo/osinfo_install_script.c
@@ -1232,6 +1232,24 @@ gboolean osinfo_install_script_get_can_post_install_drivers(OsinfoInstallScript
          OSINFO_INSTALL_SCRIPT_PROP_CAN_POST_INSTALL_DRIVERS);
 }
 
+OsinfoDeviceDriverFormat osinfo_install_script_get_pre_install_driver_format(OsinfoInstallScript *script)
+{
+    return osinfo_entity_get_param_value_enum
+        (OSINFO_ENTITY(script),
+         OSINFO_INSTALL_SCRIPT_PROP_PRE_INSTALL_DEVICE_DRIVER_FORMAT,
+         OSINFO_TYPE_DEVICE_DRIVER_FORMAT,
+         OSINFO_DEVICE_DRIVER_FORMAT_EXECUTABLE);
+}
+
+OsinfoDeviceDriverFormat osinfo_install_script_get_post_install_driver_format(OsinfoInstallScript *script)
+{
+    return osinfo_entity_get_param_value_enum
+        (OSINFO_ENTITY(script),
+         OSINFO_INSTALL_SCRIPT_PROP_POST_INSTALL_DEVICE_DRIVER_FORMAT,
+         OSINFO_TYPE_DEVICE_DRIVER_FORMAT,
+         OSINFO_DEVICE_DRIVER_FORMAT_EXECUTABLE);
+}
+
 /*
  * Local variables:
  *  indent-tabs-mode: nil
diff --git a/osinfo/osinfo_install_script.h b/osinfo/osinfo_install_script.h
index d91751e..82486ef 100644
--- a/osinfo/osinfo_install_script.h
+++ b/osinfo/osinfo_install_script.h
@@ -55,6 +55,8 @@ typedef struct _OsinfoInstallScriptPrivate OsinfoInstallScriptPrivate;
 #define OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT        "path-format"
 #define OSINFO_INSTALL_SCRIPT_PROP_CAN_PRE_INSTALL_DRIVERS "can-pre-install-drivers"
 #define OSINFO_INSTALL_SCRIPT_PROP_CAN_POST_INSTALL_DRIVERS "can-post-install-drivers"
+#define OSINFO_INSTALL_SCRIPT_PROP_PRE_INSTALL_DEVICE_DRIVER_FORMAT "pre-install-driver-format"
+#define OSINFO_INSTALL_SCRIPT_PROP_POST_INSTALL_DEVICE_DRIVER_FORMAT "post-install-driver-format"
 
 /* object */
 struct _OsinfoInstallScript
@@ -163,6 +165,9 @@ OsinfoPathFormat osinfo_install_script_get_path_format(OsinfoInstallScript *scri
 gboolean osinfo_install_script_get_can_pre_install_drivers(OsinfoInstallScript *script);
 gboolean osinfo_install_script_get_can_post_install_drivers(OsinfoInstallScript *script);
 
+OsinfoDeviceDriverFormat osinfo_install_script_get_pre_install_driver_format(OsinfoInstallScript *script);
+OsinfoDeviceDriverFormat osinfo_install_script_get_post_install_driver_format(OsinfoInstallScript *script);
+
 #endif /* __OSINFO_INSTALL_SCRIPT_H__ */
 /*
  * Local variables:
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index d186073..aad5a61 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -702,6 +702,8 @@ static void osinfo_loader_install_script(OsinfoLoader *loader,
         OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME,
         OSINFO_INSTALL_SCRIPT_PROP_CAN_PRE_INSTALL_DRIVERS,
         OSINFO_INSTALL_SCRIPT_PROP_CAN_POST_INSTALL_DRIVERS,
+        OSINFO_INSTALL_SCRIPT_PROP_PRE_INSTALL_DEVICE_DRIVER_FORMAT,
+        OSINFO_INSTALL_SCRIPT_PROP_POST_INSTALL_DEVICE_DRIVER_FORMAT,
         NULL
     };
     gchar *value = NULL;
-- 
1.8.1




More information about the Libosinfo mailing list