[gnome-boxes] unattended-{file,installer}: Drop floppy support



commit a82e4a524bc8ef2a5ac42ebf832edcf9d6461686
Author: Fabiano FidĂȘncio <fidencio redhat com>
Date:   Tue Jun 11 13:43:06 2019 +0200

    unattended-{file,installer}: Drop floppy support
    
    This commit may be a little bit controversial as we would simply drop
    support to express-install any Windows older than 7.
    
    However, all the systems we're going to drop support to express install
    them are already, for a long time, considered without support.
    
    Signed-off-by: Fabiano FidĂȘncio <fidencio redhat com>

 README.md                              |  1 -
 build-aux/flatpak/org.gnome.Boxes.json | 19 ---------
 src/unattended-file.vala               | 20 +--------
 src/unattended-installer.vala          | 74 +++++-----------------------------
 4 files changed, 11 insertions(+), 103 deletions(-)
---
diff --git a/README.md b/README.md
index cb7b335e..6eb131df 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,6 @@ A simple GNOME 3 application to access remote or virtual systems.
 # Runtime Dependencies
 
 * genisoimage (usually provided by genisoimage package)
-* mcopy (usually provided by mtools package)
 
 # Reporting Bugs
 
diff --git a/build-aux/flatpak/org.gnome.Boxes.json b/build-aux/flatpak/org.gnome.Boxes.json
index f3716c1b..c2469adb 100644
--- a/build-aux/flatpak/org.gnome.Boxes.json
+++ b/build-aux/flatpak/org.gnome.Boxes.json
@@ -40,25 +40,6 @@
                 }
             ]
         },
-        {
-            "name" : "mtools",
-            "buildsystem" : "autotools",
-            "config-opts" : ["--disable-static"],
-            "sources" : [
-                {
-                    "type" : "archive",
-                    "url" : "https://ftp.gnu.org/gnu/mtools/mtools-4.0.18.tar.bz2";,
-                    "sha256" : "59e9cf80885399c4f229e5d87e49c0c2bfeec044e1386d59fcd0b0aead6b2f85"
-                },
-                {
-                    "type": "shell",
-                    "commands": [
-                        "cp -f /usr/share/gnu-config/config.sub .",
-                        "cp -f /usr/share/gnu-config/config.guess ."
-                    ]
-                }
-            ]
-        },
         {
             "name" : "check",
             "sources" : [
diff --git a/src/unattended-file.vala b/src/unattended-file.vala
index 883e6712..43c9a704 100644
--- a/src/unattended-file.vala
+++ b/src/unattended-file.vala
@@ -29,8 +29,7 @@ protected static async void default_copy (string       disk_file,
             yield App.app.async_launcher.launch(() => {
                 copy_with_libarchive (disk_file, source_file, dest_name);
             });
-        } else
-            yield copy_with_mcopy (disk_file, source_file, dest_name, cancellable);
+        }
 
         debug ("Copied unattended file '%s' into disk drive/image '%s'", dest_name, disk_file);
     }
@@ -55,21 +54,6 @@ private static void copy_with_libarchive (string disk_file, string source_file,
         src.move (dst, FileCopyFlags.OVERWRITE);
     }
 
-    private static async void copy_with_mcopy (string       disk_file,
-                                               string       source_file,
-                                               string       dest_name,
-                                               Cancellable? cancellable = null)
-                                               throws GLib.Error {
-        string[] argv = {"mcopy",
-                             "-n",
-                             "-o",
-                             "-i",
-                                 disk_file,
-                             source_file,
-                             "::" + dest_name };
-        yield exec (argv, cancellable);
-    }
-
     private static bool is_libarchive_compatible (string filename) {
         // FIXME: We need better way to determine libarchive compatibility cause mcopy is used
         //        if this function returns false and mcopy can only handle MS-DOS images while
@@ -125,8 +109,6 @@ else if (InstallScriptInjectionMethod.DISK in injection_methods)
             injection_method = InstallScriptInjectionMethod.DISK;
         else if (InstallScriptInjectionMethod.CDROM in injection_methods)
             injection_method = InstallScriptInjectionMethod.CDROM;
-        else if (InstallScriptInjectionMethod.FLOPPY in injection_methods)
-            injection_method = InstallScriptInjectionMethod.FLOPPY;
         else
             throw new GLib.IOError.NOT_SUPPORTED ("No supported injection method available.");
     }
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 1930345e..cac78ed1 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -66,8 +66,7 @@
 
     public UnattendedSetupBox setup_box;
 
-    public File? disk_file;           // Used for installer scripts, user avatar and pre-installation drivers
-    public File? secondary_disk_file; // Used for post-installation drivers that won't fit on 1.44M primary 
disk
+    public File? disk_file;           // Used for installer scripts, user avatar, pre & post installation 
drivers
     public File? kernel_file;
     public File? initrd_file;
     public InstallConfig config;
