Skip to content

Commit

Permalink
The Boot manager setup now detects the different drives and can find …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
M0E.lnx authored and M0E.lnx committed Aug 13, 2007
1 parent 5d491a6 commit 1508dd5
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 102 deletions.
33 changes: 15 additions & 18 deletions .lang/.pot
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,16 @@ msgstr ""
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
Expand Down Expand Up @@ -384,7 +381,7 @@ msgstr ""
msgid "No partitioning"
msgstr ""

#: frmTools.class:115
#: frmTools.class:116
msgid ""
"<center><h3><b>Vector Linux repair tools:</b></h3></center>\n"
"\n"
Expand All @@ -409,43 +406,43 @@ msgid ""
"</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 ""

Expand Down
22 changes: 11 additions & 11 deletions .lang/frmTools.pot
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,47 @@ msgstr ""
"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 ""

2 changes: 1 addition & 1 deletion .project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
137 changes: 71 additions & 66 deletions Functions.module
Original file line number Diff line number Diff line change
Expand Up @@ -324,72 +324,77 @@ ENDIF

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
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"
'
'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


7 changes: 4 additions & 3 deletions frmChooseMBR.form
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:")
}
}
5 changes: 2 additions & 3 deletions frmTools.class
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ TextLabel1.Adjust
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


Expand Down

0 comments on commit 1508dd5

Please sign in to comment.