From: <cod...@go...> - 2007-08-13 15:37:09
|
Author: M0E.lnx Date: Mon Aug 13 08:35:59 2007 New Revision: 20 Modified: trunk/.lang/.pot trunk/.lang/frmTools.pot trunk/.project trunk/Functions.module trunk/frmChooseMBR.form trunk/frmTools.class Log: The Boot manager setup now detects the different drives and can find the kernel, as well as the root partitions. It will show a list of available disks. So far only gathers information but this information will be useful when writing the actual config file for the boot manager Modified: trunk/.lang/.pot ============================================================================== --- trunk/.lang/.pot (original) +++ trunk/.lang/.pot Mon Aug 13 08:35:59 2007 @@ -67,19 +67,16 @@ msgid "Advanced" msgstr "" -#: frmChooseMBR.class:45 +#: frmChooseMBR.class:46 msgid "Next >" msgstr "" -#: frmChooseMBR.class:50 +#: frmChooseMBR.class:51 msgid "< Back" msgstr "" -#: frmChooseMBR.class:55 -msgid "" -"You chose to install the boot manager to your MBR, but you have\n" -"multiple disks. Please select the disk you would like to install the " -"bootmanager in to." +#: frmChooseMBR.class:56 +msgid "Please select the drive you want your boot manager installed to:" msgstr "" #: frmConfig.class:116 @@ -384,7 +381,7 @@ msgid "No partitioning" msgstr "" -#: frmTools.class:115 +#: frmTools.class:116 msgid "" "<center><h3><b>Vector Linux repair tools:</b></h3></center>\n" "\n" @@ -409,43 +406,43 @@ "</ul>\n" msgstr "" -#: frmTools.class:126 +#: frmTools.class:127 msgid "VL Tools" msgstr "" -#: frmTools.class:141 +#: frmTools.class:142 msgid "Distro repair" msgstr "" -#: frmTools.class:148 +#: frmTools.class:149 msgid "Restore packages" msgstr "" -#: frmTools.class:156 +#: frmTools.class:157 msgid "Repair LILO" msgstr "" -#: frmTools.class:163 +#: frmTools.class:164 msgid "Backup / restore" msgstr "" -#: frmTools.class:170 +#: frmTools.class:171 msgid "Backup /home" msgstr "" -#: frmTools.class:178 +#: frmTools.class:179 msgid "Restore /home" msgstr "" -#: frmTools.class:185 +#: frmTools.class:186 msgid "Miscellaneous" msgstr "" -#: frmTools.class:192 +#: frmTools.class:193 msgid "Tool 5" msgstr "" -#: frmTools.class:200 +#: frmTools.class:201 msgid "(Make FHS tree)" msgstr "" Modified: trunk/.lang/frmTools.pot ============================================================================== --- trunk/.lang/frmTools.pot (original) +++ trunk/.lang/frmTools.pot Mon Aug 13 08:35:59 2007 @@ -14,47 +14,47 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: frmTools.class:115 +#: frmTools.class:116 msgid "<center><h3><b>Vector Linux repair tools:</b></h3></center>\n\n<b><u>Distro repair tools:</u></b>\n<ul>\n<li><b>Repair LILO:</b> Repair <b>Linux Loader</b> boot manager of an existing Vector Linux installation.</li>\n<li><b>Restore packages:</b> Restore original packages from the install CD, to fix a broken upgrade.</li>\n</ul>\n<b><u>Backup / restore tools:</u></b>\n<ul>\n<li><b>Backup /home:</b> Backup your /home directory for safekeeping.</li>\n<li><b>Restore /home:</b> Restore your /home directory from a previous backup. <font color=\"#FF0000\">WARNING: The existing /home directory will be OVERWRITTEN during restore. You have been WARNED.</font></li>\n</ul>\n<b><u>Miscellaneous tools:</u></b> \n<ul>\n<li><b>Tool 5:</b> Tool number 5 to fix something or other.</li>\n<li><b>Tool 6:</b> Tool number 6 to fix something or other.</li>\n</ul>\n" msgstr "" -#: frmTools.class:126 +#: frmTools.class:127 msgid "VL Tools" msgstr "" -#: frmTools.class:141 +#: frmTools.class:142 msgid "Distro repair" msgstr "" -#: frmTools.class:148 +#: frmTools.class:149 msgid "Restore packages" msgstr "" -#: frmTools.class:156 +#: frmTools.class:157 msgid "Repair LILO" msgstr "" -#: frmTools.class:163 +#: frmTools.class:164 msgid "Backup / restore" msgstr "" -#: frmTools.class:170 +#: frmTools.class:171 msgid "Backup /home" msgstr "" -#: frmTools.class:178 +#: frmTools.class:179 msgid "Restore /home" msgstr "" -#: frmTools.class:185 +#: frmTools.class:186 msgid "Miscellaneous" msgstr "" -#: frmTools.class:192 +#: frmTools.class:193 msgid "Tool 5" msgstr "" -#: frmTools.class:200 +#: frmTools.class:201 msgid "(Make FHS tree)" msgstr "" Modified: trunk/.project ============================================================================== --- trunk/.project (original) +++ trunk/.project Mon Aug 13 08:35:59 2007 @@ -2,7 +2,7 @@ Title=VL-gui-installer Startup=Main Icon=vl_logo_icon2.png -Version=0.0.178 +Version=0.0.193 Library=gb.qt Library=gb.qt.ext TabSize=3 Modified: trunk/Functions.module ============================================================================== --- trunk/Functions.module (original) +++ trunk/Functions.module Mon Aug 13 08:35:59 2007 @@ -324,72 +324,77 @@ END -' PUBLIC SUB BootMngrSet() -' ' This must determine: -' ' * Where the root partition is -' ' * Where the kernel is installed -' ' * where to install lilo (from global.enumLILOMODE ?? ) -' ' * Which OS's to display in the boot menu (From user input) -' ' * To use bootsplash or to use framebuffer -' ' We'll use message.info to display the values for now, we can move those values somewhere else, or dome something more useful with them later -' DIM sRoot_Part AS String -' DIM sKernel_Loc AS String -' DIM ROOT_DIR AS String = "/" -' DIM Boot_DIR AS String = Root_DIR & "boot" -' ' Locate the root Partition -' IF global.enumLILOMODE = 0 THEN -' locate_mbr() -' SHELL "cat /etc/fstab | awk '{if ($2 == \"/\") {print $1}}'" TO sRoot_Part -' IF NOT sRoot_Part OR sRoot_Part <> "" THEN -' SHELL "mount | awk '{if ($3 == \"/\") {print $1}}'" TO sRoot_Part -' END IF -' message.Info("I've identified your root partition as " & gb.newline & sRoot_Part) -' END IF -' ' Figure out where the kernel is -' IF Exist(Boot_DIR & "/vmlinuz") THEN -' sKernel_Loc = Boot_DIR & "/vmlinuz" -' ELSE IF Exist(ROOT_DIR & "/vmlinuz") THEN -' sKernel_Loc = Root_DIR & "/vmlinuz" -' ELSE -' Message.Info("I can't find a kernel !!! ") -' END IF -' IF sKernel_Loc OR sKernel_Loc <> "" THEN -' message.Info("I've located the kernel in " & gb.NewLine & sKernel_Loc) -' END IF -' -' END +PUBLIC SUB BootMngrSet() +' This must determine: +' * Where the root partition is +' * Where the kernel is installed +' * where to install lilo (from global.enumLILOMODE ?? ) +' * Which OS's to display in the boot menu (From user input) +' * To use bootsplash or to use framebuffer +' We'll use message.info to display the values for now, we can move those values somewhere else, or dome something more useful with them later + DIM sRoot_Part AS String + DIM sKernel_Loc AS String + DIM ROOT_DIR AS String = "/" + DIM Boot_DIR AS String = Root_DIR & "boot" + ' Locate the root Partition + IF global.enumLILOMODE = 0 THEN + locate_mbr() + SHELL "cat /etc/fstab | awk '{if ($2 == \"/\") {print $1}}'" TO sRoot_Part + IF NOT sRoot_Part OR sRoot_Part <> "" THEN + SHELL "mount | awk '{if ($3 == \"/\") {print $1}}'" TO sRoot_Part + END IF + message.Info("I've identified your root partition as " & gb.newline & sRoot_Part) + END IF +' Figure out where the kernel is + IF Exist(Boot_DIR & "/vmlinuz") THEN + sKernel_Loc = Boot_DIR & "/vmlinuz" + ELSE IF Exist(ROOT_DIR & "/vmlinuz") THEN + sKernel_Loc = Root_DIR & "/vmlinuz" + ELSE + Message.Info("I can't find a kernel !!! ") + END IF + IF sKernel_Loc OR sKernel_Loc <> "" THEN + message.Info("I've located the kernel in " & gb.NewLine & sKernel_Loc) + END IF + +END + +PUBLIC SUB locate_mbr() + + ' If the user chooses to install bootmanager to MBR + ' This routine will analyze whether there are more than 1 MBR available + ' and which one to use if true, else, use the one available automatically + 'SHELL "/sbin/vliloconf" + +DIM disks AS String ' list of the mbrs as string +DIM MBRs AS String[] ' split the many MBR's +DIM MBR AS String ' Hold a temporary MBR +DIM MBRTotal AS Integer ' Total MBRS +DIM MBRIndex AS Integer ' Current MBR (index) +DIM UseMBR AS String ' MBR to use.... A better place for this is probabbly somewhere in Global +DIM findcmd AS String = "fdisk -l | grep Disk | cut -d \" \" -f 2 | cut -c 1-8" ' -' PUBLIC SUB locate_mbr() -' -' ' If the user chooses to install bootmanager to MBR -' ' This routine will analyze whether there are more than 1 MBR available -' ' and which one to use if true, else, use the one available automatically -' SHELL "/sbin/vliloconf" -' -' ' DIM disks AS String ' list of the mbrs as string -' ' DIM MBRs AS String[] ' split the many MBR's -' ' DIM MBR AS String ' Hold a temporary MBR -' ' DIM MBRTotal AS Integer ' Total MBRS -' ' DIM MBRIndex AS Integer ' Current MBR (index) -' ' DIM UseMBR AS String ' MBR to use.... A better place for this is probabbly somewhere in Global -' ' -' ' SHELL "fdisk -l | grep Disk | cut -d " & " " & "-f 2 | cut -c 1-8" TO disks -' ' MBRs = Split(disks, " ") ' Maybe use a blank space (ie " " ) instead ?? -' ' MbrTotal = MBRs.Count -' ' IF MBRTotal = 0 THEN ' This should never happen. -' ' message.Info(disks) -' ' message.Error("Cannot find an MBR on this box... You must be on some kind of alien box... ;) ") -' ' ELSE IF MBRTotal = 1 ' Located only one MBR -' ' UseMBR = disks ' Obviously, use the one available MBR -' ' Message.Info("The boot manager will be installed to: " & disks) -' ' ELSE IF MBRTotal >= 2 THEN ' We found several MBR's here... Your box is loaded with drives out the whazoo! -' ' FOR MBRIndex = 0 TO MBRs.count - 1 -' ' MBR = MBRs[MBRIndex] -' ' frmChooseMBR.MbrList.Add(MBR) ' populate the list in the form -' ' frmChooseMBR.Show ' This form will shoot out a value to Global -' ' NEXT -' ' END IF -' -'END +'SHELL "fdisk -l | grep Disk | cut -d " " - f 2 | cut -c 1-8" TO disks +SHELL findcmd TO disks +'message.Info(disks) +MBRs = Split(disks, " ") ' Maybe use a blank space (ie " " ) instead ?? +MbrTotal = MBRs.Count +IF MBRTotal = 0 THEN ' This should never happen. +'message.Info(disks) + message.Error("Cannot find an MBR on this box... You must be on some kind of alien box... ;) ") +'ELSE IF MBRTotal = 1 ' Located only one MBR +' UseMBR = disks ' Obviously, use the one available MBR +' Message.Info("The boot manager will be installed to: " & disks) +'ELSE IF MBRTotal >= 2 THEN ' We found several MBR's here... Your box is loaded with drives out the whazoo! +ELSE +'message.Info(disks) +FOR MBRIndex = 0 TO MBRs.count - 1 + MBR = MBRs[MBRIndex] + frmChooseMBR.MbrList.Add(MBR) ' populate the list in the form + frmChooseMBR.Show ' This form will shoot out a value to Global +NEXT +END IF + +END Modified: trunk/frmChooseMBR.form ============================================================================== --- trunk/frmChooseMBR.form (original) +++ trunk/frmChooseMBR.form Mon Aug 13 08:35:59 2007 @@ -5,7 +5,8 @@ Font = Font["Luxi Mono"] Text = ("") { MbrList ListBox - MoveScaled(1,14,62,23) + MoveScaled(1,10,62,27) + Font = Font["Luxi Mono"] } { btNext Button MoveScaled(53,38,9,3) @@ -16,7 +17,7 @@ Text = ("< Back") } { lbWarn TextLabel - MoveScaled(1,1,62,12) - Text = ("You chose to install the boot manager to your MBR, but you have\nmultiple disks. Please select the disk you would like to install the bootmanager in to.") + MoveScaled(1,1,62,8) + Text = ("Please select the drive you want your boot manager installed to:") } } Modified: trunk/frmTools.class ============================================================================== --- trunk/frmTools.class (original) +++ trunk/frmTools.class Mon Aug 13 08:35:59 2007 @@ -24,10 +24,9 @@ END PUBLIC SUB btnBMRepair_Click() ' Repair LILO: -'frmMain.btnChoice_Click -'frmMain.btnConfigure_click ' Display the Boot Manager selection window +frmMain.btnChoice_Click +frmMain.btnConfigure_click ' Display the Boot Manager selection window ' Save us some time and use the existing code via Xdialog ??? -SHELL "/sbin/vliloconf" ' Might need to just make it appear in the right place |