[virt-tools-list] [PATCH 2/2] virtinst: In DebianDistro and UbuntuDistro, detect Install CDs

Andrew Wong andrew.kw.w at gmail.com
Thu Sep 7 23:11:31 UTC 2017


---
 virtinst/urlfetcher.py | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index e5beb9b2..47fd97f1 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -1190,10 +1190,27 @@ class DebianDistro(Distro):
 
         return True
 
+    def _is_install_cd(self):
+        # For install CDs
+        if not self._check_info(".disk/info"):
+            return False
+
+        if self.arch == "x86_64":
+            kernel_initrd_pair = ("install.amd/vmlinuz", "install.amd/initrd.gz")
+        elif self.arch == "i686":
+            kernel_initrd_pair = ("install.386/vmlinuz", "install.386/initrd.gz")
+        else:
+            kernel_initrd_pair = ("install/vmlinuz", "install/initrd.gz")
+        self._hvm_kernel_paths += [kernel_initrd_pair]
+        self._xen_kernel_paths += [kernel_initrd_pair]
+
+        return True
+
     def isValidStore(self):
         return any(check() for check in [
             self._is_regular_tree,
             self._is_daily_tree,
+            self._is_install_cd,
             ])
 
 
@@ -1244,6 +1261,18 @@ class UbuntuDistro(DebianDistro):
 
         return True
 
+    def _is_install_cd(self):
+        # For install CDs
+        if not self._check_info(".disk/mini-info"):
+            return False
+
+        kernel_initrd_pair = ("linux", "initrd.gz")
+
+        self._hvm_kernel_paths += [kernel_initrd_pair]
+        self._xen_kernel_paths += [kernel_initrd_pair]
+
+        return True
+
     def _is_install_cd_s390x(self):
         # For install CDs (s390x)
         if not self.arch == "s390x":
@@ -1261,6 +1290,7 @@ class UbuntuDistro(DebianDistro):
         return any(check() for check in [
             self._is_regular_tree,
             self._is_tree_iso,
+            self._is_install_cd,
             self._is_install_cd_s390x,
             ])
 
-- 
2.14.1




More information about the virt-tools-list mailing list