|
From: <cod...@go...> - 2009-04-30 21:28:29
|
Author: M0...@gm...
Date: Thu Apr 30 14:27:20 2009
New Revision: 540
Modified:
branches/speedy/.lang/.pot
branches/speedy/.lang/Conf0.pot
branches/speedy/.lang/MdlBootMngr.pot
branches/speedy/Conf0.class
branches/speedy/Conf0.form
branches/speedy/MdlBootMngr.module
Log:
- Wrote code to generate lilo.conf from the results of os-prober.
Modified: branches/speedy/.lang/.pot
==============================================================================
--- branches/speedy/.lang/.pot (original)
+++ branches/speedy/.lang/.pot Thu Apr 30 14:27:20 2009
@@ -14,138 +14,142 @@
msgid "VectorLinux Installer"
msgstr ""
-#: Conf0.class:51
+#: Conf0.class:54
msgid "Installation found in"
msgstr ""
-#: Conf0.class:69
+#: Conf0.class:72
msgid "Include in boot menu"
msgstr ""
-#: Conf0.class:89
+#: Conf0.class:92
msgid "Name"
msgstr ""
-#: Conf0.class:107
+#: Conf0.class:110
msgid "Initial RAM disk image"
msgstr ""
-#: Conf0.class:130
+#: Conf0.class:133
msgid "Kernel boot options"
msgstr ""
-#: Conf0.class:156
+#: Conf0.class:159
msgid "Add option to boot this operating system into text mode"
msgstr ""
-#: Conf0.class:222 MdlBootMngr.module:373
+#: Conf0.class:225 MdlBootMngr.module:373
msgid "Standard"
msgstr ""
-#: Conf0.class:222
+#: Conf0.class:225
msgid "Bootplash Med"
msgstr ""
-#: Conf0.class:222 MdlBootMngr.module:377
+#: Conf0.class:225 MdlBootMngr.module:377
msgid "Bootsplash High"
msgstr ""
-#: Conf0.class:222 MdlBootMngr.module:379
+#: Conf0.class:225 MdlBootMngr.module:379
msgid "Bootsplash Extra High"
msgstr ""
-#: Conf0.class:332 Step1.class:433 Step3a1.class:22 Step3a1a.class:186
+#: Conf0.class:336 Step1.class:433 Step3a1.class:22 Step3a1a.class:186
#: Step7a.class:143
msgid "WARNING:"
msgstr ""
-#: Conf0.class:332
+#: Conf0.class:336
msgid "Selecting this option will bypass your boot manager configuration."
msgstr ""
-#: Conf0.class:332
+#: Conf0.class:336
msgid ""
"You may not be able to start your VectorLinux installation. Do not
choose "
"this option"
msgstr ""
-#: Conf0.class:332
+#: Conf0.class:336
msgid "unless you are fully aware of what you are doing."
msgstr ""
-#: Conf0.class:400
+#: Conf0.class:406
msgid "Unable to find boot arguments for OS in"
msgstr ""
-#: Conf0.class:407
+#: Conf0.class:413
msgid "Offer"
msgstr ""
-#: Conf0.class:407
+#: Conf0.class:413
msgid "as a bootable choice"
msgstr ""
-#: Conf0.class:441
+#: Conf0.class:449
msgid "Title"
msgstr ""
-#: Conf0.class:462
+#: Conf0.class:471
msgid "Initial RAM Disk"
msgstr ""
-#: Conf0.class:514
+#: Conf0.class:527
msgid "Include this Operating System in boot menu"
msgstr ""
-#: Conf0.class:567
+#: Conf0.class:536
+msgid "Boot this operating system by default"
+msgstr ""
+
+#: Conf0.class:628
msgid "System Bootloader Configuration"
msgstr ""
-#: Conf0.class:583
+#: Conf0.class:644
msgid "Select system boot manager to use"
msgstr ""
-#: Conf0.class:592
+#: Conf0.class:653
msgid "LILO"
msgstr ""
-#: Conf0.class:598
+#: Conf0.class:660
msgid "GRUB"
msgstr ""
-#: Conf0.class:604
+#: Conf0.class:666
msgid "NONE"
msgstr ""
-#: Conf0.class:613
+#: Conf0.class:675
msgid "Boot Menu Options"
msgstr ""
-#: Conf0.class:623
+#: Conf0.class:685
msgid "Target"
msgstr ""
-#: Conf0.class:635
+#: Conf0.class:697
msgid "Video Resolution"
msgstr ""
-#: Conf0.class:654
+#: Conf0.class:716
msgid "Prompt Time Out"
msgstr ""
-#: Conf0.class:665
+#: Conf0.class:727
msgid "Seconds"
msgstr ""
-#: Conf0.class:671
+#: Conf0.class:734
msgid "Boot Default"
msgstr ""
-#: Conf0.class:690
+#: Conf0.class:754
msgid "DETECTED OPERATING SYSTEMS."
msgstr ""
-#: Conf0.class:706
+#: Conf0.class:770
msgid "Tab 0"
msgstr ""
@@ -556,12 +560,32 @@
msgid "Bootsplash Med"
msgstr ""
-#: MdlBootMngr.module:445
+#: MdlBootMngr.module:497
msgid "MBR of"
msgstr ""
-#: MdlBootMngr.module:453
+#: MdlBootMngr.module:505
msgid "Bootsector of"
+msgstr ""
+
+#: MdlBootMngr.module:586
+msgid "You must select one operating system to be started by default"
+msgstr ""
+
+#: MdlBootMngr.module:589
+msgid ""
+"Check this box to make this your default operating system, or select
another "
+"tab."
+msgstr ""
+
+#: MdlBootMngr.module:597
+msgid ""
+"Found duplicate operating system names. Please use unique labels for
each "
+"menu entry"
+msgstr ""
+
+#: MdlBootMngr.module:600
+msgid "Check these boxes to make sure they have unique names"
msgstr ""
#: MdlMain.module:35
Modified: branches/speedy/.lang/Conf0.pot
==============================================================================
--- branches/speedy/.lang/Conf0.pot (original)
+++ branches/speedy/.lang/Conf0.pot Thu Apr 30 14:27:20 2009
@@ -14,135 +14,139 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: Conf0.class:51
+#: Conf0.class:54
msgid "Installation found in"
msgstr ""
-#: Conf0.class:69
+#: Conf0.class:72
msgid "Include in boot menu"
msgstr ""
-#: Conf0.class:89
+#: Conf0.class:92
msgid "Name"
msgstr ""
-#: Conf0.class:107
+#: Conf0.class:110
msgid "Initial RAM disk image"
msgstr ""
-#: Conf0.class:130
+#: Conf0.class:133
msgid "Kernel boot options"
msgstr ""
-#: Conf0.class:156
+#: Conf0.class:159
msgid "Add option to boot this operating system into text mode"
msgstr ""
-#: Conf0.class:222
+#: Conf0.class:225
msgid "Standard"
msgstr ""
-#: Conf0.class:222
+#: Conf0.class:225
msgid "Bootplash Med"
msgstr ""
-#: Conf0.class:222
+#: Conf0.class:225
msgid "Bootsplash High"
msgstr ""
-#: Conf0.class:222
+#: Conf0.class:225
msgid "Bootsplash Extra High"
msgstr ""
-#: Conf0.class:332
+#: Conf0.class:336
msgid "WARNING:"
msgstr ""
-#: Conf0.class:332
+#: Conf0.class:336
msgid "Selecting this option will bypass your boot manager configuration."
msgstr ""
-#: Conf0.class:332
+#: Conf0.class:336
msgid "You may not be able to start your VectorLinux installation. Do not
choose this option"
msgstr ""
-#: Conf0.class:332
+#: Conf0.class:336
msgid "unless you are fully aware of what you are doing."
msgstr ""
-#: Conf0.class:400
+#: Conf0.class:406
msgid "Unable to find boot arguments for OS in"
msgstr ""
-#: Conf0.class:407
+#: Conf0.class:413
msgid "Offer"
msgstr ""
-#: Conf0.class:407
+#: Conf0.class:413
msgid "as a bootable choice"
msgstr ""
-#: Conf0.class:441
+#: Conf0.class:449
msgid "Title"
msgstr ""
-#: Conf0.class:462
+#: Conf0.class:471
msgid "Initial RAM Disk"
msgstr ""
-#: Conf0.class:514
+#: Conf0.class:527
msgid "Include this Operating System in boot menu"
msgstr ""
-#: Conf0.class:567
+#: Conf0.class:536
+msgid "Boot this operating system by default"
+msgstr ""
+
+#: Conf0.class:628
msgid "System Bootloader Configuration"
msgstr ""
-#: Conf0.class:583
+#: Conf0.class:644
msgid "Select system boot manager to use"
msgstr ""
-#: Conf0.class:592
+#: Conf0.class:653
msgid "LILO"
msgstr ""
-#: Conf0.class:598
+#: Conf0.class:660
msgid "GRUB"
msgstr ""
-#: Conf0.class:604
+#: Conf0.class:666
msgid "NONE"
msgstr ""
-#: Conf0.class:613
+#: Conf0.class:675
msgid "Boot Menu Options"
msgstr ""
-#: Conf0.class:623
+#: Conf0.class:685
msgid "Target"
msgstr ""
-#: Conf0.class:635
+#: Conf0.class:697
msgid "Video Resolution"
msgstr ""
-#: Conf0.class:654
+#: Conf0.class:716
msgid "Prompt Time Out"
msgstr ""
-#: Conf0.class:665
+#: Conf0.class:727
msgid "Seconds"
msgstr ""
-#: Conf0.class:671
+#: Conf0.class:734
msgid "Boot Default"
msgstr ""
-#: Conf0.class:690
+#: Conf0.class:754
msgid "DETECTED OPERATING SYSTEMS."
msgstr ""
-#: Conf0.class:706
+#: Conf0.class:770
msgid "Tab 0"
msgstr ""
Modified: branches/speedy/.lang/MdlBootMngr.pot
==============================================================================
--- branches/speedy/.lang/MdlBootMngr.pot (original)
+++ branches/speedy/.lang/MdlBootMngr.pot Thu Apr 30 14:27:20 2009
@@ -46,11 +46,27 @@
msgid "Bootsplash Extra High"
msgstr ""
-#: MdlBootMngr.module:445
+#: MdlBootMngr.module:497
msgid "MBR of"
msgstr ""
-#: MdlBootMngr.module:453
+#: MdlBootMngr.module:505
msgid "Bootsector of"
+msgstr ""
+
+#: MdlBootMngr.module:586
+msgid "You must select one operating system to be started by default"
+msgstr ""
+
+#: MdlBootMngr.module:589
+msgid "Check this box to make this your default operating system, or
select another tab."
+msgstr ""
+
+#: MdlBootMngr.module:597
+msgid "Found duplicate operating system names. Please use unique labels
for each menu entry"
+msgstr ""
+
+#: MdlBootMngr.module:600
+msgid "Check these boxes to make sure they have unique names"
msgstr ""
Modified: branches/speedy/Conf0.class
==============================================================================
--- branches/speedy/Conf0.class (original)
+++ branches/speedy/Conf0.class Thu Apr 30 14:27:20 2009
@@ -15,10 +15,13 @@
' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>.
'=====================================================================================
-PRIVATE objinitrds AS NEW Object[]
-PRIVATE objChecks AS NEW Object[]
-PRIVATE objappends AS NEW Object[]
-PRIVATE objNames AS NEW Object[]
+PUBLIC objinitrds AS NEW Object[]
+PUBLIC objChecks AS NEW Object[]
+PUBLIC objappends AS NEW Object[]
+PUBLIC objNames AS NEW Object[]
+PUBLIC objDefOs AS NEW Object[]
+PUBLIC objMenuObjects AS NEW Object[]
+PUBLIC objKernels AS NEW Object[]
PUBLIC SUB populate_linux_entry(sLinux AS String, sLinuxRoot AS String,
objTabStrip AS TabStrip)
@@ -226,6 +229,7 @@
'ME.List_Other_Linuxes(ME.TsOsList)
'ME.Update_Default_boot_choices()
MdlBootMngr.Display_Bootmanager_Target_Options(ME.cbTarget)
+ ME.PROBE_SYSTEM_FOR_OS("lilo")
END
@@ -363,6 +367,7 @@
NEXT
TsOsList.Count = 1
ME.PROBE_SYSTEM_FOR_OS(LCase(LAST.text))
+
END
@@ -376,6 +381,7 @@
sOsList = Split(Trim(File.Load("/tmp/os.lst")), gb.NewLine)
FOR i = 0 TO sOsList.Max
+ TsOsList.Index = TsOsList.Count - 1
sOsLine = Split(Trim(sOsList[i]), ":")
sType = Trim(sOsLine[3])
sLongDesc = Trim(sOsLine[1])
@@ -407,15 +413,17 @@
PRINT ("Offer") & Space(1) & sTitle & Space(1) & ("as a
bootable choice")
PRINT " --\\ Kernel=" & sKernel
PRINT " --\\ Initrd=" & sInitrd
+ PRINT " --\\ Root=" & sRoot
'print " --\ Options=" &
TsOsList.Current.Text = sRoot
Populate_linux_tab(sRoot, sTitle, sKernel, sInitrd,
sAppendLine, sBootManager)
+ INC TsOsList.Count
END IF
END IF
NEXT
-
+ DEC TsOsList.Count ' remove trailing empty tab
END
PUBLIC SUB Populate_linux_tab($OsRoot AS String, $Title AS String, $kernel
AS String, $initrd AS String, $appendline AS String, sBootLoader AS String)
@@ -456,6 +464,7 @@
.MaxLength = 64
END IF
END WITH
+ objNames.Add($tb)
$tl = NEW TextLabel($cont) '---------------------------- initrd label
-------------
WITH $tl
.Height = 28
@@ -473,19 +482,22 @@
.Expand = FALSE
.Width = 200
END WITH
-
+ objinitrds.Add($cb)
$cont = NEW HBox(TsOsList) ' --------------------------- new container
(hbox) ----------
$cont.Height = 28
$cont.Expand = TRUE
- $tl = NEW TextLabel($cont) ' ------------------------ append label
----------------------
+ $tl = NEW TextLabel($cont) ' ------------------------ append label
(holds the kernel path (hidden))----------------------
WITH $tl
.Text = ("Kernel boot options")
.Width = 150
.Height = 28
+ .Name = $OsRoot
.Expand = FALSE
+ .Tag = $kernel ' set the kernel path here..
.Alignment = Align.Left
END WITH
+ objKernels.Add($tl)
$tb = NEW TextBox($cont)
WITH $tb
.Height = 28
@@ -504,6 +516,7 @@
.Expand = TRUE
END WITH
+ objappends.Add($tb)
$chk = NEW CheckBox(TsOsList) AS "IncludeOs"
WITH $chk
@@ -513,8 +526,56 @@
.Tag = $OsRoot
.Text = ("Include this Operating System in boot menu")
END WITH
+ objMenuObjects.Add($chk) ' Add to array of bootable OS's
+ $chk = NEW CheckBox(TsOsList) AS "DefOS"
+ WITH $chk
+ .Expand = TRUE
+ .Value = FALSE
+ .Height = 28
+ .Tag = $OsRoot
+ .Text = ("Boot this operating system by default")
+ END WITH
+ objDefOs.Add($chk)
+
+END
+
+PUBLIC SUB DefOS_Click()
+
+ DIM cb AS CheckBox
+ DIM tb AS TextBox
+ FOR EACH cb IN objDefOs
+ IF cb <> LAST THEN cb.Value = FALSE
+ NEXT
+ FOR EACH tb IN objNames
+ IF tb.Tag = LAST.tag THEN
+ cbDefBoot.Tag = tb.Text
+ END IF
+ NEXT
+
+
+
+END
+
+
+PUBLIC SUB TLoSlIST_MouseDown()
+
+ IF MdlBootMngr.CHECK_LILO_VALUES() > 0 THEN RETURN
+ MdlBootMngr.GENERATE_LILO_HEADER()
+ MdlBootMngr.GENERATE_LILO_OS_LIST()
+
+END
+PUBLIC SUB OsNameBox_KeyRelease()
+
+ DIM cb AS CheckBox
+ FOR EACH cb IN objDefOs
+ IF cb.Value = TRUE THEN
+ IF cb.Tag = LAST.tag THEN ' we are modifying the default OS value
+ cbDefBoot.Tag = LAST.text
+ END IF
+ END IF
+ NEXT
END
Modified: branches/speedy/Conf0.form
==============================================================================
--- branches/speedy/Conf0.form (original)
+++ branches/speedy/Conf0.form Thu Apr 30 14:27:20 2009
@@ -35,6 +35,7 @@
}
{ rbGrub RadioButton
MoveScaled(16,1,14,3.5)
+ Enabled = False
Expand = True
Text = ("GRUB")
}
@@ -85,7 +86,7 @@
MoveScaled(1,0,16,3.5)
Text = ("Prompt Time Out")
}
- { SpinBox1 SpinBox
+ { sbTimeOut SpinBox
MoveScaled(18,0,6,3.5)
Value = 5
}
@@ -97,11 +98,13 @@
}
{ TextLabel4 TextLabel
MoveScaled(38,0,15,3.5)
+ Visible = False
Text = ("Boot Default")
Alignment = Align.Right
}
{ cbDefBoot ComboBox
MoveScaled(56,0,25,3.5)
+ Visible = False
Text = ("")
ReadOnly = True
}
Modified: branches/speedy/MdlBootMngr.module
==============================================================================
--- branches/speedy/MdlBootMngr.module (original)
+++ branches/speedy/MdlBootMngr.module Thu Apr 30 14:27:20 2009
@@ -359,7 +359,7 @@
DIM sTarget, sVidMod, sDefBoot, sVGA, sVidImput, sVidText, sOutput AS
String
DIM iTimeOut AS Integer
- sTarget = Trim(Conf0.cbLiloTarget.Text)
+ sTarget = Trim(Conf0.cbTarget.Text)
IF InStr(sTarget, ("MBR Of")) THEN
sTarget = Right(sTarget, Len(sTarget) - InStr(sTarget, "/") + 1)
ELSE IF sTarget = ("Bootsector Of") & Space(1) & ClsGlobal.sRoot THEN
@@ -405,7 +405,7 @@
"# Begin listing OS Choices \n"
-
+ sDefBoot = Conf0.cbDefBoot.Tag
iTimeOut = Conf0.SbTimeOut.Value * 10
sOutput = "# LILO Configuration File \n" &
@@ -421,7 +421,7 @@
"change-rules \n" &
"reset \n" &
"bitmap = /boot/bitmap/boot.bmp \n" &
- "#\n#\n#\n" &
+ "#\n\n" &
sVidText
File.Save(Temp("lilo.in"), sOutput)
@@ -430,6 +430,58 @@
END
+PUBLIC SUB GENERATE_LILO_OS_LIST()
+
+ DIM ckb AS CheckBox
+ DIM cb AS ComboBox
+ DIM tb AS TextBox
+ DIM tl AS TextLabel
+ DIM sTitle, sRoot, sInitrd, sKernel, sAppend AS String
+ DIM sBody AS String
+ DIM sHeader, sFullFile AS String
+
+ FOR EACH ckb IN Conf0.objMenuObjects
+ IF ckb.Value = TRUE THEN
+ sRoot = ckb.Tag
+ FOR EACH tb IN Conf0.objNames
+ IF tb.Tag = ckb.Tag THEN sTitle = tb.Text
+ NEXT
+ ' get the initrd
+ FOR EACH cb IN Conf0.objinitrds
+ IF cb.Tag = sRoot THEN sInitrd = Trim(cb.Text)
+ NEXT
+ ' get the append line
+ FOR EACH tb IN Conf0.objappends
+ IF tb.tag = sRoot THEN sAppend = tb.Text
+ NEXT
+ FOR EACH tl IN Conf0.objKernels
+ IF tl.Name = sRoot THEN sKernel = tl.Tag
+ NEXT
+ sBody = sBody & gb.NewLine &
+ "# Menu entry for " & sTitle & "\n" &
+ "image = " & Trim(sKernel) & "\n" &
+ "root = " & sRoot & "\n" &
+ "label = " & sTitle & "\n" &
+ "append = \"" & sAppend & "\"\n" &
+ "read-only \n"
+ 'IF sBody THEN Message(Trim(sBody))
+ END IF
+
+ ' Reset these variables for future use
+ sKernel = ""
+ sRoot = ""
+ sTitle = ""
+ sAppend = ""
+ NEXT
+ 'IF sBody THEN Message(sBody)
+ 'load the header
+ sHeader = File.Load(Temp("lilo.in"))
+ sFullFile = sHeader & sBody
+ Message(sFullFile)
+END
+
+
+
PUBLIC SUB Display_Bootmanager_Target_Options(objCB AS ComboBox)
DIM sList, sTarget, sDump AS String
@@ -521,10 +573,38 @@
RETURN $kern & "," & $initrd & "," & $append
-
+END
+
+PUBLIC FUNCTION CHECK_LILO_VALUES() AS Integer
+ ' will return 0 for clear
+ ' 1 for error
+ DIM tb, tb1, tb2 AS TextBox
+ DIM cb AS CheckBox
+ DIM sTag AS String = Conf0.TsOsList.Current.Text
+ IF NOT (Conf0.cbDefBoot.tag) THEN
+ Message.Error(("You must select one operating system to be started
by default"))
+ FOR EACH cb IN Conf0.objDefOs
+ IF cb.Tag = sTag THEN
+ Balloon.Error(("Check this box to make this your default
operating system, or select another tab."), cb, cb.Left + 24)
+ END IF
+ NEXT
+ RETURN 1
+ END IF
+ FOR EACH tb IN Conf0.objNames
+ FOR EACH tb1 IN Conf0.objNames
+ IF tb.Text = tb1.Text THEN
+ Message.Error(("Found duplicate operating system names. Please use
unique labels for each menu entry"))
+ FOR EACH tb2 IN Conf0.objNames
+ IF tb2.Tag = sTag THEN
+ Balloon.Error(("Check these boxes to make sure they have
unique names"), tb2, tb2.Left + 24)
+ END IF
+ NEXT
+ RETURN 1
+ END IF
+ NEXT
+ NEXT
END
-
|