From: <cod...@go...> - 2008-07-31 17:46:48
|
Author: ue...@gm... Date: Thu Jul 24 17:39:19 2008 New Revision: 72 Modified: branches/iVL/FrmInstallSys.class branches/iVL/FrmInstallSys.form branches/iVL/MdlDiskPart.module branches/iVL/MdlInstallSys.module branches/iVL/MdlPartFrmt.module branches/iVL/Order Log: added code to update progress bar Modified: branches/iVL/FrmInstallSys.class ============================================================================== --- branches/iVL/FrmInstallSys.class (original) +++ branches/iVL/FrmInstallSys.class Thu Jul 24 17:39:19 2008 @@ -80,3 +80,4 @@ .pbInstallProg.Move(.tlCurrPkg.Left, .tlCurrPkg.Height * 3, .tlCurrPkg.Width, 24) END WITH END + Modified: branches/iVL/FrmInstallSys.form ============================================================================== --- branches/iVL/FrmInstallSys.form (original) +++ branches/iVL/FrmInstallSys.form Thu Jul 24 17:39:19 2008 @@ -11,11 +11,19 @@ MoveScaled(1,10,76,19) Text = ("") { tlCurrPkg TextLabel - MoveScaled(1,1,45,3.375) - Text = ("TextLabel1") + MoveScaled(1,1,73,3) + Text = ("Installing ...") } { pbInstallProg ProgressBar - MoveScaled(1,7,25,3) + MoveScaled(1,5,44,3) + Visible = False + } + { pbInstallProg2 ProgressBar + MoveScaled(1,13,44,3) + } + { tlCurrPkg2 TextLabel + MoveScaled(1,9,45,3.1429) + Text = ("Total progress") } } } Modified: branches/iVL/MdlDiskPart.module ============================================================================== --- branches/iVL/MdlDiskPart.module (original) +++ branches/iVL/MdlDiskPart.module Thu Jul 24 17:39:19 2008 @@ -27,13 +27,13 @@ 'Desktop.Find("", "GParted") - IF Exist("/usr/sbin/gparted") = FALSE THEN + IF Exist("/usr/bin/gparted") = FALSE THEN Message.Error("Gparted was not found on this system. Please install gparted and try again") RETURN END IF FrmDiskPart.tlBanner.Text = "<h3>Loading gparted .... Please wait</h3>" - SHELL "/usr/sbin/gparted" + SHELL "/usr/bin/gparted" WAIT 3 sTitle = "GParted" Modified: branches/iVL/MdlInstallSys.module ============================================================================== --- branches/iVL/MdlInstallSys.module (original) +++ branches/iVL/MdlInstallSys.module Thu Jul 24 17:39:19 2008 @@ -25,7 +25,7 @@ ' this is where we need to set the mount target 'ClsGlobal.sTargetMnt = "/mnt/target" - ClsGlobal.sTargetMnt = "/home/moises/mnt/target" ' just for testing now. + ClsGlobal.sTargetMnt = "/mnt/target" ' just for testing now. IF Exist(ClsGlobal.sTargetMnt) = FALSE THEN TRY MKDIR ClsGlobal.sTargetMnt END IF @@ -35,12 +35,12 @@ SHELL "umount " & ClsGlobal.sTargetMnt WAIT 'clear the mount point '/DISABLED FOR TESTING INSTALL ONLY - ' ' ' ' 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 + SHELL "mount " & ClsPartSel.sRoot & Space(1) & ClsGlobal.sTargetMnt 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 + 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 @@ -173,7 +173,7 @@ 'Message(sFstab) IF NOT ClsGlobal.sTargetMnt OR ClsGlobal.sTargetMnt = "" THEN - ClsGlobal.sTargetMnt = "/home/moises/mnt/target" + ClsGlobal.sTargetMnt = "/mnt/target" END IF ';Message(ClsGlobal.sTargetMnt &/ "etc") @@ -232,7 +232,12 @@ DIM sOptPkgPath AS String DIM iVal AS Float DIM sBasePath AS String = ClsGlobal.sSourceMnt &/ "veclinux" - ClsGlobal.sTargetMnt = "/home/moises/mnt/target" + DIM iProgress AS Float + DIM iMBProgress AS Float + DIM ipct AS Float + DIM iMinpct AS Float = ".01" + DIM iMaxpct AS Float = ".99" + ClsGlobal.sTargetMnt = "/mnt/target" sFile = Split(File.Load(Temp$("SETUP.CONF")), "\n") FOR i = 0 TO sFile.count - 1 sLine = Trim(sFile[i]) @@ -247,36 +252,44 @@ sPakDesc = sEntry[2] 'PRINT sBasePath &/ sPakPath & " = " & sPakDesc & " size= " & CStr(sPakSize) ' figure out the sizing and the progrss meter - iTotalSize = 0 - sTargetSize = 0 - - SHELL "export gsize=$(df| grep /dev/hda3) && echo $gsize | cut -f3 -d \' \'" TO sTargetSize + SHELL "export gsize=$(df| grep " & ClsPartSel.sRoot & " ) && echo $gsize | cut -f3 -d \' \'" TO sTargetSize 'Message(CStr(sTargetSize)) iTotalSize = CInt(sTargetSize) + CInt(sPakSize) - 'RETURN + FrmInstallSys.tlCurrPkg.Text = "Installing " & sPak PRINT "Installing " & sPakPath & " Total size (KB) = " & CStr(sPakSize) - FrmInstallSys.tlCurrPkg.Text = "Installing " & sPakDesc & " ... " hproc = SHELL "lzmadec <" & sBasePath &/ sPakPath & " | tar -xp -C " & ClsGlobal.sTargetMnt WAIT 1 IF hproc.State = Process.Running THEN REPEAT - WAIT 3 + WAIT 1 ' get the actual size at each snap - SHELL "export tsize=$(df | grep /dev/hda3) && echo $tsize | cut -f3 -d \' \'" TO iCurrSize + SHELL "export gsize=$(df| grep " & ClsPartSel.sRoot & " ) && echo $gsize | cut -f3 -d \' \'" TO iCurrSize iCurrSize = Trim(CStr(iCurrSize)) - 'iVal = Round(CInt(iCurrSize) / CInt(iTotalSize), -2) 'CInt(iTotalSize) / CInt(iCurrSize) - iVal = Round((iTotalSize - iCurrSize) / iTotalSize, -2) + iProgress = CInt(iCurrSize - sTargetSize) + iMBProgress = iProgress / 1024 + IF iMBProgress > CFloat(sPakSize) THEN + iVal = iMaxpct + ELSE + ipct = 100 * iMBProgress + iVal = ipct / sPakSize * 10 + IF iVal < iMinpct THEN + iVal = iMinpct + ENDIF + IF iVal > iMaxpct THEN + iVal = iMaxpct + ENDIF + ENDIF 'FrmInstallSys.pbInstallProg.Value = (CInt(iCurrSize) / CInt(iTotalSize)) * 0.100 'PRINT CStr(iCurrSize) & "/" & CStr(iTotalSize) & " = " & iVal & "%" - PRINT CStr(iTotalSize) & "/" & CStr(iCurrSize) & " = " & iVal + PRINT CStr(iCurrSize) & "/" & CStr(iTotalSize) & " = " & iVal & "%" FrmInstallSys.pbInstallProg.Value = iVal - + UNTIL hproc.State = Process.Stopped END IF - PRINT sPakDesc & " is installed... " + PRINT sPak & " is installed... " 'PRINT "Needs to install " & sPak END IF NEXT @@ -296,7 +309,7 @@ DIM sExt AS String DIM sCMD AS String - ClsGlobal.sTargetMnt = "/home/moises/mnt/target" + ClsGlobal.sTargetMnt = "/mnt/target" PRINT "Installing bulk packages ... " FOR EACH sPkg IN RDir(ClsGlobal.sSourceMnt &/ "veclinux" &/ "required") Modified: branches/iVL/MdlPartFrmt.module ============================================================================== --- branches/iVL/MdlPartFrmt.module (original) +++ branches/iVL/MdlPartFrmt.module Thu Jul 24 17:39:19 2008 @@ -31,9 +31,11 @@ CASE "ext3" sCommand = "mke2fs -q -j " & saddr CASE "reiserfs" - sCommand = "mkreiserfs --format 3.6 -ff " & sAddr + sCommand = "mkreiserfs --format 3.6 -q " & sAddr CASE "xfs" sCommand = "mkfs.xfs -f " & sAddr + CASE "jfs" + sCommand = "mkfs.jfs -q " & sAddr END SELECT hproc = SHELL sCommand & " | echo \'FAILED\'" FOR READ Modified: branches/iVL/Order ============================================================================== --- branches/iVL/Order (original) +++ branches/iVL/Order Thu Jul 24 17:39:19 2008 @@ -4,18 +4,4 @@ (09:55:32 AM) uelsk8s: 4 $mntpint/packages/required (09:55:32 AM) uelsk8s: 5 $MNTPNT/veclinux/required/vlconfig2.tlz (09:55:57 AM) uelsk8s: because they are not listed in packages.txt for the user to select from -(09:56:13 AM) uelsk8s: they have to be installed or the install will break - - -10:38:40 AM) uelsk8s: :) -(10:39:45 AM) uelsk8s: mbused() { -(10:39:46 AM) uelsk8s: MB=0 -(10:39:46 AM) uelsk8s: for DEV in $DEVICES ; do -(10:39:46 AM) uelsk8s: line=`df | grep $DEV` -(10:39:46 AM) uelsk8s: if [ "$line" ]; then -(10:39:46 AM) uelsk8s: mb1=`echo $line | cut -f 3 -d ' '` -(10:39:48 AM) uelsk8s: MB=`expr $MB '+' $mb1` -(10:39:50 AM) uelsk8s: fi -(10:39:52 AM) uelsk8s: done; -(10:39:54 AM) uelsk8s: echo $MB -(10:39:56 AM) uelsk8s: } \ No newline at end of file +(09:56:13 AM) uelsk8s: they have to be installed or the install will break \ No newline at end of file |