Moises Henriquez avatar Moises Henriquez committed 090a5e3

initial commit

Comments (0)

Files changed (221)

src/BootMenuEntry.class

+' Gambas class file
+
+'    This file is part of vinstall-ng
+
+'    vinstall-ng is free software: you can redistribute it and/or modify
+'    it under the terms of the GNU General Public License as published by
+'    the Free Software Foundation, either version 2 of the License, or
+'    (at your option) any later version.
+
+'    vinstall-ng  is distributed in the hope that it will be useful,
+'    but WITHOUT ANY WARRANTY; without even the implied warranty of
+'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+'    GNU General Public License for more details.
+
+'    You should have received a copy of the GNU General Public License
+'    along with vinstall-ng.  If not, see <http://www.gnu.org/licenses/>.
+
+PROPERTY Label AS String
+PROPERTY Root AS String
+PROPERTY initrd AS String
+PROPERTY kernel AS String
+PROPERTY StartupOptions AS String
+PROPERTY Enabled AS Boolean
+PROPERTY IsDefault AS Boolean
+PROPERTY sLIloLabel AS String
+PROPERTY sGrubLabel AS String
+PROPERTY RamDisks AS String[]
+PROPERTY Kernels AS String[]
+PROPERTY osType AS String
+PROPERTY InitRdPath AS String
+
+
+PRIVATE $initrdpath AS String
+PRIVATE $Label AS String
+PRIVATE $Root AS String
+PRIVATE $initrd AS String
+PRIVATE $ramdisks AS NEW string[]
+PRIVATE $kernels AS NEW String[]
+PRIVATE $kernel AS String
+PRIVATE $StartupOptions AS String
+PRIVATE $Enabled AS Boolean
+PRIVATE $IsDefault AS Boolean
+PRIVATE $sLiloLabel AS String
+PRIVATE $sGrubLabel AS String
+PRIVATE $type AS String
+
+
+
+PRIVATE FUNCTION Label_Read() AS String
+
+  RETURN $Label
+
+END
+
+PRIVATE SUB Label_Write(Value AS String)
+
+  $Label = Value
+
+END
+
+PRIVATE FUNCTION Root_Read() AS String
+
+  RETURN $Root
+
+END
+
+PRIVATE SUB Root_Write(Value AS String)
+
+ $Root = Value
+
+END
+
+PRIVATE FUNCTION kernel_Read() AS String
+
+  RETURN $kernel
+
+END
+
+PRIVATE SUB kernel_Write(Value AS String)
+
+  $kernel = Value
+
+END
+
+PRIVATE FUNCTION initrd_Read() AS String
+
+RETURN $initrd
+
+END
+
+PRIVATE SUB initrd_Write(Value AS String)
+
+$initrd = Value
+
+END
+
+PRIVATE FUNCTION StartupOptions_Read() AS String
+
+  RETURN $StartupOptions
+
+END
+
+PRIVATE SUB StartupOptions_Write(Value AS String)
+
+  $StartupOptions = Value
+
+END
+
+PRIVATE FUNCTION Enabled_Read() AS Boolean
+
+  RETURN $Enabled
+
+END
+
+PRIVATE SUB Enabled_Write(Value AS Boolean)
+
+  $Enabled = Value
+
+END
+
+PRIVATE FUNCTION IsDefault_Read() AS Boolean
+
+  RETURN $IsDefault
+
+END
+
+PRIVATE SUB IsDefault_Write(Value AS Boolean)
+
+  $IsDefault = Value
+
+END
+
+PRIVATE FUNCTION sLIloLabel_Read() AS String
+
+  RETURN $sLiloLabel
+
+END
+
+PRIVATE SUB sLIloLabel_Write(Value AS String)
+
+  $sLiloLabel = Value
+
+END
+
+PRIVATE FUNCTION sGrubLabel_Read() AS String
+
+  RETURN $sGrubLabel
+
+END
+
+PRIVATE SUB sGrubLabel_Write(Value AS String)
+
+  $sGrubLabel = Value
+
+END
+
+PRIVATE FUNCTION osType_Read() AS String
+
+  RETURN $type
+
+END
+
+PRIVATE SUB osType_Write(Value AS String)
+
+  $type = Value
+
+END
+
+PRIVATE FUNCTION RamDisks_Read() AS String[]
+
+RETURN $ramdisks  
+
+END
+
+PRIVATE SUB RamDisks_Write(Value AS String[])
+
+  $ramdisks = Value
+
+END
+
+PRIVATE FUNCTION InitRdPath_Read() AS String
+
+  RETURN $initrdpath
+
+END
+
+PRIVATE SUB InitRdPath_Write(Value AS String)
+
+  $initrdpath = Value
+
+END
+
+PRIVATE FUNCTION Kernels_Read() AS String[]
+
+  RETURN $kernels  
+
+END
+
+PRIVATE SUB Kernels_Write(Value AS String[])
+
+  $kernels = Value
+
+END
+
+
+
+
+
+

src/BootMenuSettings.class

+' Gambas class file
+
+'    This file is part of vinstall-ng
+
+'    vinstall-ng is free software: you can redistribute it and/or modify
+'    it under the terms of the GNU General Public License as published by
+'    the Free Software Foundation, either version 2 of the License, or
+'    (at your option) any later version.
+
+'    vinstall-ng  is distributed in the hope that it will be useful,
+'    but WITHOUT ANY WARRANTY; without even the implied warranty of
+'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+'    GNU General Public License for more details.
+
+'    You should have received a copy of the GNU General Public License
+'    along with vinstall-ng.  If not, see <http://www.gnu.org/licenses/>.
+
+PRIVATE $target AS String
+PRIVATE $videores AS String
+PRIVATE $defaultBoot AS String
+PRIVATE $timeout AS Integer
+
+PROPERTY Target AS String
+PROPERTY VideoResolution AS String
+PROPERTY DefaultOS AS String
+PROPERTY TimeOut AS Integer
+
+
+
+PRIVATE FUNCTION Target_Read() AS String
+
+  RETURN $target
+
+END
+
+PRIVATE SUB Target_Write(Value AS String)
+
+  $target = Value
+
+END
+
+PRIVATE FUNCTION VideoResolution_Read() AS String
+
+  RETURN $videores
+
+END
+
+PRIVATE SUB VideoResolution_Write(Value AS String)
+
+  $videores = Value
+
+END
+
+PRIVATE FUNCTION DefaultOS_Read() AS String
+
+  RETURN $defaultBoot
+
+END
+
+PRIVATE SUB DefaultOS_Write(Value AS String)
+
+  $defaultBoot = Value
+
+END
+
+PRIVATE FUNCTION TimeOut_Read() AS Integer
+
+  RETURN $timeout
+
+END
+
+PRIVATE SUB TimeOut_Write(Value AS Integer)
+
+  $timeout = Value
+
+END
+' Gambas class file
+'    This file is part of vinstall-ng
+
+'    vinstall-ng is free software: you can redistribute it and/or modify
+'    it under the terms of the GNU General Public License as published by
+'    the Free Software Foundation, either version 2 of the License, or
+'    (at your option) any later version.
+
+'    vinstall-ng  is distributed in the hope that it will be useful,
+'    but WITHOUT ANY WARRANTY; without even the implied warranty of
+'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+'    GNU General Public License for more details.
+
+'    You should have received a copy of the GNU General Public License
+'    along with vinstall-ng.  If not, see <http://www.gnu.org/licenses/>.
+
+PRIVATE $Name AS String
+PRIVATE $Contents AS NEW String[]
+PRIVATE $Description AS String
+PRIVATE $path AS String
+PRIVATE $required AS Boolean
+
+PROPERTY Name AS String
+PROPERTY Contents AS String[]
+PROPERTY Description AS String
+PROPERTY Path AS String
+PROPERTY Required AS Boolean
+
+
+
+
+
+
+PRIVATE FUNCTION Name_Read() AS String
+
+  RETURN $Name
+
+END
+
+PRIVATE SUB Name_Write(Value AS String)
+
+  $Name = Value
+
+END
+
+PRIVATE FUNCTION Contents_Read() AS String[]
+
+  RETURN $Contents
+
+END
+
+PRIVATE SUB Contents_Write(Value AS String[])
+
+  $Contents = Value
+
+END
+
+PRIVATE FUNCTION Description_Read() AS String
+
+  RETURN $Description
+
+END
+
+PRIVATE SUB Description_Write(Value AS String)
+
+  $Description = Value
+
+END
+
+PRIVATE FUNCTION Path_Read() AS String
+
+  RETURN $path
+
+END
+
+PRIVATE SUB Path_Write(Value AS String)
+
+  $path = Value
+
+END
+
+PRIVATE FUNCTION Required_Read() AS Boolean
+
+  RETURN $required
+
+END
+
+PRIVATE SUB Required_Write(Value AS Boolean)
+
+  $required = Value
+
+END
+Vector (Founder)
+Caitlyn (Repo Maintainer)
+Exeterdad (Repo Maintainer)
+Joe1962 (VL-hot Chief)
+JohnB316 (SOHO Chief)
+Kocil (Dynamite Man)
+Lagagnon (Docs chief)
+M0E-lnx (Vpackager)
+M-ake (Web Artist)
+Masta (Artiste)
+Nightflier (Light Chief)
+Rbistolfi (Web Master)
+Tigger (SOHO Architect)
+Uelsk8s (ISO Chief)
+Barlas
+Berke
+Blurrymind
+Cintyram
+Dweeberkitty
+Easuter
+Freakyc
+Gamfa
+GbHill
+GrannyGeek
+Hanumizzle
+Inggy
+Jbcolmena
+Jaos
+Keffin
+Kidd
+Larhzu
+Lost-n-LovinLinux
+Ludocools
+Lyn
+Mamahoohoo
+Maf3000
+Mikecindi
+Monty67
+Mutiny
+Niiler
+PastorEd
+Paul
+Pita
+Ren
+Salmonix
+Shalow_Hal
+Stoichyu
+Suse-Refugee
+Stretchedthin
+TonyH9904
+The_Headacher
+Tigerwolf
+Toothandnail
+UKBill
+Vanger
+Verbl-Kint
+WebMouse
+wm
+YaP
+Yiannis
+Zarniwoop

