From: <cod...@go...> - 2007-08-10 20:46:58
|
Author: M0E.lnx Date: Fri Aug 10 13:46:09 2007 New Revision: 19 Added: trunk/frmChooseMBR.class trunk/frmChooseMBR.form Modified: trunk/.lang/.pot trunk/.lang/frmTools.pot trunk/.project trunk/Functions.module trunk/Global.class trunk/frmTools.class Log: Modified the previous code on the boot manager setup. Now, it calls the existing script that uses Xdialog to setup the boot manager. It allows the user to choose, and to setup whatever the choice is... I think it saves us a lot of time and effort. Modified: trunk/.lang/.pot ============================================================================== --- trunk/.lang/.pot (original) +++ trunk/.lang/.pot Fri Aug 10 13:46:09 2007 @@ -67,6 +67,21 @@ msgid "Advanced" msgstr "" +#: frmChooseMBR.class:45 +msgid "Next >" +msgstr "" + +#: frmChooseMBR.class:50 +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." +msgstr "" + #: frmConfig.class:116 msgid "" "<center><h3><b>Configuration:</b></h3></center>\n" @@ -369,7 +384,7 @@ msgid "No partitioning" msgstr "" -#: frmTools.class:113 +#: frmTools.class:115 msgid "" "<center><h3><b>Vector Linux repair tools:</b></h3></center>\n" "\n" @@ -394,43 +409,43 @@ "</ul>\n" msgstr "" -#: frmTools.class:124 +#: frmTools.class:126 msgid "VL Tools" msgstr "" -#: frmTools.class:139 +#: frmTools.class:141 msgid "Distro repair" msgstr "" -#: frmTools.class:146 +#: frmTools.class:148 msgid "Restore packages" msgstr "" -#: frmTools.class:154 +#: frmTools.class:156 msgid "Repair LILO" msgstr "" -#: frmTools.class:161 +#: frmTools.class:163 msgid "Backup / restore" msgstr "" -#: frmTools.class:168 +#: frmTools.class:170 msgid "Backup /home" msgstr "" -#: frmTools.class:176 +#: frmTools.class:178 msgid "Restore /home" msgstr "" -#: frmTools.class:183 +#: frmTools.class:185 msgid "Miscellaneous" msgstr "" -#: frmTools.class:190 +#: frmTools.class:192 msgid "Tool 5" msgstr "" -#: frmTools.class:198 +#: frmTools.class:200 msgid "(Make FHS tree)" msgstr "" Modified: trunk/.lang/frmTools.pot ============================================================================== --- trunk/.lang/frmTools.pot (original) +++ trunk/.lang/frmTools.pot Fri Aug 10 13:46:09 2007 @@ -14,47 +14,47 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: frmTools.class:113 +#: frmTools.class:115 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:124 +#: frmTools.class:126 msgid "VL Tools" msgstr "" -#: frmTools.class:139 +#: frmTools.class:141 msgid "Distro repair" msgstr "" -#: frmTools.class:146 +#: frmTools.class:148 msgid "Restore packages" msgstr "" -#: frmTools.class:154 +#: frmTools.class:156 msgid "Repair LILO" msgstr "" -#: frmTools.class:161 +#: frmTools.class:163 msgid "Backup / restore" msgstr "" -#: frmTools.class:168 +#: frmTools.class:170 msgid "Backup /home" msgstr "" -#: frmTools.class:176 +#: frmTools.class:178 msgid "Restore /home" msgstr "" -#: frmTools.class:183 +#: frmTools.class:185 msgid "Miscellaneous" msgstr "" -#: frmTools.class:190 +#: frmTools.class:192 msgid "Tool 5" msgstr "" -#: frmTools.class:198 +#: frmTools.class:200 msgid "(Make FHS tree)" msgstr "" Modified: trunk/.project ============================================================================== --- trunk/.project (original) +++ trunk/.project Fri Aug 10 13:46:09 2007 @@ -2,7 +2,7 @@ Title=VL-gui-installer Startup=Main Icon=vl_logo_icon2.png -Version=0.0.171 +Version=0.0.178 Library=gb.qt Library=gb.qt.ext TabSize=3 Modified: trunk/Functions.module ============================================================================== --- trunk/Functions.module (original) +++ trunk/Functions.module Fri Aug 10 13:46:09 2007 @@ -324,37 +324,72 @@ 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 - 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 +' ' +' ' 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 + Modified: trunk/Global.class ============================================================================== --- trunk/Global.class (original) +++ trunk/Global.class Fri Aug 10 13:46:09 2007 @@ -65,5 +65,8 @@ 'temp stuff 2 check out: STATIC PUBLIC installDrive AS String +' MBR Selection (When more than one is available) +STATIC PUBLIC MBRSel AS String + Added: trunk/frmChooseMBR.class ============================================================================== --- (empty file) +++ trunk/frmChooseMBR.class Fri Aug 10 13:46:09 2007 @@ -0,0 +1,23 @@ +' Gambas class file + + +PUBLIC SUB btNext_Click() + +global.MBRSel = Trim(MBRList.text) +Message.Info(global.MBRSel) ' Just a sanity check to make sure the right value is parsed +ME.Close +' May need to add more code here... to tell it where to go next + +END + +PUBLIC SUB btBack_Click() + +ME.Close + +END + +PUBLIC SUB Form_Open() + +ME.title = "Choose MBR" + +END Added: trunk/frmChooseMBR.form ============================================================================== --- (empty file) +++ trunk/frmChooseMBR.form Fri Aug 10 13:46:09 2007 @@ -0,0 +1,22 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,64,43) + Font = Font["Luxi Mono"] + Text = ("") + { MbrList ListBox + MoveScaled(1,14,62,23) + } + { btNext Button + MoveScaled(53,38,9,3) + Text = ("Next >") + } + { btBack Button + MoveScaled(44,38,8,3) + 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.") + } +} Modified: trunk/frmTools.class ============================================================================== --- trunk/frmTools.class (original) +++ trunk/frmTools.class Fri Aug 10 13:46:09 2007 @@ -25,7 +25,11 @@ PUBLIC SUB btnBMRepair_Click() ' Repair LILO: 'frmMain.btnChoice_Click -frmMain.btnConfigure_click ' Display the Boot Manager selection window +'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 + END |