@@ -172,11 +171,6 @@ public override void prepare_to_continue_installation (string vm_name) {
 
         var path = get_user_unattended (unattended);
         disk_file = File.new_for_path (path);
-        if (secondary_unattended_files.length () > 0 &&
-            injection_method == InstallScriptInjectionMethod.FLOPPY) {
-            path = get_user_unattended ("unattended.iso");
-            secondary_disk_file = File.new_for_path (path);
-        }
 
         if (os_media.kernel_path != null && os_media.initrd_path != null) {
             path = get_user_unattended ("kernel");
@@ -213,22 +207,6 @@ public override async void prepare_for_installation (string vm_name, Cancellable
            if (injection_method != InstallScriptInjectionMethod.CDROM)
                 foreach (var unattended_file in unattended_files)
                     yield unattended_file.copy (cancellable);
-
-            if (secondary_disk_file != null) {
-                var secondary_disk_path = secondary_disk_file.get_path ();
-
-                debug ("Creating secondary disk image '%s'...", secondary_disk_path);
-                string[] argv = { "genisoimage", "-graft-points", "-J", "-rock", "-o", secondary_disk_path };
-                foreach (var unattended_file in secondary_unattended_files) {
-                    var dest_path = escape_genisoimage_path (unattended_file.dest_name);
-                    var src_path = escape_genisoimage_path (unattended_file.src_path);
-
-                    argv += dest_path + "=" + src_path;
-                }
-
-                yield exec (argv, cancellable);
-                debug ("Created secondary disk image '%s'...", secondary_disk_path);
-            }
         } catch (GLib.Error error) {
             clean_up ();
             // An error occurred when trying to setup unattended installation, but it's likely that a 
non-unattended
@@ -250,10 +228,6 @@ public override void setup_domain_config (Domain domain) {
         return_if_fail (disk_file != null);
         var disk = get_unattended_disk_config ();
         domain.add_device (disk);
-        if (secondary_disk_file != null) {
-            disk = get_secondary_unattended_disk_config ();
-            domain.add_device (disk);
-        }
     }
 
     public void configure_install_script (InstallScript script) {
@@ -294,10 +268,6 @@ public override void setup_post_install_domain_config (Domain domain) {
             var path = disk_file.get_path ();
             remove_disk_from_domain_config (domain, path);
         }
-        if (secondary_disk_file != null) {
-            var path = secondary_disk_file.get_path ();
-            remove_disk_from_domain_config (domain, path);
-        }
 
         base.setup_post_install_domain_config (domain);
     }
@@ -343,11 +313,6 @@ public override void clean_up () {
                 disk_file = null;
             }
 
-            if (secondary_disk_file != null) {
-                delete_file (secondary_disk_file);
-                secondary_disk_file = null;
-            }
-
             if (kernel_file != null) {
                 delete_file (kernel_file);
                 kernel_file = null;
@@ -389,40 +354,21 @@ public override async bool prepare (ActivityProgress progress = new ActivityProg
         disk.set_driver_format (DomainDiskFormat.RAW);
         disk.set_source (disk_file.get_path ());
 
-        if (injection_method == InstallScriptInjectionMethod.FLOPPY) {
-            disk.set_target_dev ("fda");
-            disk.set_guest_device_type (DomainDiskGuestDeviceType.FLOPPY);
-            disk.set_target_bus (DomainDiskBus.FDC);
+        if (injection_method == InstallScriptInjectionMethod.CDROM) {
+            // Explicitly set "hdd" as the target device as the installer media is *always* set
+            // as "hdc".
+            disk.set_target_dev ("hdd");
+            disk.set_guest_device_type (DomainDiskGuestDeviceType.CDROM);
+            disk.set_target_bus (prefers_q35? DomainDiskBus.SATA : DomainDiskBus.IDE);
         } else {
-            if (injection_method == InstallScriptInjectionMethod.CDROM) {
-                // Explicitly set "hdd" as the target device as the installer media is *always* set
-                // as "hdc".
-                disk.set_target_dev ("hdd");
-                disk.set_guest_device_type (DomainDiskGuestDeviceType.CDROM);
-                disk.set_target_bus (prefers_q35? DomainDiskBus.SATA : DomainDiskBus.IDE);
-            } else {
-                disk.set_target_dev ((supports_virtio_disk || supports_virtio1_disk)? "sda":  "sdb");
-                disk.set_guest_device_type (DomainDiskGuestDeviceType.DISK);
-                disk.set_target_bus (DomainDiskBus.USB);
-            }
+            disk.set_target_dev ((supports_virtio_disk || supports_virtio1_disk)? "sda":  "sdb");
+            disk.set_guest_device_type (DomainDiskGuestDeviceType.DISK);
+            disk.set_target_bus (DomainDiskBus.USB);
         }
 
         return disk;
     }
 
-    private DomainDisk? get_secondary_unattended_disk_config (PathFormat path_format = PathFormat.UNIX) {
-        var disk = new DomainDisk ();
-        disk.set_type (DomainDiskType.FILE);
-        disk.set_driver_name ("qemu");
-        disk.set_driver_format (DomainDiskFormat.RAW);
-        disk.set_source (secondary_disk_file.get_path ());
-        disk.set_target_dev ((path_format == PathFormat.DOS)? "E" : "hdd");
-        disk.set_guest_device_type (DomainDiskGuestDeviceType.CDROM);
-        disk.set_target_bus (prefers_q35? DomainDiskBus.SATA : DomainDiskBus.IDE);
-
-        return disk;
-    }
-
     private string device_name_to_path (PathFormat path_format, string name) {
         return (path_format == PathFormat.UNIX)? "/dev/" + name : name;
     }


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