Moises Henriquez avatar Moises Henriquez committed ef102f5

Debug bootloader adding TUI entry for installed system

Comments (0)

Files changed (2)

vinstall/backend/bootloader.py

             if system.initrd:
                 self.buffer.append("%s initrd = %s" % (tab,
                     system.initrd))
-#            if system.appendline:
-#                if "splash" not in system.appendline:
-#                    self.buffer.append('%s append = "%s splash quiet"' %
-#                            (tab, system.appendline))
-#                else:
-            self.buffer.append('%s append = "%s"' % (tab,
+            if system.appendline:
+                if "splash" not in system.appendline:
+                    self.buffer.append('%s append = "%s splash quiet"' %
+                            (tab, system.appendline))
+                else:
+                    self.buffer.append('%s append = "%s"' % (tab,
                             system.appendline))
             self.buffer.append("%s read-only" % tab)
             self.buffer.append("# --")

vinstall/controller/bootloader.py

 
         location = model.DropdownOptionList()
         location.label = u"Install the bootloader in"
-	bootsplash = model.BoolOption(u"Disable boot animation","Disable boot animation","Disable bootsplash")
+	splash_opt = model.BoolOption(u"Disable boot animation","Disable boot animation","Disable bootsplash")
         for i in self.targets:
             location.add_option(unicode(i))
 
-        return Render(title, intro, bootloaders, location, bootsplash)
+        return Render(title, intro, bootloaders, location, splash_opt)
 
     def next(self):
         """Return next step
 	    os.rename(os.path.join(ramdiskdir,"initrd.gz"),
 		      os.path.join(ramdiskdir,"disabledinitrd.gz"))
 
-    def command(self, bootloader, target, bootsplash):
+    def command(self, bootloader, target, splash_opt):
         """Schedule command for later execution
 
         """
         yield self.set_bind_mounts, tuple(), "Mounting pseudo filesystems"
         yield self.depmod, tuple(), "Running depmod"
         yield self.mkinitrd, tuple(), "Creating initrd"
-	if bootsplash: # This will have a True value if it was disabled by the user
+	if splash_opt: # 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, (bootsplash,), "Setting bootsplash preference"
-        yield self.install_bootloader, (bootloader, target), "Installing bootloader"
+	    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"
 
-    def install_bootloader(self, bloader, target):
+    def install_bootloader(self, bloader, target, splash_opt):
         """Install the bootloader
 
         """
         target = disk.path()
 
         if bloader.lower() == "lilo":
-            self.install_lilo(target)
+            self.install_lilo(target, splash_opt)
         elif bloader == "Grub2":
             self.install_grub(target)
         else:
             return
 
-    def install_lilo(self, target):
+    def install_lilo(self, target, splash_opt):
         """ Install LILO to target
 
         """
         lilo = bootloader.Lilo(target)
         for system in bootloader.OperatingSystem.all():
 	    LOG.debug("Adding %s entry to LiLo boot menu"% system.label)
+	    if splash_opt: # Splash was disabled... override the initd line for the entry
+	        if system.root == self.config['target_device'].path():
+		    system.initrd = None
+		    tui_label = system.label
+		    tui_kernel = system.kernel
             lilo.add_os(system)
 	# Create the TUI entry for LiLO
 	LOG.debug("Adding Linux-tui entry to LiLO boot menu")
 	tui = bootloader.OperatingSystem()
 	rootpart = self.config['target_device']
-	tui.kernel = "/boot/vmlinuz"
+	tui.kernel = tui_label
 	tui.root = rootpart.path()
 	tui.type = "linux"
 	tui.initrd = None
-	tui.label = "Linux-tui"
-	tui.appendline = 'root=%s ro vga=normal 2'% tui.root
+	tui.label = "%s-tui"%tui_label
+	tui.appendline = 'root=%s ro 2'% tui.root
 	lilo.add_os(tui)
 	
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.