Commits

Rodrigo Bistolfi committed 297435c

advanced.py: Outline for live cd support

  • Participants
  • Parent commits 6c2c55e

Comments (0)

Files changed (1)

File vinstall/controller/automatic.py

         """
         disk = self.get_disk(diskindex)
 
+        if self.is_live():
+            installpkg = self.live_installpkg
+            packages = self.live_packages
+        else:
+            installpkg = self.installpkg
+            packages = self.packages
+
         yield self.partitioning, (disk,), "Partitioning %s" % disk
         yield self.format_partitions, (disk,), "Formating partitions"
         yield self.mount_target, (disk,), "Mounting target"
 
-        yield self.preinstall, tuple(), "Preparing package install"
-        for package in self.packages():
-            yield self.installpkg, (package, disk), "Installing %s" % package.split("/")[-1]
-        yield self.postinstall, tuple(), "Installing setup routines"
+        if not self.is_live():
+            yield self.preinstall, tuple(), "Preparing package install"
+        
+        for package in packages():
+            yield installpkg, (package, disk), "Installing %s" % package.split("/")[-1]
+        
+        if not self.is_live():
+            yield self.postinstall, tuple(), "Installing setup routines"
+        
         yield self.install_kernel, tuple(), "Installing Linux kernel"
 
         yield self.set_bind_mounts, tuple(), "Mounting pseudo filesystems"
             kernel_version)
         shutil.copyfile(source, target)
 
+    def is_live(self):
+        """Return True if install media is a Live CD
+        
+        """
+        return NotImplemented
+
+    def live_packages(self):
+        """Return an iterable containing all available packages for a Live
+        edition
+        
+        """
+        return NotImplemented
+
+    def live_installpkg(self, package, disk):
+        """Install a package from a Live install media (usually a bulk)
+        
+        """
+        return NotImplemented
+
     def fstab(self, disk):
         """Create and install a fstab file in disk