src/ClsGlobal.class

+' Gambas class file
+
+'    This file is part of vinstall-ng
+
+'    vinstall-ng is free software: you can redistribute it and/or modify
+'    it under the terms of the GNU General Public License as published by
+'    the Free Software Foundation, either version 2 of the License, or
+'    (at your option) any later version.
+
+'    vinstall-ng  is distributed in the hope that it will be useful,
+'    but WITHOUT ANY WARRANTY; without even the implied warranty of
+'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+'    GNU General Public License for more details.
+
+'    You should have received a copy of the GNU General Public License
+'    along with vinstall-ng.  If not, see <http://www.gnu.org/licenses/>.
+
+STATIC PUBLIC fRunningMainForm AS Object
+
+STATIC PUBLIC sTargetPath AS String
+STATIC PUBLIC sDistroName AS String
+STATIC PUBLIC sDistroVer AS String
+
+' Installatio media information
+STATIC PUBLIC sSourceName AS String
+STATIC PUBLIC sSourceAddr AS String
+
+' Media scan
+STATIC PUBLIC sToScan AS String
+STATIC PUBLIC sLastScanned AS String
+
+
+' Partition method used
+
+STATIC PUBLIC bAutoPartition AS Boolean
+STATIC PUBLIC sTargetRoot AS String ' we know by default this is a reiserfs partition
+STATIC PUBLIC sTargetSwap AS String
+
+' PARTITIONS SELECTED
+STATIC PUBLIC sRoot AS String
+STATIC PUBLIC froot AS String
+STATIC PUBLIC shome AS String
+STATIC PUBLIC fhome AS String
+STATIC PUBLIC sopt AS String
+STATIC PUBLIC fopt AS String
+STATIC PUBLIC susr AS String
+STATIC PUBLIC fusr AS String
+STATIC PUBLIC stmp AS String
+STATIC PUBLIC ftmp AS String
+STATIC PUBLIC svar AS String
+STATIC PUBLIC fvar AS String
+STATIC PUBLIC sboot AS String
+STATIC PUBLIC fboot AS String
+
+STATIC PUBLIC sVitalPartList AS String
+STATIC PUBLIC sWapPartList AS String
+STATIC PUBLIC sMiscMountList AS String
+
+STATIC PUBLIC sFullDiscToWipe AS String
+
+' Installation method variable
+' 0 = FULL INSTALL
+' 1 = CUSTOMIZED INSTALL
+' 2 = MINIMAL INSTALL
+STATIC PUBLIC iInstallMethod AS Integer
+
+' INSTALLATION DETAILS
+
+STATIC PUBLIC sBulkListToInstall AS String
+STATIC PUBLIC sPkgListToInstall AS String
+
+' auto partition by shinking existing partitions
+STATIC PUBLIC lTotalMBforVL AS Long
+
+STATIC PUBLIC sDefBoot AS String
+STATIC PUBLIC sInstallType AS String ' type of installation to be done (Full, Custom, Minimal)
+STATIC PUBLIC MinOptions AS NEW String[]
+STATIC PUBLIC objMinComponents AS NEW Object[]
+
+STATIC PUBLIC BootMngrTarget AS String
+STATIC PUBLIC sysLang AS String
+STATIC PUBLIC sysKbLayout AS String
+STATIC PUBLIC sysKbModel AS String
+
+STATIC PUBLIC PSel AS String
+STATIC PUBLIC PSelSize AS String
+STATIC PUBLIC PRMntPoint AS String
+STATIC PUBLIC PRMntFs AS String
+
+' Gambas class file
+'    This file is part of vinstall-ng
+
+'    vinstall-ng is free software: you can redistribute it and/or modify
+'    it under the terms of the GNU General Public License as published by
+'    the Free Software Foundation, either version 2 of the License, or
+'    (at your option) any later version.
+
+'    vinstall-ng  is distributed in the hope that it will be useful,
+'    but WITHOUT ANY WARRANTY; without even the implied warranty of
+'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+'    GNU General Public License for more details.
+
+'    You should have received a copy of the GNU General Public License
+'    along with vinstall-ng.  If not, see <http://www.gnu.org/licenses/>.
+'=====================================================================================
+
+PUBLIC objIncludes AS NEW Object[]
+PUBLIC objLabels AS NEW Object[]
+PUBLIC objAppends AS NEW Object[]
+PUBLIC objInitrds AS NEW Object[]
+
+PUBLIC SUB POPULATE_MENU_TABSTRIP()
+  
+  DIM entry AS BootMenuEntry
+  DIM i AS Integer
+  DIM tl AS TextLabel
+  DIM tb AS TextBox
+  DIM chk AS CheckBox
+  DIM cb AS ComboBox
+  
+  
+  FOR EACH entry IN MdlBootMngr.objMenuEntries
+    ME.TsOsList.Index = ME.TsOsList.Count - 1
+    TsOsList.Text = entry.Root
+    tl = NEW TextLabel(TsOsList)
+      IF entry.osType LIKE "linux" THEN 
+        tl.Text = entry.sGrubLabel & Space(1) & "(" & entry.kernel & ")" 
+        TsOsList.Picture = Picture.Load("images/tux.png")
+      ELSE IF InStr(entry.sGrubLabel, "Windows") OR InStr(entry.sGrubLabel, "windows") THEN 
+        tl.Text = entry.sGrubLabel & Space(1) & ("Found on") & Space(1) & entry.Root
+        TsOsList.Picture = Picture.Load("images/win32.png")
+      ELSE ' & Space(1) & entry.Root
+        tl.Text = entry.sGrubLabel & Space(1) & ("Found on") & Space(1) & entry.Root
+        TsOsList.Picture = Picture.Load("images/unknown-os32.png")
+      END IF
+    tl.Height = 24
+    tl.Expand = TRUE
+    tl = NEW TextLabel(ME.TsOsList)
+    tl.Text = ("Label")
+    tl.Height = 24
+    tl.Width = 150
+    tl.Expand = FALSE
+    tl.Alignment = Align.Left
+      
+      tb = NEW TextBox(ME.TsOsList) AS "NameBox"
+      tb.Height = 24
+      tb.Expand = TRUE
+      tb.tag = entry.Root
+      tb.Text = entry.sLIloLabel
+      
+        objLabels.Add(tb)
+        IF entry.osType LIKE "linux" THEN 
+      
+      tl = NEW TextLabel(ME.TsOsList)
+      tl.Height = 24
+      tl.Width = 150
+      tl.Expand = FALSE
+      tl.Alignment = Align.Left
+      tl.Visible = TRUE
+      tl.Text = ("Initrd")
+      
+        cb = NEW ComboBox(ME.TsOsList) AS "InitrdPicker"
+        cb.Height = 24
+        cb.Width = 200
+        cb.Expand = TRUE
+        cb.ReadOnly = TRUE
+        cb.List = entry.RamDisks
+        'IF cb.List.Count > 0 THEN cb.Text = cb.List[0]
+        'cb.ReadOnly = TRUE
+        cb.Tag = entry.Root
+        cb.Visible = TRUE
+        cb.ReadOnly = TRUE
+          objInitrds.Add(cb)
+  END IF
+      
+      chk = NEW CheckBox(ME.TsOsList) AS "IncludeBox"
+      chk.Height = 24
+      chk.Value = TRUE
+      entry.Enabled = chk.Value
+      chk.Expand = TRUE
+      chk.Tag = entry.Root
+      chk.Text = ("Include this operating system in boot menu")
+      objIncludes.Add(chk)
+
+      
+    INC ME.TsOsList.Count
+      
+  NEXT 
+    TRY DEC ME.TsOsList.Count
+  
+END
+
+PUBLIC SUB InitrdPicker_Click()
+  
+  DIM entry AS BootMenuEntry
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF LAST.tag = entry.Root THEN 
+      DEBUG "Setting initrd for " & entry.Root
+          entry.initrd = LAST.text
+      END IF
+    NEXT 
+  
+  
+END
+
+
+PUBLIC SUB IncludeBox_Click()
+  
+  DIM entry AS BootMenuEntry
+  'DIM i AS Integer
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.root = LAST.tag THEN entry.Enabled = LAST.value
+        ME.cbDefBoot.Clear()
+        ME.List_Def_Boot_Options()
+    NEXT 
+  
+END
+
+
+PUBLIC SUB BootOptions_Change()
+  
+  DIM entry AS BootMenuEntry
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.Root = LAST.tag THEN 
+        entry.StartupOptions = LAST.text
+      END IF
+    NEXT 
+  
+END
+
+
+
+PUBLIC SUB NameBox_KeyRelease()
+  
+  DIM entry AS BootMenuEntry
+  
+  IF ME.rbLilo.Value = TRUE THEN 
+    ' do nt allow spaces
+    IF Key.Text = " " THEN LAST.text = Left(LAST.text, Len(LAST.text) - 1)
+    
+  END IF
+  
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.root = LAST.tag THEN 
+        entry.Label = LAST.text
+      END IF
+    NEXT 
+    
+    ME.cbDefBoot.Clear
+    ME.List_Def_Boot_Options()
+    
+    
+    
+  
+END
+
+PUBLIC SUB Resize_Labels()
+  
+  DIM tl AS TextLabel
+  DIM l, i AS Integer
+  DIM sdump AS String
+  
+    IF Len(ME.TextLabel1.Text) > l THEN l = Len(ME.TextLabel1.Text)
+    IF Len(ME.TextLabel2.Text) > l THEN l = Len(ME.TextLabel2.Text)
+    IF Len(ME.lbTarget.Text) > l THEN l = Len(ME.lbTarget.Text)
+    IF Len(ME.TextLabel4.Text) > l THEN l = Len(ME.TextLabel4.Text)
+  FOR i = 0 TO l 
+    sdump = sdump & "a" ' I need a dummy string
+  NEXT 
+    ME.TextLabel1.Width = MdlObjSizer.get_object_width(sdump)
+    ME.TextLabel2.Width = MdlObjSizer.get_object_width(sdump)
+    ME.lbTarget.Width = MdlObjSizer.get_object_width(sdump)
+    ME.TextLabel4.Width = MdlObjSizer.get_object_width(sdump)
+    
+END
+
+PRIVATE SUB List_target_options(sBootloader AS String)
+  
+  DIM sList, sTarget, sDump AS String
+  DIM sListArr, entry AS String[]
+  DIM i AS Integer
+  DIM cb, cbl AS ComboBox
+  DIM p AS Partition
+  DIM bsector AS Boolean
+  DIM root, spart, sfs, smnt AS String
+  
+  SHELL "probedisk | grep -vi cdrom | cut -f 1 -d \'|\'" TO sList
+  sList = Trim(sList)
+  
+  sListArr = Split(sList, "\n").Sort(gb.Ascent)
+    FOR i = 0 TO sListArr.Max
+    sTarget = ("MBR of") & Space(1) & Trim(sListArr[i])    
+      'objCB.Add(Trim(sTarget))
+      ME.cbTarget.Add(Trim(sTarget))
+    NEXT 
+  ' determine how the root partition was formatted
+  
+  FOR i = 0 TO Main.Install.Partitions.Max
+    IF InStr(LCase(Trim(Main.Install.Partitions[i])), "swap") THEN CONTINUE 
+    entry = Split(Trim(Main.Install.Partitions[i]), "-")
+      spart = Trim(entry[0])
+      sfs = Trim(entry[entry.Max])
+      smnt = Trim(entry[2])
+      ' slot 1 has the partition size
+      IF smnt = "/" THEN 
+        root = spart
+        IF sfs LIKE "xfs" THEN 
+          bsector = FALSE
+            ELSE 
+          bsector = TRUE
+          BREAK 
+        END IF
+      ELSE 
+        CONTINUE  ' we only want the "/"
+      END IF
+    NEXT 
+  IF sBootloader LIKE "lilo" THEN 
+    IF bsector = TRUE THEN ME.cbTarget.Add(("Bootsector of") & Space(1) & spart)
+  END IF
+      
+END
+
+PRIVATE SUB Install_emergency_bootloader(selection AS String)
+  
+  DIM target AS String
+  DIM liloline AS String
+  SHELL "probedisk | grep -vi rom | grep a | cut -f 1 -d \'|\'" TO target
+  
+  SELECT CASE selection
+    
+    CASE "Lilo", "lilo", "LILO"
+    liloline = "/sbin/vliloquiet MBR " & target & " bootsplash-high YES"
+      SHELL "chroot " & main.Install.TargetMount & Space(1) & liloline WAIT 
+    CASE "Grub", "grub", "GRUB"
+      SHELL "chroot " & main.Install.TargetMount & " grub-mkdevicemap --no-floppy" WAIT 
+      SHELL "chroot " & main.Install.TargetMount & " grub-install --no-floppy " & target WAIT 
+      SHELL "chroot " & main.Install.TargetMount & " grub-mkconfig -o /boot/grub/grub.cfg" WAIT 
+  END SELECT 
+    
+  DEBUG "Installed " & selection & " as emergency bootloader on " & target
+  Message.Info(selection & Space(1) & ("has been installed to") & Space(1) & target & "<br>" &
+  ("You may now click") & Space(1) & ClsGlobal.fRunningMainForm.btnext.text & Space(1) & ("to continue."))
+  
+END
+
+
+PUBLIC SUB Form_Open()
+  DIM ent AS BootMenuEntry
+  
+  Main.BootLoader = NEW BootMenuSettings
+  main.BootLoader.TimeOut = sbTimeOut.Value
+  ME.tlbanner.Text = "<h2>" & tlbanner.Text & "</h2>"
+  ME.Resize_Labels()
+  ME.sbTimeOut.Value = 5
+  MdlMain.ADVANCE_STATUS_TREE("Step5", "Step6")
+  ME.cbVidRes.List = [("Standard"), ("Bootsplash Med"), ("Bootsplash High"), ("Bootsplash Extra High")]
+  'MdlBootMngr.Display_Bootmanager_Target_Options(ME.cbTarget)
+  'List_target_options("lilo")
+  hbox4.Visible = MdlBootMngr.objMenuEntries.Count > 0
+  ME.List_Def_Boot_Options()
+  IF MdlBootMngr.objMenuEntries.Count <= 0 THEN 
+    REPEAT 
+      IF MdlBootMngr.bMenuRan <> TRUE THEN WAIT 
+    UNTIL MdlBootMngr.bMenuRan = TRUE
+  
+  END IF
+  hbox4.Visible = MdlBootMngr.objMenuEntries.Count > 0
+    IF MdlBootMngr.objMenuEntries.Count > 0 THEN 
+      
+      ME.POPULATE_MENU_TABSTRIP()
+      ME.HPFailSafe.Visible = FALSE
+  ME.rbGrub_Click()
+  cbTarget.clear()
+  List_target_options("grub")
+  ClsGlobal.fRunningMainForm.$aPrev.Clear()
+  ME.cbTarget.ReadOnly = TRUE
+  'ME.cbTarget_Click()
+  'Main.BootLoader.Target = Trim(ME.cbTarget.Text)
+  ME.Set_Bootloader_Target(ME.cbTarget.Text)
+ Main.BootLoader.DefaultOS = Trim(ME.cbDefBoot.Text)
+ ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+ 
+ ELSE 
+  DEBUG "Display failsafe boot options"
+  WITH ME
+    .btlilo.Width = MdlObjSizer.get_object_width(btlilo.Text) + 24
+    .btgrub.Width = MdlObjSizer.get_object_width(btgrub.Text) + 24
+    .btskip.Width = MdlObjSizer.get_object_width(btskip.Text) + 24
+    .TLoSlIST.BackColor = Color.DarkRed
+    .TLoSlIST.ForeColor = Color.Yellow
+    .TLoSlIST.Font.Bold = TRUE
+    .sbTimeOut.Enabled = FALSE
+    .rbLilo.Enabled = FALSE
+    .rbGrub.Enabled = FALSE
+    .rbNone.Enabled = FALSE
+    .cbDefBoot.Enabled = FALSE
+    .cbTarget.Enabled = FALSE
+    .cbVidRes.Enabled = FALSE
+    .TLoSlIST.Text = UCase("failsafe bootloader selection")
+    .tlFailWarning.Text = Main.Install.Name & Space(1) & ("was unable to probe for any other operating systems on your computer.") & Space(1)&
+      ("We will attempt a failsafe boot option to allow you to start your computer. If you have any issues after that, you may use") & Space(1)&
+      ("the control center to resolve them. You may also boot your computer using the first installation disc and by typing the following at the prompt") & "<br><br>" &
+      "\"" & "linux root=" & Main.Install.Root & " ro" & "\" (without quotes)<br><br> " &
+      ("Choose which bootmanager you would like to use in failsafe mode by click one of the buttons below.")
+    .HBox4.Visible = FALSE
+    .HpFailsafe.Visible = TRUE
+    .HPFailSafe.Height = .ClientHeight - .HPFailSafe.Top - 12
+  END WITH 
+ END IF
+ IF Application.Args[1] = "-C" THEN MdlMain.Mount_Target_Partitions()
+    
+ ClsGlobal.fRunningMainForm.btnext.enabled = FALSE
+ ME.rbGrub.Value = TRUE
+    
+END
+
+PUBLIC SUB List_Def_Boot_Options()
+
+DIM entry AS BootMenuEntry
+  FOR EACH entry IN MdlBootMngr.objMenuEntries
+    ME.cbDefBoot.Add(entry.Label)
+  NEXT 
+  
+END
+
+
+PUBLIC FUNCTION GetNext() AS String
+  
+
+  RETURN "Conf1"
+  
+END
+PRIVATE SUB Lock_Form()
+  
+  TLoSlIST.Text = "<b>" & ("Saving Configuration") & "..." & Space(1) & ("Please wait") & "</b>"
+  TLoSlIST.BackColor = color.SelectedBackground
+  ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+  ClsGlobal.fRunningMainForm.btquit.enabled = FALSE
+  TsOsList.Enabled = FALSE
+  
+END
+PUBLIC SUB Revert_Form()
+  
+  IF MdlBootMngr.objMenuEntries.Count > 0 THEN 
+    TLoSlIST.Text = "<b>" & UCase(("DETECTED OPERATING SYSTEMS")) & "</b>"
+    TLoSlIST.BackColor = tlbanner.BackColor
+  ELSE 
+    WITH ME
+      .btgrub.Enabled = TRUE
+      .btlilo.Enabled = TRUE
+    END WITH 
+  END IF
+  ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+  ClsGlobal.fRunningMainForm.btquit.enabled = TRUE
+  ClsGlobal.fRunningMainForm.btnext.enabled = FALSE
+  TsOsList.Enabled = TRUE
+  
+END
+
+
+PUBLIC SUB OnExit()
+  DIM entry AS BootMenuEntry
+  DIM cb AS ComboBox
+  DIM target AS String
+  
+    main.BootLoader.TimeOut = sbTimeOut.Value
+  MdlMain.Set_App_Status(("Saving bootloader configuration ... Please wait"), 30)
+  IF MdlBootMngr.objMenuEntries.Count <= 0 THEN RETURN 
+  
+   TLoSlIST.Text = "<b>" & ("Saving configuration") & "..." & Space(1) & ("Please wait") & "</b>"
+   TLoSlIST.BackColor = Color.SelectedBackground
+   ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+   ClsGlobal.fRunningMainForm.btquit.enabled = FALSE
+  Lock_Form()
+  WAIT 0.25
+  
+  target = Right(Trim(ME.cbTarget.Text), Len(ME.cbTarget.Text) - InStr(ME.cbTarget.Text, "/") + 1)
+  
+  'RETURN 
+  Main.BootLoader.DefaultOS = Trim(ME.cbDefBoot.Text)
+  'Main.BootLoader.Target = Trim(ME.cbTarget.Text)
+  'ME.Set_Bootloader_Target(ME.cbTarget.Text)
+  Main.BootLoader.Target = target
+  Main.BootLoader.TimeOut = ME.sbTimeOut.Value
+  Main.BootLoader.VideoResolution = Trim(ME.cbVidRes.Text)
+  
+  IF rbNone.Value = TRUE THEN RETURN 
+    
+    IF ME.rbGrub.Value = TRUE THEN 
+      'MdlBootMngr.UPDATE_GRUB_TIMEOUT(ME.sbTimeOut.Value)
+      Set_Grub_DEFAULTS()
+        IF MdlBootMngr.RUN_GRUB_INSTALL() > 0 THEN 
+        Main.bStopNav = TRUE
+          SELECT CASE Message.Question(("The bootloader did not install correctly. You may continue without it and") & gb.NewLine &
+             ("use your installation media to boot your system, or click") & Space(1) & "\"" & ("No") & "\"" & Space(1) & ("to try and correct the problem.") & gb.newline &
+            gb.NewLine & ("Would you like to continue without setting up the booloader?"), ("Yes"), ("No"))
+            CASE 1
+            Main.bStopNav = FALSE
+            ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+            CASE ELSE 
+              ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+              Main.bStopNav = TRUE
+          END SELECT 
+          
+          'Message.Error("Failed to save configuration. You may need to use your installation media for the initial boot")
+          'ClsGlobal.fRunningMainForm.$ocurrent = Conf0 ' Try this to make it stay in Conf0
+          RETURN 
+        END IF
+        Main.bStopNav = FALSE
+        'Message.Info(("Grub configuration saved successfully"))
+        MdlMain.Set_App_Status(("Bootloader was successfully configured"))
+    DEBUG "Saved grub configuration"
+
+  ELSE 
+
+    ' set initrds
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.Enabled = TRUE THEN 
+      IF entry.Root <> Main.Install.Root THEN 
+        FOR EACH cb IN objInitrds
+          IF cb.Tag = entry.Root THEN 
+            entry.initrd = cb.Text
+          END IF
+        NEXT 
+      END IF
+      END IF
+    NEXT 
+      
+GENERATE_LILO_HEADER(ME.sbTimeOut.Value)
+  ' after that's done, we need to run lilo. The config file has already been saved to /mnt/target/etc/lilo.conf
+    IF Exist(Main.Install.TargetMount &/ "etc" &/ "lilo.conf") THEN 
+        IF MdlBootMngr.SETUP_LILO_BOOT_MANAGER() > 0 THEN 
+        Main.bStopNav = TRUE
+          DEBUG "Error in lilo setup. Please check lilo.conf"
+          ' Message.Error(("Unable to successfully install LILO on") & Space(1) & Main.BootLoader.Target & gb.NewLine &
+          ' ("You may click") & Space(1) & ClsGlobal.fRunningMainForm.btback.text & Space(1) & ("to go back and correct the problem") & gb.NewLine &
+          ' ("You may also choose to continue and use your installation media to boot your installed system."))
+          
+          SELECT CASE Message.Question(("The bootloader did not install correctly. You may continue without it and") & gb.NewLine &
+          ("use your installation media to boot your system, or click") & Space(1) & "\"" & ("No") & "\"" & Space(1) & ("to try and correct the problem.") & gb.newline &
+            gb.NewLine & ("Would you like to continue without setting up the booloader?"), ("Yes"), ("No"))
+            CASE 1
+            Main.bStopNav = FALSE
+          CASE ELSE 
+          'Message("As you wish")
+            Main.bStopNav = TRUE
+              'FMain.bclear = FALSE
+
+          END SELECT 
+          
+          ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+          'Message.Error("Failed to save configuration. You may need to use your installation media for the initial boot")
+          'ClsGlobal.fRunningMainForm.$ocurrent = Conf0
+          STOP EVENT 
+          RETURN 
+        ELSE 
+        'MdlBootMngr.SETUP_LILO_BOOT_MANAGER()
+        Main.bStopNav = FALSE
+          DEBUG "Booloader succcessfully setup."
+          MdlMain.Set_App_Status(("Bootloader was successfully configured"))
+        END IF
+      'PRINT " \\ --> Lilo boot manager installed successfully."
+    ELSE 
+      DEBUG Main.Install.Root &/ "etc/lilo.conf not found...cannot install lilo."
+      STOP EVENT 
+      RETURN 
+    END IF
+  
+  Revert_Form()
+END IF
+
+TLoSlIST.Text = UCase(("Detected operating systems"))
+ME.TsOsList.Enabled = TRUE
+TLoSlIST.BackColor = Color.SelectedBackground
+  ClsGlobal.fRunningMainForm.btback.enabled = TRUE
+  ClsGlobal.fRunningMainForm.btquit.enabled = TRUE
+  TLoSlIST.BackColor = TsOsList.BackColor
+  
+  'Start the background configuration scripts
+'  MdlMain.write_background_config_scripts()
+
+END
+
+PRIVATE SUB GENERATE_LILO_HEADER(iTimeOut AS Integer)
+  
+  DIM sTmp AS String
+  DIM sVGA, sVidImput, sDefBoot, sVidText, sOutput, sTarget AS String
+  DIM sOsList AS String
+  DIM entry AS BootMenuEntry
+  
+  
+  sVidImput = Trim(ME.cbVidRes.Text)
+  sDefBoot = Trim(ME.cbDefBoot.Text)
+  sTarget = Main.BootLoader.Target
+  iTimeOut = ME.sbTimeOut.Value
+  'iTimeout = Main.BootLoader.TimeOut
+  'Message(sVidImput)
+    'IF iTimeout = 0 OR NOT (iTimeout) THEN iTimeout = 5 ' set default timeout value to 5 seconds.
+
+    SELECT CASE sVidImput
+      CASE ("Standard")
+        svga = "normal"
+      CASE ("Bootsplash Med")
+        svga = "788"
+      CASE ("Bootsplash High")
+        svga = "791"
+      CASE ("Bootsplash Extra High")
+        svga = "794"
+      END SELECT 
+      
+    sVidText = "# VESA framebuffer console @ 1024x768x64k \n" &
+"vga = " & svga & "\n" &
+"# Normal VGA console \n" &
+"#vga = normal \n" &
+"#VESA framebuffer console @ 1024 x768x64k \n" &
+"#vga = 791 \n" &
+"#VESA framebuffer console @ 1024 x768x32k \n" &
+"#vga = 790 \n" &
+"#VESA framebuffer console @ 1024 x768x256 \n" &
+"#vga = 773 \n" &
+"#VESA framebuffer console @ 800 x600x64k \n" &
+"#vga = 788 \n" &
+"#VESA framebuffer console @ 800 x600x32k \n" &
+"#vga = 787 \n" &
+"#VESA framebuffer console @ 800 x600x256 \n" &
+"#vga = 771 \n" &
+"#VESA framebuffer console @ 640 x480x64k \n" &
+"#vga = 785 \n" &
+"#VESA framebuffer console @ 640 x480x32k \n" &
+"#vga = 784 \n" &
+"#VESA framebuffer console @ 640 x480x256 \n" &
+"#vga = 769 \n" &
+"# Begin listing OS Choices \n"
+
+    IF Conf0.rbLilo.Value = TRUE THEN 
+      sOsList = MdlBootMngr.GENERATE_LILO_OS_LIST("lilo")
+    ELSE 
+      'sOsList = ME.GENERATE_LILO_OS_LIST("grub")
+    END IF
+    'sDefBoot = 
+  ' FOR EACH entry IN MdlBootMngr.objMenuEntries
+  '   IF entry.IsDefault = TRUE THEN 
+  '     sDefBoot = entry.Label
+  '   END IF
+  ' NEXT 
+  iTimeOut = iTimeOut * 10
+  
+  sOutput = "# LILO Configuration File \n" &
+  "# Generated by the " & Main.Install.Name & " Installer \n \n" &
+  "# Begin lilo global configuration \n \n" &
+  "boot = " & sTarget & "\n" &
+  "default = " & sDefBoot & "\n" &
+  "prompt \n" &
+  "compact \n" &
+  "timeout = " & iTimeOut & "\n" &
+  "#\n#\n#\n" &
+  "# Override dangerous defaults that require the partition table: \n" &
+  "change-rules \n" &
+  "reset \n"
+  IF Exist(Main.Install.TargetMount &/ "boot" &/ "bitmap" &/ "boot.bmp") THEN 
+   sOutput = sOutput & "bitmap = /boot/bitmap/boot.bmp \n \n"
+  END IF
+
+  sOutput = sOutput & sVidText & gb.NewLine & sOsList & gb.NewLine
+  
+  
+  
+  File.Save(Temp("lilo.in"), sOutput)
+  
+  'Message(sOutput)
+  File.Save(Main.Install.TargetMount &/ "etc" &/ "lilo.conf", sOutput)
+  
+  
+  'Message(File.Load(Temp("lilo.in")))
+
+END
+
+
+PUBLIC SUB StartUp()
+  
+  ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+  
+  
+END
+
+
+
+PUBLIC SUB Names_Change()
+  
+
+  
+  TsOsList.Current.Text = LAST.text
+  ME.Update_Default_boot_choices()
+  
+  
+END
+
+PUBLIC SUB tbOsLabel_Change()
+  
+  LAST.text = Replace(LAST.text, " ", "")  
+  IF Len(LAST.text) > 15 THEN 
+    RETURN 
+  END IF
+    
+  TsOsList.Current.Text = LAST.text
+  ME.Update_Default_boot_choices()
+  
+END
+
+
+
+
+PUBLIC SUB Form_Resize()
+
+  hbox4.Height = ME.ClientH - (hbox4.top + 30)
+  HPFailSafe.Height = ME.ClientH - HpFailsafe.Top - 12
+  hbox1.Width = hbox1.Parent.Width - (hbox1.Left * 2)
+  hbox2.Width = hbox2.Parent.Width - (hbox2.Left * 2)
+  hbox3.Width = hbox3.Parent.Width - (hbox3.Left * 2)
+
+END
+
+PUBLIC SUB Toggle_window_controls(bval AS Boolean)
+  
+  DIM obj AS Object
+  'DIM rb AS RadioButton
+  
+  FOR EACH obj IN ME.Children
+    IF obj.Name <> "HPanel2" THEN 
+     TRY obj.enabled = bval
+    END IF
+  NEXT 
+  'FOR EACH obj IN ME.HPanel2.Children
+  '  TRY obj.enabled = TRUE
+  'NEXT 
+END
+
+
+PUBLIC SUB rbNone_Click()
+
+
+    IF LAST.value = TRUE THEN 
+   Message.Warning("<b>" & ("WARNING:") & "</b><br>" &
+    ("Selecting this option will bypass your boot manager configuration.") & "<br>" &
+    ("You may not be able to start your") & Space(1) & ClsGlobal.sDistroName & Space(1) & ("installation. Do not choose this option") & "<br>" &
+    ("unless you are fully aware of what you are doing."))
+  END IF
+  Timer1.Enabled = FALSE
+  ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+  ME.Toggle_window_controls(FALSE)
+  Main.bStopNav = FALSE
+
+END
+
+PUBLIC SUB Toggle_Grub_Objects(bEnabled AS Boolean)
+  
+  WITH ME
+    '.sbTimeOut.Enabled = bEnabled
+    .cbDefBoot.Enabled = bEnabled
+    '.cbVidRes.Enabled = bEnabled
+  END WITH 
+      
+  
+END
+
+PRIVATE SUB Set_Grub_DEFAULTS()
+  
+  DIM sOut AS String
+  
+  sOut = "# Default grub settings for" & Space(1) & Main.Install.Name & Space(1) & Main.Install.Version & gb.NewLine &
+  "#" & gb.NewLine &
+  "# Default settings provided by GUI Installer" & gb.NewLine &
+  "export GRUB_DISABLE_LINUX_UUID=true" & gb.NewLine &
+  "export GRUB_TERMINAL=gfxterm" & gb.NewLine &
+  "export GRUB_TIMEOUT=" & ME.sbTimeOut.Value & gb.NewLine &
+  "export GRUB_GFXMODE=" & ME.cbVidRes.Text & gb.NewLine & 
+  "export GRUB_DISTRIBUTOR=\"" & Replace(main.Install.Name, " ", "") & "\"" & gb.NewLine &
+  "if [ \"$GRUB_GFXMODE\" = \"1024x768x16\" ]; then " & gb.NewLine &
+  "VGA=791" & gb.NewLine &
+  "elif [ \"$GRUB_GFXMODE\" = \"800x600x16\" ]; then" & gb.NewLine &
+  "VGA=788" & gb.NewLine & 
+  "elif [ \"$GRUB_GFXMODE\" = \"1280x1024x16\" ]; then" & gb.NewLine &
+  "VGA=794" & gb.NewLine &
+  "else" & gb.NewLine &
+  "VGA=normal" & gb.NewLine &
+  "fi" & gb.NewLine
+  
+    
+  
+  IF Exist(Main.Install.TargetMount &/ "etc" &/ "default" &/ "grub") THEN TRY KILL Main.Install.TargetMount &/ "etc/default/grub"
+  IF Exist("/etc/default/grub") THEN TRY KILL "/etc/default/grub"
+  
+  TRY File.Save(Main.Install.TargetMount &/ "etc" &/ "default" &/ "grub", sOut)
+  TRY File.Save("/etc/default/grub", sOut)
+  
+  
+END
+
+
+PUBLIC SUB rbGrub_Click()
+ 
+  DIM entry AS BootMenuEntry
+  DIM tb AS TextBox
+  DIM cb AS CheckBox
+  DIM Modes AS String[]
+  
+  ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+  cbTarget.Clear()
+  ME.Toggle_window_controls(TRUE)
+  ME.Toggle_Grub_Objects(FALSE)
+  IF MdlBootMngr.objMenuEntries THEN 
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      entry.Label = entry.sGrubLabel
+      FOR EACH cb IN objIncludes
+        IF cb.Tag = entry.Root THEN cb.Enabled = FALSE
+      NEXT 
+      FOR EACH tb IN objLabels
+        IF tb.Tag = entry.Root THEN 
+        tb.MaxLength = 100
+          tb.Text = entry.Label
+          tb.ReadOnly = TRUE ' Edits to the label are not allowed here, since grub depends on os-prober to get the labels.
+          
+        END IF
+      NEXT 
+      
+    NEXT 
+    
+    ME.cbDefBoot.Clear
+    ME.List_Def_Boot_Options()
+    List_target_options(LCase(LAST.text))
+  END IF
+  
+  ' LIST GRUB_GFXMODES
+  Modes = ["640x480x16", "800x600x16", "1024x768x16", "1280x1024x16"]
+  ME.cbVidRes.List = Modes
+  ME.cbVidRes.text = "1024x768x16"
+  
+END
+
+
+
+PUBLIC SUB rbLilo_Click()
+ DIM entry AS BootMenuEntry
+ DIM tb AS TextBox
+ DIM cb AS CheckBox
+  
+ ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+ ME.Toggle_window_controls(TRUE)
+ ME.Toggle_Grub_Objects(TRUE)
+ cbTarget.Clear()
+ 
+  IF MdlBootMngr.objMenuEntries THEN 
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      entry.Label = Replace(entry.Label, " ", "")
+      entry.Label = Replace(entry.Label, "(", "_")
+        IF Right(entry.Label) = "_" THEN 
+          REPEAT 
+          entry.Label = Left(entry.Label, Len(entry.Label) - 1)
+          UNTIL Right(entry.Label) <> "_"
+        END IF
+          
+      IF InStr(entry.sGrubLabel, "VectorLinux") THEN entry.Label = "Vector-" & Replace(entry.Root, "/dev/", "")
+      entry.Label = Trim(entry.Label)
+      entry.Label = Left(entry.Label, 15)
+      FOR EACH cb IN objIncludes
+        IF cb.Tag = entry.Root THEN cb.Enabled = TRUE
+      NEXT 
+        FOR EACH tb IN objLabels
+          IF tb.tag = entry.root THEN 
+            IF InStr(tb.Text, "VectorLinux") THEN 
+              tb.Text = "Vector-" & Replace(entry.Root, "/dev/", "")
+            ELSE IF InStr(entry.sGrubLabel, "Windows") THEN 
+              tb.Text = "Windows-" & Replace(entry.Root, "/dev/", "")
+            ELSE 
+              tb.Text = entry.Label
+            END IF
+            tb.MaxLength = 15
+            tb.ReadOnly = FALSE
+          END IF
+        NEXT 
+    NEXT 
+    
+    FOR EACH tb IN objLabels
+      tb.Text = Replace(tb.Text, " ", "")
+    NEXT 
+  END IF
+  
+  ME.cbDefBoot.Clear
+  ME.List_Def_Boot_Options()
+  List_target_options(LCase(LAST.text))
+  ME.cbVidRes.List = [("Standard"), ("Bootsplash Med"), ("Bootsplash High"), ("Bootsplash Extra High")]
+  'ME.cbVidRes.Selection = cbVidRes.Find(("Bootsplash High"))
+  ME.cbVidRes.Text = ("Bootsplash High")
+
+END
+
+
+
+
+PUBLIC FUNCTION determine_boot_parameters(sRoot AS String) AS String
+  
+  ' needs to return a string[] containing the kernel, initrd, and append lines for an OS
+  DIM sShortPart AS String = Right(sRoot, Len(sRoot) - Len("/dev/"))
+  DIM sBootPath AS String
+  DIM skernel, sinitrd, sAppend AS String
+  DIM sDump AS String
+  DIM sDumparr AS String[]
+    TRY MKDIR "/mnt/hd"
+    SHELL "mount " & sRoot & " /mnt/hd 2>/dev/null" WAIT 
+    
+      IF Exist("/mnt/hd/vmlinuz") THEN 
+        sBootPath = "/"
+      ELSE IF Exist("/mnt/hd/boot/vmlinuz") THEN 
+        sBootPath = "/boot"
+      END IF
+      
+      IF NOT (sBootPath) THEN ' the above lines did not find anything
+        SHELL "ls -B /mnt/hd | grep vmlinuz" TO sDump
+          sDump = Trim(sDump)
+            IF sDump THEN 
+              sBootPath = "/"
+            ELSE ' not found in the roots dir of the distro, look in /boot
+              SHELL "ls -B /mnt/hd/boot | grep vmlinuz" TO sDump
+                sDump = Trim(sDump)
+                  IF sDump THEN sBootPath = "/boot"
+            END IF
+      END IF
+                  
+        ' now get the real path
+        
+        sdump = Trim(sdump)
+        'Message(sdump)
+          IF sdump THEN sDumparr = Split(Trim(sDump), gb.NewLine) ' found something
+               ' this will either pick up the link to the default kernel, or the first kernel that comes up from that partition.
+        IF sDumparr THEN 
+          skernel = Trim(Replace(sDumparr[0], "@", ""))
+            IF skernel THEN PRINT "Found kernel " & skernel & " for " & sRoot
+      ' now get the initrd
+      SHELL "ls -B " & sBootPath & " | grep initrd" TO sDump
+        sDump = Trim(sDump)
+          IF sDump THEN 
+            sDumparr = Split(Trim(sdump), gb.NewLine) ' found something for initrd
+              sinitrd = Trim(Replace(sDumparr[0], "@", ""))
+              IF sinitrd THEN PRINT "Found initrd " & sinitrd & " for " & sRoot
+          END IF
+      
+      TRY MKDIR Main.Install.TargetMount &/ "boot" &/ "tamu"
+      TRY COPY "/mnt/hd" &/ sBootPath &/ skernel TO Main.Install.TargetMount &/ "boot" &/ "tamu" &/ skernel & "-" & sShortPart
+      TRY COPY "/mnt/hd" &/ sBootPath &/ sinitrd TO Main.Install.TargetMount &/ "boot" &/ "tamu" &/ sinitrd & "-" & sShortPart
+      
+    SHELL "umount -f /mnt/hd >/dev/null" WAIT 
+    
+    skernel = "/boot/tamu" &/ skernel & "-" & sShortPart
+    sinitrd = "/boot/tamu" &/ sinitrd & "-" & sShortPart
+        
+      
+      ' IF Exist(sBootPath &/ "initrd") THEN 
+      '   sinitrd = sBootPath &/ "initrd"
+      ' END IF
+       sAppend = "splash=silent" 'generic kernel arguments.
+      
+      RETURN skernel & "," & sinitrd & "," & sAppend
+    'END IF
+    ELSE 
+      RETURN 
+    END IF
+  
+END
+
+
+PUBLIC SUB Timer1_Timer()
+
+  ClsGlobal.fRunningMainForm.btnext.enabled = MdlBootMngr.CHECK_LILO_VALUES(TRUE) < 1
+  'DEBUG "Timer tick"
+  'PRINT MdlBootMngr.CHECK_LILO_VALUES(TRUE)
+  
+END
+
+PUBLIC SUB Set_Bootloader_Target(sRawString AS String)
+  
+  DIM sRes AS String
+    IF Len(Trim(sRawString)) <= 0 THEN 
+      DEBUG "Empty parameter"
+      RETURN 
+    END IF
+    'DEBUG "Raw string received as " & sRawString
+    IF InStr(sRawString, ("Bootsector")) THEN 
+      sRes = Main.Install.RootPartition
+    ELSE IF InStr(sRawString, ("MBR")) THEN 
+      sRes = Right(Trim(sRawString), Len("/dev/sda"))
+    ELSE IF InStr(sRawString, ("Floppy")) THEN 
+      sRes = "/dev/fd0"
+    ELSE 
+      sRes = ""
+    END IF
+    'DEBUG "Result: " & sRes
+    Main.BootLoader.Target = sRes
+  DEBUG "bootloader target changed to " & Main.BootLoader.Target
+END
+
+
+PUBLIC SUB cbTarget_Click()
+' DIM sDump AS String[]
+'   'ClsGlobal.BootMngrTarget = Trim(LAST.text)
+'   IF InStr(LAST.text, ("Bootsector")) THEN 
+'     'ClsGlobal.BootMngrTarget = Right(Trim(LAST.text), Len("/dev/sda1"))
+'     sDump = Split(LAST.text, " ")
+'     ClsGlobal.BootMngrTarget = sDump[sDump.Max]
+'     'Main.BootLoader.Target = Trim(sdump[sdump.Max])
+'     Main.BootLoader.Target = Main.Install.RootPartition
+'   ELSE IF InStr(LAST.text, ("MBR Of")) THEN 
+'     ClsGlobal.BootMngrTarget = Right(Trim(LAST.text), Len("/dev/sda"))
+'     Main.BootLoader.Target = Right(Trim(LAST.text), Len("/dev/sda"))
+'   ELSE IF InStr(LAST.text, ("Floppy")) THEN 
+'     ClsGlobal.BootMngrTarget = "/dev/fd0"
+'     Main.BootLoader.Target = "/dev/fd0"
+'   END IF
+'   
+ME.Set_Bootloader_Target(LAST.text)
+END
+
+
+
+PUBLIC SUB TextLabel4_MouseDown()
+
+  
+
+END
+
+PUBLIC SUB cbDefBoot_Click()
+
+  DIM entry AS BootMenuEntry
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      entry.IsDefault = FALSE
+    NEXT 
+  
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.Label = Trim(LAST.text) THEN 
+        entry.IsDefault = TRUE
+        'PRINT "Default OS is now set to " & entry.Label
+      END IF
+    NEXT 
+    
+    Main.BootLoader.DefaultOS = LAST.text
+
+
+END
+
+PUBLIC SUB cbVidRes_Click()
+
+  MdlBootMngr.sVidMode = Trim(LAST.text)
+  Main.BootLoader.VideoResolution = Trim(LAST.text)
+
+END
+
+PUBLIC SUB sbTimeOut_Change()
+
+  Main.BootLoader.TimeOut = sbTimeOut.Value
+
+END
+
+
+
+
+PUBLIC SUB btlilo_Click()
+  btgrub.Enabled = FALSE
+  btskip.Enabled = FALSE
+  Install_emergency_bootloader(LAST.text)
+  ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+
+END
+
+PUBLIC SUB btgrub_Click()
+
+  btlilo.Enabled = FALSE
+  btskip.Enabled = FALSE
+  Install_emergency_bootloader(LAST.text)
+  ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+
+END
+
+PUBLIC SUB btskip_Click()
+
+  btlilo.Enabled = FALSE
+  btgrub.Enabled = FALSE
+  DEBUG "Bypassing emergency bootloader installation per user request."
+  ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+  ClsGlobal.fRunningMainForm.btnext_click() ' emulate the click
+  
+
+END
+' Gambas class file
+'    This file is part of vinstall-ng
+
+'    vinstall-ng is free software: you can redistribute it and/or modify
+'    it under the terms of the GNU General Public License as published by
+'    the Free Software Foundation, either version 2 of the License, or
+'    (at your option) any later version.
+
+'    vinstall-ng  is distributed in the hope that it will be useful,
+'    but WITHOUT ANY WARRANTY; without even the implied warranty of
+'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+'    GNU General Public License for more details.
+
+'    You should have received a copy of the GNU General Public License
+'    along with vinstall-ng.  If not, see <http://www.gnu.org/licenses/>.
+'=====================================================================================
+
+PUBLIC objIncludes AS NEW Object[]
+PUBLIC objLabels AS NEW Object[]
+PUBLIC objAppends AS NEW Object[]
+PUBLIC objInitrds AS NEW Object[]
+
+PUBLIC SUB POPULATE_MENU_TABSTRIP()
+  
+  DIM entry AS BootMenuEntry
+  DIM i AS Integer
+  DIM tl AS TextLabel
+  DIM tb AS TextBox
+  DIM chk AS CheckBox
+  DIM cb AS ComboBox
+  
+  
+  FOR EACH entry IN MdlBootMngr.objMenuEntries
+    ME.TsOsList.Index = ME.TsOsList.Count - 1
+    TsOsList.Text = entry.Root
+    tl = NEW TextLabel(TsOsList)
+      IF entry.osType LIKE "linux" THEN 
+        tl.Text = entry.sGrubLabel & Space(1) & "(" & entry.kernel & ")" 
+        TsOsList.Picture = Picture.Load("images/tux.png")
+      ELSE IF InStr(entry.sGrubLabel, "Windows") OR InStr(entry.sGrubLabel, "windows") THEN 
+        tl.Text = entry.sGrubLabel & Space(1) & ("Found on") & Space(1) & entry.Root
+        TsOsList.Picture = Picture.Load("images/win32.png")
+      ELSE ' & Space(1) & entry.Root
+        tl.Text = entry.sGrubLabel & Space(1) & ("Found on") & Space(1) & entry.Root
+        TsOsList.Picture = Picture.Load("images/unknown-os32.png")
+      END IF
+    tl.Height = 24
+    tl.Expand = TRUE
+    tl = NEW TextLabel(ME.TsOsList)
+    tl.Text = ("Label")
+    tl.Height = 24
+    tl.Width = 150
+    tl.Expand = FALSE
+    tl.Alignment = Align.Left
+      
+      tb = NEW TextBox(ME.TsOsList) AS "NameBox"
+      tb.Height = 24
+      tb.Expand = TRUE
+      tb.tag = entry.Root
+      tb.Text = entry.sLIloLabel
+      
+        objLabels.Add(tb)
+        IF entry.osType LIKE "linux" THEN 
+      
+      tl = NEW TextLabel(ME.TsOsList)
+      tl.Height = 24
+      tl.Width = 150
+      tl.Expand = FALSE
+      tl.Alignment = Align.Left
+      tl.Visible = TRUE
+      tl.Text = ("Initrd")
+      
+        cb = NEW ComboBox(ME.TsOsList) AS "InitrdPicker"
+        cb.Height = 24
+        cb.Width = 200
+        cb.Expand = TRUE
+        cb.ReadOnly = TRUE
+        cb.List = entry.RamDisks
+        'IF cb.List.Count > 0 THEN cb.Text = cb.List[0]
+        'cb.ReadOnly = TRUE
+        cb.Tag = entry.Root
+        cb.Visible = TRUE
+        cb.ReadOnly = TRUE
+          objInitrds.Add(cb)
+  END IF
+      
+      chk = NEW CheckBox(ME.TsOsList) AS "IncludeBox"
+      chk.Height = 24
+      chk.Value = TRUE
+      entry.Enabled = chk.Value
+      chk.Expand = TRUE
+      chk.Tag = entry.Root
+      chk.Text = ("Include this operating system in boot menu")
+      objIncludes.Add(chk)
+
+      
+    INC ME.TsOsList.Count
+      
+  NEXT 
+    TRY DEC ME.TsOsList.Count
+  
+END
+
+PUBLIC SUB InitrdPicker_Click()
+  
+  DIM entry AS BootMenuEntry
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF LAST.tag = entry.Root THEN 
+      DEBUG "Setting initrd for " & entry.Root
+          entry.initrd = LAST.text
+      END IF
+    NEXT 
+  
+  
+END
+
+
+PUBLIC SUB IncludeBox_Click()
+  
+  DIM entry AS BootMenuEntry
+  'DIM i AS Integer
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.root = LAST.tag THEN entry.Enabled = LAST.value
+        ME.cbDefBoot.Clear()
+        ME.List_Def_Boot_Options()
+    NEXT 
+  
+END
+
+
+PUBLIC SUB BootOptions_Change()
+  
+  DIM entry AS BootMenuEntry
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.Root = LAST.tag THEN 
+        entry.StartupOptions = LAST.text
+      END IF
+    NEXT 
+  
+END
+
+
+
+PUBLIC SUB NameBox_KeyRelease()
+  
+  DIM entry AS BootMenuEntry
+  
+  IF ME.rbLilo.Value = TRUE THEN 
+    ' do nt allow spaces
+    IF Key.Text = " " THEN LAST.text = Left(LAST.text, Len(LAST.text) - 1)
+    
+  END IF
+  
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.root = LAST.tag THEN 
+        entry.Label = LAST.text
+      END IF
+    NEXT 
+    
+    ME.cbDefBoot.Clear
+    ME.List_Def_Boot_Options()
+    
+    
+    
+  
+END
+
+PUBLIC SUB Resize_Labels()
+  
+  DIM tl AS TextLabel
+  DIM l, i AS Integer
+  DIM sdump AS String
+  
+    IF Len(ME.TextLabel1.Text) > l THEN l = Len(ME.TextLabel1.Text)
+    IF Len(ME.TextLabel2.Text) > l THEN l = Len(ME.TextLabel2.Text)
+    IF Len(ME.lbTarget.Text) > l THEN l = Len(ME.lbTarget.Text)
+    IF Len(ME.TextLabel4.Text) > l THEN l = Len(ME.TextLabel4.Text)
+  FOR i = 0 TO l 
+    sdump = sdump & "a" ' I need a dummy string
+  NEXT 
+    ME.TextLabel1.Width = MdlObjSizer.get_object_width(sdump)
+    ME.TextLabel2.Width = MdlObjSizer.get_object_width(sdump)
+    ME.lbTarget.Width = MdlObjSizer.get_object_width(sdump)
+    ME.TextLabel4.Width = MdlObjSizer.get_object_width(sdump)
+    
+END
+
+PRIVATE SUB List_target_options(sBootloader AS String)
+  
+  DIM sList, sTarget, sDump AS String
+  DIM sListArr, entry AS String[]
+  DIM i AS Integer
+  DIM cb, cbl AS ComboBox
+  DIM p AS Partition
+  DIM bsector AS Boolean
+  DIM root, spart, sfs, smnt AS String
+  
+  SHELL "probedisk | grep -vi cdrom | cut -f 1 -d \'|\'" TO sList
+  sList = Trim(sList)
+  
+  sListArr = Split(sList, "\n").Sort(gb.Ascent)
+    FOR i = 0 TO sListArr.Max
+    sTarget = ("MBR of") & Space(1) & Trim(sListArr[i])    
+      'objCB.Add(Trim(sTarget))
+      ME.cbTarget.Add(Trim(sTarget))
+    NEXT 
+  ' determine how the root partition was formatted
+  
+  FOR i = 0 TO Main.Install.Partitions.Max
+    IF InStr(LCase(Trim(Main.Install.Partitions[i])), "swap") THEN CONTINUE 
+    entry = Split(Trim(Main.Install.Partitions[i]), "-")
+      spart = Trim(entry[0])
+      sfs = Trim(entry[entry.Max])
+      smnt = Trim(entry[2])
+      ' slot 1 has the partition size
+      IF smnt = "/" THEN 
+        root = spart
+        IF sfs LIKE "xfs" THEN 
+          bsector = FALSE
+            ELSE 
+          bsector = TRUE
+          BREAK 
+        END IF
+      ELSE 
+        CONTINUE  ' we only want the "/"
+      END IF
+    NEXT 
+  IF sBootloader LIKE "lilo" THEN 
+    IF bsector = TRUE THEN ME.cbTarget.Add(("Bootsector of") & Space(1) & spart)
+  END IF
+      
+END
+
+PRIVATE SUB Install_emergency_bootloader(selection AS String)
+  
+  DIM target AS String
+  DIM liloline AS String
+  SHELL "probedisk | grep -vi rom | grep a | cut -f 1 -d \'|\'" TO target
+  
+  SELECT CASE selection
+    
+    CASE "Lilo", "lilo", "LILO"
+    liloline = "/sbin/vliloquiet MBR " & target & " bootplash-high YES"
+      SHELL "chroot " & main.Install.TargetMount & Space(1) & liloline WAIT 
+    CASE "Grub", "grub", "GRUB"
+      SHELL "chroot " & main.Install.TargetMount & " grub-mkdevicemap" WAIT 
+      SHELL "chroot " & main.Install.TargetMount & " grub-install " & target WAIT 
+      SHELL "chroot " & main.Install.TargetMount & " grub-mkconfig -o /boot/grub/grub.cfg" WAIT 
+  END SELECT 
+    
+  DEBUG "Installed " & selection & " as emergency bootloader on " & target
+  Message.Info(selection & Space(1) & ("has been installed to") & Space(1) & target & "<br>" &
+  ("You may now click") & Space(1) & ClsGlobal.fRunningMainForm.btnext.text & Space(1) & ("to continue."))
+  
+END
+
+
+PUBLIC SUB Form_Open()
+  DIM ent AS BootMenuEntry
+  
+  Main.BootLoader = NEW BootMenuSettings
+  main.BootLoader.TimeOut = sbTimeOut.Value
+  ME.tlbanner.Text = "<h2>" & tlbanner.Text & "</h2>"
+  ME.Resize_Labels()
+  ME.sbTimeOut.Value = 5
+  MdlMain.ADVANCE_STATUS_TREE("Step5", "Step6")
+  ME.cbVidRes.List = [("Standard"), ("Bootsplash Med"), ("Bootsplash High"), ("Bootsplash Extra High")]
+  'MdlBootMngr.Display_Bootmanager_Target_Options(ME.cbTarget)
+  'List_target_options("lilo")
+  hbox4.Visible = MdlBootMngr.objMenuEntries.Count > 0
+  ME.List_Def_Boot_Options()
+  IF MdlBootMngr.objMenuEntries.Count <= 0 THEN 
+    REPEAT 
+      IF MdlBootMngr.bMenuRan <> TRUE THEN WAIT 
+    UNTIL MdlBootMngr.bMenuRan = TRUE
+  
+  END IF
+  hbox4.Visible = MdlBootMngr.objMenuEntries.Count > 0
+    IF MdlBootMngr.objMenuEntries.Count > 0 THEN 
+      
+      ME.POPULATE_MENU_TABSTRIP()
+      ME.HPFailSafe.Visible = FALSE
+  ME.rbGrub_Click()
+  cbTarget.clear()
+  List_target_options("grub")
+  ClsGlobal.fRunningMainForm.$aPrev.Clear()
+  ME.cbTarget.ReadOnly = TRUE
+  'ME.cbTarget_Click()
+  'Main.BootLoader.Target = Trim(ME.cbTarget.Text)
+  ME.Set_Bootloader_Target(ME.cbTarget.Text)
+ Main.BootLoader.DefaultOS = Trim(ME.cbDefBoot.Text)
+ ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+ 
+ ELSE 
+  DEBUG "Display failsafe boot options"
+  WITH ME
+    .btlilo.Width = MdlObjSizer.get_object_width(btlilo.Text) + 24
+    .btgrub.Width = MdlObjSizer.get_object_width(btgrub.Text) + 24
+    .btskip.Width = MdlObjSizer.get_object_width(btskip.Text) + 24
+    .TLoSlIST.BackColor = Color.DarkRed
+    .TLoSlIST.ForeColor = Color.Yellow
+    .TLoSlIST.Font.Bold = TRUE
+    .sbTimeOut.Enabled = FALSE
+    .rbLilo.Enabled = FALSE
+    .rbGrub.Enabled = FALSE
+    .rbNone.Enabled = FALSE
+    .cbDefBoot.Enabled = FALSE
+    .cbTarget.Enabled = FALSE
+    .cbVidRes.Enabled = FALSE
+    .TLoSlIST.Text = UCase("failsafe bootloader selection")
+    .tlFailWarning.Text = Main.Install.Name & Space(1) & ("was unable to probe for any other operating systems on your computer.") & Space(1)&
+      ("We will attempt a failsafe boot option to allow you to start your computer. If you have any issues after that, you may use") & Space(1)&
+      ("the control center to resolve them. You may also boot your computer using the first installation disc and by typing the following at the prompt") & "<br><br>" &
+      "\"" & "linux root=" & Main.Install.Root & " ro" & "\" (without quotes)<br><br> " &
+      ("Choose which bootmanager you would like to use in failsafe mode by click one of the buttons below.")
+    .HBox4.Visible = FALSE
+    .HpFailsafe.Visible = TRUE
+    .HPFailSafe.Height = .ClientHeight - .HPFailSafe.Top - 12
+  END WITH 
+ END IF
+ IF Application.Args[1] = "-C" THEN MdlMain.Mount_Target_Partitions()
+    
+ ClsGlobal.fRunningMainForm.btnext.enabled = FALSE
+ ME.rbGrub.Value = TRUE
+    
+END
+
+PUBLIC SUB List_Def_Boot_Options()
+
+DIM entry AS BootMenuEntry
+  FOR EACH entry IN MdlBootMngr.objMenuEntries
+    ME.cbDefBoot.Add(entry.Label)
+  NEXT 
+  
+END
+
+
+PUBLIC FUNCTION GetNext() AS String
+  
+  ' IF MdlBootMngr.RUN_GRUB_INSTALL() > 0 OR MdlBootMngr.SETUP_LILO_BOOT_MANAGER() > 0 THEN
+  '   RETURN "Conf0"
+  ' ELSE 
+  '   RETURN "Conf1"
+  '   ENDIF 
+  RETURN "Conf1"
+  
+END
+PRIVATE SUB Lock_Form()
+  
+  TLoSlIST.Text = "<b>" & ("Saving Configuration") & "..." & Space(1) & ("Please wait") & "</b>"
+  TLoSlIST.BackColor = color.SelectedBackground
+  ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+  ClsGlobal.fRunningMainForm.btquit.enabled = FALSE
+  TsOsList.Enabled = FALSE
+  
+END
+PUBLIC SUB Revert_Form()
+  
+  IF MdlBootMngr.objMenuEntries.Count > 0 THEN 
+    TLoSlIST.Text = "<b>" & UCase(("DETECTED OPERATING SYSTEMS")) & "</b>"
+    TLoSlIST.BackColor = tlbanner.BackColor
+  ELSE 
+    WITH ME
+      .btgrub.Enabled = TRUE
+      .btlilo.Enabled = TRUE
+    END WITH 
+  END IF
+  ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+  ClsGlobal.fRunningMainForm.btquit.enabled = TRUE
+  ClsGlobal.fRunningMainForm.btnext.enabled = FALSE
+  TsOsList.Enabled = TRUE
+  
+END
+
+
+PUBLIC SUB OnExit()
+  DIM entry AS BootMenuEntry
+  DIM cb AS ComboBox
+  DIM target AS String
+  
+    main.BootLoader.TimeOut = sbTimeOut.Value
+  MdlMain.Set_App_Status(("Saving bootloader configuration ... Please wait"), 30)
+  IF MdlBootMngr.objMenuEntries.Count <= 0 THEN RETURN 
+  
+   TLoSlIST.Text = "<b>" & ("Saving configuration") & "..." & Space(1) & ("Please wait") & "</b>"
+   TLoSlIST.BackColor = Color.SelectedBackground
+   ClsGlobal.fRunningMainForm.btback.enabled = FALSE
+   ClsGlobal.fRunningMainForm.btquit.enabled = FALSE
+  Lock_Form()
+  WAIT 0.25
+  
+  target = Right(Trim(ME.cbTarget.Text), Len(ME.cbTarget.Text) - InStr(ME.cbTarget.Text, "/") + 1)
+  
+  'RETURN 
+  Main.BootLoader.DefaultOS = Trim(ME.cbDefBoot.Text)
+  'Main.BootLoader.Target = Trim(ME.cbTarget.Text)
+  'ME.Set_Bootloader_Target(ME.cbTarget.Text)
+  Main.BootLoader.Target = target
+  Main.BootLoader.TimeOut = ME.sbTimeOut.Value
+  Main.BootLoader.VideoResolution = Trim(ME.cbVidRes.Text)
+  
+  IF rbNone.Value = TRUE THEN RETURN 
+    
+    IF ME.rbGrub.Value = TRUE THEN 
+      'MdlBootMngr.UPDATE_GRUB_TIMEOUT(ME.sbTimeOut.Value)
+      Set_Grub_DEFAULTS()
+        IF MdlBootMngr.RUN_GRUB_INSTALL() > 0 THEN 
+        Main.bStopNav = TRUE
+          SELECT CASE Message.Question(("The bootloader did not install correctly. You may continue without it and") & gb.NewLine &
+             ("use your installation media to boot your system, or click") & Space(1) & "\"" & ("No") & "\"" & Space(1) & ("to try and correct the problem.") & gb.newline &
+            gb.NewLine & ("Would you like to continue without setting up the booloader?"), ("Yes"), ("No"))
+            CASE 1
+            Main.bStopNav = FALSE
+            ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+            CASE ELSE 
+              ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+              Main.bStopNav = TRUE
+          END SELECT 
+          
+          'Message.Error("Failed to save configuration. You may need to use your installation media for the initial boot")
+          'ClsGlobal.fRunningMainForm.$ocurrent = Conf0 ' Try this to make it stay in Conf0
+          RETURN 
+        END IF
+        Main.bStopNav = FALSE
+        'Message.Info(("Grub configuration saved successfully"))
+        MdlMain.Set_App_Status(("Bootloader was successfully configured"))
+    DEBUG "Saved grub configuration"
+
+  ELSE 
+
+    ' set initrds
+    FOR EACH entry IN MdlBootMngr.objMenuEntries
+      IF entry.Enabled = TRUE THEN 
+      IF entry.Root <> Main.Install.Root THEN 
+        FOR EACH cb IN objInitrds
+          IF cb.Tag = entry.Root THEN 
+            entry.initrd = cb.Text
+          END IF
+        NEXT 
+      END IF
+      END IF
+    NEXT 
+      
+GENERATE_LILO_HEADER(ME.sbTimeOut.Value)
+  ' after that's done, we need to run lilo. The config file has already been saved to /mnt/target/etc/lilo.conf
+    IF Exist(Main.Install.TargetMount &/ "etc" &/ "lilo.conf") THEN 
+        IF MdlBootMngr.SETUP_LILO_BOOT_MANAGER() > 0 THEN 
+        Main.bStopNav = TRUE
+          DEBUG "Error in lilo setup. Please check lilo.conf"
+          ' Message.Error(("Unable to successfully install LILO on") & Space(1) & Main.BootLoader.Target & gb.NewLine &
+          ' ("You may click") & Space(1) & ClsGlobal.fRunningMainForm.btback.text & Space(1) & ("to go back and correct the problem") & gb.NewLine &
+          ' ("You may also choose to continue and use your installation media to boot your installed system."))
+          
+          SELECT CASE Message.Question(("The bootloader did not install correctly. You may continue without it and") & gb.NewLine &
+          ("use your installation media to boot your system, or click") & Space(1) & "\"" & ("No") & "\"" & Space(1) & ("to try and correct the problem.") & gb.newline &
+            gb.NewLine & ("Would you like to continue without setting up the booloader?"), ("Yes"), ("No"))
+            CASE 1
+            Main.bStopNav = FALSE
+          CASE ELSE 
+          'Message("As you wish")
+            Main.bStopNav = TRUE
+              'FMain.bclear = FALSE
+
+          END SELECT 
+          
+          ClsGlobal.fRunningMainForm.btnext.enabled = TRUE
+          'Message.Error("Failed to save configuration. You may need to use your installation media for the initial boot")
+          'ClsGlobal.fRunningMainForm.$ocurrent = Conf0
+          STOP EVENT 
+          RETURN 
+        ELSE 
+        'MdlBootMngr.SETUP_LILO_BOOT_MANAGER()
+        Main.bStopNav = FALSE
+          DEBUG "Booloader succcessfully setup."
+          MdlMain.Set_App_Status(("Bootloader was successfully configured"))
+        END IF
+      'PRINT " \\ --> Lilo boot manager installed successfully."