From: <cod...@go...> - 2008-08-15 16:30:59
|
Author: M0...@gm... Date: Fri Aug 15 09:30:50 2008 New Revision: 127 Modified: branches/iVL/FrmLilo.class branches/iVL/MdlConfLilo.module branches/iVL/MdlLiloOsList.module Log: - Constructed lilo.conf (not yet written to disk) - Began process to find and copy vmlinuz and initrds for other linux installs to /boot/tamu Modified: branches/iVL/FrmLilo.class ============================================================================== --- branches/iVL/FrmLilo.class (original) +++ branches/iVL/FrmLilo.class Fri Aug 15 09:30:50 2008 @@ -21,7 +21,7 @@ PUBLIC SUB Form_Open() - +ClsPartSel.sRoot = "/dev/hda1" ' FMain.FrmCurr = ME ' FMain.tvPlan["Conf0"].Selected = TRUE ' FMain.tvPlan["Conf0"].Picture = MdlCore.sNowPic @@ -58,6 +58,7 @@ .FBResolution.Enabled = FALSE .TabStrip1.Enabled = FALSE .sbTimer.Enabled = FALSE + .cbDefBoot.Enabled = FALSE END WITH ELSE WITH ME @@ -66,6 +67,7 @@ .LiloTarget.Enabled = TRUE .FBResolution.Enabled = TRUE .sbTimer.Enabled = TRUE + .cbDefBoot.Enabled = TRUE END WITH END IF @@ -148,5 +150,7 @@ 'MdlConfLilo.WRITE_LILO_DOT_CONF\ MdlConfLilo.GENERATE_LILO_DOT_CONF() + MdlConfLilo.GATHER_OTHER_LINUX_KERNELS_AND_INITRDS() + 'MdlConfLilo.WRITE_LILO_DOT_CONF() END Modified: branches/iVL/MdlConfLilo.module ============================================================================== --- branches/iVL/MdlConfLilo.module (original) +++ branches/iVL/MdlConfLilo.module Fri Aug 15 09:30:50 2008 @@ -23,11 +23,49 @@ PUBLIC FUNCTION WRITE_LILO_DOT_CONF() AS Integer - DIM sGlbl AS String + DIM sOut AS String DIM iTimeout AS Integer DIM sTrgt AS String DIM sFB AS String + sTrgt = Trim(FrmLilo.LiloTarget.text) + IF InStr(sTrgt, "MBR of") THEN + sTrgt = Right(sTrgt, Len(sTrgt) - InStr(sTrgt, "/") + 1) + END IF + + iTimeout = FrmLilo.sbTimer.Value * 100 + + sOut = "# LILO Configuration File \n" & + "# Generated by the VectorLinux installer \n" & + "# \n" & + "# Begin lilo global configuration \n" & + "boot = " & sTrgt & "\n" & + "default = " & FrmLilo.cbDefBoot.Text & "\n" & + "compact \n" & + "prompt \n" & + "timeout = " & iTimeout & "\n" & + "# \n" & + "# Override dangerous defaults that rewrite the partition table: \n" & + "change-rules \n" & + "reset \n" + 'IF Exist(ClsGlobal.sTargetMnt &/ "boot" &/ "bitmap" &/ "boot.bmp") THEN + IF Exist("/boot/bitmap/boot.bmp") THEN + sOut = sOut & "\n" & + "bitmap = /boot/bitmap/boot.bmp \n" + END IF + sOut = sOut & "\n" & + "vga = 791 \n" & + "# \n" & "# Begin listing OS Choices \n \n" & + sDotConf + + + + Message(sOut) + + + + + END @@ -64,6 +102,62 @@ END + +PUBLIC SUB GATHER_OTHER_LINUX_KERNELS_AND_INITRDS() + + DIM tb AS TextBox + DIM cb AS CheckBox + DIM sShortAddr AS String + DIM sInitrd0, sInitrd1 AS String + DIM sDump AS String + sInitrd0 = "initrd" + sInitrd1 = "initrd.gz" + ClsPartSel.sRoot = "/dev/hda1" ' just for testing + FOR EACH cb IN MdlLiloOsList.bIncluded + IF cb.Value = TRUE THEN + sShortAddr = Right(cb.tag, Len(cb.tag) - RInStr(cb.tag, "/")) + IF cb.tag <> ClsPartSel.sRoot THEN + FOR EACH tb IN MdlLiloOsList.txtInitrds + 'IF cb.tag <> ClsPartSel.sRoot THEN + IF tb.tag = cb.tag THEN + 'mount it and find the initrd + SHELL "mkdir /mnt" &/ sShortAddr WAIT + SHELL "mount " & cb.tag & Space(1) & "/mnt" &/ sShortAddr WAIT + SHELL "ls /mnt" &/ sShortAddr &/ "boot" TO sDump + 'message(sDump) + IF Exist("/mnt/ " & sShortAddr &/ "boot" &/ sInitrd0) THEN + PRINT "cp /mnt" &/ sShortAddr &/ "boot" &/ sInitrd0 & " to " & ClsGlobal.sTargetMnt &/ "boot" &/ "tamu" &/ tb.text + 'SHELL "cp /mnt" &/ sShortAddr &/ sInitrd0 & Space(1) & ClsGlobal.sTargetMnt &/ "boot" &/ "tamu" &/ tb.text + ELSE IF Exist("/mnt" &/ sShortAddr &/ "boot" &/ sInitrd1) THEN + PRINT "cp /mnt" &/ sShortAddr &/ "boot" &/ sInitrd1 & " to " & ClsGlobal.sTargetMnt &/ "boot" &/ "tamu" &/ tb.text + 'SHELL "cp /mnt" &/ sShortAddr &/ sInitrd1 & Space(1) & ClsGlobal.sTargetMnt &/ "boot" &/ "tamu" &/ tb.text + ELSE + PRINT "No initrd found" + END IF + ' now copy the kernel to the same location + IF Exist("/mnt" &/ sShortAddr &/ "boot" &/ "vmlinuz") THEN + PRINT "Copy /mnt" &/ sShortAddr &/ "boot" &/ "vmlinuz" & " to " & ClsGlobal.sTargetMnt &/ "boot" &/ "tamu" &/ "vmlinuz-" & sShortaddr + 'SHELL "cp -L /mnt" &/ sShortAddr &/ "boot" &/ "vmlinuz" & Space(1) & ClsGlobal.sTargetMnt &/ "boot" &/ "tamu" &/ "vmlinuz-" & sShortAddr WAIT + END IF + + 'SHELL "umount /mnt" &/ sShortAddr WAIT + END IF + NEXT + END IF + + END IF + NEXT + + +END + + + + + + + + PUBLIC SUB GENERATE_LILO_DOT_CONF() DIM sFile AS String @@ -104,7 +198,8 @@ sEntryRoot = bInc.Tag FOR EACH tb IN MdlLiloOsList.txtInitrds IF tb.tag = bInc.tag THEN - sEntryInitrd = tb.Text + + sEntryInitrd = sBootAddr &/ tb.Text END IF NEXT ' now put it in a section Modified: branches/iVL/MdlLiloOsList.module ============================================================================== --- branches/iVL/MdlLiloOsList.module (original) +++ branches/iVL/MdlLiloOsList.module Fri Aug 15 09:30:50 2008 @@ -285,8 +285,8 @@ txtAppnd = NEW TextBox(FrmLilo.TabStrip1) AS "NameBox" WITH txtAppnd .Width = tl.Width * 4 - .text = FrmLilo.TabStrip1.Current.text 'sLiloDesc .Height = tl.Height + .text = FrmLilo.TabStrip1.Current.text 'sLiloDesc .x = tl.left + tl.Width + 8 .y = tl.Top .MaxLength = 15 @@ -302,13 +302,20 @@ .Height = 27 .Alignment = Align.Normal .Background = Color.Background + .Visible = FALSE END WITH txtAppnd = NEW TextBox(FrmLilo.TabStrip1) AS "initrdBox" WITH txtAppnd - .text = "initrd-" & sShortAddr + .Move(tl.Left + tl.Width + 4, tl.top, 250, 27) .tag = arrLinux[i] + IF .tag = ClsPartSel.sRoot THEN + .text = "initrd" + ELSE + .text = "initrd-" & sShortAddr + END IF + .Visible = FALSE END WITH ME.txtInitrds.Add(txtAppnd) |