[gnome-boxes] unattended-file: Handle INITRD injection method



commit 22c329cc8dc8ad637a09bcfab9114bfe4210f414
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Jul 31 17:21:01 2014 +0200

    unattended-file: Handle INITRD injection method
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730640
    
    Conflicts:
        src/unattended-file.vala

 src/unattended-file.vala |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/unattended-file.vala b/src/unattended-file.vala
index 8b83ebb..06f8f3a 100644
--- a/src/unattended-file.vala
+++ b/src/unattended-file.vala
@@ -92,10 +92,24 @@ private class Boxes.UnattendedScriptFile : GLib.Object, Boxes.UnattendedFile {
     public string dest_name { get; set; }
     public string src_path { get; set; }
 
+    protected string disk_file {
+        owned get {
+            switch (injection_method) {
+            case InstallScriptInjectionMethod.DISK:
+                return installer.disk_file.get_path ();
+            case InstallScriptInjectionMethod.INITRD:
+                return installer.initrd_file.get_path ();
+            default:
+                assert_not_reached ();
+            }
+        }
+    }
+
     protected UnattendedInstaller installer { get; set; }
     protected InstallScript script { get; set; }
 
     private File unattended_tmp;
+    private InstallScriptInjectionMethod injection_method;
 
     public UnattendedScriptFile (UnattendedInstaller installer,
                                  InstallScript       script,
@@ -106,7 +120,11 @@ private class Boxes.UnattendedScriptFile : GLib.Object, Boxes.UnattendedFile {
         this.dest_name = dest_name;
 
         var injection_methods = script.get_injection_methods ();
-        if (!(InstallScriptInjectionMethod.DISK in injection_methods))
+        if (InstallScriptInjectionMethod.DISK in injection_methods)
+            injection_method = InstallScriptInjectionMethod.DISK;
+        else if (InstallScriptInjectionMethod.INITRD in injection_methods)
+            injection_method = InstallScriptInjectionMethod.INITRD;
+        else
             throw new GLib.IOError.NOT_SUPPORTED ("No supported injection method available.");
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]