|
From: <cod...@go...> - 2008-12-30 22:33:09
|
Author: M0...@gm...
Date: Tue Dec 30 13:01:20 2008
New Revision: 442
Added:
branches/iVL/FrmMediaCheck.class
branches/iVL/FrmMediaCheck.form
branches/iVL/MdlVerifyMedia.module
branches/iVL/images/throbber.gif (contents, props changed)
Modified:
branches/iVL/.lang/FrmSelISO.pot
branches/iVL/.lang/MdlCore.pot
branches/iVL/.project
branches/iVL/FrmSelISO.class
branches/iVL/FrmSelISO.form
branches/iVL/MdlConfLilo.module
branches/iVL/MdlCore.module
Log:
- Implemented installation media verifyer
- Attempt to fix cdrom detection problems
Modified: branches/iVL/.lang/FrmSelISO.pot
==============================================================================
--- branches/iVL/.lang/FrmSelISO.pot (original)
+++ branches/iVL/.lang/FrmSelISO.pot Tue Dec 30 13:01:20 2008
@@ -26,35 +26,39 @@
msgid "to begin installating"
msgstr ""
-#: FrmSelISO.class:81
+#: FrmSelISO.class:83
msgid "Unable to locate any installable media."
msgstr ""
-#: FrmSelISO.class:87
+#: FrmSelISO.class:91
msgid "Select installation media from the list below"
msgstr ""
-#: FrmSelISO.class:116
+#: FrmSelISO.class:122
msgid "Unable to identify distro."
msgstr ""
-#: FrmSelISO.class:151
+#: FrmSelISO.class:157
msgid "Minimum Disk Space Requirements"
msgstr ""
-#: FrmSelISO.class:256
+#: FrmSelISO.class:270
msgid "No installable images found."
msgstr ""
-#: FrmSelISO.class:262
+#: FrmSelISO.class:276
msgid "Select which VectorLinux version you wish to install from the list
below"
msgstr ""
-#: FrmSelISO.class:267
+#: FrmSelISO.class:281
msgid "TextLabel1"
msgstr ""
-#: FrmSelISO.class:272
+#: FrmSelISO.class:286
msgid "Search Again"
+msgstr ""
+
+#: FrmSelISO.class:297
+msgid "Verify Installation Files"
msgstr ""
Modified: branches/iVL/.lang/MdlCore.pot
==============================================================================
--- branches/iVL/.lang/MdlCore.pot (original)
+++ branches/iVL/.lang/MdlCore.pot Tue Dec 30 13:01:20 2008
@@ -18,99 +18,99 @@
msgid "Working ... Please Wait"
msgstr ""
-#: MdlCore.module:251
+#: MdlCore.module:259
msgid "Scanning system for installable media. Please wait ..."
msgstr ""
-#: MdlCore.module:267
+#: MdlCore.module:275
msgid "No Installable Media Found"
msgstr ""
-#: MdlCore.module:269
+#: MdlCore.module:277
msgid "Setup was unable to find any installable media on your system.
Please insert your VectorLinux "
msgstr ""
-#: MdlCore.module:269
+#: MdlCore.module:277
msgid "installation CD and click"
msgstr ""
-#: MdlCore.module:269
+#: MdlCore.module:277
msgid "to try again"
msgstr ""
-#: MdlCore.module:430
+#: MdlCore.module:438
msgid "Build Date: "
msgstr ""
-#: MdlCore.module:430
+#: MdlCore.module:438
msgid "MINIMUM REQUIREMENTS"
msgstr ""
-#: MdlCore.module:435
+#: MdlCore.module:443
msgid "Setup is unable to find SETUP.CONF in your install media. This
could be symptoms of a bad burn or a bad ISO"
msgstr ""
-#: MdlCore.module:508
+#: MdlCore.module:516
msgid "Cannot find SETUP.CONF"
msgstr ""
-#: MdlCore.module:516
+#: MdlCore.module:524
msgid "Preparation"
msgstr ""
-#: MdlCore.module:517
+#: MdlCore.module:525
msgid "Language Selection"
msgstr ""
-#: MdlCore.module:518
+#: MdlCore.module:526
msgid "Find installation media"
msgstr ""
-#: MdlCore.module:519
+#: MdlCore.module:527
msgid "Disk Partitioning"
msgstr ""
-#: MdlCore.module:520
+#: MdlCore.module:528
msgid "Software Selection"
msgstr ""
-#: MdlCore.module:522
+#: MdlCore.module:530
msgid "Installation"
msgstr ""
-#: MdlCore.module:523
+#: MdlCore.module:531
msgid "Installation Summary"
msgstr ""
-#: MdlCore.module:525
+#: MdlCore.module:533
msgid "Install Operating System"
msgstr ""
-#: MdlCore.module:526
+#: MdlCore.module:534
msgid "System Configuration"
msgstr ""
-#: MdlCore.module:527
+#: MdlCore.module:535
msgid "Boot Menu Options"
msgstr ""
-#: MdlCore.module:528
+#: MdlCore.module:536
msgid "Regional Settings"
msgstr ""
-#: MdlCore.module:529
+#: MdlCore.module:537
msgid "System Administrator"
msgstr ""
-#: MdlCore.module:530
+#: MdlCore.module:538
msgid "User Accounts"
msgstr ""
-#: MdlCore.module:531
+#: MdlCore.module:539
msgid "Network Configuration"
msgstr ""
-#: MdlCore.module:532
+#: MdlCore.module:540
msgid "Final Hardware Configuration"
msgstr ""
Modified: branches/iVL/.project
==============================================================================
--- branches/iVL/.project (original)
+++ branches/iVL/.project Tue Dec 30 13:01:20 2008
@@ -1,5 +1,5 @@
# Gambas Project File 2.0
-# Compiled with Gambas 2.9.0
+# Compiled with Gambas 2.10.0
Title=VectorLinux Installer
Startup=MdlCore
Version=0.1.14
Added: branches/iVL/FrmMediaCheck.class
==============================================================================
--- (empty file)
+++ branches/iVL/FrmMediaCheck.class Tue Dec 30 13:01:20 2008
@@ -0,0 +1,87 @@
+' 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 sEntry AS String
+
+
+PUBLIC SUB Form_Open()
+MdlVerifyMedia.iProcSig = 0
+ME.Height = ME.pnlTop.Top + ME.pnlTop.Height
+MdlCore.LOCK_GUI()
+FMain.Enabled = FALSE
+ME.tlBanner.Text = "<b>" & ME.tlBanner.Text & "</b>"
+ME.tlVerifyDetails.Text = ("Verifying the installation files can help you
avoid an unsuccessful install.") & "<br><br>" &
+("Keep in mind however, that this process can take a while (expect it to
take just as Long as a real installation process)") & "<br><br>" &
+("Click") & Space(1) & btstart.Text & Space(1) & ("to begin. You may
press") & Space(1) & btstop.Text & Space(1) & ("to stop the process" &
+Space(1) & "at any time.")
+'Message(sEntry)
+
+END
+
+
+
+
+PUBLIC SUB Form_Close()
+
+ WITH FMain
+ .btQuit.Enabled = TRUE
+ .btnext.Enabled = TRUE
+ .btnext.ForeColor = Color.Black
+ .btQuit.ForeColor = Color.Black
+ .Enabled = TRUE
+ END WITH
+
+END
+
+PUBLIC SUB tlVerifyDetails_MouseDown()
+
+
+
+END
+
+PUBLIC SUB btstart_Click()
+
+
+ 'ME.ProgressBar1.Visible = TRUE
+ btstart.Enabled = FALSE
+ btstop.Enabled = TRUE
+ ME.ProgressBar1.Visible = TRUE
+ WAIT 1
+ MdlVerifyMedia.PERFORM_MEDIA_CHECK(sEntry)
+
+END
+
+PUBLIC SUB btClose_Click()
+
+ ME.Close
+
+END
+
+PUBLIC SUB btstop_Click()
+ LAST.Enabled = FALSE
+ MdlVerifyMedia.iProcSig = 225 ' send the error message
+ MdlVerifyMedia.hproc.Kill
+ MdlVerifyMedia.iProcSig = 225
+ FrmMediaCheck.btClose.Enabled = TRUE
+ FrmMediaCheck.btstart.Enabled = TRUE
+
+END
+
+PUBLIC SUB Form_Resize()
+
+
+
+END
Added: branches/iVL/FrmMediaCheck.form
==============================================================================
--- (empty file)
+++ branches/iVL/FrmMediaCheck.form Tue Dec 30 13:01:20 2008
@@ -0,0 +1,56 @@
+# Gambas Form File 2.0
+
+{ Form Form
+ MoveScaled(0,0,83,53)
+ Text = ("")
+ Icon = Picture["images/throbber.gif"]
+ Arrangement = Arrange.Vertical
+ { pnlTop Panel
+ MoveScaled(1,1,78,45)
+ Expand = True
+ Arrangement = Arrange.Row
+ { tlBanner TextLabel
+ MoveScaled(1,1,32,4)
+ Background = Color.SelectedBackground
+ Foreground = Color.SelectedForeground
+ Expand = True
+ Text = ("VERIFY INSTALLATION FILES")
+ Alignment = Align.Center
+ }
+ { Separator1 Separator
+ MoveScaled(2,6,67,1)
+ Expand = True
+ }
+ { tlVerifyDetails TextLabel
+ MoveScaled(2,8,72,17)
+ Expand = True
+ Text = ("")
+ }
+ { MovieBox1 MovieBox
+ MoveScaled(30,24,5,18.2857)
+ Expand = True
+ Path = "/home/vluser/devel/installer/images/throbber.gif"
+ }
+ { ProgressBar1 ProgressBar
+ MoveScaled(2,41,74,3)
+ Visible = False
+ Expand = True
+ }
+ }
+ { Panel1 Panel
+ MoveScaled(1,46,79,4)
+ { btClose Button
+ MoveScaled(31,0,13,2)
+ Text = ("Close")
+ }
+ { btstop Button
+ MoveScaled(16,0,13,2)
+ Enabled = False
+ Text = ("Stop")
+ }
+ { btstart Button
+ MoveScaled(0,0,15,1)
+ Text = ("Start")
+ }
+ }
+}
Modified: branches/iVL/FrmSelISO.class
==============================================================================
--- branches/iVL/FrmSelISO.class (original)
+++ branches/iVL/FrmSelISO.class Tue Dec 30 13:01:20 2008
@@ -77,12 +77,16 @@
IF lstInstallableImg.count = 1 AND lstInstallableImg.Find(("No
Installable Media Found")) = -1 THEN
tlBanner.Text = ("Click") & Space(1) & "\'" & FMain.btnext.text & "\'"
& Space(1) & ("to begin installating") & Space(1)&
Left(FrmSelISO.lstInstallableImg.text,
InStr(FrmSelISO.lstInstallableImg.text, "/") - 4)
+ FrmSelISO.btVerifyInstall.Enabled = TRUE
+ FrmSelISO.btVerifyInstall.ForeColor = Color.Black
ELSE IF lstInstallableImg.Find(("No Installable Media Found")) <> -1 THEN
tlBanner.Text = "<b>" & ("Unable to locate any installable media.")
& "</b>"
FMain.btnext.Enabled = FALSE
FMain.btback.Enabled = FALSE
FMain.btnext.ForeColor = Color.Gray
FMain.btback.ForeColor = Color.Gray
+ FrmSelISO.btVerifyInstall.Enabled = FALSE
+ FrmSelISO.btVerifyInstall.ForeColor = Color.Gray
ELSE
tlBanner.text = "<b>" & ("Select installation media from the list
below") & "</b>"
WITH FMain
@@ -91,6 +95,8 @@
.btnext.Enabled = TRUE
.btnext.ForeColor = Color.Black
END WITH
+ FrmSelISO.btVerifyInstall.Enabled = TRUE
+ FrmSelISO.btVerifyInstall.ForeColor = Color.Black
END IF
FMain.btnext.Enabled = TRUE
@@ -204,7 +210,8 @@
'.lstInstallableImg.Move(4, .btResCan.top, .ClientWidth -
((.lstInstallableImg.Left * 2) + .btResCan.Left))
' .lstInstallableImg.Move(.left + 4, .btResCan.Top, .Width -
(.btResCan.Width + 24), 21)
'.tlDistroDesc.Move(.lstInstallableImg.Left *
2, .lstInstallableImg.top + .lstInstallableImg.Height + 48)
- .tlDistroDesc.Move(4, .lstInstallableImg.top
+ .lstInstallableImg.Height + 24, .ClientWidth - (.tlDistroDesc.left *
2), .ClientHeight - (.tldistrodesc.top + .btrescan.height))
+ .tlDistroDesc.Move(4, .lstInstallableImg.top
+ .lstInstallableImg.Height + 24, .ClientWidth - (.tlDistroDesc.left *
2)) ', .ClientHeight - (.tldistrodesc.top + .btrescan.height))
+ .btVerifyInstall.Move(4, .tlDistroDesc.top + .tlDistroDesc.Height + 8,
MdlObjSizer.get_object_width(.btVerifyInstall.Text) + 36, 21)
'.FullScreen = TRUE
END WITH
@@ -231,5 +238,11 @@
PUBLIC SUB Form_Show()
Form_Open()
+
+END
+
+PUBLIC SUB btVerifyInstall_Click()
+ FrmMediaCheck.sEntry = Trim(ME.lstInstallableImg.Text)
+ FrmMediaCheck.ShowDialog()
END
Modified: branches/iVL/FrmSelISO.form
==============================================================================
--- branches/iVL/FrmSelISO.form (original)
+++ branches/iVL/FrmSelISO.form Tue Dec 30 13:01:20 2008
@@ -1,7 +1,7 @@
# Gambas Form File 2.0
{ Form Form
- MoveScaled(0,0,63,41)
+ MoveScaled(0,0,63,52)
Text = ("")
FullScreen = True
{ lstInstallableImg ComboBox
@@ -14,7 +14,7 @@
Text = ("Select which VectorLinux version you wish to install from the
list below")
}
{ tlDistroDesc TextLabel
- MoveScaled(1,16,60,23)
+ MoveScaled(1,15,60,27)
Text = ("TextLabel1")
}
{ btResCan Button
@@ -24,5 +24,11 @@
}
{ hrSep Separator
MoveScaled(2,7,43,1)
+ }
+ { btVerifyInstall Button
+ MoveScaled(1,43,26,3)
+ Enabled = False
+ Text = ("Verify Installation Files")
+ Picture = Picture["icon:/small/apply"]
}
}
Modified: branches/iVL/MdlConfLilo.module
==============================================================================
--- branches/iVL/MdlConfLilo.module (original)
+++ branches/iVL/MdlConfLilo.module Tue Dec 30 13:01:20 2008
@@ -310,15 +310,6 @@
EXEC ["mount", "-o", "bind", "/dev", ClsGlobal.sTargetMnt &/ "dev"] WAIT
-' ' '
-' ' ' ' Mount home directory for user accounts
-' ' ' FOR EACH cbox IN MdlPartSel.oMountPoints
-' ' ' IF cbox.Text = "/home" THEN
-' ' ' EXEC ["mount", CStr(cbox.Tag), ClsGlobal.sTargetMnt
&/ "home"] WAIT
-' ' ' END IF
-' ' ' NEXT
-' ' '
-
'We will run the commands neccisary to setup the newly installed system
here
EXEC ["mkdir", "-p", ClsGlobal.sTargetMnt &/ "var" &/ "log" &/ "setup"]
WAIT
Modified: branches/iVL/MdlCore.module
==============================================================================
--- branches/iVL/MdlCore.module (original)
+++ branches/iVL/MdlCore.module Tue Dec 30 13:01:20 2008
@@ -137,7 +137,7 @@
DIM sCmd AS String
DIM sResults AS String
DIM sList AS String
-DIM sDrives AS String[]
+DIM sDrives, sDumparr AS String[]
DIM sDrive AS String
DIM sMountPoint AS String
DIM sDump AS String
@@ -151,6 +151,14 @@
'sCmd = "cat /proc/sys/dev/cdrom/info | grep \"drive name\" |cut -f 2
-d\':\'|xargs -n 2"
sCmd = "probedisk|cut -d\'|\' -f1|cut -d\'/\' -f3"
SHELL sCmd TO sList
+ ' additional check to make sure cdroms are detected
+ SHELL "cat /proc/sys/dev/cdrom/info | grep \"^drive name\" | cut -f
2 -d\':\'|xargs -n 2" TO sDump
+ sDump = Trim(sDump)
+ sDumparr = Split(sdump, "\n")
+ FOR i = 0 TO sDumparr.count - 1
+ IF InStr(sList, Trim(sDumparr[i])) = FALSE THEN sList =
sList & Space(1) & Trim(sDumparr[i])
+ NEXT
+
sList = sList & Space(1) & sResults
sList = Trim(sList)
'PRINT sList
Added: branches/iVL/MdlVerifyMedia.module
==============================================================================
--- (empty file)
+++ branches/iVL/MdlVerifyMedia.module Tue Dec 30 13:01:20 2008
@@ -0,0 +1,127 @@
+' 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/>.
+
+' <uel_sk8s> flog="/tmp/check-bulk.log"
+' <uel_sk8s> lzmadec <$1 > /dev/null 2>&1
+' <uel_sk8s> if [ $? = 0 ]; then
+' <uel_sk8s> echo "check-bulk $1 OK" >> $flog
+' <uel_sk8s> exit 0
+' <uel_sk8s> else
+' <uel_sk8s> echo "check-bulk $1 FAILED" >> $flog
+' <uel_sk8s> exit 1
+' <uel_sk8s> fi
+
+PUBLIC hproc AS Process
+PUBLIC iProcSig AS Integer ' 225 will indicate stop now and dont continue
+
+PUBLIC FUNCTION VERIFY_BULK(sPathToBulk AS String) AS Integer
+
+ 'DIM hproc AS Process
+ DIM iRetVal AS Integer
+
+ PRINT "Verifying " & sPathToBulk
+ 'RETURN
+ 'hproc = EXEC ["lzmadec", "< ", sPathToBulk, " >", "/dev/null"] WAIT
+ hproc = SHELL "lzmadec < " & sPathToBulk & " > /dev/null" ' WAIT
+ WAIT 1
+ IF hproc.State = Process.Running THEN
+ REPEAT
+ WAIT
+ FrmMediaCheck.MovieBox1.Playing = TRUE
+ FrmMediaCheck.btClose.Enabled = FALSE
+ FrmMediaCheck.btstart.Enabled = FALSE
+ UNTIL
+ iProcSig = 225 OR hproc.State = Process.Stopped
+ END IF
+
+ iRetVal = hproc.Value
+ RETURN iRetVal
+
+END
+
+PUBLIC SUB PERFORM_MEDIA_CHECK(sEntry AS String)
+ DIM sDevice AS String
+ DIM sImage AS String
+ DIM sBulkList AS String
+ DIM sArrBulks AS String[]
+ DIM sBulk AS String
+ DIM i, iBlkCnt, iRes AS Integer
+ DIM sBulkBasePath AS String = "/mnt/loop/veclinux"
+
+ FrmMediaCheck.ProgressBar1.Visible = TRUE
+
+ sDevice = Right(sEntry, Len(sEntry) - InStr(sEntry, "/") + 1)
+ IF InStr(sEntry, ".iso on") THEN
+ ' this is an iso, we must mount the drive and then the ISO
+ sDevice = Right(sEntry, Len(sEntry) - InStr(sEntry, "/"))
+ sImage = Left(sEntry, InStr(sEntry, " "))
+ ' perform the mounting
+ EXEC ["mkdir", "/mnt/loop"] WAIT
+ EXEC ["mkdir", "/mnt/source"] WAIT
+ EXEC ["mount", sDevice, "/mnt/source"] WAIT
+ EXEC ["mount", "-o", "loop", "/mnt/source" &/
sImage, "/mnt/loop"] WAIT
+ ELSE ' Actual CD Media
+ EXEC ["mkdir", "/mnt/source"] WAIT
+ EXEC ["mount", sDevice, "/mnt/loop"] ' Mount it to loop, just to
keep this consistant.
+
+ END IF
+
+ ' Get the list of bulks on this install
+ SHELL "cat " & sBulkBasePath &/ "SETUP.CONF" & Space(1) & "| grep
\"^BULK\" | cut -f 1 -d \':\'" TO sBulkList
+ ' ^ That produces something like "BULK0='required/veclinux.tlz", so
we need to strip it still
+ sBulkList = Trim(sBulkList)
+ sArrBulks = Split(sBulkList, "\n")
+ iBlkCnt = sArrBulks.Count - 1
+ FOR i = 0 TO sArrBulks.Count - 1
+ sBulk = Right(sArrBulks[i], Len(sArrBulks[i]) -
InStr(sArrBulks[i], "\'"))
+ IF Exist(sBulkBasePath &/ sBulk) AND iProcSig <> 225 THEN
+ FrmMediaCheck.ProgressBar1.Value = i / iBlkCnt
+ IF ME.VERIFY_BULK(sBulkBasePath &/ sBulk) <> 0 AND
iProcSig <> 225 THEN
+ FrmMediaCheck.MovieBox1.Playing = FALSE
+ Message.Error(sBulk & Space(1) & ("has failed
the test!") & "<br>" &
+ ("This could either mean your download or burn
process was corrupted"))
+ BREAK
+ END IF
+ 'Message(ME.VERIFY_BULK(sBulkBasePath &/ sBulk))
+ 'Message(sBulk)
+ ELSE IF iProcSig = 225 THEN
+ FrmMediaCheck.MovieBox1.Playing = FALSE
+ 'Message.Error("Process abort signal received from user")
+ BREAK
+ RETURN
+
+ END IF
+ WAIT 1
+ NEXT
+
+ EXEC ["umount", "/mnt/source"] WAIT
+ EXEC ["umount", "/mnt/loop"] WAIT
+
+ IF iProcSig = 225 THEN
+ Message.Error("Process stopped by user")
+ FrmMediaCheck.MovieBox1.Playing = FALSE
+ FrmMediaCheck.btstart.Enabled = TRUE
+ FrmMediaCheck.btClose.Enabled = TRUE
+ RETURN
+ END IF
+ Message.Info("All tests passed. You can continue to install safely")
+ FrmMediaCheck.MovieBox1.Playing = FALSE
+ FrmMediaCheck.btstop.Enabled = FALSE
+ FrmMediaCheck.btClose.Enabled = TRUE
+ FrmMediaCheck.btstart.Enabled = TRUE
+END
+
+
Added: branches/iVL/images/throbber.gif
==============================================================================
Binary file. No diff available.
|