From: <cod...@go...> - 2009-05-08 00:39:23
|
Author: M0...@gm... Date: Thu May 7 14:31:49 2009 New Revision: 545 Added: branches/speedy/Step9.class branches/speedy/Step9.form Modified: branches/speedy/.lang/.pot branches/speedy/.lang/Conf5.pot branches/speedy/.lang/Step7.pot branches/speedy/.lang/Step7a.pot branches/speedy/ClsGlobal.class branches/speedy/MdlMain.module branches/speedy/Step7.class branches/speedy/Step7a.class branches/speedy/Step8.class Log: - Added code to perform a customized installation. - Partitioning is now performed correctly - Partitions mount to the correct place - BUG: Status progressbar and label not being updated after each package installs. Modified: branches/speedy/.lang/.pot ============================================================================== --- branches/speedy/.lang/.pot (original) +++ branches/speedy/.lang/.pot Thu May 7 14:31:49 2009 @@ -55,7 +55,7 @@ msgstr "" #: Conf0.class:360 Step1.class:434 Step3a1.class:22 Step3a1a.class:186 -#: Step7a.class:143 +#: Step7a.class:144 msgid "WARNING:" msgstr "" @@ -498,11 +498,11 @@ msgid "Mouse driver for Text Mode interface" msgstr "" -#: Conf5.class:227 +#: Conf5.class:221 msgid "System Services" msgstr "" -#: Conf5.class:248 +#: Conf5.class:242 msgid "Select the system services to be launched at start-up." msgstr "" @@ -1089,11 +1089,11 @@ msgid "This step cannot be undone. Are you sure you want to continue?" msgstr "" -#: Step3a1a.class:186 Step6.class:510 Step7a.class:143 +#: Step3a1a.class:186 Step6.class:510 Step7a.class:144 msgid "Yes" msgstr "" -#: Step3a1a.class:186 Step6.class:510 Step7a.class:143 +#: Step3a1a.class:186 Step6.class:510 Step7a.class:144 msgid "No" msgstr "" @@ -1394,27 +1394,27 @@ msgid "Select Installation Mode" msgstr "" -#: Step7.class:109 +#: Step7.class:113 msgid "Full Install" msgstr "" -#: Step7.class:119 +#: Step7.class:123 msgid "Install everthing in the image (Fully Automated)" msgstr "" -#: Step7.class:127 Step8.class:137 +#: Step7.class:131 Step8.class:137 msgid "Customized" msgstr "" -#: Step7.class:137 +#: Step7.class:141 msgid "Select the components you wish to install (Advanced)" msgstr "" -#: Step7.class:145 Step8.class:139 +#: Step7.class:149 Step8.class:139 msgid "Minimal" msgstr "" -#: Step7.class:155 +#: Step7.class:159 msgid "Install the most minimal working confuguration (For older hardware)" msgstr "" @@ -1426,31 +1426,31 @@ msgid "Component" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "" "This component is a dependancy to any graphical user interface progam on the " "system" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "" "Choosing not to install this may result in a command-line (text mode) " "installation only" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "Are you sure you want to disable this conponent anyway?" msgstr "" -#: Step7a.class:169 Step7b.class:183 +#: Step7a.class:170 Step7b.class:183 msgid "Select All" msgstr "" -#: Step7a.class:175 Step7b.class:181 +#: Step7a.class:176 Step7b.class:181 msgid "Un-Select All" msgstr "" -#: Step7a.class:235 +#: Step7a.class:236 msgid "" "Major optional components available for installation. To select / un-select " "a component, click it's name or the box to the left of it's name." @@ -1526,4 +1526,12 @@ msgid "" "Your VectorLinux installation is about to be performed as follows. If you " "need to make any changes, this is your last chance." +msgstr "" + +#: Step9.class:22 +msgid "is being installed to your computer. Please wait." +msgstr "" + +#: Step9.class:80 +msgid "Installation in progress" msgstr "" Modified: branches/speedy/.lang/Conf5.pot ============================================================================== --- branches/speedy/.lang/Conf5.pot (original) +++ branches/speedy/.lang/Conf5.pot Thu May 7 14:31:49 2009 @@ -74,11 +74,11 @@ msgid "Mouse driver for Text Mode interface" msgstr "" -#: Conf5.class:227 +#: Conf5.class:221 msgid "System Services" msgstr "" -#: Conf5.class:248 +#: Conf5.class:242 msgid "Select the system services to be launched at start-up." msgstr "" Modified: branches/speedy/.lang/Step7.pot ============================================================================== --- branches/speedy/.lang/Step7.pot (original) +++ branches/speedy/.lang/Step7.pot Thu May 7 14:31:49 2009 @@ -18,27 +18,27 @@ msgid "Select Installation Mode" msgstr "" -#: Step7.class:109 +#: Step7.class:113 msgid "Full Install" msgstr "" -#: Step7.class:119 +#: Step7.class:123 msgid "Install everthing in the image (Fully Automated)" msgstr "" -#: Step7.class:127 +#: Step7.class:131 msgid "Customized" msgstr "" -#: Step7.class:137 +#: Step7.class:141 msgid "Select the components you wish to install (Advanced)" msgstr "" -#: Step7.class:145 +#: Step7.class:149 msgid "Minimal" msgstr "" -#: Step7.class:155 +#: Step7.class:159 msgid "Install the most minimal working confuguration (For older hardware)" msgstr "" Modified: branches/speedy/.lang/Step7a.pot ============================================================================== --- branches/speedy/.lang/Step7a.pot (original) +++ branches/speedy/.lang/Step7a.pot Thu May 7 14:31:49 2009 @@ -26,39 +26,39 @@ msgid "Description" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "WARNING:" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "This component is a dependancy to any graphical user interface progam on the system" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "Choosing not to install this may result in a command-line (text mode) installation only" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "Are you sure you want to disable this conponent anyway?" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "Yes" msgstr "" -#: Step7a.class:143 +#: Step7a.class:144 msgid "No" msgstr "" -#: Step7a.class:169 +#: Step7a.class:170 msgid "Select All" msgstr "" -#: Step7a.class:175 +#: Step7a.class:176 msgid "Un-Select All" msgstr "" -#: Step7a.class:235 +#: Step7a.class:236 msgid "Major optional components available for installation. To select / un-select a component, click it's name or the box to the left of it's name." msgstr "" Modified: branches/speedy/ClsGlobal.class ============================================================================== --- branches/speedy/ClsGlobal.class (original) +++ branches/speedy/ClsGlobal.class Thu May 7 14:31:49 2009 @@ -73,5 +73,5 @@ STATIC PUBLIC lTotalMBforVL AS Long STATIC PUBLIC sDefBoot AS String - +STATIC PUBLIC sInstallType AS String ' type of installation to be done (Full, Custom, Minimal) Modified: branches/speedy/MdlMain.module ============================================================================== --- branches/speedy/MdlMain.module (original) +++ branches/speedy/MdlMain.module Thu May 7 14:31:49 2009 @@ -223,4 +223,232 @@ END +PUBLIC FUNCTION PERFORM_PARTITIONING() AS Integer + + DIM sReqs AS String[] = Split(Trim(ClsGlobal.sVitalPartList), "|") ' partition list is a string separated by "|" (/dev/hda1-/mnt/point/-reiserfs| /dev/hda2-/mnt/point-ext3) + DIM sPart, sFmt, scommand AS String + DIM sPartEntry AS String[] + DIM i, iretval AS Integer + DIM $hproc AS Process + + FOR i = 0 TO sReqs.Max + sPart = Trim(Left(sReqs[i], Len("/dev/hda1"))) + sFmt = Trim(Right(sReqs[i], Len(sReqs[i]) - RInStr(sReqs[i], "-"))) + IF Trim(sFmt) THEN + SELECT CASE Trim(sFmt) + CASE "ext2" + sCommand = "mke2fs -q " & sPart + CASE "ext3" + 'sCommand = "mke2fs -q -j " & saddr + scommand = "mkfs.ext3 -1 -j " & sPart + CASE "reiserfs" + sCommand = "mkreiserfs --format 3.6 -q " & sPart + CASE "xfs" + sCommand = "mkfs.xfs -f " & sPart + CASE "jfs" + sCommand = "mkfs.jfs -q " & sPart + CASE "swap" + sCommand = "mkswap -L swap-space " & sPart + END SELECT + DEBUG "Formatting " & sPart & " with " & sFmt + $hproc = SHELL scommand WAIT + IF $hproc.Value > 1 THEN + DEBUG sPart & " failed to format to " & sFmt + iretval = 1 + BREAK + ELSE + DEBUG "Success!" + END IF + END IF + NEXT + + IF NOT (ClsGlobal.sTargetPath) THEN ClsGlobal.sTargetPath = "/mnt/target" + ' =---------- MOUNT THE PARTITIONS NOW ---------------- + SHELL "umount /mnt/target" WAIT + IF iretval < 1 THEN ' if everything is OK, we should be mounting partitions here now. + TRY MKDIR "/mnt/target" + FOR i = 0 TO sReqs.Max + IF Trim(sReqs[i]) THEN + 'Message(sReqs[i]) + sPartEntry = Split(sReqs[i], "-") + IF Trim(sPartEntry[2]) AND IF Exist(ClsGlobal.sTargetPath &/ sPartEntry[2]) = FALSE THEN TRY MKDIR ClsGlobal.sTargetPath &/ sPartEntry[2] + SELECT CASE Trim(sPartEntry[2]) + CASE "/" + $hproc = SHELL "mount " & Trim(sPartEntry[0]) & Space(1) & ClsGlobal.sTargetPath & " > /dev/null" WAIT + IF $hproc.Value > 0 THEN + DEBUG sPartEntry[0] & " failed to mount to " & ClsGlobal.sTargetPath &/ sPartEntry[2] + iretval = 1 + BREAK + ELSE + PRINT " + Mounted " & sPartEntry[0] & " to " & ClsGlobal.sTargetPath &/ sPartEntry[2] + END IF + CASE ELSE + $hproc = SHELL "mount " & Trim(sPartEntry[0]) & ClsGlobal.sTargetPath &/ sPartEntry[2] & " > /dev/null" WAIT + IF $hproc.Value > 0 THEN + DEBUG sPartEntry[0] & " failed to mount to " & sPartEntry[2] + iretval = 1 + BREAK + ELSE + PRINT " + Mounted " & sPartEntry[0] & " to " & ClsGlobal.sTargetPath &/ sPartEntry[2] + END IF + END SELECT + END IF + NEXT + + END IF + + + RETURN iretval +END + +PUBLIC FUNCTION INSTALL_PACKAGES(tlStatus AS TextLabel, pbProg AS ProgressBar, iInstallType AS Integer) AS Integer + + DIM $pkg, $bulk, $bulkfile, $file, $path AS String + DIM $BulkArr, $PkgArr, $filearr AS String[] + DIM $pkgcnt, i, ii, iii, ires AS Integer + DIM sDump AS String + ' Load file that defines package paths into a temp file + SHELL "cat /mnt/source/packages/CHECKSUMS.md5 | cut -f 2-10 -d \'.\'" TO sDump + File.Save(Temp("pkgpaths"), Trim(sDump)) + + ClsGlobal.fRunningMainForm.btNext.enabled = FALSE + SELECT CASE iInstallType + CASE 0 + GOTO FULL_INSTALL + CASE 1 + ' perform partitioning as requested. + IF ME.PERFORM_PARTITIONING() > 0 THEN RETURN + GOTO CUSTOM_INSTALL + CASE 2 + GOTO MINIMAL_INSTALL + END SELECT + + + + CUSTOM_INSTALL: + ' PRE-SET BULKS ARE IN CLSGLOBAL.SBULKLISTTOINSTALL + ' X11,LXDE,DEV,ETC + ' SOFTWARE SELECTION IN CLSGLOBAL.SPKGLISTTOINSTALL + ' PKG1,PKG2,PKG3,PKG4,ETC + $BulkArr = Split(Trim(ClsGlobal.sBulkListToInstall), ",") + $PkgArr = Split(Trim(ClsGlobal.sPkgListToInstall), ",") + + ' Get to total number of package to be installed... this will be used for the progressbar + FOR i = 0 TO $BulkArr.Max + IF Trim($BulkArr[i]) THEN + 'PRINT " -- Installing bulk-preset " & $BulkArr[i] + TRY $file = Trim(File.Load("/mnt/source/veclinux" &/ $BulkArr[i])) ' read definition file + $filearr = Split(Trim($file), gb.NewLine) + $pkgcnt = $pkgcnt + $filearr.Count + END IF + NEXT + ' Add the number of packages individually selected to the count + $pkgcnt = $pkgcnt + $PkgArr.Count + + 'This will loop through each bulk definition file, read it, and process it's contents. + FOR i = 0 TO $BulkArr.Max + IF Trim($BulkArr[i]) THEN + PRINT " -- Installing bulk-preset " & $BulkArr[i] + TRY $file = Trim(File.Load("/mnt/source/veclinux" &/ $BulkArr[i])) ' read definition file + $filearr = Split($file, gb.NewLine) + FOR ii = 0 TO $filearr.Max ' read each line in the file. + INC iii + ' install this package + pbProg.Value = iii / $pkgcnt + $path = ME.GET_PACKAGE_FULL_PATH($filearr[ii]) + IF $path THEN + IF Exist("/mnt/source/packages" &/ Trim($path)) THEN + tlStatus.Text = $path + ires = ME.INSTALL_THIS_PACKAGE("/mnt/source/packages" &/ Trim($path)) + IF ires > 0 THEN + ClsGlobal.fRunningMainForm.btNext.enabled = TRUE + RETURN 1 + BREAK ' this will never get executed + END IF + END IF + END IF + 'WAIT 1 + NEXT + END IF + NEXT + + ' and now we do the packages. (THESE ARE LISTED IN THE 'OPTIONAL' BULK DEF) + DEBUG " --- Installing optional individual packages" + $filearr = Split(ClsGlobal.sPkgListToInstall, ",") + FOR i = 0 TO $filearr.Max + $path = ME.GET_PACKAGE_FULL_PATH(Trim($filearr[i])) + INC iii + pbProg.Value = iii / $pkgcnt + IF Trim($path) THEN + IF Exist("/mnt/source/packages" &/ Trim($path)) THEN + ires = ME.INSTALL_THIS_PACKAGE("/mnt/source/packages" &/ Trim($path)) + IF ires > 0 THEN + ClsGlobal.fRunningMainForm.btNext.enabled = TRUE + RETURN 1 + END IF + END IF + END IF + + tlStatus.Text = "Optional package " & $path + + 'WAIT 1 + NEXT + ClsGlobal.fRunningMainForm.btNext.enabled = TRUE + RETURN + + FULL_INSTALL: + Message("Full install not programmed yet") + RETURN + MINIMAL_INSTALL: + Message("Minimal install not yet programmed") + RETURN + +END + +PUBLIC FUNCTION INSTALL_THIS_PACKAGE(sFullPkgPath AS String) AS Integer + + DIM $hproc AS Process + + '$hproc = EXEC ["/sbin/installpkg ", "-R", ClsGlobal.sTargetPath, sFullPkgPath] WAIT + $hproc = SHELL "/sbin/installpkg -R " & ClsGlobal.sTargetPath & Space(1) & sFullPkgPath WAIT + IF $hproc.Value > 0 THEN + DEBUG sFullPkgPath & Space(1) & "failed to install" + RETURN 1 + END IF + RETURN 0 + +END + + + +PUBLIC FUNCTION GET_PACKAGE_FULL_PATH(sPkgname AS String) AS String + + DIM sList AS String[] + DIM sPkg, sShortname, sParentDir AS String + DIM sDump1, sDump, sRetval AS String + DIM i AS Integer + + sdump1 = Trim(File.Load(Temp("pkgpaths"))) + sList = Split(Trim(sdump1), gb.NewLine) + + FOR i = 0 TO sList.Max + + IF InStr(sList[i], sPkgname) THEN + sParentDir = Left(sList[i], RInStr(sList[i], "/")) + sPkg = Right(sList[i], Len(sList[i]) - Len(sParentDir)) + SHELL "pkgname " & sPkg TO sDump + IF Trim(sdump) = Trim(sPkgname) THEN + 'PRINT "looking for " & sPkgname & Space(5) & sDump + sRetval = sList[i] + BREAK ' I've found a match... no need to keep looking + END IF + END IF + NEXT + + IF Trim(sRetval) THEN + RETURN Trim(sRetval) + ELSE + DEBUG sPkgname & " not found" + END IF +END Modified: branches/speedy/Step7.class ============================================================================== --- branches/speedy/Step7.class (original) +++ branches/speedy/Step7.class Thu May 7 14:31:49 2009 @@ -45,6 +45,10 @@ END PUBLIC SUB OnExit() + ' set the install type to clsglobal. + IF ME.rbFullInstall.Value = TRUE THEN ClsGlobal.sInstallType = rbFullInstall.Tag + IF ME.rbCustomInstall.Value = TRUE THEN ClsGlobal.sInstallType = rbCustomInstall.Tag + IF ME.rbMinimal.Value = TRUE THEN ClsGlobal.sInstallType = rbMinimal.Tag END Modified: branches/speedy/Step7a.class ============================================================================== --- branches/speedy/Step7a.class (original) +++ branches/speedy/Step7a.class Thu May 7 14:31:49 2009 @@ -107,7 +107,8 @@ DIM irow AS Integer DIM sList AS String FOR irow = 2 TO gvBulkSel.Rows.count - 1 - IF gvBulkSel[irow, 3].Text LIKE "yes" THEN + 'IF gvBulkSel[irow, 3].Text LIKE "yes" THEN + IF gvBulkSel[irow, 0].Picture = picyes THEN sList = sList & Trim(gvBulkSel[irow, 1].Text) & "," END IF NEXT Modified: branches/speedy/Step8.class ============================================================================== --- branches/speedy/Step8.class (original) +++ branches/speedy/Step8.class Thu May 7 14:31:49 2009 @@ -40,7 +40,7 @@ ' ClsGlobal.fRunningMainForm.listview1["Step3"].picture = MdlStartUp.pDone - RETURN "Conf0" + RETURN "Step9" END Added: branches/speedy/Step9.class ============================================================================== --- (empty file) +++ branches/speedy/Step9.class Thu May 7 14:31:49 2009 @@ -0,0 +1,47 @@ +' 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() + + ME.tlbanner.Text = "<h2>" & tlbanner.Text & "</h2>" + ME.tlInstallWarn.Text = ClsGlobal.sDistroName & Space(1) & ClsGlobal.sDistroVer & Space(1)& + ("is being installed to your computer. Please wait.") + + WAIT 1 + ME.Refresh + MdlMain.INSTALL_PACKAGES(ME.tlCurrPkg, ME.pbInstall, ClsGlobal.iInstallMethod) + +END +PUBLIC FUNCTION GetNExt() AS String + + RETURN "Conf0" + +END + +PUBLIC SUB OnExit() + + + +END +PUBLIC SUB StartUp() + + + +END + + + Added: branches/speedy/Step9.form ============================================================================== --- (empty file) +++ branches/speedy/Step9.form Thu May 7 14:31:49 2009 @@ -0,0 +1,62 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,73,48) + Text = ("") + Arrangement = Arrange.Row + { HPanel1 HPanel + MoveScaled(0,0,60,5) + Expand = True + { tlbanner TextLabel + MoveScaled(12,0,19,3) + Expand = True + Text = ("Installation in progress") + } + { Separator1 Separator + MoveScaled(13,4,25,1) + Expand = True + } + } + { HBox1 HBox + MoveScaled(0,5,12,2) + Expand = True + } + { HBox2 HBox + MoveScaled(0,8,65,6) + Expand = True + Padding = 2 + { tlInstallWarn TextLabel + MoveScaled(0,0,20,5) + Expand = True + Text = ("") + Alignment = Align.Left + } + } + { HBox3 HBox + MoveScaled(0,14,15,2) + Expand = True + } + { HBox4 HBox + MoveScaled(0,17,72,3.5) + Expand = True + Padding = 2 + { tlCurrPkg TextLabel + MoveScaled(1,0,23,3.5) + Expand = True + Text = ("") + } + } + { HBox5 HBox + MoveScaled(0,21,7,2) + Expand = True + } + { HPanel2 HPanel + MoveScaled(0,23,73,3.25) + Expand = True + Padding = 2 + { pbInstall ProgressBar + MoveScaled(0,0,21,3) + Expand = True + } + } +} |