Added variables for disk drives

netsetup
Mike Hiretsky 14 years ago
parent 948e65259c
commit 3520ad2ecb

@ -348,8 +348,17 @@ class PartitionDistributive(Distributive):
def formatPartition(self,format=""):
"""Format partition"""
if isMount(self.partition) == '/':
raise DistributiveError(
"Cann't format root partition %s" %
self.partition)
if isMount(self.partition):
raise DistributiveError(
"Cann't format partition %s, because it is mounted" %
self.partition)
# TODO: need multipartition formating
res,errmes = self.runOsCommand("/sbin/mkfs.reiserfs -f %s" % self.partition)
res,errmes = self.runOsCommand("/sbin/mkfs.reiserfs -f %s" %
self.partition)
if res == 0:
return True
else:
@ -367,9 +376,10 @@ class PartitionDistributive(Distributive):
raise DistributiveError("Wrong partition name '%s'"%self.partition)
pipe = Popen(["/sbin/grub",
"--device-map=%s/boot/grub/device.map"%self.getDirectory(),
"--batch"], stdin=subprocess.PIPE,stdout=subprocess.PIPE)
pipe.stdin.write("root (hd%d,%d)\n"%(hddNum,partitionNum))
"--no-floppy",
"--batch"], stdin=PIPE,stdout=PIPE)
# TODO: change hd0 for bootloader install to other disks
pipe.stdin.write("root (hd%d,%d)\n"%(hddNum,partitionNum))
pipe.stdin.write("setup (hd0)\n")
pipe.stdin.write("quit\n")
pipe.stdin.close()

@ -95,9 +95,8 @@ class cl_install(color_print):
def printInfo(self,sourceDistr,targetDistr):
self.printSUCCESS(_("Installation %s %s")%
("<needed>","<needed>"))
# (self.clVars.Get('os_linux_name'),
# self.clVars.Get('os_linux_subname')))
(self.clVars.Get('os_linux_name'),
self.clVars.Get('os_linux_subname')))
self.defaultPrint(_("System information\n"))
self.printSUCCESS(_("Computer name")+": %s"%
self.clVars.Get('os_net_hostname'))
@ -106,8 +105,7 @@ class cl_install(color_print):
self.printSUCCESS(_("Network devices")+": %s"%
self.clVars.Get("os_net_interfaces_info"))
self.printSUCCESS(_("Installed system")+": %s %s"%
(self.clVars.Get('os_linux_name'),
self.clVars.Get('os_linux_ver')))
(self.old_os_linux_name, self.old_os_linux_ver))
self.defaultPrint(_("Hardware\n"))
self.printSUCCESS(_("Machine hardware name")+": %s"%
self.clVars.Get('os_arch_machine'))
@ -184,10 +182,13 @@ class cl_install(color_print):
try:
targetDistr = self.getTargetDistributive(disk,buildermode)
distRep = DistributiveRepository('/usr/calculate/share/linux')
osname = osname or self.clVars.Get('os_linux_shortname')
self.old_os_linux_name = self.clVars.Get('os_linux_shortname')
self.old_os_linux_ver = self.clVars.Get('os_linux_ver')
if osname:
self.clVars.Set('os_linux_shortname',osname.upper())
sourceDistr = distRep.getLastDistributive(
march=self.clVars.Get('os_arch_machine'),
shortname=osname.lower())
shortname=self.clVars.Get('os_linux_shortname').lower())
if sourceDistr:
# print info
self.printInfo(sourceDistr,targetDistr)
@ -211,6 +212,7 @@ class cl_install(color_print):
self.prepareBoot(targetDistr)
else:
self.printWARNING("No update available.")
return False
except (InstallError,DistributiveError),e:
error = e
@ -223,7 +225,7 @@ class cl_install(color_print):
self.printSUCCESS(_("Releasing source distributive"))
sourceDistr.close()
if targetDistr:
self.printSUCCESS(_("Unmount installed system volume"))
self.printSUCCESS(_("Unmount target system volume"))
targetDistr.close()
except KeyboardInterrupt,e:
pass

@ -31,7 +31,56 @@ class Data:
# program version
cl_ver = {'value':'2.2.0'}
# maching architecture
os_arch_machine = {'mode':'w'}
# inforamation about net interfaces
os_net_interfaces_info = {}
# list of available partition devices
os_disk_dev = {}
# list mounted points for installed system
os_disk_install = {}
# list mounted points for current operation system
os_disk_load = {}
# list filesystem for partition devices
os_disk_format = {}
# list uudi for partition devices
os_disk_uuid = {}
# list grub id for partition devices
os_disk_grub = {}
# type of partition devices (primary, extended or logical)
os_disk_part = {}
# partition size
os_disk_size = {}
# label of partitions
os_disk_name = {}
# devices
os_device_dev = {}
# device type (hdd,cdrom,usb-flash)
os_device_type = {}
# map number for grub
os_device_map = {}
# part of current grub.conf
os_grub_info = {}
# content of device.map file for grub
os_grub_devicemap_info = {}
# information about mount points for fstab
os_fstab_mount_info = {}
# information about swap for fstab
os_fstab_swap_info = {}

Loading…
Cancel
Save