/[gli]/trunk/src/GLIStorageDevice.py
Gentoo

Diff of /trunk/src/GLIStorageDevice.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 197 Revision 198
24 self._parted_disk = parted.PedDisk.new(self._parted_dev) 24 self._parted_disk = parted.PedDisk.new(self._parted_dev)
25 self.set_disk_geometry_from_disk() 25 self.set_disk_geometry_from_disk()
26 26
27 def set_disk_geometry_from_disk(self): 27 def set_disk_geometry_from_disk(self):
28 self._total_bytes = self._parted_dev.length * self._parted_dev.sector_size 28 self._total_bytes = self._parted_dev.length * self._parted_dev.sector_size
29# if string.strip(commands.getoutput("echo " + self._device + " | grep '/hd'")) == self._device: # IDE 29 if string.strip(commands.getoutput("echo " + self._device + " | grep '/hd'")) == self._device: # IDE
30# proc_dir = "/proc/ide/" + commands.getoutput("echo " + self._device + " | cut -d '/' -f 3") 30 proc_dir = "/proc/ide/" + commands.getoutput("echo " + self._device + " | cut -d '/' -f 3")
31# proc_dir = string.strip(proc_dir) 31 proc_dir = string.strip(proc_dir)
32# heads = commands.getoutput("cat " + proc_dir + "/geometry | grep logical | cut -d '/' -f 2") 32 heads = commands.getoutput("cat " + proc_dir + "/geometry | grep logical | cut -d '/' -f 2")
33# sectors = commands.getoutput("cat " + proc_dir + "/geometry | grep logical | cut -d '/' -f 3") 33 sectors = commands.getoutput("cat " + proc_dir + "/geometry | grep logical | cut -d '/' -f 3")
34# total_sectors = commands.getoutput("cat " + proc_dir + "/capacity") 34 total_sectors = commands.getoutput("cat " + proc_dir + "/capacity")
35# cylinders = int(total_sectors) / (int(heads) * int(sectors)) 35 cylinders = int(total_sectors) / (int(heads) * int(sectors))
36# self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = int(heads), int(sectors), int(cylinders) 36 self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = int(heads), int(sectors), int(cylinders)
37# else: #SCSI 37 else: #SCSI
38 self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = self._parted_dev.heads, self._parted_dev.sectors, self._parted_dev.cylinders 38 self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = self._parted_dev.heads, self._parted_dev.sectors, self._parted_dev.cylinders
39 39
40 self._cylinder_bytes = self._geometry['heads'] * self._geometry['sectors'] * self._parted_dev.sector_size 40 self._cylinder_bytes = self._geometry['heads'] * self._geometry['sectors'] * self._parted_dev.sector_size
41 self._total_sectors = self._geometry['cylinders'] * self._geometry['heads'] * self._geometry['sectors'] 41 self._total_sectors = self._geometry['cylinders'] * self._geometry['heads'] * self._geometry['sectors']
42 self._sectors_in_cylinder = self._geometry['heads'] * self._geometry['sectors'] 42 self._sectors_in_cylinder = self._geometry['heads'] * self._geometry['sectors']
43 43

Legend:
Removed from v.197  
changed lines
  Added in v.198

  ViewVC Help
Powered by ViewVC 1.1.20