Moises Henriquez committed ab2a402

Fix automatically disabling bootsplash when not asked to. Add code to copy installation logs to the target. Fix problem where only the -TUI boot option was getting written to lilo.conf

Comments (0)

Files changed (1)


-import os
+import os, shutil
 from vinstall.backend import bootloader, utils, sp
 from import Disk, Partition
 from vinstall.core import Render, Controller, model, log
 	"""Disable the bootsplash if asked to by the preference set by splash_opt.
 	splash_opt is a Boolean"""
-	if not splash_disabled:
-	    return
-	else:
+	if splash_disabled == True :
 	    # Disable the bootsplash by renaming the initrd.
 	    if not os.path.exists(os.path.join(ramdiskdir,'initrd.gz')):
 	        LOG.error("User selected to disable bootsplash, but no initrd was found in target")
         yield self.set_bind_mounts, tuple(), "Mounting pseudo filesystems"
         yield self.depmod, tuple(), "Running depmod"
         yield self.mkinitrd, tuple(), "Creating initrd"
-	if splash_opt: # This will have a True value if it was disabled by the user
+	if splash_opt == True : # This will have a True value if it was disabled by the user
 	    LOG.debug("User selected to disable the bootsplash animation.  Scheduling method to disable it.")
 	    yield self.disable_bootsplash, (splash_opt,), "Setting bootsplash preference"
         yield self.install_bootloader, (bootloader, target, splash_opt), "Installing bootloader"
         yield self.clear_bind_mounts, tuple(), "Clearing bind mounts"
+	yield self.save_installation_logs, tuple(), "Saving installation logs"
+    def save_installation_logs(self):
+	"""Save the installation logs to the target"""
+	logloc = os.getcwd()
+	logtarget = "/mnt/TARGET/var/log"
+	shutil.copy(os.path.join(logloc,'installer.log'), os.path.join(logtarget,'installer.log'))
+	shutil.copy(os.path.join(logloc,'subprocess.log'), os.path.join(logtarget,'installer-subprocess.log'))
     def install_bootloader(self, bloader, target, splash_opt):
         """Install the bootloader
 	        # Set grab the values for the tui entry here.
 	        tui_label = system.label
    	        tui_kernel = system.kernel
-	    if splash_opt: 
+	    if splash_opt == True: 
 		# Splash was disabled... override the initd line for the entry
 	        if system.root == self.config['target_device'].path():
 		    system.initrd = None
 		    system.appendline = "root=%s verbose"% system.root
-		else:
-		    system.appendline = "root=%s splash quiet"% system.root
-                lilo.add_os(system)
+	    else:
+	        system.appendline = "root=%s splash quiet"% system.root
+            lilo.add_os(system)
 	if tui_kernel:
 	    # Create the TUI entry for LiLO
 	    LOG.debug("Adding Linux-tui entry to LiLO boot menu")