From: <cod...@go...> - 2008-08-26 17:17:11
|
Author: M0E.lnx Date: Tue Aug 26 10:16:38 2008 New Revision: 146 Modified: branches/iVL/.lang/ClsGlobal.pot branches/iVL/.lang/ClsPartSel.pot branches/iVL/.lang/ClsWinDrives.pot branches/iVL/.lang/FrmLicense.pot branches/iVL/.lang/FrmPkgSel.pot branches/iVL/.lang/FrmSummary.pot branches/iVL/.lang/FrmWinDrives.pot branches/iVL/.lang/MdlCore.pot branches/iVL/.lang/MdlObjSizer.pot branches/iVL/.lang/MdlPkgSel.pot branches/iVL/.lang/MdlSetup.pot branches/iVL/.lang/MdlSummarize.pot branches/iVL/MdlInstallSys.module branches/iVL/MdlWinDrives.module Log: - Added new method of detecting ntfs partitions (similar to fat) - Added code to write FAT16, FAT32, NTFS partitions to /etc/fstab - Added code to create mount points for win partitions on target Modified: branches/iVL/.lang/ClsGlobal.pot ============================================================================== --- branches/iVL/.lang/ClsGlobal.pot (original) +++ branches/iVL/.lang/ClsGlobal.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/ClsGlobal.class +# /home/moe/area-51/projects/installer/ClsGlobal.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/ClsPartSel.pot ============================================================================== --- branches/iVL/.lang/ClsPartSel.pot (original) +++ branches/iVL/.lang/ClsPartSel.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/ClsPartSel.class +# /home/moe/area-51/projects/installer/ClsPartSel.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/ClsWinDrives.pot ============================================================================== --- branches/iVL/.lang/ClsWinDrives.pot (original) +++ branches/iVL/.lang/ClsWinDrives.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/ClsWinDrives.class +# /home/moe/area-51/projects/installer/ClsWinDrives.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/FrmLicense.pot ============================================================================== --- branches/iVL/.lang/FrmLicense.pot (original) +++ branches/iVL/.lang/FrmLicense.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/FrmLicense.class +# /home/moe/area-51/projects/installer/FrmLicense.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/FrmPkgSel.pot ============================================================================== --- branches/iVL/.lang/FrmPkgSel.pot (original) +++ branches/iVL/.lang/FrmPkgSel.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/FrmPkgSel.class +# /home/moe/area-51/projects/installer/FrmPkgSel.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/FrmSummary.pot ============================================================================== --- branches/iVL/.lang/FrmSummary.pot (original) +++ branches/iVL/.lang/FrmSummary.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/FrmSummary.class +# /home/moe/area-51/projects/installer/FrmSummary.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/FrmWinDrives.pot ============================================================================== --- branches/iVL/.lang/FrmWinDrives.pot (original) +++ branches/iVL/.lang/FrmWinDrives.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/FrmWinDrives.class +# /home/moe/area-51/projects/installer/FrmWinDrives.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlCore.pot ============================================================================== --- branches/iVL/.lang/MdlCore.pot (original) +++ branches/iVL/.lang/MdlCore.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/MdlCore.module +# /home/moe/area-51/projects/installer/MdlCore.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlObjSizer.pot ============================================================================== --- branches/iVL/.lang/MdlObjSizer.pot (original) +++ branches/iVL/.lang/MdlObjSizer.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/MdlObjSizer.module +# /home/moe/area-51/projects/installer/MdlObjSizer.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlPkgSel.pot ============================================================================== --- branches/iVL/.lang/MdlPkgSel.pot (original) +++ branches/iVL/.lang/MdlPkgSel.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/MdlPkgSel.module +# /home/moe/area-51/projects/installer/MdlPkgSel.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlSetup.pot ============================================================================== --- branches/iVL/.lang/MdlSetup.pot (original) +++ branches/iVL/.lang/MdlSetup.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/MdlSetup.module +# /home/moe/area-51/projects/installer/MdlSetup.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlSummarize.pot ============================================================================== --- branches/iVL/.lang/MdlSummarize.pot (original) +++ branches/iVL/.lang/MdlSummarize.pot Tue Aug 26 10:16:38 2008 @@ -1,4 +1,4 @@ -# /home/vluser/area-51/projects/installer/MdlSummarize.module +# /home/moe/area-51/projects/installer/MdlSummarize.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/MdlInstallSys.module ============================================================================== --- branches/iVL/MdlInstallSys.module (original) +++ branches/iVL/MdlInstallSys.module Tue Aug 26 10:16:38 2008 @@ -206,14 +206,26 @@ "#/dev/hda1 /mnt/dos msdos umask=0 0 0 \n" & "#/dev/hda1 /mnt/win vfat fmask=111,dmask=0,quiet,shortname=mixed,user 0 0 \n" & "#/dev/hda1 /mnt/win ntfs umask=0 0 0\n" - IF ClsWinDrives.sWinDrives THEN - FOR i = 0 TO ClsWinDrives.sWinDrives.Count - 1 - sWinPart = Trim(Left(ClsWinDrives.sWinDrives[i], InStr(ClsWinDrives.sWinDrives[i], "|") - 1)) - sWinMntPnt = Trim(Right(ClsWinDrives.sWinDrives[i], Len(ClsWinDrives.sWinDrives[i]) - InStr(ClsWinDrives.sWinDrives[i], "|"))) - 'Message("Mount " & sWinPart & " to " & sWinMntPnt) - ' if this is right... then add it to the file - NEXT - END IF + +' LET'S GET THE WINDOWS PARTITIONS IN HERE +FOR EACH cb IN MdlWinDrives.oWMntPoints + IF cb.text <> "Do not mount" THEN + sDrive = Left(cb.tag, Len("/dev/hda")) + spartNo = Right(cb.tag, Len(cb.tag) - Len(sDrive)) + IF Len(sPartNo) > 1 THEN + sBlank = "" + ELSE + sBlank = " " + END IF + SHELL "export sfmt=$(parted " & sDrive & " print | grep ^\'" & sBlank & sPartNo & "\'); echo $sfmt | cut -f 6 -d \' \'" TO sRes + IF sRes = "fat32" OR sRes = "fat16" THEN sRes = "vfat" + sFstab = sFstab & "\n" & + cb.tag & Space(1) & cb.text & Space(1) & sRes & Space(1) & ME.fS_oPTIONS(sRes) & " 0 0 " + END IF + ' create the mount point for the target + TRY MKDIR ClsGlobal.sTargetMnt &/ cb.Text +NEXT + sFstab = sFstab & "\n\n" & "# Floppy disks \n" & @@ -251,15 +263,7 @@ END IF NEXT - - -' ' ' IF ClsPartSel.sSwap THEN -' ' ' ' take a second here to throw the swap line to the current running system -' ' ' SHELL "echo \'" & ClsPartSel.sSwap & Space(5) & "none" & Space(5) & "swap" & Space(5) & "sw" & Space(5) & "0" & Space(5) & "0" & "\' >> /etc/fstab" WAIT -' ' ' 'write the same line to the future fstab -' ' ' sFstab = sFstab & gb.NewLine & -' ' ' ClsPartSel.sSwap & Space(5) & "none" & Space(5) & "swap" & Space(5) & "sw" & Space(5) & "0" & Space(5) & "0" -' ' ' END IF + sFstab = sFstab & "\n" ' Wheewww!... that's the whole fstab there... Please fix the win partitions @@ -281,7 +285,7 @@ SELECT CASE LCase(sType) CASE "reiserfs" sMntOpts = "noatime" - CASE "vfat" + CASE "vfat", "fat32", "fat16" sMntOpts = "fmask=111,dmask=0,gid=users,shortname=mixed,quiet,user" CASE "ntfs" sMntOpts = "umask=0,gid=users,user" @@ -363,7 +367,7 @@ FrmInstallSys.pbInstallProg2.Value = 1 'Message.Info("Vectorlinux is now installed in your system. Please click next to configure it.") FrmInstallSys.tlBanner.Text = "Vectorlinux is now installed in your system. Please click next to configure it." - FrmInstallSys.tlCurrPkg.Text = "packages have been Installed. Please click next to move on to System Configuration." + FrmInstallSys.tlCurrPkg.Text = "packages have been installed in your system. Please click next to configure it." WITH FMain .btQuit.Enabled = TRUE .btQuit.ForeColor = Color.Black Modified: branches/iVL/MdlWinDrives.module ============================================================================== --- branches/iVL/MdlWinDrives.module (original) +++ branches/iVL/MdlWinDrives.module Tue Aug 26 10:16:38 2008 @@ -123,146 +123,52 @@ y = y + tl.Height + 4 NEXT ' now do ntfs partitions the same way - - - - END IF - RETURN - - - - - sDump1 = "" - SHELL "probepart | grep -e \'/dev\' | grep -v \' Ext\' | grep -v \'raid autodetect\' | grep -v \' Linux\' | cut -f 1 -d \' \' | sed -r \'s/Disk//g\'" TO sdump1 - File.Save(Temp("all"), Trim(sDump1)) - - vObj = NEW Object[] -sDump1 = File.Load(Temp("all")) -sDump1 = Trim(sDump1) -'Message(sDump1) - IF sDump1 <> "" THEN - sDump1 = Trim(sDump1) - 'y = y + tl.Height * 2 + 4 - ' create a new text label just to label the separation between windows and linux partitions - tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "Separator" - WITH tl - .Text = "<b>Windows Partitions Detected</b>" - .Height = 27 - .Width = MdlObjSizer.get_object_width(.Text) - .x = FrmWinDrives.svWinDrives.Width / 2 - (.Width / 2) - .y = y - cbx = .x + .Width - (.Width / 2) - END WITH - - y = y + tl.Height + 8 - - tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "Headers" - WITH tl - .x = x - .y = y - .text = "<B>PARTITION</B>" - .Width = MdlObjSizer.get_object_width(.Text) * 1.5 - .Height = 27 - END WITH - cbx = x + (tl.Width) * 2 - tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "Headers" - WITH tl - .x = cbx - .y = y - .text = "<b>MOUNT TO </B>" - .Width = MdlObjSizer.get_object_width(.Text) * 1.5 - .Height = 27 - END WITH - y = y + tl.Height + 8 - - 'END IF - IF InStr(sDump1, gb.NewLine) THEN ' more than one partition found - sPartList = Split(sDump1, gb.NewLine) ' multiple partitions found - 'initiate the array - ClsWinDrives.sWinDrives = NEW String[] - FOR i = 0 TO sPartList.Count - 1 - sPart = Right(sPartList[i], Len(sPartList[i]) - RInStr(sPartList[i], "/")) - - SHELL "mkdir /mnt" &/ spart & " && mount " & Trim(sPartList[i]) & Space(1) & "/mnt" &/ sPart WAIT - ' get the size using df -h | grep sPart and some sed - ' will embed some bash, but should probabbly be fixed - SHELL "export " & sPart & "=$(df -h | grep " & sPart & ") && echo $" & sPart & " | cut -f 2 -d \' \'" TO sSize - SHELL "umount /mnt" &/ spart WAIT - 'SHELL "rm -rf /mnt" &/ spart WAIT - TRY RMDIR "/mnt" &/ sPart - - - tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "WinPartitions" + sDump1 = "" + sDisks.Clear + SHELL "probepart | grep -i ntfs | cut -f 1 -d \' \'" TO sDump1 + sDisks = Split(sDump1, "\n") + FOR i = 0 TO sDisks.Count - 1 + sPartNo = Right(sDisks[i], Len(sDisks[i]) - Len("/dev/hda")) + IF Len(sPartNo) > 1 THEN + sBlank = "" + ELSE + sBlank = " " + END IF + SHELL "export s=$(parted " & Left(sDisks[i], Len("/dev/hda")) & " print | grep ^\'" & sBlank & sPartNo & "\'); echo $s | cut -f 4 -d \' \'" TO sPartsize + tl = NEW TextLabel(FrmWinDrives.svWinDrives) WITH tl + .y = y + .x = x + .text = sDisks[i] & " [ " & sPartsize & " ]" + .Width = 200 + .Height = 21 + .tag = sDisks[i] + .Alignment = Align.Normal + END WITH + cb = NEW ComboBox(FrmWinDrives.svWinDrives) + WITH cb + .x = cbx + .y = tl.top + .Width = tl.Width * 0.75 + .Height = 21 + .tag = sDisks[i] + .Add("/mnt" &/ Right(.tag, Len(.tag) - RInStr(.tag, "/"))) + .Add("Do not mount") - .Text = sPartList[i] & " ( " & sSize & " )" - .Width = MdlObjSizer.get_object_width(.Text) ' * 1.5 - .Tag = sPartList[i] - .Height = 27 - .x = x 'FrmPartSel.tlPartRow.Left - .y = y - - IF .Width > lbwidth THEN - lbwidth = .Width - ELSE - .Width = lbwidth - END IF - ME.vObj.Add(tl) - END WITH - - - ClsWinDrives.sWinDrives.Add(tl.Tag & "|" & "/mnt/" & sPart) - ' now create the combobox to select the mount point - cb = NEW ComboBox(FrmWinDrives.svWinDrives) AS "WinMntPoints" - oWMntPoints = NEW Object[] - WITH cb - .Tag = sPartList[i] - .Height = 27 - '.x = FrmPartSel.scrollPartitions.Width / 2 'lbwidth + 12 - .x = cbx 'x + tl.Width + 8 'FrmPartSel.tlPartRow2.Left - .y = tl.Top - .Add("/mnt" &/ sPart) - .Add("Do not mount") - .Width = MdlObjSizer.get_object_width("Do not mount") * 2 - .ReadOnly = FALSE -' .border = border.Plain - ME.oWMntPoints.Add(cb) - END WITH - - y = y + tl.Height + 4 - ' + '.ReadOnly = TRUE + END WITH + ME.oWMntPoints.Add(cb) - NEXT - - + + y = y + tl.Height + 4 + NEXT - ELSE ' only one win partition found - - - sPart = Right(sDump1, Len(sDump1) - RInStr(sDump1, "/")) - 'Message(sPart) - SHELL "mkdir -p /mnt" &/ spart & " && mount " & Trim(sDump1) & Space(1) & "/mnt" &/ sPart WAIT - SHELL "export " & sPart & "=$(df -h | grep " & sPart & ") && echo $" & sPart & " | cut -f 2 -d \' \'" TO sSize - sSize = Trim(sSize) - 'Message(sSize) - - - y = y + tl.Height + 4 - tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "WinPartitions" - WITH tl - .Text = sDump1 & " ( " & sSize & " )" - .tag = sDump1 - .Height = 27 - .Width = MdlObjSizer.get_object_width(.Text) * 1.5 - .x = FrmPartSel.tlPartRow.Left - .y = y - - END WITH - SHELL "umount /mnt" &/ spart WAIT - SHELL "rm -rf /mnt" &/ spart WAIT - END IF + + + 'END IF + ELSE ' no widnows partitions found tl = NEW TextLabel(FrmWinDrives.svWinDrives) |