From: <cod...@go...> - 2008-11-23 05:15:21
|
Author: M0...@gm... Date: Sat Nov 22 21:14:14 2008 New Revision: 320 Modified: branches/iVL/MdlWinDrives.module Log: attempt to fix windows partitions detection Modified: branches/iVL/MdlWinDrives.module ============================================================================== --- branches/iVL/MdlWinDrives.module (original) +++ branches/iVL/MdlWinDrives.module Sat Nov 22 21:14:14 2008 @@ -47,7 +47,8 @@ ' MOVE THESE PARTITIONS TO A DIFFERENT WINDOW. ' THESE ARE ONLY NEEDED FOR FSTAB - SHELL "probepart | grep -i fat | cut -f 1 -d \' \'" TO sDump1 + 'SHELL "probepart | grep -i fat | cut -f 1 -d \' \'" TO sDump1 + SHELL "fdisk -l| grep -E \'^/dev/.* * .*(FAT16|FAT32|HPFS|NTFS|Win)\' | cut -f 1 -d \' \'" TO sDump1 'message(sDump1) IF sDump1 <> "" THEN sDump1 = Trim(sDump1) @@ -130,59 +131,60 @@ y = y + tl.Height + 4 NEXT - ' now do ntfs partitions the same way - sDump1 = "" - 'sDisks.Clear - SHELL "probepart | grep -i ntfs | cut -f 1 -d \' \'" TO sDump1 - sDump1 = Trim(sDump1) - wintfs = Split(sDump1, "\n") - FOR i = 0 TO wintfs.Count - 1 - sPartNo = Right(wintfs[i], Len(wintfs[i]) - Len("/dev/hda")) - IF Len(sPartNo) > 1 THEN - sBlank = "" - ELSE - sBlank = " " - END IF - 'we need to know if this fails. it fails on a test machine here with "bad partition table" - SHELL "export s=$(parted " & Left(wintfs[i], Len("/dev/hda")) & " print | grep ^\'" & sBlank & sPartNo & "\'); echo $s | cut -f 4 -d \' \'" TO sPartsize - 'IF sPartSize.len = 0 THEN - IF Len(sPartsize) = 0 THEN - sPartSize = "UNKNOWN" - ENDIF - tl = NEW TextLabel(FrmWinDrives.svWinDrives) - WITH tl - .y = y - .x = x - .text = wintfs[i] & " [ " & sPartsize & " ]" - .Width = 200 - .Height = 21 - .tag = wintfs[i] - .Alignment = Align.Normal - END WITH - ME.tlWnParts.Add(tl) - cb = NEW ComboBox(FrmWinDrives.svWinDrives) - WITH cb - .x = cbx - .y = tl.top - .Width = tl.Width * 0.75 - .Height = 21 - .tag = wintfs[i] - .Add("/mnt" &/ Right(.tag, Len(.tag) - RInStr(.tag, "/"))) - .Add(("Do not mount")) - - '.ReadOnly = TRUE - END WITH - ME.oWMntPoints.Add(cb) - - - - y = y + tl.Height + 4 - NEXT - - - - - 'END IF + ' ' ' now do ntfs partitions the same way + ' ' sDump1 = "" + ' ' 'sDisks.Clear + ' ' 'SHELL "probepart | grep -i ntfs | cut -f 1 -d \' \'" TO sDump1\ + ' ' SHELL "fdisk -l| grep -E \'^/dev/.* * .*(FAT16|FAT32|HPFS|NTFS| Win)\' | cut -f 1 -d \' \'" TO sDump1 + ' ' sDump1 = Trim(sDump1) + ' ' wintfs = Split(sDump1, "\n") + ' ' FOR i = 0 TO wintfs.Count - 1 + ' ' sPartNo = Right(wintfs[i], Len(wintfs[i]) - Len("/dev/hda")) + ' ' IF Len(sPartNo) > 1 THEN + ' ' sBlank = "" + ' ' ELSE + ' ' sBlank = " " + ' ' END IF + ' ' 'we need to know if this fails. it fails on a test machine here with "bad partition table" + ' ' SHELL "export s=$(parted " & Left(wintfs[i], Len("/dev/hda")) & " print | grep ^\'" & sBlank & sPartNo & "\'); echo $s | cut -f 4 -d \' \'" TO sPartsize + ' ' 'IF sPartSize.len = 0 THEN + ' ' IF Len(sPartsize) = 0 THEN + ' ' sPartSize = "UNKNOWN" + ' ' ENDIF + ' ' tl = NEW TextLabel(FrmWinDrives.svWinDrives) + ' ' WITH tl + ' ' .y = y + ' ' .x = x + ' ' .text = wintfs[i] & " [ " & sPartsize & " ]" + ' ' .Width = 200 + ' ' .Height = 21 + ' ' .tag = wintfs[i] + ' ' .Alignment = Align.Normal + ' ' END WITH + ' ' ME.tlWnParts.Add(tl) + ' ' cb = NEW ComboBox(FrmWinDrives.svWinDrives) + ' ' WITH cb + ' ' .x = cbx + ' ' .y = tl.top + ' ' .Width = tl.Width * 0.75 + ' ' .Height = 21 + ' ' .tag = wintfs[i] + ' ' .Add("/mnt" &/ Right(.tag, Len(.tag) - RInStr(.tag, "/"))) + ' ' .Add(("Do not mount")) + ' ' + ' ' '.ReadOnly = TRUE + ' ' END WITH + ' ' ME.oWMntPoints.Add(cb) + ' ' + ' ' + ' ' + ' ' y = y + tl.Height + 4 + ' ' NEXT + ' ' + ' ' + ' ' + ' ' + ' ' 'END IF ELSE ' no widnows partitions found |