|
From: <cod...@go...> - 2008-11-13 13:33:07
|
Author: M0E.lnx
Date: Thu Nov 13 05:32:30 2008
New Revision: 288
Added:
branches/iVL/FrmLiloSetup.class
branches/iVL/FrmLiloSetup.form
branches/iVL/MdlLilo.module
Modified:
branches/iVL/ClsGlobal.class
branches/iVL/FrmLilo.form
branches/iVL/MdlInstallCustom.module
branches/iVL/MdlInstallSys.module
branches/iVL/MdlLiloOsList.module
branches/iVL/MdlSetup.module
Log:
Begin new LILO setup
Modified: branches/iVL/ClsGlobal.class
==============================================================================
--- branches/iVL/ClsGlobal.class (original)
+++ branches/iVL/ClsGlobal.class Thu Nov 13 05:32:30 2008
@@ -26,10 +26,6 @@
STATIC PUBLIC iSwapMin AS Integer = 64
STATIC PUBLIC iPkgCnt AS Integer = 0
STATIC PUBLIC iBulkCnt AS Integer = 0
-STATIC PUBLIC iPkgTot AS Integer
-STATIC PUBLIC iPkgNum AS Integer
-
-STATIC PUBLIC fPbInc AS Float
STATIC PUBLIC sRootMnt AS String
STATIC PUBLIC sHomeMnt AS String
Modified: branches/iVL/FrmLilo.form
==============================================================================
--- branches/iVL/FrmLilo.form (original)
+++ branches/iVL/FrmLilo.form Thu Nov 13 05:32:30 2008
@@ -11,7 +11,7 @@
MoveScaled(1,7,18,3)
Text = ("Don't Install Lilo")
}
- { TabStrip1 TabStrip
+ { tsOsSetup TabStrip
MoveScaled(1,27,71,40)
Index = 0
Text = ("Tab 0")
Added: branches/iVL/FrmLiloSetup.class
==============================================================================
--- (empty file)
+++ branches/iVL/FrmLiloSetup.class Thu Nov 13 05:32:30 2008
@@ -0,0 +1,46 @@
+' 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 SUB Form_Open()
+
+ MdlLilo.LIST_LINUX_OS()
+ MdlLilo.LIST_WIN_INSTALLS()
+ ME.CLEANUP_TABSTRIP()
+END
+
+PUBLIC SUB CLEANUP_TABSTRIP()
+DIM i AS Integer
+
+ ' will remove blank tabstrip
+ FOR i = 0 TO ME.tsLIloTabs.Count
+ tsLIloTabs.Index = i
+ IF tsLIloTabs.Text = "" THEN
+ tsLIloTabs[i].Delete
+ RETURN
+ END IF
+
+ NEXT
+
+
+END
+
+PUBLIC SUB Form_Menu()
+
+ MdlLilo.GENERATE_LILO_DOT_CONF
+
+END
Added: branches/iVL/FrmLiloSetup.form
==============================================================================
--- (empty file)
+++ branches/iVL/FrmLiloSetup.form Thu Nov 13 05:32:30 2008
@@ -0,0 +1,82 @@
+# Gambas Form File 2.0
+
+{ Form Form
+ MoveScaled(0,0,92,60)
+ Text = ("")
+ Arrangement = Arrange.Vertical
+ { HPanel1 HPanel
+ MoveScaled(1,1,71,7)
+ { tlBanner TextLabel
+ MoveScaled(1,1,21,3)
+ Expand = True
+ Text = ("Bootloaded Setup")
+ }
+ { Separator1 Separator
+ MoveScaled(2,4,22,1)
+ Expand = True
+ }
+ }
+ { HPanel2 HPanel
+ MoveScaled(1,8,88,18)
+ { CheckBox1 CheckBox
+ MoveScaled(1,2,20,3)
+ Expand = True
+ Text = ("Do not install LILO")
+ }
+ { tlVidRes TextLabel
+ MoveScaled(40,4,16,3)
+ Expand = True
+ Text = ("Video Resolution")
+ Alignment = Align.Normal
+ }
+ { cbVideoRes ComboBox
+ MoveScaled(57,4,22,3)
+ Expand = True
+ Text = ("ComboBox1")
+ }
+ { tlLiloTarget TextLabel
+ MoveScaled(1,5,7,3)
+ Expand = True
+ Text = ("Target")
+ Alignment = Align.Normal
+ }
+ { cbLIloTarget ComboBox
+ MoveScaled(10,5,26,2)
+ Expand = True
+ Text = ("ComboBox1")
+ }
+ { cbDefBoot TextLabel
+ MoveScaled(40,8,17,3)
+ Expand = True
+ Text = ("Boot Default")
+ }
+ { ComboBox1 ComboBox
+ MoveScaled(58,8,21,3)
+ Expand = True
+ Text = ("ComboBox1")
+ }
+ { tlTimeOut TextLabel
+ MoveScaled(1,10,14,3)
+ Expand = True
+ Text = ("Prompt Timeout")
+ Alignment = Align.Normal
+ }
+ { SpinBox1 SpinBox
+ MoveScaled(16,10,7,3)
+ Expand = True
+ }
+ { cbTimeOutSec TextLabel
+ MoveScaled(24,10,8,3)
+ Expand = True
+ Text = ("Seconds")
+ Alignment = Align.Normal
+ }
+ }
+ { tsLIloTabs TabStrip
+ MoveScaled(1,28,84,30)
+ Expand = True
+ Index = 0
+ Text = ("Tab 0")
+ Index = 0
+ }
+}
Modified: branches/iVL/MdlInstallCustom.module
==============================================================================
--- branches/iVL/MdlInstallCustom.module (original)
+++ branches/iVL/MdlInstallCustom.module Thu Nov 13 05:32:30 2008
@@ -18,12 +18,12 @@
' needs to read arrays from clsPkgsel and install all required packages
-'PUBLIC fPbInc AS Float
+PUBLIC fPbInc AS Float
PRIVATE hproc AS Process
PRIVATE sDump AS String
PRIVATE sErr AS String
-'PRIVATE iPkgCnt AS Integer
+PRIVATE iPkgCnt AS Integer
PRIVATE iPkgNum AS Integer
@@ -36,9 +36,7 @@
.tvPlan["Inst1"].Picture = MdlCore.sNowPic
.tvPlan["Inst0"].Picture = MdlCore.sDonePic
END WITH
- 'pass the pkg count to the function in mdlsetup
- MdlSetup.CALCULATE_PACKAGE_COUNT(TRUE)
- 'ME.CALCULATE_TOTAL_PACKAGES()
+ ME.CALCULATE_TOTAL_PACKAGES()
'RETURN
WAIT 2
iRet = ME.INSTALL_REQUIRED_BULKS()
@@ -68,8 +66,8 @@
'iret = ME.INSTALL_PACKAGES_REQUIRED()
' Make sure we set the right value for the progress bar here
- 'MdlInstallSys.iPkgCnt = iPkgCnt
- 'MdlInstallSys.iPkgNum = iPkgNum
+ MdlInstallSys.iPkgCnt = iPkgCnt
+ MdlInstallSys.iPkgNum = iPkgNum
iret = MdlInstallSys.INSTALL_REQUIRED_PACKAGES()
PRINT "INSTALLING ADDITIONAL REQUIRED SOFTWARE"
@@ -277,7 +275,7 @@
FrmInstallSys.tlCurrPkg.Text = ("Installing") & Space(1) &
FrmUsrPkgSel.GridView1[ii, 1].Text
FrmInstallSys.pbInstallProg.Value = i / iStepTotal
INC iPkgNum
- FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(ClsGlobal.iPkgTot, iPkgNum)
+ FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(iPkgCnt, iPkgNum)
'hproc = EXEC ["installpkg", sBasePath &/ sLoc &/ sPkg, "
-R ", ClsGlobal.sTargetMnt, " || echo \'FAILED\' 2> /tmp/installdump"]
'hproc = EXEC ["installpkg -R " & ClsGlobal.sTargetMnt &
Space(1) & sBasePath &/ sLoc &/ sPkg & " || echo \'FAILED\' 2>
/tmp/installdump"]
@@ -355,7 +353,7 @@
FrmInstallSys.pbInstallProg.Value = i / iStepTotal
INC iPkgNum
'MdlSetup.UPDATE_OVERALL_PROGRESS(iPkgCnt, iPkgNum)
- FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(ClsGlobal.iPkgTot, iPkgNum)
+ FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(iPkgCnt, iPkgNum)
IF InStr(sDump, "FAILED") > 0 THEN
Message.Error("Error installing user-selected package" &
Space(1) & cb.Text)
RETURN 1
@@ -537,103 +535,103 @@
END
-' PUBLIC SUB CALCULATE_TOTAL_PACKAGES()
-'
-' DIM i, ii AS Integer
-' DIM irs AS Integer
-' DIM sOutput AS String
-' DIM sOutArr AS String[]
-' DIM cb AS CheckBox
-'
-'
-' PRINT ("Calculating package count ... Please wait")
-' SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" & "
| grep ^BULK | grep required" TO sOutput
-' sOutput = Trim(sOutput)
-' IF InStr(sOutput, "\n") > 0 THEN
-' sOutArr = Split(sOutput, "\n")
-' i = i + sOutArr.Count
-' ELSE
-' i = i + 1
-' END IF
-' 'add bulks to ClsGlobal.iBulkCnt
-' ClsGlobal.iBulkCnt = i
-' 'Message.Info(i & " from required bulks")
-' 'RETURN
-' 'count required packages in
-' sOutArr.Clear
-' sOutput = ""
-' SHELL "ls -m " & ClsGlobal.sSourceMnt &/ "packages" &/ "required"
&/ "*.t?z" TO sOutput
-' sOutput = Trim(sOutput)
-' sOutArr = Split(sOutput, ",")
-' i = i + sOutArr.Count
-' 'add pkgs TO ClsGlobal.iPkgCnt
-' ClsGlobal.iPkgCnt = sOutArr.Count
-' 'Message(i & " from packages/required")
-' 'Count CONF packages in
-' sOutArr.Clear
-' sOutput = ""
-' SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" & "
| grep ^CONF" TO sOutput
-' sOutput = Trim(sOutput)
-' IF InStr(sOutput, "\n") > 0 THEN
-' sOutArr = Split(sOutput, "\n")
-' i = i + sOutArr.Count
-' 'add config bulks to ClsGlobal.iPkgCnt cause they are small and at
the end
-' ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + sOutArr.Count
-' ELSE
-' i = i + 1
-' 'add config bulks to ClsGlobal.iPkgCnt cause they are small and at
the end
-' ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + 1
-' END IF
-' 'Count user-selected stuff in
-'
-' REPEAT
-' IF FrmPkgSel.scrlInstallOpts[ii, 0].Picture = FrmPkgSel.pyes
THEN INC irs
-' INC ii
-' UNTIL ii = FrmPkgSel.scrlInstallOpts.Rows.Count
-' i = i + irs
-' 'add bulks to ClsGlobal.iBulkCnt
-' ClsGlobal.iBulkCnt = ClsGlobal.iBulkCnt + irs
-'
-'
-' ' ' ' ' 'we will need to cycle through the arrays for th is for
accuracy...
-' ' ' ' ' irs = 0
-' ' ' ' ' FOR EACH cb IN MdlPkgSel.Bulks
-' ' ' ' ' IF cb.value = TRUE THEN INC irs
-' ' ' ' '
-' ' ' ' '
-' ' ' ' ' NEXT
-' ' ' ' ' i = i + irs
-' ' now do the optional packages
-' irs = 0 ' reset the count
-'
-' REPEAT
-' IF FrmUsrPkgSel.GridView1[ii, 0].Picture = FrmUsrPkgSel.pYes
THEN
-' INC irs
-' END IF
-' INC ii
-' UNTIL ii = FrmUsrPkgSel.GridView1.Rows.Count
-'
-'
-' ' ' ' ' ' ' ' FOR EACH cb IN MdlPkgSel.Pkgs
-' ' ' ' ' ' ' ' IF cb.Value = TRUE THEN INC irs
-' ' ' ' ' ' ' '
-' ' NEXT
-' i = i + irs ' the count to the total
-' 'i = i + ClsPkgSel.arrBulks.Count + ClsPkgSel.arrPkgs.Count
-' 'add pkgs TO ClsGlobal.iPkgCnt
-' ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + irs
-' iPkgCnt = i
-' PRINT ("Total packages to be installed = ") & i
-' fPbInc = 1 / iPkgCnt
-' PRINT "The total progrssbar will work in increments of " & fPbInc & "
on every package installed"
-' PRINT ("Total bulks to be installed = ") & ClsGlobal.iBulkCnt
-' fPbInc = 0.6 / ClsGlobal.iBulkCnt
-' PRINT "The total progrssbar will work in increments of " & fPbInc & "
on every bulk installed"
-' PRINT ("Total pkgs to be installed = ") & ClsGlobal.iPkgCnt
-' fPbInc = 0.4 / ClsGlobal.iPkgCnt
-' PRINT "The total progrssbar will work in increments of " & fPbInc & "
on every pkg installed"
-'
-' END
+PUBLIC SUB CALCULATE_TOTAL_PACKAGES()
+
+ DIM i, ii AS Integer
+ DIM irs AS Integer
+ DIM sOutput AS String
+ DIM sOutArr AS String[]
+ DIM cb AS CheckBox
+
+
+ PRINT ("Calculating package count ... Please wait")
+ SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" & " |
grep ^BULK | grep required" TO sOutput
+ sOutput = Trim(sOutput)
+ IF InStr(sOutput, "\n") > 0 THEN
+ sOutArr = Split(sOutput, "\n")
+ i = i + sOutArr.Count
+ ELSE
+ i = i + 1
+ END IF
+ 'add bulks to ClsGlobal.iBulkCnt
+ ClsGlobal.iBulkCnt = i
+ 'Message.Info(i & " from required bulks")
+ 'RETURN
+ 'count required packages in
+ sOutArr.Clear
+ sOutput = ""
+ SHELL "ls -m " & ClsGlobal.sSourceMnt &/ "packages" &/ "required"
&/ "*.t?z" TO sOutput
+ sOutput = Trim(sOutput)
+ sOutArr = Split(sOutput, ",")
+ i = i + sOutArr.Count
+ 'add pkgs TO ClsGlobal.iPkgCnt
+ ClsGlobal.iPkgCnt = sOutArr.Count
+ 'Message(i & " from packages/required")
+ 'Count CONF packages in
+ sOutArr.Clear
+ sOutput = ""
+ SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" & " |
grep ^CONF" TO sOutput
+ sOutput = Trim(sOutput)
+ IF InStr(sOutput, "\n") > 0 THEN
+ sOutArr = Split(sOutput, "\n")
+ i = i + sOutArr.Count
+ 'add config bulks to ClsGlobal.iPkgCnt cause they are small and at
the end
+ ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + sOutArr.Count
+ ELSE
+ i = i + 1
+ 'add config bulks to ClsGlobal.iPkgCnt cause they are small and at the
end
+ ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + 1
+ END IF
+ 'Count user-selected stuff in
+
+ REPEAT
+ IF FrmPkgSel.scrlInstallOpts[ii, 0].Picture = FrmPkgSel.pyes
THEN INC irs
+ INC ii
+ UNTIL ii = FrmPkgSel.scrlInstallOpts.Rows.Count
+ i = i + irs
+ 'add bulks to ClsGlobal.iBulkCnt
+ ClsGlobal.iBulkCnt = ClsGlobal.iBulkCnt + irs
+
+
+ ' ' ' ' 'we will need to cycle through the arrays for th is for
accuracy...
+ ' ' ' ' irs = 0
+ ' ' ' ' FOR EACH cb IN MdlPkgSel.Bulks
+ ' ' ' ' IF cb.value = TRUE THEN INC irs
+ ' ' ' '
+ ' ' ' '
+ ' ' ' ' NEXT
+ ' ' ' ' i = i + irs
+ ' now do the optional packages
+ irs = 0 ' reset the count
+
+ REPEAT
+ IF FrmUsrPkgSel.GridView1[ii, 0].Picture = FrmUsrPkgSel.pYes THEN
+ INC irs
+ END IF
+ INC ii
+ UNTIL ii = FrmUsrPkgSel.GridView1.Rows.Count
+
+
+ ' ' ' ' ' ' ' FOR EACH cb IN MdlPkgSel.Pkgs
+ ' ' ' ' ' ' ' IF cb.Value = TRUE THEN INC irs
+ ' ' ' ' ' ' '
+' NEXT
+ i = i + irs ' the count to the total
+ 'i = i + ClsPkgSel.arrBulks.Count + ClsPkgSel.arrPkgs.Count
+ 'add pkgs TO ClsGlobal.iPkgCnt
+ ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + irs
+ iPkgCnt = i
+ PRINT ("Total packages to be installed = ") & i
+ fPbInc = 1 / iPkgCnt
+ PRINT "The total progrssbar will work in increments of " & fPbInc & " on
every package installed"
+ PRINT ("Total bulks to be installed = ") & ClsGlobal.iBulkCnt
+ fPbInc = 0.6 / ClsGlobal.iBulkCnt
+ PRINT "The total progrssbar will work in increments of " & fPbInc & " on
every bulk installed"
+ PRINT ("Total pkgs to be installed = ") & ClsGlobal.iPkgCnt
+ fPbInc = 0.4 / ClsGlobal.iPkgCnt
+ PRINT "The total progrssbar will work in increments of " & fPbInc & " on
every pkg installed"
+
+END
PUBLIC FUNCTION INSTALL_REQUIRED_BULKS() AS Integer
@@ -670,7 +668,7 @@
PRINT " ! " & ClsGlobal.sSourceMnt &/ "veclinux" &/ sBulk & " is
installed"
NEXT
ELSE ' found only one line
- 'iPkgCnt = iPkgCnt + 1 ' add only one to the overall package count
+ iPkgCnt = iPkgCnt + 1 ' add only one to the overall package count
sTrimmed = Right(sOutput, Len(sOutput) - InStr(sOutput, "\'"))
sTrimmed = Left(sTrimmed, Len(sTrimmed) - RInStr(sTrimmed, "\'"))
sLine = Split(sTrimmed, ":")
@@ -728,7 +726,7 @@
'MdlInstallSys.UPDATE_STEP_PROGRESS(CFloat(vTargetSize),
CFloat(vSize))
MdlInstallSys.UPDATE_STEP_PROGRESS(vTargetSize, vSize, iPkgNum)
- FrmInstallSys.pbInstallProg2.Value =
(FrmInstallSys.pbInstallProg2.Value + (ClsGlobal.fPbInc - (ClsGlobal.fPbInc
* FrmInstallSys.pbInstallProg.Value)) / 100)
+ FrmInstallSys.pbInstallProg2.Value =
(FrmInstallSys.pbInstallProg2.Value + (fPbInc - (fPbInc *
FrmInstallSys.pbInstallProg.Value)) / 100)
END IF
UNTIL
hproc.State = Process.Stopped
@@ -740,7 +738,7 @@
' ' ' IF InStr(sDump, "FAILED") > 0 THEN
' ' ' RETURN 1
' ' ' ELSE
- FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(ClsGlobal.iPkgTot, iPkgNum)
+ FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(iPkgCnt, iPkgNum)
RETURN 0
END IF
' END IF
@@ -762,7 +760,7 @@
END IF
FrmInstallSys.pbInstallProg.Value = 0
INC iPkgNum
- PRINT "Package " & iPkgNum & " of " & ClsGlobal.iPkgTot
+ PRINT "Package " & iPkgNum & " of " & iPkgCnt
MdlSetup.SHOW_PROGRESS_CONTROLS()
FrmInstallSys.tlCurrPkg.Text = "Processing " & File.Name(sPackagePath)
'hproc = SHELL "install-pkg " & sPackagePath & Space(1) &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
@@ -790,7 +788,7 @@
ELSE
FrmInstallSys.pbInstallProg.Value = 1
WAIT
- FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(ClsGlobal.iPkgTot, iPkgNum)
+ FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(iPkgCnt, iPkgNum)
RETURN 0
END IF
END IF
Modified: branches/iVL/MdlInstallSys.module
==============================================================================
--- branches/iVL/MdlInstallSys.module (original)
+++ branches/iVL/MdlInstallSys.module Thu Nov 13 05:32:30 2008
@@ -312,9 +312,9 @@
.tvPlan["Inst0"].Picture = MdlCore.sDonePic
END WITH
- 'iPkgCnt = MdlSetup.CALCULATE_PACKAGE_COUNT(FALSE)
+ iPkgCnt = MdlSetup.CALCULATE_PACKAGE_COUNT(FALSE)
'Message.Info("Total packages = " & iPkgCnt)
- PRINT "Total packages to be installed " & ClsGlobal.iPkgTot
+ PRINT "Total packages to be installed " & iPkgCnt
PRINT "Installing bulks"
MdlSetup.SHOW_PROGRESS_CONTROLS()
@@ -446,6 +446,8 @@
'DIM sFile AS String = File.Load(ClsGlobal.sSourceMnt &/ "veclinux"
&/ "SETUP.CONF")
DIM sLine AS String
+
+
SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF |
grep ^BULK" TO sRawList
' sList = Split(File.Load(Temp$("SETUP.CONF")), "\n")
sList = Split(sRawList, "\n")
@@ -475,7 +477,7 @@
REPEAT
WAIT 2
ME.UPDATE_STEP_PROGRESS(CFloat(vTargetSize),
CFloat(vBulkSize), iPkgNum)
- FrmInstallSys.pbInstallProg2.Value =
(FrmInstallSys.pbInstallProg2.Value + (ClsGlobal.fPbInc - (ClsGlobal.fPbInc
* FrmInstallSys.pbInstallProg.Value)) / 100)
+
UNTIL
hproc.State = Process.Stopped
'error check
Added: branches/iVL/MdlLilo.module
==============================================================================
--- (empty file)
+++ branches/iVL/MdlLilo.module Thu Nov 13 05:32:30 2008
@@ -0,0 +1,378 @@
+' Gambas module 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 arrLinuxIncCheckboxes AS Object[]
+PUBLIC arrLinuxInitrdBoxes AS Object[]
+PUBLIC arrLinuxNametxtboxes AS Object[]
+PUBLIC arrLinuxAppendtxtBoxes AS Object[]
+PUBLIC arrLinuxTextBoots AS Object[]
+PUBLIC arrWinBootChecks AS Object[]
+PUBLIC arrWinNameTxtBoxes AS Object[]
+PUBLIC arrCbInitrds AS Object[]
+PRIVATE i AS Integer ' used for object key
+
+
+
+PUBLIC SUB GENERATE_LILO_DOT_CONF()
+
+ DIM tb AS TextBox
+ DIM cb AS CheckBox
+ DIM sSection AS String
+ DIM cbox AS ComboBox
+ DIM sLabel, sKernel, sInitrd, sAppend AS String
+ DIM sBootPath AS String
+
+
+ FOR EACH cb IN arrLinuxIncCheckboxes
+ IF Right(cb.Tag, Len(cb.Tag) - InStr(cb.Tag, "/") + 1) =
ClsPartSel.sRoot THEN
+ sBootPath = "/boot"
+ ELSE
+ sBootPath = "/boot/tamu"
+ END IF
+ IF cb.Value = TRUE THEN
+ FOR EACH tb IN arrLinuxNametxtboxes
+ IF tb.Tag = cb.Tag THEN
+ sLabel = tb.Text
+ sKernel = "vmlinuz-" & sLabel
+ END IF
+ NEXT
+ FOR EACH cbox IN arrCbInitrds
+ IF cb.Tag = cbox.Tag THEN sInitrd = Trim(cbox.Text) & "-" &
sLabel
+ NEXT
+ FOR EACH tb IN arrLinuxAppendtxtBoxes
+ IF cb.Tag = tb.Tag THEN sAppend = Trim(tb.Text)
+
+ NEXT
+
+ sSection = "image = " & sBootPath &/ sKernel & "<br>" &
+ "root = " & Right(cb.Tag, Len(cb.Tag) - InStr(cb.Tag, "/") + 1)
& "<br>" &
+ "label = " & sLabel & "<br>" &
+ "append = " & sAppend & "<br>" &
+ "initrd = " & sBootPath &/ sInitrd & "<br>" &
+ "read only"
+
+ Message(sSection)
+
+ 'sSection = "image=" & "boot" &/ tb.Text
+ 'Message(sSection)
+ END IF
+ NEXT
+ 'END IF
+ 'NEXT
+
+
+END
+
+
+
+
+
+
+
+PUBLIC SUB LIST_LINUX_OS()
+
+ DIM sDump, sLinuxPart, sPart, vmlinuz, kernel AS String
+ DIM sOsDesc AS String
+ DIM x, y, i, ii AS Integer
+ DIM sPartitions, sOs AS String[]
+
+ arrLinuxIncCheckboxes = NEW Object[]
+ arrLinuxInitrdBoxes = NEW Object[]
+ arrLinuxNametxtboxes = NEW Object[]
+ arrLinuxAppendtxtBoxes = NEW Object[]
+ arrLinuxTextBoots = NEW Object[]
+ arrCbInitrds = NEW Object[]
+
+
+
+ SHELL "fdisk -l |grep -E \'83 *Linux\' | cut -f 1 -d \' \'" TO sDump
+ sDump = Trim(sDump)
+ sPartitions = Split(sDump, gb.NewLine)
+ TRY MKDIR "/tmp/lilo_tmp"
+ FOR i = 0 TO sPartitions.Count - 1
+ sLinuxPart = Trim(sPartitions[i])
+ sPart = Right(sLinuxpart, Len(sLinuxPart) -
RInStr(sLinuxPart, "/"))
+ EXEC ["mount", "/dev/" & sPart, "/tmp/lilo_tmp"] WAIT
+
+ IF IsDir("/tmp/lilo_tmp/boot") THEN
+ FOR EACH vmlinuz IN
Dir("/tmp/lilo_tmp/boot", "vmlinuz*", gb.File)
+ IF Stat("/tmp/lilo_tmp/boot" &/
vmlinuz).Type <> 6
+ sOsDesc =
MdlLiloOsList.ID_DISTRO("/tmp/lilo_tmp")
+ sOsDesc =
Replace(vmlinuz, "vmlinuz", sOsDesc)
+
+ 'Message(Stat("/tmp/lilo_tmp" &/
vmlinuz).Type)
+ WITH FrmLiloSetup
+ .tsLIloTabs.Index
= .tsLIloTabs.Count - 1
+ .tsLIloTabs.Text = sOsDesc &
Space(1) & "(" & sPart & ")"
+ .tsLIloTabs.Count
= .tsLIloTabs.Count + 1
+ ' populate the tabstrip here
+
ME.FILL_IN_LINUX_TAB(sOsDesc, "/dev" &/ sPart)
+
+ END WITH
+ END IF
+ NEXT
+ END IF
+
+ EXEC ["umount", "/tmp/lilo_tmp"] WAIT
+ NEXT
+
+END
+
+PUBLIC SUB LIST_WIN_INSTALLS()
+
+ DIM sWinPartlist, sPartition AS String
+ DIM sWinDrives AS String[]
+ DIM i, ii AS Integer
+ DIM sTmpMountPoint AS String = "/tmp/lilo_tmp"
+
+ ME.arrWinBootChecks = NEW Object[]
+ ME.arrWinNameTxtBoxes = NEW Object[]
+
+ SHELL "fdisk -l| grep -E \'^/dev/.* * .*(FAT16|FAT32|HPFS|NTFS|Win)\' |
cut -f 1 -d \' \'" TO sWinPartlist
+ sWinPartlist = Trim(sWinPartlist)
+ sWinDrives = Split(sWinPartlist, gb.NewLine)
+ FOR i = 0 TO sWinDrives.Count - 1
+ sPartition = sWinDrives[i]
+ EXEC ["mount", sPartition, sTmpMountPoint] WAIT
+ IF Exist(sTmpMountPoint &/ "winnt" &/ "system32"
&/ "winver.exe") OR IF Exist(sTmpMountPoint &/ "WINDOWS" &/ "system32"
&/ "winver.exe") THEN
+ 'Message(sPartition & " has a windows install")
+ WITH FrmLiloSetup.tsLIloTabs
+ .Index = .Count - 1
+ .Text = "Windows" & Space(1) & "(" &
Right(sPartition, Len(sPartition) - RInStr(sPartition, "/")) & ")"
+ .Count = .Count + 1
+ END WITH
+ ' populate the tab
+ ME.FILL_IN_WINDOWS_TAB("Windows",
sPartition)
+
+ END IF
+
+
+
+
+ EXEC ["umount", sTmpMountPoint] WAIT
+ NEXT
+
+END
+
+PUBLIC SUB FILL_IN_WINDOWS_TAB(sDesc AS String, sHostPart AS String)
+
+ DIM tb AS TextBox
+ DIM tl AS TextLabel
+ DIM cb AS CheckBox
+ DIM hr AS Separator
+ DIM x, y AS Integer
+
+ x = 4
+ y = 12
+
+ tl = NEW TextLabel(FrmLiloSetup.tsLIloTabs)
+ WITH tl
+ .Text = "<h3>" & sDesc & Space(1) & ("installed on") &
Space(1) & sHostPart & "</h3>"
+ .Height = 21
+ .Width = MdlObjSizer.get_object_width(.Text)
+ .Move(x, y)
+ END WITH
+ y = y + tl.Height + 4
+ hr = NEW Separator(FrmLiloSetup.tsLIloTabs)
+ WITH hr
+ .Height = 2
+ .Move(x - 2, y)
+ .Width = FrmLiloSetup.tsLIloTabs.Width - x
+ END WITH
+ y = y + 16
+
+ cb = NEW CheckBox(FrmLiloSetup.tsLIloTabs) AS "bBootWinInstall"
+ WITH cb
+ .Move(x, y)
+ .Value = TRUE
+ .Text = ("Include this installation in the boot menu")
+ .Width = MdlObjSizer.get_object_width(.Text) + 36
+ .Height = 21
+ .Tag = sHostPart
+ END WITH
+ ME.arrWinBootChecks.Add(cb)
+ y = y + cb.Height + 4
+
+ tl = NEW TextLabel(FrmLiloSetup.tsLIloTabs)
+ WITH tl
+ .Text = ("Name")
+ .Height = 21
+ .Width = MdlObjSizer.get_object_width(.Text)
+ .Move(x, y)
+ .Alignment = Align.Normal
+ END WITH
+ 'y = y + tl.Height + 4
+
+ tb = NEW TextBox(FrmLiloSetup.tsLIloTabs) AS "txtWinNameBox"
+ WITH tb
+ .Height = 21
+ .Width = 200
+ .Text = sDesc & "-" & Right(sHostPart, Len(sHostPart)
- RInStr(sHostPart, "/"))
+ .MaxLength = 15
+ .Move(x + tl.Width + 8, y)
+ .Tag = sHostPart
+ END WITH
+ ME.arrWinNameTxtBoxes.Add(tb)
+
+
+END
+
+
+
+
+
+
+
+
+
+ PUBLIC SUB FILL_IN_LINUX_TAB(sDesc AS String, sHostPart AS String)
+
+ DIM tb AS TextBox
+ DIM cb AS CheckBox
+ DIM tl AS TextLabel
+ DIM x, y AS Integer
+ DIM hrsep AS Separator
+ DIM cbox AS ComboBox
+ DIM sDump AS String
+ 'DIM i AS Integer
+ 'DIM sKernelStr AS String
+
+
+ ' hack just for testing here
+ ClsPartSel.sRoot = "/dev/hdb1"
+ INC i
+ x = 4
+ y = 12
+ 'WITH FrmLiloSetup.tsLIloTabs
+ tl = NEW TextLabel(FrmLiloSetup.tsLIloTabs) AS "osItroLabels"
+ WITH tl
+ .Move(x, y)
+ .Text = "<h3>" & sDesc & Space(1) & ("installed in") & Space(1)
& sHostPart & "</h3>"
+ .Height = 21
+ .Width = MdlObjSizer.get_object_width(.Text) + 36
+ .Alignment = Align.Normal
+ END WITH
+ y = y + tl.Height + 4
+
+ hrsep = NEW Separator(FrmLiloSetup.tsLIloTabs) AS "Separators"
+ WITH hrsep
+ .Height = 2
+ .Move(x - 2, y, FrmLiloSetup.tsLIloTabs.Width - 4)
+ END WITH
+ y = y + 16
+
+
+
+ cb = NEW CheckBox(FrmLiloSetup.tsLIloTabs) AS "cbIncCheckboxes"
+ WITH cb
+ .Tag = i & sHostPart
+ .Text = ("Include in boot menu")
+ .Value = TRUE
+ .Width = MdlObjSizer.get_object_width(.Text) + 36
+ .Height = 21
+ .Move(x, y)
+ END WITH
+ ME.arrLinuxIncCheckboxes.Add(cb)
+ y = y + cb.Height + 4
+
+ tl = NEW
TextLabel(FrmLiloSetup.tsLIloTabs) AS "NameLabels"
+ WITH tl
+ .Move(x, y)
+ .Text = ("Name")
+ .Width =
MdlObjSizer.get_object_width(.Text)
+ .Height = 21
+ .Alignment = Align.Normal
+ END WITH
+ 'y = y + tl.Height + 4
+
+ tb = NEW TextBox(FrmLiloSetup.tsLIloTabs)
AS "OsNameTxtBox"
+ WITH tb
+ .Height = 21
+ .Width = 200
+ .MaxLength = 15
+ .Move(x + tl.Width + 8, y)
+ .Text = sDesc & "-" &
Right(sHostPart, Len(sHostPart) - RInStr(sHostPart, "/"))
+ .Tag = i & sHostPart
+ END WITH
+ ME.arrLinuxNametxtboxes.Add(tb)
+ x = x + tl.Width + 8 + tb.Width
+ tl = NEW TextLabel(FrmLiloSetup.tsLIloTabs)
+ WITH tl
+ .Text = ("Initrd")
+ .Height = 21
+ .Width =
MdlObjSizer.get_object_width(.Text)
+ .Move(x + 8, y)
+ .Alignment = Align.Bottom
+ END WITH
+
+ cbox = NEW
ComboBox(FrmLiloSetup.tsLIloTabs)
+ WITH cbox
+ .Move(x + tl.Width + 16, y)
+ .ReadOnly = TRUE
+ .Width = 200
+ .Height = 21
+ .Tag = i & sHostPart
+ ' BROWSE FOR INITRD IMAGES
+ FOR EACH sDump IN
Dir("/tmp/lilo_tmp/boot/", "initrd*")
+ IF
cbox.Find(Trim(sDump)) = -1 THEN cbox.Add(Trim(sDump))
+ NEXT
+
+ .Sorted = TRUE
+ END WITH
+ ME.arrCbInitrds.Add(cbox)
+
+
+ x = 4
+ y = y + tb.Height + 4
+
+
+ tl = NEW
TextLabel(FrmLiloSetup.tsLIloTabs) AS "AppendLabel"
+ WITH tl
+ .Text = ("Kernel boot options")
+ .Width =
MdlObjSizer.get_object_width(.Text)
+ .Height = 21
+ .Alignment = Align.Normal
+ .Move(x, y)
+ END WITH
+
+ tb = NEW TextBox(FrmLiloSetup.tsLIloTabs)
AS "txtAppendBox"
+ WITH tb
+ .Move(x + tl.Width + 8, y,
FrmLiloSetup.tsLIloTabs.Width - (x + tl.Width + 8 + 4), 21)
+ .Text = ""
+ .Tag = i & sHostPart
+ .ReadOnly = FALSE
+ END WITH
+ ME.arrLinuxAppendtxtBoxes.Add(tb)
+ y = y + tb.Height + 4
+
+ IF sHostPart = ClsPartSel.sRoot THEN
+ ' ADD A NEW CHECK BOX TO BOOT INTO TEXT MODE
+ cb = NEW CheckBox(FrmLiloSetup.tsLIloTabs) AS "bDoTextMode"
+ WITH cb
+ .Move(x, y)
+ .Value = FALSE
+ .Text = ("Add option to boot this operating system into
text mode")
+ .Height = 21
+ .Width = MdlObjSizer.get_object_width(.Text) + 36
+ .Tag = i & sHostPart
+ END WITH
+ ME.arrLinuxTextBoots.Add(cb)
+ END IF
+
+
+END
+
Modified: branches/iVL/MdlLiloOsList.module
==============================================================================
--- branches/iVL/MdlLiloOsList.module (original)
+++ branches/iVL/MdlLiloOsList.module Thu Nov 13 05:32:30 2008
@@ -123,7 +123,7 @@
PRINT "mounting " & sWinAddr
'SHELL "mount " & "/dev" &/ sWinAddr & Space(1) & "/mnt" &/
sWinAddr WAIT
EXEC ["mount", "/dev" &/ sWinAddr, "/mnt" &/ sWinAddr] WAIT
- IF Exist("/mnt" &/ sWinAddr &/ "windows" &/ "system32"
&/ "winver.exe") OR Exist("/mnt" &/ sWinAddr &/ "winnt" &/ "system32"
&/ "winver.exe") THEN
+ IF Exist("/mnt" &/ sWinAddr &/ "windows" &/ "system32"
&/ "winver.exe") OR IF IsDir("/mnt" &/ sWinAddr &/ "winnt") = TRUE
THEN 'Exist("/mnt" &/ sWinAddr &/ "winnt" &/ "system32" &/ "winver.exe")
THEN
'IF IsDir("/mnt" &/ sWinAddr &/ "windows") = TRUE THEN
' this is indeed a windows installation
@@ -215,9 +215,9 @@
PUBLIC SUB LIST_LILO_OS_CHOICES()
- DIM sLinuxList AS String
- DIM arrLinux AS String[]
- DIM i AS Integer
+ DIM sLinuxList, sDump AS String
+ DIM arrLinux, arrDump AS String[]
+ DIM i, ii AS Integer
DIM sLiloLabel AS String
DIM sLiloDesc AS String
DIM svmLinuz AS String
@@ -261,11 +261,19 @@
sShortAddr = Right(arrLinux[i], Len(arrLinux[i]) -
RInStr(arrLinux[i], "/"))
PRINT "scanning " & arrLinux[i]
PRINT "mount " & arrLinux[i] & Space(1) & "/tmp/lilo_tmp"
- SHELL "mount " & arrLinux[i] & Space(1) & "/tmp/lilo_tmp" WAIT
+ 'SHELL "mount " & arrLinux[i] & Space(1) & "/tmp/lilo_tmp" WAIT
+ EXEC ["mount", arrLinux[i], "/tmp/lilo_tmp"] WAIT
' now check for a vmlinuz
- IF Exist("/tmp/lilo_tmp/boot/vmlinuz") = TRUE THEN
- FrmLilo.TabStrip1.Count = FrmLilo.TabStrip1.count +
1 'arrLinux.Count - 1
+ 'IF Exist("/tmp/lilo_tmp/boot/vmlinuz*") = TRUE THEN
+ 'EXEC ["ls", "-l", "/tmp/lilo_tmp/boot/vmlinuz*"] TO sDump
+ SHELL "ls -1 /tmp/lilo_tmp/boot/vmlinuz* | grep -v \'@\'" TO sDump
+ Message(sDump)
+ sDump = Trim(sDump)
+ arrDump = Split(sDump, "\n")
+
+ FOR ii = 0 TO arrDump.Count - 1
+ FrmLilo.TabStrip1.Count = FrmLilo.TabStrip1.count +
1 'arrLinux.Count - 1
sLiloDesc = ME.ID_DISTRO("/tmp/lilo_tmp")
@@ -419,11 +427,18 @@
'END IF
END WITH ' end jacking with the tabstrip itself
- END IF
- SHELL "umount /tmp/lilo_tmp" WAIT
+ 'END IF
+ ' SHELL "umount /tmp/lilo_tmp" WAIT
+ NEXT
+ EXEC ["umount", "/tmp/lilo_tmp"] WAIT
+ 'NEXT
END IF
+
NEXT
-
+
+'NEXT ' next in dump
+
+
FOR i = 0 TO FrmLilo.TabStrip1.Count - 1
WITH FrmLilo.TabStrip1
.Index = i
@@ -431,8 +446,8 @@
FrmLilo.TabStrip1[i].Visible = FALSE
END IF
END WITH
-
- NEXT
+ NEXT
+
Modified: branches/iVL/MdlSetup.module
==============================================================================
--- branches/iVL/MdlSetup.module (original)
+++ branches/iVL/MdlSetup.module Thu Nov 13 05:32:30 2008
@@ -167,7 +167,7 @@
iCPkg = iCurrPkg - ClsGlobal.iBulkCnt
fRet = iCPkg * fcur
fRet = Round(fRet, -2)
- fRet = fRet + fbulk
+ fRet = fRet + 0.6
ENDIF
RETURN fRet
@@ -176,87 +176,26 @@
PUBLIC FUNCTION CALCULATE_PACKAGE_COUNT(bCustom AS Boolean) AS Integer
-
- DIM sOutput AS String
- DIM sOutArr AS String[]
- DIM cb AS CheckBox
+
DIM sDump AS String
DIM sTotalList AS String
- DIM i, ii AS Integer
- DIM irs AS Integer
+ DIM i AS Integer
DIM sList AS String[]
+ DIM iQTY AS Integer
' let's get a package count
- IF bCustom = FALSE THEN 'DOING A FULL INSTALL
- 'find bulks
- SHELL "find " & ClsGlobal.sSourceMnt & "/veclinux - name \"*.tlz\"|wc
-l" TO ClsGlobal.iBulkCnt
- 'find packages
- SHELL "find " & ClsGlobal.sSourceMnt & "/packages - name \"*.tlz\"|wc
-l" TO ClsGlobal.iPkgCnt
- ClsGlobal.iPkgTot = ClsGlobal.iBulkCnt + ClsGlobal.iPkgCnt
+ IF bCustom = FALSE THEN ' DOING A FULL INSTALL
+
+ SHELL "find " & ClsGlobal.sSourceMnt & " -name \"*.tlz\"|wc -l" TO
iQTY
ELSE ' GOING FOR CUSTOM INSTALL
- PRINT ("Calculating package count ... Please wait")
- SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" & "
| grep ^BULK | grep required" TO sOutput
- sOutput = Trim(sOutput)
- IF InStr(sOutput, "\n") > 0 THEN
- sOutArr = Split(sOutput, "\n")
- i = i + sOutArr.Count
- ELSE
- i = i + 1
- END IF
- 'add bulks to ClsGlobal.iBulkCnt
- ClsGlobal.iBulkCnt = i
- 'count required packages in
- sOutArr.Clear
- sOutput = ""
- SHELL "ls -m " & ClsGlobal.sSourceMnt &/ "packages" &/ "required"
&/ "*.t?z" TO sOutput
- sOutput = Trim(sOutput)
- sOutArr = Split(sOutput, ",")
- i = i + sOutArr.Count
- 'add pkgs TO ClsGlobal.iPkgCnt
- ClsGlobal.iPkgCnt = sOutArr.Count
- 'Count CONF packages in
- sOutArr.Clear
- sOutput = ""
- SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" & "
| grep ^CONF" TO sOutput
- sOutput = Trim(sOutput)
- IF InStr(sOutput, "\n") > 0 THEN
- sOutArr = Split(sOutput, "\n")
- i = i + sOutArr.Count
- 'add config bulks to ClsGlobal.iPkgCnt cause they are small and at
the end
- ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + sOutArr.Count
- ELSE
- i = i + 1
- 'add config bulks to ClsGlobal.iPkgCnt cause they are small and at
the end
- ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + 1
- END IF
- 'Count user-selected bulks
- REPEAT
- IF FrmPkgSel.scrlInstallOpts[ii, 0].Picture = FrmPkgSel.pyes THEN
INC irs
- INC ii
- UNTIL ii = FrmPkgSel.scrlInstallOpts.Rows.Count
- i = i + irs
- 'add bulks to ClsGlobal.iBulkCnt
- ClsGlobal.iBulkCnt = ClsGlobal.iBulkCnt + irs
- ' now do the optional packages
- irs = 0 ' reset the count
- REPEAT
- IF FrmUsrPkgSel.GridView1[ii, 0].Picture = FrmUsrPkgSel.pYes THEN
- INC irs
- END IF
- INC ii
- UNTIL ii = FrmUsrPkgSel.GridView1.Rows.Count
- i = i + irs ' the count to the total
- 'add pkgs TO ClsGlobal.iPkgCnt
- ClsGlobal.iPkgCnt = ClsGlobal.iPkgCnt + irs
- ClsGlobal.iPkgTot = i
+
END IF
- PRINT ("Total bulks to be installed = ") & ClsGlobal.iBulkCnt
- ClsGlobal.fPbInc = 0.6 / ClsGlobal.iBulkCnt
- PRINT "The total progrssbar will work in increments of " &
ClsGlobal.fPbInc & " on every bulk installed"
- PRINT ("Total pkgs to be installed = ") & ClsGlobal.iPkgCnt
- ClsGlobal.fPbInc = 0.4 / ClsGlobal.iPkgCnt
- PRINT "The total progrssbar will work in increments of " &
ClsGlobal.fPbInc & " on every pkg installed"
- RETURN ClsGlobal.iPkgTot
+
+
+ RETURN iQTY
+
+
+
END
|