From: <cod...@go...> - 2008-07-22 22:00:43
|
Author: M0...@gm... Date: Tue Jul 22 14:59:22 2008 New Revision: 67 Added: branches/iVL/FrmHostPrep.class branches/iVL/FrmHostPrep.form branches/iVL/FrmInstallSys.class branches/iVL/FrmInstallSys.form branches/iVL/MdlInstallSys.module branches/iVL/MdlPartFrmt.module Modified: branches/iVL/.lang/FMain.pot branches/iVL/.lang/FrmPartScheme.pot branches/iVL/.lang/FrmPartSel.pot branches/iVL/.lang/FrmPkgSel.pot branches/iVL/.lang/FrmSelISO.pot branches/iVL/.lang/FrmSummary.pot branches/iVL/.lang/FrmWinDrives.pot branches/iVL/ClsGlobal.class branches/iVL/ClsPartSel.class branches/iVL/FMain.class branches/iVL/FrmPartScheme.class branches/iVL/FrmPartSel.class branches/iVL/FrmPkgSel.class branches/iVL/FrmPkgsel2.class branches/iVL/FrmSelISO.class branches/iVL/FrmSummary.class branches/iVL/FrmWinDrives.class branches/iVL/MdlCore.module branches/iVL/MdlDiskPart.module branches/iVL/MdlPkgSel.module branches/iVL/MdlSetup.module Log: - Fixed frame and button positions on FMAIN - Added function to format and mount selected partitions (needs testing... unable to test here) - Added function to save /etc/fstab to the target. - Designed installation window and began functions to install bulks and packages - Enabled reverse navigation. The algorithm still needs work. Modified: branches/iVL/.lang/FMain.pot ============================================================================== --- branches/iVL/.lang/FMain.pot (original) +++ branches/iVL/.lang/FMain.pot Tue Jul 22 14:59:22 2008 @@ -14,23 +14,23 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FMain.class:209 +#: FMain.class:238 msgid "Process Overview" msgstr "" -#: FMain.class:223 +#: FMain.class:252 msgid "VectorLinux Install" msgstr "" -#: FMain.class:234 +#: FMain.class:263 msgid "Next" msgstr "" -#: FMain.class:240 +#: FMain.class:269 msgid "Back" msgstr "" -#: FMain.class:246 +#: FMain.class:275 msgid "Exit" msgstr "" Modified: branches/iVL/.lang/FrmPartScheme.pot ============================================================================== --- branches/iVL/.lang/FrmPartScheme.pot (original) +++ branches/iVL/.lang/FrmPartScheme.pot Tue Jul 22 14:59:22 2008 @@ -14,19 +14,19 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmPartScheme.class:97 +#: FrmPartScheme.class:105 msgid "Select your disk partition option" msgstr "" -#: FrmPartScheme.class:102 +#: FrmPartScheme.class:110 msgid "Use existing disk partitions" msgstr "" -#: FrmPartScheme.class:107 +#: FrmPartScheme.class:115 msgid "Modify my disk partitions to make room for new installation" msgstr "" -#: FrmPartScheme.class:112 +#: FrmPartScheme.class:120 msgid "TextLabel1" msgstr "" Modified: branches/iVL/.lang/FrmPartSel.pot ============================================================================== --- branches/iVL/.lang/FrmPartSel.pot (original) +++ branches/iVL/.lang/FrmPartSel.pot Tue Jul 22 14:59:22 2008 @@ -14,15 +14,15 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmPartSel.class:143 +#: FrmPartSel.class:151 msgid "Define where the operating system will be installed\n<br>\nLinux is a modular operating system. This means that it has the ability to keep system and user data separately.<br> A recommended setup would included a / (root), a /home, and a swap partitions.\n<br>\nPlease select which partitions you would like to use for your install" msgstr "" -#: FrmPartSel.class:152 +#: FrmPartSel.class:160 msgid "Check this box if you have a Windows installation on your system or any other windows partition (FAT, FAT32, NTFS) that you want auto-mounted as soon as your computer starts" msgstr "" -#: FrmPartSel.class:153 +#: FrmPartSel.class:161 msgid "Detect and Setup Windows partitions for auto-mounting at boot" msgstr "" Modified: branches/iVL/.lang/FrmPkgSel.pot ============================================================================== --- branches/iVL/.lang/FrmPkgSel.pot (original) +++ branches/iVL/.lang/FrmPkgSel.pot Tue Jul 22 14:59:22 2008 @@ -14,15 +14,15 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmPkgSel.class:88 +#: FrmPkgSel.class:96 msgid "TextLabel1" msgstr "" -#: FrmPkgSel.class:94 +#: FrmPkgSel.class:102 msgid "Full Install" msgstr "" -#: FrmPkgSel.class:99 +#: FrmPkgSel.class:107 msgid "Custom Install" msgstr "" Modified: branches/iVL/.lang/FrmSelISO.pot ============================================================================== --- branches/iVL/.lang/FrmSelISO.pot (original) +++ branches/iVL/.lang/FrmSelISO.pot Tue Jul 22 14:59:22 2008 @@ -14,19 +14,19 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmSelISO.class:215 +#: FrmSelISO.class:224 msgid "No installable images found." msgstr "" -#: FrmSelISO.class:221 +#: FrmSelISO.class:230 msgid "Select which distribution to install from the list below" msgstr "" -#: FrmSelISO.class:226 +#: FrmSelISO.class:235 msgid "TextLabel1" msgstr "" -#: FrmSelISO.class:231 +#: FrmSelISO.class:240 msgid "Search Again" msgstr "" Modified: branches/iVL/.lang/FrmSummary.pot ============================================================================== --- branches/iVL/.lang/FrmSummary.pot (original) +++ branches/iVL/.lang/FrmSummary.pot Tue Jul 22 14:59:22 2008 @@ -14,7 +14,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmSummary.class:65 +#: FrmSummary.class:73 msgid "TextLabel1" msgstr "" Modified: branches/iVL/.lang/FrmWinDrives.pot ============================================================================== --- branches/iVL/.lang/FrmWinDrives.pot (original) +++ branches/iVL/.lang/FrmWinDrives.pot Tue Jul 22 14:59:22 2008 @@ -14,7 +14,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmWinDrives.class:66 +#: FrmWinDrives.class:68 msgid "Select the windows partitions you would like to mount during boot" msgstr "" Modified: branches/iVL/ClsGlobal.class ============================================================================== --- branches/iVL/ClsGlobal.class (original) +++ branches/iVL/ClsGlobal.class Tue Jul 22 14:59:22 2008 @@ -40,3 +40,5 @@ STATIC PUBLIC sDocDir AS String STATIC PUBLIC sSetupConfPath AS String STATIC PUBLIC sReadMePath AS String + +STATIC PUBLIC sBackNav AS Object[] Modified: branches/iVL/ClsPartSel.class ============================================================================== --- branches/iVL/ClsPartSel.class (original) +++ branches/iVL/ClsPartSel.class Tue Jul 22 14:59:22 2008 @@ -33,3 +33,5 @@ STATIC PUBLIC sSwap AS String STATIC PUBLIC bDoWin AS Boolean + +STATIC PUBLIC sPartitionArray AS String[] Modified: branches/iVL/FMain.class ============================================================================== --- branches/iVL/FMain.class (original) +++ branches/iVL/FMain.class Tue Jul 22 14:59:22 2008 @@ -28,6 +28,8 @@ PUBLIC SUB Form_Open() DIM iImg AS Image + +ClsGlobal.sBackNav = NEW Object[] ClsGlobal.sSourceMnt = "/mnt" &/ "cdrom" FrmSelISO.Reparent(ME.pnlWinHost) FrmSelISO.Width = pnlWinHost.Width @@ -90,9 +92,12 @@ WITH ME .tlBanner.width = ME.width - .Frame1.Move(4, .PictureBox1.top + .PictureBox1.Height + 4, MdlCore.iLeftWidth * 1.60, .ClientHeight - tlBanner.Height - (.btback.Height * 1.5)) + .Frame1.Move(4, .PictureBox1.Top + .PictureBox1.Height + 4, MdlCore.iLeftWidth * 1.5, .ClientHeight - .PictureBox1.Height * 1.5) + '.Frame1.Move(4, .PictureBox1.top + .PictureBox1.Height + 4, MdlCore.iLeftWidth * 1.60, .ClientHeight - tlBanner.Height - (.btback.Height * 2)) '.Frame1.Resize(MdlCore.iLeftWidth * 1.60, .ClientHeight - tlBanner.Height - (.btback.Height * 1.5)) - .tvPlan.Move(4, 24, .Frame1.Width - 8, Frame1.Height - (.Frame1.Height / 20)) + .tvPlan.Move(4, 24, .Frame1.Width - 8, .Frame1.Height - 28) ' THIS WILL LEAVE 16PIX ON TOP AND BOTTOM AND 2 ON LEFT AND RIGHT + '.tvPlan.Move(4, 24, .Frame1.Width - 8, Frame1.Height - (.Frame1.Height / 20)) + .pnlWinHost.Move(.Frame1.left + .Frame1.Width + 4, .Frame1.top + (.tlBanner.Height / 2), .tlBanner.Width - (.Frame1.Width + 8), .ClientHeight - (.tlbanner.height + (.btback.height * 2))) .btback.Move(.pnlWinHost.Left, .Frame1.top + .Frame1.Height - .btback.Height, MdlObjSizer.get_object_width(.btback.text) + 36) .btnext.Move(.pnlWinHost.Left + .pnlWinHost.Width - (.btnext.Width + 8), .btback.Top, MdlObjSizer.get_object_width(.btnext.text) + 36) @@ -173,6 +178,10 @@ CASE "FrmWinDrives" 'Move on to selecting packages frmNext = FrmPkgSel + CASE "FrmSummary" + frmNext = FrmHostPrep ' prepare host + + END SELECT @@ -180,7 +189,27 @@ frmNext.Reparent(ME.pnlWinHost) FrmCurr.Hide frmLast = FrmCurr + 'IF ClsGlobal.sBackNav.Find(FrmCurr) = -1 THEN + ' ClsGlobal.sBackNav.Add(FrmCurr) + 'END IF + IF ClsGlobal.sBackNav.Find(frmNext) = -1 THEN + ClsGlobal.sBackNav.Add(frmNext) + END IF frmNext.Show - + + +END + +PUBLIC SUB btback_Click() + + DIM iKey AS Integer + DIM frm AS Form + iKey = ClsGlobal.sBackNav.Find(FrmCurr) + IF iKey <> -1 THEN + frm = ClsGlobal.sBackNav[iKey - 1] + FrmCurr.Hide + frm.Show + END IF + END Added: branches/iVL/FrmHostPrep.class ============================================================================== --- (empty file) +++ branches/iVL/FrmHostPrep.class Tue Jul 22 14:59:22 2008 @@ -0,0 +1,101 @@ +' 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() + +FMain.FrmCurr = ME +FMain.tvPlan["Prep3"].Picture = MdlCore.sDonePic +FMain.tvPlan["Inst0"].picture = MdlCore.sNowPic +FMain.tvPlan["Inst0"].Selected = TRUE + + + + ' may need to move this code to another event. The FormOpen event only happens once. + ME.PREPARE_ALL_PARTITIONS() + +END + + +PUBLIC SUB PREPARE_ALL_PARTITIONS() + + DIM sList AS String[] + DIM i, iretval AS Integer + DIM sPart, sFormat AS String + + sList = NEW String[] + + IF ClsPartSel.sRoot THEN + sList.Add(ClsPartSel.sRoot & ";" & ClsPartSel.fRoot) + END IF + IF ClsPartSel.sHome THEN + sList.Add(ClsPartSel.sHome & ";" & ClsPartSel.fHome) + END IF + IF ClsPartSel.sUsr THEN + sList.Add(ClsPartSel.sUsr & ";" & ClsPartSel.fUsr) + END IF + IF ClsPartSel.sOpt THEN + sList.Add(ClsPartSel.sOpt & ";" & ClsPartSel.fOpt) + END IF + IF ClsPartSel.sTmp THEN + sList.Add(ClsPartSel.sTmp & ";" & ClsPartSel.fTmp) + END IF + IF ClsPartSel.sVar THEN + sList.Add(ClsPartSel.sVar & ";" & ClsPartSel.fVar) + END IF + + ' now that we have the list in the array, let's do each one + FOR i = 0 TO sList.Count - 1 + sPart = Left(sList[i], InStr(sList[i], ";") - 1) + sFormat = Right(sList[i], Len(sList[i]) - InStr(sList[i], ";")) + iretval = MdlPartFrmt.FORMAT_PARTITION(sPart, sFormat) ' do the formatting + IF iretval <> 0 THEN + RETURN ' stop right there there's been an error. + END IF + NEXT + + + IF iretval AND iretval <> 0 THEN + ' there has been an error. Do not move from here + RETURN + ELSE + 'move on to installing.. first, make fstab + END IF + +END + + + + +PUBLIC SUB Form_Resize() + + WITH ME + .tlbanner.Move(4, 8, .ClientWidth - 8) + .frmStatus.Move(.tlbanner.Left, .tlbanner.Height * 1.5, .tlbanner.Width, .tlbanner.Height * 6) + .tlStatus.move(4, 24, .frmStatus.Width - 8, .frmStatus.Height - 36) + + END WITH + +END + +PUBLIC SUB Form_Show() + + Form_Open() + + +END Added: branches/iVL/FrmHostPrep.form ============================================================================== --- (empty file) +++ branches/iVL/FrmHostPrep.form Tue Jul 22 14:59:22 2008 @@ -0,0 +1,18 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,73,48) + Text = ("") + { tlbanner TextLabel + MoveScaled(1,3,59,3.375) + Text = ("Vectorlinux is preparing your system for installation. Please wait.") + } + { frmStatus Frame + MoveScaled(1,10,71,20) + Text = ("Current Status") + { tlStatus TextLabel + MoveScaled(1,3,67,12) + Text = ("TextLabel1") + } + } +} Added: branches/iVL/FrmInstallSys.class ============================================================================== --- (empty file) +++ branches/iVL/FrmInstallSys.class Tue Jul 22 14:59:22 2008 @@ -0,0 +1,74 @@ +' 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() + DIM sRes AS Integer ' we will need to + + FMain.FrmCurr = ME + FMain.tvPlan["Inst0"].Picture = MdlCore.sDonePic + FMain.tvPlan["Inst1"].Picture = MdlCore.sNowPic + FMain.tvPlan["Inst1"].Selected = TRUE + + 'initiate install procedure + ' 1: MOUNT PARTITIONS + ' 2: Write /etc/fstab + ' 3: Install packages + + sRes = MdlInstallSys.MOUNT_DEFINED_PARTITIONS() + IF sRes AND sRes <> 0 THEN + RETURN ' exit... there was an error mounting + END IF + sRes = 0 + sRes = MdlInstallSys.WRITE_NEW_FSTAB() + IF sRes AND sRes <> 0 THEN + RETURN + END IF + sRes = 0 + sRes = MdlInstallSys.INSTALL_BULK_PACKAGES() + IF sRes AND sRes <> 0 THEN + RETURN + END IF + sRes = 0 + sRes = MdlInstallSys.INSTALL_PACKAGES() + IF sRes AND sRes <> 0 THEN + RETURN + END IF + + ' DONE WITH INSTALLATION. REBOOT THE SYSTEM. + + + + +END + +PUBLIC SUB Form_Show() + + Form_Open() + +END + +PUBLIC SUB Form_Resize() + + WITH ME + .tlBanner.Move(4, 16, .ClientWidth - 16) + .FrmProg.Move(.tlBanner.Left, .tlBanner.Height * 2, .ClientWidth - 8) + .tlCurrPkg.Move(4, 4, .FrmProg.Width - 8) + .pbInstallProg.Move(.tlCurrPkg.Left, .tlCurrPkg.Height * 3, .tlCurrPkg.Width, 24) + END WITH +END Added: branches/iVL/FrmInstallSys.form ============================================================================== --- (empty file) +++ branches/iVL/FrmInstallSys.form Tue Jul 22 14:59:22 2008 @@ -0,0 +1,21 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,78,51) + Text = ("") + { tlBanner TextLabel + MoveScaled(6,1,63,3) + Text = ("Vectorlinux is currently being installed to your system... Please wait") + } + { FrmProg Frame + MoveScaled(1,10,76,19) + Text = ("") + { tlCurrPkg TextLabel + MoveScaled(1,1,45,3.375) + Text = ("TextLabel1") + } + { pbInstallProg ProgressBar + MoveScaled(1,7,25,3) + } + } +} Modified: branches/iVL/FrmPartScheme.class ============================================================================== --- branches/iVL/FrmPartScheme.class (original) +++ branches/iVL/FrmPartScheme.class Tue Jul 22 14:59:22 2008 @@ -36,6 +36,8 @@ FMain.tvPlan["Prep1"].Selected = TRUE FMain.tvPlan["Prep1"].Picture = MdlCore.sNowPic FMain.tvPlan["Prep0"].Picture = MdlCore.sDonePic +FMain.btback.Enabled = TRUE +FMain.btback.ForeColor = Color.Black 'FMain.frmNext = FrmPartSel WITH ME .rbEditPartitions.Width = MdlObjSizer.get_object_width(.rbEditPartitions.Text) + 24 @@ -74,5 +76,11 @@ PUBLIC SUB Form_Hide() + +END + +PUBLIC SUB Form_Show() + + Form_Open() END Modified: branches/iVL/FrmPartSel.class ============================================================================== --- branches/iVL/FrmPartSel.class (original) +++ branches/iVL/FrmPartSel.class Tue Jul 22 14:59:22 2008 @@ -61,6 +61,8 @@ MdlPartSel.DISPLAY_PARTITION_OPTIONS ME.cbDoWin.Value = FALSE ClsPartSel.bDoWin = FALSE + FMain.btback.Enabled = TRUE +FMain.btback.ForeColor = Color.Black END @@ -123,3 +125,9 @@ END + +PUBLIC SUB Form_Show() + + Form_Open + +END Modified: branches/iVL/FrmPkgSel.class ============================================================================== --- branches/iVL/FrmPkgSel.class (original) +++ branches/iVL/FrmPkgSel.class Tue Jul 22 14:59:22 2008 @@ -26,6 +26,8 @@ FMain.tvPlan["Prep2"].Selected = TRUE FMain.tvPlan["Prep1"].Picture = MdlCore.sDonePic FMain.tvPlan["Prep2"].Picture = MdlCore.sNowPic + FMain.btback.Enabled = TRUE +FMain.btback.ForeColor = Color.Black END @@ -64,5 +66,11 @@ PUBLIC SUB Form_Hide() + +END + +PUBLIC SUB Form_Show() + + Form_Open() END Modified: branches/iVL/FrmPkgsel2.class ============================================================================== --- branches/iVL/FrmPkgsel2.class (original) +++ branches/iVL/FrmPkgsel2.class Tue Jul 22 14:59:22 2008 @@ -25,6 +25,8 @@ END WITH FMain.FrmCurr = ME + FMain.btback.Enabled = TRUE +FMain.btback.ForeColor = Color.Black MdlPkgSel.LIST_PACKAGE_SELECTION() END Modified: branches/iVL/FrmSelISO.class ============================================================================== --- branches/iVL/FrmSelISO.class (original) +++ branches/iVL/FrmSelISO.class Tue Jul 22 14:59:22 2008 @@ -54,6 +54,9 @@ FMain.sNextKey = "Prep0" FMain.FrmCurr = ME FMain.frmNext = FrmPartScheme + IF ClsGlobal.sBackNav.Find(ME) = -1 THEN + ClsGlobal.sBackNav.Add(ME) + END IF ' shape the main form according to the findings 'warn the user if no installable media was found @@ -191,5 +194,11 @@ FMain.frmLast = ME + +END + +PUBLIC SUB Form_Show() + + Form_Open() END Modified: branches/iVL/FrmSummary.class ============================================================================== --- branches/iVL/FrmSummary.class (original) +++ branches/iVL/FrmSummary.class Tue Jul 22 14:59:22 2008 @@ -30,6 +30,8 @@ FMain.tvPlan["Inst0"].Selected = TRUE FMain.tvPlan["Prep2"].Picture = MdlCore.sDonePic FMain.tvPlan["Inst0"].Picture = MdlCore.sNowPic + FMain.btback.Enabled = TRUE +FMain.btback.ForeColor = Color.Black END @@ -42,5 +44,11 @@ '.tlSummary.Move(.tlBanner.Left, .tlBanner.top + .tlBanner.Height + 4, .tlBanner.Width, .ClientH - 16) END WITH + +END + +PUBLIC SUB Form_Show() + + Form_Open() END Modified: branches/iVL/FrmWinDrives.class ============================================================================== --- branches/iVL/FrmWinDrives.class (original) +++ branches/iVL/FrmWinDrives.class Tue Jul 22 14:59:22 2008 @@ -22,6 +22,8 @@ MdlWinDrives.LIST_WIN_PARTITIONS 'ME.Resize(ME.Parent.Width - 12, ME.Parent.Height - 12) FMain.FrmCurr = ME + FMain.btback.Enabled = TRUE +FMain.btback.ForeColor = Color.Black END Modified: branches/iVL/MdlCore.module ============================================================================== --- branches/iVL/MdlCore.module (original) +++ branches/iVL/MdlCore.module Tue Jul 22 14:59:22 2008 @@ -471,7 +471,8 @@ '.Add("Prep3", "Desktop Selection", sToDopic, "Prep") .Add("Inst", "Installation", sCatPic) .Add("Inst0", "Installation Summary", sToDopic, "Inst") - .Add("Inst1", "Install Operating System", sToDopic, "Inst") + .Add("Inst1", "Prepare Host", sToDopic, "Inst") + .Add("Inst2", "Install Operating System", sToDopic, "Inst") .Add("Conf", "System Configuration", sCatPic) .Add("Conf0", "Computer Name", sToDopic, "Conf") .Add("Conf1", "System Administrator", sToDopic, "Conf") Modified: branches/iVL/MdlDiskPart.module ============================================================================== --- branches/iVL/MdlDiskPart.module (original) +++ branches/iVL/MdlDiskPart.module Tue Jul 22 14:59:22 2008 @@ -33,7 +33,7 @@ END IF FrmDiskPart.tlBanner.Text = "<h3>Loading gparted .... Please wait</h3>" - SHELL "/usr/bin/gparted" + SHELL "/usr/sbin/gparted" WAIT 3 sTitle = "GParted" Added: branches/iVL/MdlInstallSys.module ============================================================================== --- (empty file) +++ branches/iVL/MdlInstallSys.module Tue Jul 22 14:59:22 2008 @@ -0,0 +1,206 @@ +' 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 FUNCTION MOUNT_DEFINED_PARTITIONS() AS Integer + + + + ' this is where we need to set the mount target + ClsGlobal.sTargetMnt = "/mnt/target" + IF Exist(ClsGlobal.sTargetMnt) = FALSE THEN + TRY MKDIR ClsGlobal.sTargetMnt + END IF + + FrmInstallSys.tlCurrPkg.Text = "Mounting target partitions" + + SHELL "umount " & ClsGlobal.sTargetMnt WAIT 'clear the mount point + + SHELL "mount " & ClsPartSel.sRoot & Space(1) & ClsGlobal.sTargetMnt & Space(1) & " -t " & ClsPartSel.fRoot WAIT 'moun the root partition first + IF ClsPartSel.sHome THEN + SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "home" WAIT + SHELL "mount " & ClsPartSel.sHome & Space(1) & ClsGlobal.sTargetMnt &/ "home -t " & ClsPartSel.fhome WAIT 'mount the home partition if defined + + END IF + IF ClsPartSel.sUsr THEN + SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "usr" WAIT + SHELL "mount " & ClsPartSel.sUsr & Space(1) & ClsGlobal.sTargetMnt &/ "usr -t" & ClsPartSel.fUsr WAIT ' mount the user partition + END IF + IF ClsPartSel.sOpt THEN + SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "opt" WAIT + SHELL "mount " & ClsPartSel.sOpt & Space(1) & ClsGlobal.sTargetMnt &/ "opt -t " & ClsPartSel.fOpt WAIT 'mount the opt partitiong + END IF + IF ClsPartSel.sVar THEN + SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "var" WAIT + SHELL "mount " & ClsPartSel.sVar & Space(1) & ClsGlobal.sTargetMnt &/ "var -t " & ClsPartSel.fVar WAIT + END IF + IF ClsPartSel.sTmp THEN + SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "tmp" WAIT + SHELL "mount " & ClsPartSel.sTmp & Space(1) & ClsGlobal.sTargetMnt &/ "tmp -t " & ClsPartSel.fTmp WAIT + END IF + + ' see if there is a swap partition and use it + IF ClsPartSel.sSwap THEN + SHELL "swapon -a " WAIT + END IF + + 'WRITE THE NEW FSTAB NOW, RIGHT BEFORE INSTALLING PACKAGES. + + 'ME.WRITE_NEW_FSTAB() ' do this from the install form + + + + +END + + + +PUBLIC FUNCTION WRITE_NEW_FSTAB() AS Integer + + DIM sEntry AS String + DIM sPartition AS String + DIM sMountPoint AS String + DIM sMntOpts AS String + DIM i AS Integer + DIM sWinPart AS String + DIM sWinMntPnt AS String + DIM sFstab AS String + + FrmInstallSys.tlCurrPkg.Text = "Writing new /etc/fstab to system" + + sFstab = "# /etc/fstab: static file system information.\n" & + "#\n" & +"#The following is an example.Please see fstab(5) for further details.\n" & +"#Please refer to mount(1) for a complete description OF mount options.\n" & +"#\n" & +"#Format:\n" & +"# < file system > < mount point > < type > < options > < dump > < pass >\n" & +"#\n" & +"#dump(8)uses the < dump > field to determine which file systems need \n" & +"# to be dumped.fsck(8)uses the < pass > column TO determine which file \n" & +"#systems need TO be checked - - the root file system should have a 1 in \n" & +"#this field, other file systems a 2, AND any file systems that should \n" & +"#not be checked(such AS MS - initrd / mnt OR NFS file systems)a 0.\n\n\n" & +"#The Linux partitions\n" + +sFstab = sFstab & gb.NewLine & +ClsPartSel.sRoot & " / " & LCase(ClsPartSel.fRoot) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fRoot)) & " 0 1" & gb.NewLine +IF ClsPartSel.sHome THEN + sFstab = sFstab & gb.NewLine & ClsPartSel.sHome & " /home " & LCase(ClsPartSel.fhome) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fhome)) & " 0 2" +END IF +IF ClsPartSel.sUsr THEN + sFstab = sFstab & gb.NewLine & ClsPartSel.sUsr & " /usr " & LCase(ClsPartSel.fUsr) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fUsr)) & " 0 2 " +END IF +IF ClsPartSel.sOpt THEN + sFstab = sFstab & gb.NewLine & ClsPartSel.sopt & " /opt " & LCase(ClsPartSel.fOpt) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fOpt)) & " 0 2 " +END IF +IF ClsPartSel.sVar THEN + sFstab = sFstab & gb.NewLine & ClsPartSel.sVar & " /var " & LCase(ClsPartSel.fVar) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fVar)) & " 0 2 " +END IF +IF ClsPartSel.sTmp THEN + sFstab = sFstab & gb.NewLine & ClsPartSel.sTmp & " /tmp " & LCase(ClsPartSel.fTmp) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fTmp)) & " 0 2 " +END IF + +sFstab = sFstab & "\n\n" & +"# Shared Windows/Linux partition" & +"#/dev/hda1 /mnt/dos msdos umask=0 0 0 \n" & +"#/dev/hda1 /mnt/win vfat fmask=111,dmask=0,quiet,shortname=mixed,user 0 0 \n" & +"#/dev/hda1 /mnt/win ntfs umask=0 0 0\n" + IF ClsWinDrives.sWinDrives THEN + FOR i = 0 TO ClsWinDrives.sWinDrives.Count - 1 + sWinPart = Trim(Left(ClsWinDrives.sWinDrives[i], InStr(ClsWinDrives.sWinDrives[i], "|") - 1)) + sWinMntPnt = Trim(Right(ClsWinDrives.sWinDrives[i], Len(ClsWinDrives.sWinDrives[i]) - InStr(ClsWinDrives.sWinDrives[i], "|"))) + 'Message("Mount " & sWinPart & " to " & sWinMntPnt) + ' if this is right... then add it to the file + NEXT + END IF + +sFstab = sFstab & "\n\n" & +"# Floppy disks \n" & +"# The 'noauto' option indicates that the file system should not be mounted \n" & +"# with 'mount -a' 'user' indicates that normal users are allowed to mount \n" & +"# the file system. \n" & +"/dev/fd0 /mnt/floppy auto defaults,noauto,user 0 0 \n" & +"#/dev/fd1 /mnt/floppy auto defaults,noauto,user 0 0 \n\n" & +"# If you have a ls-120 floppy drive, it could be on /dev/hda b c d etc.\n" & +"#/dev/hdd /mnt/ls120 auto defaults,noauto,user 0 0 \n\n" & +"# CDROM, CDWRITER, DVD \n" & +"/dev/cdrom /media/cdrom iso9660 defaults,noauto,ro,user 0 0 \n" & +"#/dev/cdwriter /media/cdwriter iso9660 defaults,noauto,rw,user 0 0 \n" & +"#/dev/dvd /media/dvd auto defaults,noauto,ro,user 0 0\n\n" & +"# NFS file systems:\n" & +"#linux01.gwdg.de:/suse/6.3/i386.de /mnt/nfs nfs defaults 0 0\n\n" & +"# proc file system:\n" & +"proc /proc proc defaults 0 0\n\n" & +"# Unix98 devpts filesystem: \n" & +"none /dev/pts devpts gid=5,mode=666 0 0\n\n" & +"# Shared memory filesystem: \n" & +"tmpfs /dev/shm tmpfs defaults 0 0 \n\n" & +"# Basic USB filesystem\n" & +"sysfs /sys sysfs defaults 0 0\n" & +"usbfs /proc/bus/usb usbfs rw,devmode=0666 0 0\n\n" & +"# example of a VFAT USB pendrive\n" & +"#/dev/sda1 /mnt/pendrive vfat fmask=111,dmask=0,noauto,user,quiet,shortname=mixed 0 0\n\n" & +"# Swap partitions\n" & +"# The 'sw' option means auto activating with 'swapon -a'.\n" +IF ClsPartSel.sSwap THEN + sFstab = sFstab & gb.NewLine & + ClsPartSel.sSwap & Space(5) & "none" & Space(5) & "swap" & Space(5) & "sw" & Space(5) & "0" & Space(5) & "0" +END IF +' Wheewww!... that's the whole fstab there... Please fix the win partitions + + ' now save the file to /etc/fstab + TRY File.Save(ClsGlobal.sTargetMnt &/ "etc" &/ "fstab", SConv(sFstab)) + CATCH + RETURN 1 + + +END +PUBLIC FUNCTION fS_oPTIONS(sType AS String) AS String + + DIM sMntOpts AS String + + SELECT CASE LCase(sType) + CASE "reiserfs" + sMntOpts = "noatime" + CASE "vfat" + sMntOpts = "fmask=111,dmask=0,gid=users,shortname=mixed,quiet,user" + CASE "ntfs" + sMntOpts = "umask=0,gid=users,user" + CASE "ext2", "ext3" + sMntOpts = "defaults" + CASE ELSE + sMntOpts = "defaults" + END SELECT + + RETURN sMntOpts + + +END + +PUBLIC FUNCTION INSTALL_BULK_PACKAGES() AS Integer + + + +END + +PUBLIC FUNCTION INSTALL_PACKAGES() AS Integer + + + +END + + Added: branches/iVL/MdlPartFrmt.module ============================================================================== --- (empty file) +++ branches/iVL/MdlPartFrmt.module Tue Jul 22 14:59:22 2008 @@ -0,0 +1,76 @@ +' 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/>. + PRIVATE hproc AS Process + PRIVATE sDump AS String + PRIVATE sErr AS String +PUBLIC FUNCTION FORMAT_PARTITION(sAddr AS String, sFS AS String) AS Integer ' will return 1 for trouble, 0 for clear + + DIM sCommand AS String + + + 'Umount the volume first + SHELL "umount " & sAddr WAIT + SELECT CASE LCase(sFS) + CASE "ext2" + sCommand = "mke2fs -q " & sAddr + CASE "ext3" + sCommand = "mke2fs -q -j " & saddr + CASE "reiserfs" + sCommand = "mkreiserfs --format 3.6 -ff " & sAddr + CASE "xfs" + sCommand = "mkfs.xfs -f " & sAddr + END SELECT + + hproc = SHELL sCommand & " | echo \'FAILED\'" FOR READ + WAIT + IF hproc.State = Process.Running THEN + REPEAT + FrmHostPrep.tlStatus.Text = "Formatting " & sAddr & " as " & sFS + + WAIT + UNTIL + hproc.State = Process.Stopped + sDump = Trim(sDump) + sErr = Trim(sErr) + IF InStr(sDump, "FAILED") > 0 AND sErr <> "" THEN + 'error here + Message.Error("There has been an error wile trying to format " & sAddr & " to " & sFS & gb.NewLine & + sErr) + FrmHostPrep.tlStatus.Text = "Unable to format " & saddr + RETURN 1 + ELSE + RETURN 0 + END IF + END IF + +END + +PUBLIC SUB process_read() + + DIM sLine AS String + READ #LAST, sLine, -256 + sDump = sDump & gb.NewLine & sLine + + +END + +PUBLIC SUB Process_error(errormsg AS String) + sErr = sErr & gb.NewLine & sErr + +END + Modified: branches/iVL/MdlPkgSel.module ============================================================================== --- branches/iVL/MdlPkgSel.module (original) +++ branches/iVL/MdlPkgSel.module Tue Jul 22 14:59:22 2008 @@ -177,12 +177,10 @@ ClsPkgSel.arrPkgs.Add(cb.Tag) END IF NEXT - - - - - - + END + + + Modified: branches/iVL/MdlSetup.module ============================================================================== --- branches/iVL/MdlSetup.module (original) +++ branches/iVL/MdlSetup.module Tue Jul 22 14:59:22 2008 @@ -133,173 +133,7 @@ END -PUBLIC SUB MOUNT_DEFINED_PARTITIONS() - - - ' this is where we need to set the mount target - ClsGlobal.sTargetMnt = "/mnt/target" - IF Exist(ClsGlobal.sTargetMnt) = FALSE THEN - TRY MKDIR ClsGlobal.sTargetMnt - END IF - - SHELL "umount " & ClsGlobal.sTargetMnt WAIT 'clear the mount point - - SHELL "mount " & ClsPartSel.sRoot & Space(1) & ClsGlobal.sTargetMnt & Space(1) & " -t " & ClsPartSel.fRoot WAIT 'moun the root partition first - IF ClsPartSel.sHome THEN - SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "home" WAIT - SHELL "mount " & ClsPartSel.sHome & Space(1) & ClsGlobal.sTargetMnt &/ "home -t " & ClsPartSel.fhome WAIT 'mount the home partition if defined - - END IF - IF ClsPartSel.sUsr THEN - SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "usr" WAIT - SHELL "mount " & ClsPartSel.sUsr & Space(1) & ClsGlobal.sTargetMnt &/ "usr -t" & ClsPartSel.fUsr WAIT ' mount the user partition - END IF - IF ClsPartSel.sOpt THEN - SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "opt" WAIT - SHELL "mount " & ClsPartSel.sOpt & Space(1) & ClsGlobal.sTargetMnt &/ "opt -t " & ClsPartSel.fOpt WAIT 'mount the opt partitiong - END IF - IF ClsPartSel.sVar THEN - SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "var" WAIT - SHELL "mount " & ClsPartSel.sVar & Space(1) & ClsGlobal.sTargetMnt &/ "var -t " & ClsPartSel.fVar WAIT - END IF - IF ClsPartSel.sTmp THEN - SHELL "mkdir -p " & ClsGlobal.sTargetMnt &/ "tmp" WAIT - SHELL "mount " & ClsPartSel.sTmp & Space(1) & ClsGlobal.sTargetMnt &/ "tmp -t " & ClsPartSel.fTmp WAIT - END IF - - ' see if there is a swap partition and use it - IF ClsPartSel.sSwap THEN - SHELL "swapon -a " WAIT - END IF - - 'WRITE THE NEW FSTAB NOW, RIGHT BEFORE INSTALLING PACKAGES. - - ME.WRITE_NEW_FSTAB() - - - -END - - - -PUBLIC FUNCTION WRITE_NEW_FSTAB() - - DIM sEntry AS String - DIM sPartition AS String - DIM sMountPoint AS String - DIM sMntOpts AS String - DIM i AS Integer - DIM sWinPart AS String - DIM sWinMntPnt AS String - DIM sFstab AS String - - sFstab = "# /etc/fstab: static file system information.\n" & - "#\n" & -"#The following is an example.Please see fstab(5) for further details.\n" & -"#Please refer to mount(1) for a complete description OF mount options.\n" & -"#\n" & -"#Format:\n" & -"# < file system > < mount point > < type > < options > < dump > < pass >\n" & -"#\n" & -"#dump(8)uses the < dump > field to determine which file systems need \n" & -"# to be dumped.fsck(8)uses the < pass > column TO determine which file \n" & -"#systems need TO be checked - - the root file system should have a 1 in \n" & -"#this field, other file systems a 2, AND any file systems that should \n" & -"#not be checked(such AS MS - initrd / mnt OR NFS file systems)a 0.\n\n\n" & -"#The Linux partitions\n" - -sFstab = sFstab & gb.NewLine & -ClsPartSel.sRoot & " / " & LCase(ClsPartSel.fRoot) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fRoot)) & " 0 1" & gb.NewLine -IF ClsPartSel.sHome THEN - sFstab = sFstab & gb.NewLine & ClsPartSel.sHome & " /home " & LCase(ClsPartSel.fhome) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fhome)) & " 0 2" -END IF -IF ClsPartSel.sUsr THEN - sFstab = sFstab & gb.NewLine & ClsPartSel.sUsr & " /usr " & LCase(ClsPartSel.fUsr) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fUsr)) & " 0 2 " -END IF -IF ClsPartSel.sOpt THEN - sFstab = sFstab & gb.NewLine & ClsPartSel.sopt & " /opt " & LCase(ClsPartSel.fOpt) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fOpt)) & " 0 2 " -END IF -IF ClsPartSel.sVar THEN - sFstab = sFstab & gb.NewLine & ClsPartSel.sVar & " /var " & LCase(ClsPartSel.fVar) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fVar)) & " 0 2 " -END IF -IF ClsPartSel.sTmp THEN - sFstab = sFstab & gb.NewLine & ClsPartSel.sTmp & " /tmp " & LCase(ClsPartSel.fTmp) & " " & ME.fS_oPTIONS(LCase(ClsPartSel.fTmp)) & " 0 2 " -END IF - -sFstab = sFstab & "\n\n" & -"# Shared Windows/Linux partition" & -"#/dev/hda1 /mnt/dos msdos umask=0 0 0 \n" & -"#/dev/hda1 /mnt/win vfat fmask=111,dmask=0,quiet,shortname=mixed,user 0 0 \n" & -"#/dev/hda1 /mnt/win ntfs umask=0 0 0\n" - IF ClsWinDrives.sWinDrives THEN - FOR i = 0 TO ClsWinDrives.sWinDrives.Count - 1 - sWinPart = Trim(Left(ClsWinDrives.sWinDrives[i], InStr(ClsWinDrives.sWinDrives[i], "|") - 1)) - sWinMntPnt = Trim(Right(ClsWinDrives.sWinDrives[i], Len(ClsWinDrives.sWinDrives[i]) - InStr(ClsWinDrives.sWinDrives[i], "|"))) - Message("Mount " & sWinPart & " to " & sWinMntPnt) - ' if this is right... then add it to the file - NEXT - END IF - -sFstab = sFstab & "\n\n" & -"# Floppy disks \n" & -"# The 'noauto' option indicates that the file system should not be mounted \n" & -"# with 'mount -a' 'user' indicates that normal users are allowed to mount \n" & -"# the file system. \n" & -"/dev/fd0 /mnt/floppy auto defaults,noauto,user 0 0 \n" & -"#/dev/fd1 /mnt/floppy auto defaults,noauto,user 0 0 \n\n" & -"# If you have a ls-120 floppy drive, it could be on /dev/hda b c d etc.\n" & -"#/dev/hdd /mnt/ls120 auto defaults,noauto,user 0 0 \n\n" & -"# CDROM, CDWRITER, DVD \n" & -"/dev/cdrom /media/cdrom iso9660 defaults,noauto,ro,user 0 0 \n" & -"#/dev/cdwriter /media/cdwriter iso9660 defaults,noauto,rw,user 0 0 \n" & -"#/dev/dvd /media/dvd auto defaults,noauto,ro,user 0 0\n\n" & -"# NFS file systems:\n" & -"#linux01.gwdg.de:/suse/6.3/i386.de /mnt/nfs nfs defaults 0 0\n\n" & -"# proc file system:\n" & -"proc /proc proc defaults 0 0\n\n" & -"# Unix98 devpts filesystem: \n" & -"none /dev/pts devpts gid=5,mode=666 0 0\n\n" & -"# Shared memory filesystem: \n" & -"tmpfs /dev/shm tmpfs defaults 0 0 \n\n" & -"# Basic USB filesystem\n" & -"sysfs /sys sysfs defaults 0 0\n" & -"usbfs /proc/bus/usb usbfs rw,devmode=0666 0 0\n\n" & -"# example of a VFAT USB pendrive\n" & -"#/dev/sda1 /mnt/pendrive vfat fmask=111,dmask=0,noauto,user,quiet,shortname=mixed 0 0\n\n" & -"# Swap partitions\n" & -"# The 'sw' option means auto activating with 'swapon -a'.\n" -IF ClsPartSel.sSwap THEN - sFstab = sFstab & gb.NewLine & - ClsPartSel.sSwap & Space(5) & "none" & Space(5) & "swap" & Space(5) & "sw" & Space(5) & "0" & Space(5) & "0" -END IF -' Wheewww!... that's the whole fstab there... Please fix the win partitions - - - - -END -PUBLIC FUNCTION fS_oPTIONS(sType AS String) AS String - - DIM sMntOpts AS String - - SELECT CASE LCase(sType) - CASE "reiserfs" - sMntOpts = "noatime" - CASE "vfat" - sMntOpts = "fmask=111,dmask=0,gid=users,shortname=mixed,quiet,user" - CASE "ntfs" - sMntOpts = "umask=0,gid=users,user" - CASE "ext2", "ext3" - sMntOpts = "defaults" - CASE ELSE - sMntOpts = "defaults" - END SELECT - - RETURN sMntOpts - - -END |