Commits

Anonymous committed df20e78

Added lilo support for non-linux OS detection

Comments (0)

Files changed (1)

modules/support/vectorlinux/BOOTLOADERS.py

         if short_desc.strip().startswith("Vector"):
             short_desc = "Vector-%s"% rootpart.split("/")[-1]
         OS.label = short_desc.strip()
-        if os_type.strip() in ("linux",):
+        if os_type.strip().lower() in ("linux",):
+            os._ostype = "linux"
             bootinfo = get_linux_boot_info(rootpart.strip())
             if bootinfo is None: continue
             OS.root = bootinfo["root"] or rootpart.strip()
             OS.kernel = bootinfo["kernel"].strip()
             OS.initrd = bootinfo["initrd"].strip()
             OS.appendline = bootinfo["append"].strip()
+        elif "windows" or "microsoft" in os_type_strip().lower():
+            OS.root = rootpart.strip()
+            OS.label = "Windows-%s"% roorpart.strip().splir("/")[-1]
+            OS._ostype = "windows"
+            # FIXME: ^^ This needs testing.
+
         ret.append(OS)
 
     return ret
         lilo_root = get_current_bootsector() # this returns whatever partition is mounted @ /
         ret = []
         spacer = " "*4
+        
         for entry in oslist:
             ret.append("# -- %s on %s -- "% (entry.label, entry.root))
-            ret.append("image = %s"% entry.kernel)
-            ret.append("%s root = %s"% (spacer, entry.root))
-            if entry.root != lilo_root:
-                ret.append("%s label = %s"% (spacer, entry.label))
-            else:
-                if entry.label.endswith('-tui'):
+            if entry._ostype == 'linux':
+                ret.append("image = %s"% entry.kernel)
+                ret.append("%s root = %s"% (spacer, entry.root))
+                if entry.root != lilo_root:
                     ret.append("%s label = %s"% (spacer, entry.label))
                 else:
-                    ret.append("%s label = VectorLinux"% spacer)
-            if entry.initrd not in ("",None):
-                ret.append("%s initrd = %s"% (spacer, entry.initrd))
-            if entry.appendline is not "":
-                if "splash" not in entry.appendline:
-                    ret.append("%s append = \"%s splash=silent\""% (
-                        spacer, entry.appendline))
-                else:
-                    ret.append("%s append = \"%s\""% (spacer, entry.appendline))
-            ret.append("%s read-only"% (spacer))
-            ret.append("#")
-            ret.append("# -- end of listing for %s on %s -- "%(entry.label, entry.root))
-            ret.append("#")
-        
+                    if entry.label.endswith('-tui'):
+                        ret.append("%s label = %s"% (spacer, entry.label))
+                    else:
+                        ret.append("%s label = VectorLinux"% spacer)
+                if entry.initrd not in ("",None):
+                    ret.append("%s initrd = %s"% (spacer, entry.initrd))
+                if entry.appendline not in ("", None):
+                    if "splash" not in entry.appendline:
+                        ret.append("%s append = \"%s aplash=silent\""% (spacer, entry.appendline))
+                    else:
+                        ret.append("%s append = \"%s\""% (spacer, entry.appendline))
+                ret.append("%s read-only"% spacer)
+                ret.append("#")
+                ret.append("#")
+                ret.append("# -- End of listing for %s on %s -- "% (entry.label, entry.root))
+                ret.append("#")
+            elif entry._ostype == 'windows':
+                ret.append("%s other = %s"% (spacer, entry.root))
+                ret.append("%s label = %s"% (spacer, entry.label))
+                ret.append("%s table = %s"% (spacer, entry.root))
+
+            
         # Add some trailing text
         ret.append("#")
         ret.append("# ------------------------------------ #")
 class Entry(object):
     def __init__(self):
         self.label = ""
+        self._ostype = 'linux'
 
 class BootLoader(object):
     def __init__(self,