From: <cod...@go...> - 2009-04-24 21:46:36
|
Author: M0...@gm... Date: Fri Apr 24 13:52:36 2009 New Revision: 538 Modified: branches/speedy/Conf0.class branches/speedy/Conf1.class branches/speedy/Conf2.class branches/speedy/Conf3.class branches/speedy/Conf3a.class branches/speedy/Conf4.class branches/speedy/Conf4.form branches/speedy/Conf5.class branches/speedy/Conf5.form branches/speedy/MdlBootMngr.module branches/speedy/MdlStartUp.module branches/speedy/Step1.class branches/speedy/Step1.form branches/speedy/Step6.class Log: - Began implementing new OS detection method on boot manager Modified: branches/speedy/Conf0.class ============================================================================== --- branches/speedy/Conf0.class (original) +++ branches/speedy/Conf0.class Fri Apr 24 13:52:36 2009 @@ -223,8 +223,8 @@ .TLoSlIST.Text = "<b>" & UCase(.TLoSlIST.Text) & "</b>" END WITH 'ME.Fake_Names() - ME.List_Other_Linuxes(ME.TsOsList) - ME.Update_Default_boot_choices() + 'ME.List_Other_Linuxes(ME.TsOsList) + 'ME.Update_Default_boot_choices() MdlBootMngr.Display_Bootmanager_Target_Options(ME.cbTarget) @@ -232,10 +232,6 @@ PUBLIC FUNCTION GetNext() AS String - ClsGlobal.fRunningMainForm.listview1["Step5"].picture = MdlStartUp.pDone - ClsGlobal.fRunningMainForm.listview1["Step4"].picture = MdlStartUp.pDone - ClsGlobal.fRunningMainForm.listview1["Step6"].picture = MdlStartUp.pNow - RETURN "Conf1" END @@ -340,13 +336,185 @@ END PUBLIC SUB rbGrub_Click() - + DIM i AS Integer + DIM $ob AS Object + ME.Toggle_window_controls(TRUE) + FOR i = 0 TO TsOsList.Count - 1 + FOR EACH $ob IN TsOsList[i].Children + $ob.Delete + NEXT + TRY TsOsList[i].Delete + NEXT + TsOsList.Count = 1 + ME.PROBE_SYSTEM_FOR_OS(LCase(LAST.text)) END PUBLIC SUB rbLilo_Click() - + DIM i AS Integer + DIM $ob AS Object ME.Toggle_window_controls(TRUE) + FOR i = 0 TO TsOsList.Count - 1 + FOR EACH $ob IN TsOsList[i].Children + $ob.Delete + NEXT + TRY TsOsList[i].Delete + NEXT + TsOsList.Count = 1 + ME.PROBE_SYSTEM_FOR_OS(LCase(LAST.text)) + +END +PUBLIC SUB PROBE_SYSTEM_FOR_OS(sBootManager AS String) + + DIM sDump, sOs, sRoot, sLongDesc, sType, sTitle AS String + DIM i AS Integer + DIM sOsList, sOsLine, sBootLine, sDumparr AS String[] + DIM sKernel, sInitrd, sAppendLine AS String + DIM sBootargs AS String + + sOsList = Split(Trim(File.Load("/tmp/os.lst")), gb.NewLine) + FOR i = 0 TO sOsList.Max + sOsLine = Split(Trim(sOsList[i]), ":") + sType = Trim(sOsLine[3]) + sLongDesc = Trim(sOsLine[1]) + sOs = Trim(sOsLine[2]) + sRoot = Trim(sOsLine[0]) + IF sBootManager LIKE "lilo" THEN + sTitle = sOs + ELSE + sTitle = sLongDesc + END IF + + ' Message(sLongDesc & " was found in " & sRoot) + ' -= NOW I NEED TO GET THE KERNEL, INITRD AND APPEND LINES FOR THIS OS. =- + IF sType LIKE "linux" THEN + ' this function will return an array separated by "," in this order + ' /path/to/kernel, /path/to/initrd, appendline here + + sBootargs = MdlBootMngr.Get_OS_Boot_Params(sRoot) + + IF NOT (sBootargs) THEN + '= CAN NOT FIND BOOT ARGUMENTS FOR THIS OS =' + PRINT ("Unable to find boot arguments for OS in") & Space(1) & sRoot + RETURN + ELSE + sBootLine = Split(sbootargs, ",") + sKernel = sBootLine[0] + sInitrd = sBootLine[1] + sAppendLine = sBootLine[2] + PRINT ("Offer") & Space(1) & sTitle & Space(1) & ("as a bootable choice") + PRINT " --\\ Kernel=" & sKernel + PRINT " --\\ Initrd=" & sInitrd + 'print " --\ Options=" & + TsOsList.Current.Text = sRoot + Populate_linux_tab(sRoot, sTitle, sKernel, sInitrd, sAppendLine, sBootManager) + END IF + + END IF + + NEXT + END + +PUBLIC SUB Populate_linux_tab($OsRoot AS String, $Title AS String, $kernel AS String, $initrd AS String, $appendline AS String, sBootLoader AS String) + + DIM $tb AS TextBox + DIM $tl AS textlabel + DIM $cb AS ComboBox + DIM $cont AS HBox + DIM $chk AS CheckBox + + + $cont = NEW HBox(ME.TsOsList) + $cont.Height = 12 + $cont.Expand = TRUE + $cont = NEW HBox(ME.TsOsList) + $cont.Height = 28 + $cont.Expand = TRUE + $cont.Spacing = 4 + $cont.Padding = 2 + + $tl = NEW TextLabel($cont) + WITH $tl + .text = ("Title") '--------------- title label ----------- + .Expand = FALSE + .height = 28 + .Width = 64 + .Alignment = Align.Left + END WITH + $tb = NEW TextBox($cont) AS "OsNameBox" ' ------------ Title text box ------------ + WITH $tb + .Height = 28 + .Tag = $OsRoot + .Expand = TRUE + .Text = $Title + IF sBootLoader LIKE "lilo" THEN + .MaxLength = 15 + ELSE + .MaxLength = 64 + END IF + END WITH + $tl = NEW TextLabel($cont) '---------------------------- initrd label ------------- + WITH $tl + .Height = 28 + .Text = ("Initial RAM Disk") + .Alignment = Align.Left + .Width = 100 + .Expand = FALSE + END WITH + $cb = NEW ComboBox($cont) '-------------------------- initrd combobox -------------- + WITH $cb + .ReadOnly = TRUE + .Tag = $OsRoot + .List = [$initrd] + .Height = 28 + .Expand = FALSE + .Width = 200 + END WITH + + $cont = NEW HBox(TsOsList) ' --------------------------- new container (hbox) ---------- + $cont.Height = 28 + $cont.Expand = TRUE + + $tl = NEW TextLabel($cont) ' ------------------------ append label ---------------------- + WITH $tl + .Text = ("Kernel boot options") + .Width = 150 + .Height = 28 + .Expand = FALSE + .Alignment = Align.Left + END WITH + $tb = NEW TextBox($cont) + WITH $tb + .Height = 28 + .Tag = $OsRoot + IF InStr($AppendLine, "append") THEN + .Text = Right($appendline, Len($appendline) - Len("append")) + + ELSE + .Text = $appendline + END IF + .Text = Trim(Replace(.Text, "\"", "")) + IF Left(Trim(.Text)) = "=" THEN + .Text = Right(.Text, Len(.Text) - 1) + END IF + .Text = Trim(.Text) + + .Expand = TRUE + END WITH + + $chk = NEW CheckBox(TsOsList) AS "IncludeOs" + WITH $chk + .Expand = TRUE + .Value = TRUE + .Height = 28 + .Tag = $OsRoot + .Text = ("Include this Operating System in boot menu") + END WITH + + + +END + Modified: branches/speedy/Conf1.class ============================================================================== --- branches/speedy/Conf1.class (original) +++ branches/speedy/Conf1.class Fri Apr 24 13:52:36 2009 @@ -23,14 +23,10 @@ ' default the time zone to us/central ME.lbTmZone[ME.lbTmZone.Find("US/Central")].Selected = TRUE - END PUBLIC FUNCTION GetNext() AS String - - ClsGlobal.fRunningMainForm.listview1["Step6"].picture = MdlStartUp.pDone - ClsGlobal.fRunningMainForm.listview1["Step7"].picture = MdlStartUp.pNow RETURN "Conf2" Modified: branches/speedy/Conf2.class ============================================================================== --- branches/speedy/Conf2.class (original) +++ branches/speedy/Conf2.class Fri Apr 24 13:52:36 2009 @@ -34,8 +34,6 @@ END PUBLIC FUNCTION GetNext() AS String - ClsGlobal.fRunningMainForm.listview1["Step7"].picture = MdlStartUp.pDone - ClsGlobal.fRunningMainForm.listview1["Step8"].picture = MdlStartUp.pNow RETURN "Conf3" Modified: branches/speedy/Conf3.class ============================================================================== --- branches/speedy/Conf3.class (original) +++ branches/speedy/Conf3.class Fri Apr 24 13:52:36 2009 @@ -50,7 +50,7 @@ END WITH WAIT 0.1 Button1.Enabled = ME.check_for_impartable_accounts() - ClsGlobal.fRunningMainForm.btnext.Enabled = TRUE + 'MdlMain.Display_User_Group_Choices(ME.lbUsrGrps) END PUBLIC FUNCTION GetNext() AS String @@ -71,7 +71,6 @@ obj.delete NEXT MdlMain.Display_User_Group_Choices(ME.lbUsrGrps) - ClsGlobal.fRunningMainForm.btnext.Enabled = TRUE END @@ -160,7 +159,9 @@ '-== Make sure we have valid entries before trying to create a user account ==- IF Check_Text_Entry() = FALSE THEN IF MdlMain.CHECK_EXISTING_USER(Trim(ME.txtLogin.Text)) = FALSE THEN - MdlMain.CREATE_NEW_USER_ACCOUNT(Trim(txtLogin.Text), Trim(txtRealName.Text), btPicSel.Picture, Trim(txtPass2.Text)) ' create new account + IF MdlMain.CREATE_NEW_USER_ACCOUNT(Trim(txtLogin.Text), Trim(txtRealName.Text), btPicSel.Picture, Trim(txtPass2.Text)) > 0 THEN ' create new account while checking for errors + Message.Error(("Unable to successfully create user account. Please run VasmCC after installation is done.")) + END IF ELSE ' user exists Message.Error(("User") & Space(1) & "\"" & Trim(ME.txtLogin.Text) & "\"" & Space(1) & ("already exists in the system.") & "<br>" & ("Please select another user login name")) Modified: branches/speedy/Conf3a.class ============================================================================== --- branches/speedy/Conf3a.class (original) +++ branches/speedy/Conf3a.class Fri Apr 24 13:52:36 2009 @@ -173,7 +173,11 @@ END IF NEXT sList = Trim(sList) - + ' IF sList THEN + ' Message(sList) + ' ELSE + ' Message("No settings to reset") + ' END IF END Modified: branches/speedy/Conf4.class ============================================================================== --- branches/speedy/Conf4.class (original) +++ branches/speedy/Conf4.class Fri Apr 24 13:52:36 2009 @@ -13,22 +13,16 @@ ' You should have received a copy of the GNU General Public License ' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. -' -' ================ network setup window ======== + +'-= network configuration window =- PUBLIC SUB Form_Open() - WITH ME - .tlbanner.Text = "<h2>" & tlbanner.Text & "</h2>" - END WITH + END - PUBLIC FUNCTION GetNext() AS String - ClsGlobal.fRunningMainForm.listview1["Step8"].picture = MdlStartUp.pDone - ClsGlobal.fRunningMainForm.listview1["Step9"].picture = MdlStartUp.pNow - RETURN "Conf5" END @@ -42,5 +36,3 @@ END - - Modified: branches/speedy/Conf4.form ============================================================================== --- branches/speedy/Conf4.form (original) +++ branches/speedy/Conf4.form Fri Apr 24 13:52:36 2009 @@ -1,7 +1,7 @@ # Gambas Form File 2.0 { Form Form - MoveScaled(0,0,83,54) + MoveScaled(0,0,89,48) Text = ("") Arrangement = Arrange.Row { HPanel1 HPanel @@ -10,11 +10,45 @@ { tlbanner TextLabel MoveScaled(12,0,33,3) Expand = True - Text = ("Network Settings") + Text = ("Network Configuration") } { Separator1 Separator MoveScaled(13,4,25,1) Expand = True + } + } + { HBox1 HBox + MoveScaled(0,5,6,1) + Expand = True + } + { HBox2 HBox + MoveScaled(0,7,88,3.5) + Expand = True + Spacing = 4 + Padding = 2 + { TextLabel1 TextLabel + MoveScaled(1,0,18.75,3.5) + Text = ("Computer Name") + Alignment = Align.Left + } + { txtHostname TextBox + MoveScaled(20,0,25,3.5) + Text = ("VLocity") + } + } + { HBox4 HBox + MoveScaled(0,10,53,3.5) + Expand = True + Spacing = 4 + Padding = 2 + { TextLabel2 TextLabel + MoveScaled(1,0,18.75,3.5) + Text = ("Domain") + Alignment = Align.Left + } + { txtDomain TextBox + MoveScaled(24,0,25,3.5) + Text = ("Linux.net") } } } Modified: branches/speedy/Conf5.class ============================================================================== --- branches/speedy/Conf5.class (original) +++ branches/speedy/Conf5.class Fri Apr 24 13:52:36 2009 @@ -1,4 +1,5 @@ ' Gambas class file + ' This file is part of vinstall-ng ' vinstall-ng is free software: you can redistribute it and/or modify @@ -13,23 +14,57 @@ ' You should have received a copy of the GNU General Public License ' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. +' +'-= system services window =- -' ==================== services configuration settings ================= -PRIVATE picStatus AS Picture PUBLIC SUB Form_Open() - WITH ME - .tlbanner.Text = "<h2>" & tlbanner.Text & "</h2>" - END WITH - ME.Prepare_Grid() - ME.lIST_SERVICES() + ME.prepare_grid() + ME.LIST_AVAILABLE_SERVICES() +END +PUBLIC SUB prepare_grid() + + ME.svServiceList.Columns.count = 4 + ME.svServiceList.Rows.Count = 3 + ME.svServiceList.Columns[0].Width = 24 + ME.svServiceList.Columns[1].Width = 32 + ME.svServiceList.Columns[2].Width = 200 + ME.svServiceList.Rows[1].Height = 12 + ME.svServiceList[0, 2].Text = ("Service") + ME.svServiceList[0, 3].Text = ("Description") + ME.svServiceList[0, 2].Alignment = Align.Center + ME.svServiceList[0, 3].Alignment = Align.Center + ME.svServiceList[0, 2].Font.Bold = TRUE + ME.svServiceList[0, 3].Font.Bold = TRUE + ME.svServiceList[0, 0].BackColor = Color.SelectedBackground + ME.svServiceList[0, 1].BackColor = Color.SelectedBackground + ME.svServiceList[0, 2].BackColor = Color.SelectedBackground + ME.svServiceList[0, 3].BackColor = Color.SelectedBackground + +END + +PUBLIC SUB LIST_AVAILABLE_SERVICES() + + DIM irow AS Integer = 2 + DIM sFile AS String + + 'FOR EACH sFile IN Dir(ClsGlobal.sTargetPath &/ "etc" &/ "rc.d" &/ "init.d", "*", gb.File) + FOR EACH sFile IN Dir("/etc/rc.d/init.d", "*", gb.File) + svServiceList[irow, 2].Text = sFile + INC irow + INC svServiceList.Rows.Count + NEXT + DEC svServiceList.Rows.Count + 'Message("Done") + END + + PUBLIC FUNCTION GetNext() AS String - ClsGlobal.fRunningMainForm.listview1["Step9"].picture = MdlStartUp.pDone - ClsGlobal.fRunningMainForm.listview1["Step10"].picture = MdlStartUp.pNow RETURN "FDone" + END PUBLIC SUB StartUp() @@ -38,160 +73,22 @@ END PUBLIC SUB OnExit() - ME.SAVE_SERVICES_LIST() + END -PUBLIC SUB Form_Resize() - WITH ME - .gvSvcList.Height = .ClientH - (.gvSvcList.Top + 12) - .gvSvcList.Columns[2].Width = .gvSvcList.Width - (.gvSvcList.Columns[2].Left + 12) - END WITH +PUBLIC SUB Form_Resize() -END -PUBLIC SUB Prepare_Grid() - DIM i AS Integer WITH ME - .gvSvcList.Rows.Count = 3 - .gvSvcList.columns.Count = 4 - .gvheader.rows.Count = 1 - .gvheader.Columns.Count = 3 - .gvheader[0, 2].Text = UCase(("Service")) - FOR i = 0 TO gvheader.columns.Count - 1 - .gvheader[0, i].BackColor = Color.SelectedBackground - .gvheader[0, i].Alignment = Align.Center - NEXT - .gvSvcList.columns[0].Width = 24 - .gvheader.Columns[0].Width = 24 - .gvSvcList.Columns[1].Width = 64 - .gvheader.Columns[1].Width = 64 - .gvSvcList.Columns[3].Width = 1 + .svServiceList.Height = .ClientH - (.svServiceList.top + 12) END WITH - - -END - -PUBLIC SUB lIST_SERVICES() - - DIM irow AS Integer - DIM sService, sDesc AS String - DIM sPic AS Picture - DIM sLogo AS Image - DIM sSvcPath AS String = "/etc/rc.d/init.d" 'ClsGlobal.sTargetPath &/ "etc" &/ "rc.d" &/ "init.d" - - picStatus = Picture.Load("images/16px-check.png") - - FOR EACH sService IN Dir(sSvcPath, "*", gb.File) - SELECT CASE sService - CASE "cron" - sDesc = ("System task scheduler") - sPic = picStatus - CASE "bluetooth" - sDesc = ("Bluetooth device manager") - sPic = "" - CASE "sshd" - sDesc = ("Secure Shell remote access") - sPic = "" - CASE "gslaptd" - sDesc = ("Software update notifications") - sPic = picStatus - CASE "wifi-radar" - sDesc = ("Wireless network scanner") - sPic = "" - CASE "cups" - sDesc = ("Printing service") - sPic = picStatus - CASE "fuse" - sDesc = ("File in userspace daemon") - sPic = "" - CASE "inetd" - sDesc = ("Internet Super Server") - sPic = "" - CASE "portmap" - sDesc = ("RPC Port Mapper") - sPic = "" - CASE "samba" - sDesc = ("Windows networking service") - sPic = "" - CASE "vmware" - sDesc = ("VMWare modules") - sPic = "" - CASE "wicd" - sDesc = ("Network interface manager") - sPic = picStatus - CASE "firewall" - sDesc = ("Enhanced network security") - sPic = "" - CASE "gpm" - sDesc = ("Mouse driver for Text Mode interface") - sPic = "" - END SELECT - IF Exist("images" &/ sService & ".svg") THEN - sLogo = Image.Load("images" &/ sService & ".svg") - ELSE - sLogo = Image.Load("images" &/ "service.svg") - END IF - - - IF sDesc THEN - ME.gvSvcList[irow, 0].Picture = sPic - IF sLogo THEN - ME.gvSvcList[irow, 1].Picture = sLogo.Picture - ME.gvSvcList[irow, 1].Alignment = Align.Center - END IF - ME.gvSvcList.rows[irow].Height = 64 'sLogo.Height - ME.gvSvcList[irow, 0].Alignment = Align.Center - ME.gvSvcList[irow, 2].Text = UCase(sService) & gb.NewLine & gb.NewLine & sDesc - ME.gvSvcList[irow, 3].Text = sService - INC irow - INC gvSvcList.Rows.Count - END IF - NEXT - - DEC gvSvcList.Rows.Count - DEC gvSvcList.Rows.Count - DEC gvSvcList.Rows.Count - - END +PUBLIC SUB TextLabel1_Menu() -PUBLIC SUB gvSvcList_Click() - - IF LAST.column > 1 THEN RETURN - IF gvSvcList[LAST.row, 0].Picture = picStatus THEN - gvSvcList[LAST.row, 0].Picture = "" - ELSE - gvSvcList[LAST.row, 0].Picture = picStatus - END IF - - gvSvcList.Refresh() - -END -PUBLIC SUB SAVE_SERVICES_LIST() - - DIM irow AS Integer - DIM sSVc AS String - - ' We will default to runlevel 4 (GUI Mode) for services. - FOR irow = 0 TO ME.gvSvcList.Rows.Count - 1 - sSVc = gvSvcList[irow, 3].Text - IF gvSvcList[irow, 0].Picture = picStatus THEN - PRINT " \\__ Setting up services" & gb.NewLine - PRINT " \\- " & sSVc - SHELL "chroot " & ClsGlobal.sTargetPath & " /sbin/service -s " & sSVc & " 4" WAIT - END IF - - NEXT - -END - - -PUBLIC SUB gvSvcList_Menu() - - ME.SAVE_SERVICES_LIST() + MdlBootMngr.PROBE_SYSTEM_FOR_OS("LILO") END Modified: branches/speedy/Conf5.form ============================================================================== --- branches/speedy/Conf5.form (original) +++ branches/speedy/Conf5.form Fri Apr 24 13:52:36 2009 @@ -1,7 +1,7 @@ # Gambas Form File 2.0 { Form Form - MoveScaled(0,0,92,59) + MoveScaled(0,0,64,45) Text = ("") Arrangement = Arrange.Row Padding = 2 @@ -11,7 +11,7 @@ { tlbanner TextLabel MoveScaled(12,0,33,3) Expand = True - Text = ("System Services") + Text = ("System Serices") } { Separator1 Separator MoveScaled(13,4,25,1) @@ -19,31 +19,24 @@ } } { HBox1 HBox - MoveScaled(4,5,6,2) + MoveScaled(0,5,6,1) Expand = True } { HBox2 HBox - MoveScaled(0,7,59,3.5) + MoveScaled(0,6,56,5) Expand = True - { tlExp TextLabel - MoveScaled(1,0,21,3.5) + { TextLabel1 TextLabel + MoveScaled(1,0,51,4) Expand = True - Text = ("Select the system services to be launched at start-up.") + Text = ("Select system services to run on start-up") } } { HBox3 HBox - MoveScaled(1,11,4,2) + MoveScaled(0,11,5,2) Expand = True } - { gvheader GridView - MoveScaled(1,13,56,3) + { svServiceList GridView + MoveScaled(1,14,62,27) Expand = True - Scrollbar = Scroll.None - Border = False - } - { gvSvcList GridView - MoveScaled(1,18,56,19) - Expand = True - Scrollbar = Scroll.Vertical } } Modified: branches/speedy/MdlBootMngr.module ============================================================================== --- branches/speedy/MdlBootMngr.module (original) +++ branches/speedy/MdlBootMngr.module Fri Apr 24 13:52:36 2009 @@ -456,23 +456,74 @@ END -PUBLIC FUNCTION convert_to_grub_format(sPartitionAddr AS String) AS String +' PUBLIC SUB PROBE_SYSTEM_FOR_OS(sBootManager AS String) +' +' DIM sDump, sOs, sRoot, sLongDesc, sType, sTitle AS String +' DIM i AS Integer +' DIM sOsList, sOsLine, sBootLine, sDumparr AS String[] +' DIM sKernel, sInitrd, sAppendLine AS String +' DIM sBootargs AS String +' +' sOsList = Split(Trim(File.Load("/tmp/os.lst")), gb.NewLine) +' FOR i = 0 TO sOsList.Max +' sOsLine = Split(Trim(sOsList[i]), ":") +' sType = Trim(sOsLine[3]) +' sLongDesc = Trim(sOsLine[1]) +' sOs = Trim(sOsLine[2]) +' sRoot = Trim(sOsLine[0]) +' IF sBootManager LIKE "lilo" THEN +' sTitle = sOs +' ELSE +' sTitle = sLongDesc +' END IF +' +' ' Message(sLongDesc & " was found in " & sRoot) +' ' -= NOW I NEED TO GET THE KERNEL, INITRD AND APPEND LINES FOR THIS OS. =- +' IF sType LIKE "linux" THEN +' ' this function will return an array separated by "," in this order +' ' /path/to/kernel, /path/to/initrd, appendline here +' +' sBootargs = Get_OS_Boot_Params(sRoot) +' IF NOT (sBootargs) THEN +' '= CAN NOT FIND BOOT ARGUMENTS FOR THIS OS =' +' PRINT ("Unable to find boot arguments for OS in") & Space(1) & sRoot +' RETURN +' ELSE +' Message(sTitle & "<br>" & sBootargs) +' END IF +' +' END IF +' +' NEXT +' +' END + +PUBLIC FUNCTION Get_OS_Boot_Params(sOsRoot AS String) AS String - DIM sAlpha AS String[] = Split("a b c d e f g h i k l m n o p q r s t u v w x y z", Space(1)) - DIM sDrive, sPartAlpha, sRetVal AS String - DIM i, iPartNu AS Integer + DIM $kern, $initrd, $append, sDump AS String + DIM i AS Integer + DIM $dumparr, $linearr AS String[] + DIM $file AS String = "/tmp/bootargs.lst" + DIM $line AS String + 'dim sListarr as String[] = Split(Trim(File.Load("/tmp/bootargs. + SHELL "cat " & $file & " | grep ^" & sOsRoot TO sDump + sDump = Trim(sDump) + $dumparr = Split(sDump, gb.NewLine) + ' always grab the first line only for each os + $line = Trim($dumparr[0]) + IF NOT ($line) THEN RETURN + $append = Right($line, Len($line) - InStr($line, "append") + 1) & "\"" + $linearr = Split($line, ":") + $kern = Trim($linearr[3]) + $initrd = Trim($linearr[4]) + - 'IF InStr(sPartitionAddr, "/") < 2 THEN RETURN ' invalid entry - 'IF InStr(sPartitionAddr, "*[0-9]*") = FALSE THEN RETURN 'invalid entry - sPartAlpha = Left(sPartitionAddr, Len("/dev/hda")) ' trim this out - iPartNu = Right(sPartitionAddr, Len(sPartitionAddr) - Len("/dev/hda")) ' cut the partition number from the string - i = sAlpha.Find(Right(sPartAlpha)) + RETURN $kern & "," & $initrd & "," & $append + + - ' To grub, it's always "hd" even if the drive is a sata interface - sRetVal = "(hd" & i & "," & iPartNu & ")" - RETURN sRetVal - + END Modified: branches/speedy/MdlStartUp.module ============================================================================== --- branches/speedy/MdlStartUp.module (original) +++ branches/speedy/MdlStartUp.module Fri Apr 24 13:52:36 2009 @@ -51,7 +51,7 @@ ClsGlobal.fRunningMainForm.listview1.add("Cat2", Space(3) & ("System Configuration"), pCategory) ClsGlobal.fRunningMainForm.listview1.add("Step6", ("System Boot Manager"), pToDo) ClsGlobal.fRunningMainForm.listview1.add("Step7", ("Regional Settings"), pToDo) - ClsGlobal.fRunningMainForm.listview1.add("Step8", ("User Accounts"), pToDO) + ClsGlobal.fRunningMainForm.listview1.add("Step8", ("User Accounts"), pToDo) ClsGlobal.fRunningMainForm.listview1.add("Step9", ("Network Settings"), pToDo) ClsGlobal.fRunningMainForm.listview1.add("Step10", ("Startup Options"), pToDo) ClsGlobal.fRunningMainForm.listview1.add("Step11", ("Final Configuration"), pToDo) Modified: branches/speedy/Step1.class ============================================================================== --- branches/speedy/Step1.class (original) +++ branches/speedy/Step1.class Fri Apr 24 13:52:36 2009 @@ -195,9 +195,9 @@ PUBLIC SUB FIND_CD_INSTALL_MEDIA() DIM sDump, sDrive, sOutput, sShortDrive AS String - DIM sName, sVersion, sMntPnt AS String + DIM sName, sVersion AS String DIM i AS Integer - DIM sDriveList, sDumparr AS String[] + DIM sDriveList AS String[] ME.mvLooking.Playing = TRUE WAIT 1 @@ -216,23 +216,13 @@ sDriveList = Split(sOutput, "\n") FOR i = 0 TO sDriveList.Count - 1 sShortDrive = Right(Trim(sDriveList[i]), Len(Trim(sDriveList[i])) - RInStr(Trim(sDriveList[i]), "/")) - sMntPnt = "/mnt" &/ sShortDrive - IF IsDir(sMntPnt) = FALSE THEN - EXEC ["mkdir", "-p", sMntPnt] WAIT - END IF + EXEC ["mkdir", "-p", "/mnt" &/ sShortDrive] WAIT + 'EXEC ["mount", "-o", "ro", Trim(sDriveList[i]), "/mnt" &/ sShortDrive] WAIT + SHELL "mount " & Trim(sDriveList[i]) & Space(1) & "/mnt" &/ sShortDrive & " 2>/dev/null" WAIT PRINT ("Scanning") & Space(1) & sDriveList[i] - SHELL "mount | grep \"^" & Trim(sDriveList[i]) & "\" | cut -f 3 -d \' \'" TO sDump - sDump = Trim(sDump) - IF NOT (sDump) THEN - SHELL "mount " & Trim(sDriveList[i]) & Space(1) & sMntPnt & " 2>/dev/null" WAIT - ELSE - sDumparr = Split(sDump, gb.NewLine) - sMntPnt = Trim(sDumparr[0]) - END IF - - IF Exist(sMntPnt &/ "veclinux" &/ "VINSTALL.CONF") THEN - SHELL "grep \"^DISTRO=\"" & sMntPnt &/ "veclinux" &/ "VINSTALL.CONF | cut -f 2 -d \'=\'" TO sName - SHELL "grep \"^VERSION=\"" & sMntPnt &/ "veclinux" &/ "VINSTALL.CONF | cut -f 2 -d \'=\'" TO sVersion + IF Exist("/mnt" &/ sShortDrive &/ "veclinux" &/ "VINSTALL.CONF") THEN + SHELL "grep \"^DISTRO=\" /mnt" &/ sShortDrive &/ "veclinux" &/ "VINSTALL.CONF | cut -f 2 -d \'=\'" TO sName + SHELL "grep \"^VERSION=\" /mnt" &/ sShortDrive &/ "veclinux" &/ "VINSTALL.CONF | cut -f 2 -d \'=\'" TO sVersion sName = Trim(Replace(sName, "\'", "")) sVersion = Trim(Replace(sVersion, "\'", "")) File.Save(Temp(sShortDrive), File.Load("/mnt" &/ sShortDrive &/ "veclinux" &/ "VINSTALL.CONF")) @@ -257,10 +247,10 @@ PUBLIC SUB FIND_ISO_INSTALL_MEDIA() - DIM sOutput, sPart, sISoName, sFile, sDump AS String - DIM sName, sVersion, sMntPnt AS String + DIM sOutput, sPart, sISoName, sFile AS String + DIM sName, sVersion AS String DIM i AS Integer - DIM sPartList, sDumparr AS String[] + DIM sPartList AS String[] ME.ComboBox1.Enabled = FALSE @@ -275,21 +265,11 @@ sPartList = Split(sOutput, "\n") FOR i = 0 TO sPartList.Count - 1 sPart = Trim(Right(Trim(sPartList[i]), Len(Trim(sPartList[i])) - RInStr(Trim(sPartList[i]), "/"))) - sMntPnt = "/mnt" &/ sPart - IF IsDir(sMntPnt) = FALSE THEN - EXEC ["mkdir", "-p", sMntPnt] WAIT - END IF - SHELL "mount | grep \"^/dev" &/ Trim(spart) & "\" | cut -f 3 -d \' \'" TO sDump - sDump = Trim(sDump) - IF sDump THEN - sDumparr = Split(sDump, gb.NewLine) - sMntPnt = Trim(sDumparr[0]) - ELSE - EXEC ["mount", "/dev" &/ Trim(sPart), sMntPnt] WAIT - END IF - FOR EACH sFile IN Dir(sMntPnt, "*.iso", gb.File) + EXEC ["mkdir", "/mnt" &/ Trim(sPart)] WAIT + EXEC ["mount", "/dev" &/ Trim(sPart), "/mnt" &/ Trim(sPart)] WAIT + FOR EACH sFile IN Dir("/mnt" &/ Trim(sPart), "*.iso") TRY MKDIR "/mnt/loop" - EXEC ["mount", "-o", "loop", sMntPnt &/ Trim(sFile), "/mnt/loop"] WAIT + EXEC ["mount", "-o", "loop", "/mnt" &/ Trim(sPart) &/ Trim(sFile), "/mnt/loop"] WAIT IF Exist("/mnt/loop/veclinux/VINSTALL.CONF") THEN 'PRINT "Adding temp file" & Space(1) & Temp(Trim(sFile) & "-" & Trim(sPart)) File.Save(Temp(Trim(sFile) & "-" & Trim(sPart)), File.Load("/mnt/loop/veclinux/VINSTALL.CONF")) @@ -302,9 +282,9 @@ NEXT - EXEC ["umount", sMntPnt] WAIT + EXEC ["umount", "/mnt" &/ Trim(sPart)] WAIT EXEC ["sync"] WAIT - TRY RMDIR sMntPnt + TRY RMDIR "/mnt" &/ Trim(sPart) 'EXEC ["rm,", "-rf", "/mnt" &/ Trim(sPart)] WAIT @@ -493,5 +473,3 @@ ME.tlNext.Visible = TRUE END - - Modified: branches/speedy/Step1.form ============================================================================== --- branches/speedy/Step1.form (original) +++ branches/speedy/Step1.form Fri Apr 24 13:52:36 2009 @@ -1,7 +1,7 @@ # Gambas Form File 2.0 { Form Form - MoveScaled(0,0,67,69) + MoveScaled(0,0,67,59) Text = ("") Arrangement = Arrange.Vertical { HPanel1 HPanel @@ -18,7 +18,7 @@ } } { Panel1 Panel - MoveScaled(1,8,60,56) + MoveScaled(1,8,60,45) Expand = True Arrangement = Arrange.Row { TextLabel2 TextLabel @@ -68,14 +68,14 @@ Expand = True Text = ("Check Installation media before installing") } + { mvLooking MovieBox + MoveScaled(5,24,11,25) + Expand = True + } { tlNext TextLabel MoveScaled(2,26,45,6) Expand = True Text = ("") - } - { mvLooking MovieBox - MoveScaled(4,27,11,28) - Expand = True } } } Modified: branches/speedy/Step6.class ============================================================================== --- branches/speedy/Step6.class (original) +++ branches/speedy/Step6.class Fri Apr 24 13:52:36 2009 @@ -255,12 +255,12 @@ 'IF LAST.text = ("Swap") THEN RETURN IF LAST.text <> ("Not Used") THEN IF LAST.TEXT <> ("Swap") THEN - IF ME.CheckEntry(LAST.text, gvPartListing.RowAt(LAST.y)) > 0 THEN - LAST.text = ("Not Used") - STOP EVENT - RETURN - END IF - END IF + IF ME.CheckEntry(LAST.text, gvPartListing.RowAt(LAST.y)) > 0 THEN + LAST.text = ("Not Used") + STOP EVENT + RETURN + END IF + END IF END IF IF LAST.text <> ("Not Used") THEN @@ -328,27 +328,77 @@ DIM sPart, sFormat, sSize, sMntPoint AS String DIM i, irow AS Integer - FOR EACH cb IN ME.objMntPoints - IF cb.Text <> ("Not Used") THEN - FOR irow = 0 TO gvPartListing.Rows.Count - 1 + + ' ================= get the list of vital partitions ===================== + FOR irow = 2 TO gvPartListing.Rows.count - 1 + IF Trim(gvPartListing[irow, 2].Text) THEN + IF Trim(gvPartListing[irow, 2].Text) <> ("Not Used") AND Trim(gvPartListing[irow, 2].Text) <> ("Swap") THEN sPart = Trim(gvPartListing[irow, 0].Text) sSize = Trim(gvPartListing[irow, 1].Text) sMntPoint = Trim(gvPartListing[irow, 2].Text) sFormat = Trim(gvPartListing[irow, 4].Text) - IF sPart = cb.Tag THEN ' we found a match. - IF cb.Text <> ("Swap") THEN - ClsGlobal.sVitalPartList = ClsGlobal.sVitalPartList & sPart & "-" & sSize & "-" & sMntPoint & "-" & sFormat & "|" - ELSE - ClsGlobal.sWapPartList = ClsGlobal.sWapPartList & sPart & "-" & sSize & "|" - END IF - END IF - NEXT + ' Message(gvPartListing[irow, 0].Text & " - (" & gvPartListing[irow, 1].Text & ") - " & gvPartListing[irow, 2].Text) + ' ClsGlobal.sVitalPartList = ClsGlobal.sVitalPartList & cbox.Tag & "-" & sSize & "-" & cbox.Text & "-" & sFormat & "," + ClsGlobal.sVitalPartList = ClsGlobal.sVitalPartList & sPart & "-" & sSize & "-" & sMntPoint & "-" & sFormat & "|" + + END IF + END IF + + NEXT + + ' =========== get list of swap partitions selected .(if any) ===================== + + FOR irow = 2 TO gvPartListing.Rows.count - 1 + IF Trim(gvPartListing[irow, 2].Text) = ("Swap") THEN + sPart = Trim(gvPartListing[irow, 0].Text) + sSize = Trim(gvPartListing[irow, 1].Text) + ' ClsGlobal.sWapPartList = ClsGlobal.sWapPartList & gvPartListing[i, 0].Text & "-" & gvPartListing[i, 1].Text & "," + ClsGlobal.sWapPartList = ClsGlobal.sWapPartList & spart & "-" & sSize & "|" END IF NEXT - + + + 'Message(ClsGlobal.sVitalPartList) +' +' FOR EACH cbox IN objMntPoints +' IF cbox.Text <> ("Not Used") THEN +' i = 2 +' REPEAT +' IF Trim(gvPartListing[i, 0].Text) = Trim(cbox.Tag) THEN +' sSize = Trim(gvPartListing[i, 1].Text) +' END IF +' INC i +' UNTIL sSize OR i = gvPartListing.Rows.Count +' +' FOR EACH cb IN objFS +' IF cbox.tag = cb.Tag THEN +' sFormat = Trim(cb.Text) +' BREAK +' ELSE +' sFormat = "" +' END IF +' NEXT +' ClsGlobal.sVitalPartList = ClsGlobal.sVitalPartList & cbox.Tag & "-" & sSize & "-" & cbox.Text & "-" & sFormat & "," +' END IF +' NEXT +' +' FOR i = 2 TO gvPartListing.Rows.count - 1 +' IF gvPartListing[i, 4].Text LIKE "linux-swap" THEN +' FOR EACH cbox IN objMntPoints +' IF cbox.tag = gvPartListing[i, 0].Text THEN +' IF cbox.text <> ("Not Used") THEN +' ClsGlobal.sWapPartList = ClsGlobal.sWapPartList & gvPartListing[i, 0].Text & "-" & gvPartListing[i, 1].Text & "," +' END IF +' END IF +' NEXT +' END IF +' NEXT +' +' END - +' +' PUBLIC SUB Form_Open() @@ -395,6 +445,4 @@ cbYN.Visible = FALSE END - - |