Add --iso option.

lvmraid
Mike Hiretsky 13 years ago
parent b129e397bc
commit 5eaedb26fe

@ -313,6 +313,9 @@ class fillVars(object, glob_attr):
dev_hash['options'] = fstab.getBy(what=fstab.OPTS,eq=devName) or ""
dev_hash['size'] = getPartitionSize(disk)
dev_hash['content'] = osProberHash.get(devName,'')
if not dev_hash['content'] and devParent in devicesHash and \
devicesHash[devParent]['type'] == "flash":
dev_hash['content'] = distrRep._getfromcontent(devName).get('name','')
if devParent in devicesHash and 'ID_PART_ENTRY_NUMBER' in props:
dev_hash['grub'] = "%s,%d"%(devicesHash[devParent]['map'],
int(props['ID_PART_ENTRY_NUMBER'])-1)
@ -689,7 +692,9 @@ class fillVars(object, glob_attr):
discardType = ["dir"]
else:
discardType = []
distRep = DistributiveRepository(self.Get('cl_image_path'))
if type(imagePath) == str:
imagePath = [imagePath]
distRep = DistributiveRepository(imagePath)
return distRep.getBestDistributive(march=archMachine,
shortname=shortName.lower(),
discardType=discardType,

@ -2470,3 +2470,17 @@ the system") + " (yes/no)"
self.printERROR(_("Package uninstallation failed"))
return False
return True
def setIso(self,isoimage):
"""Set iso image for installation"""
imageData = DistributiveRepository()._getfromcontent(isoimage)
if "name" in imageData and imageData.get('build','') and \
"march" in imageData:
self.clVars.Set('os_install_arch_machine',
imageData['march'],True)
self.setLinuxName(imageData['name'].upper())
self.clVars.Set('cl_image',True)
return True
else:
self.printERROR(_("Wrong image file"))
return False

@ -57,6 +57,9 @@ CMD_OPTIONS = [{'shortOption':"d",
'choices':['flash','hdd','usb-hdd'],
'help':_("device type for installed system")
},
{'longOption':'iso',
'optVal':"ISO",
'help':_("ISO image for installation")},
{'shortOption':"s",
'longOption':"os",
'optVal':"SYSTEM",
@ -372,6 +375,10 @@ class install_cmd(share_cmd):
self.logicObj.clVars.Set('os_install_root_type',
self.optobj.values.type, True)
if self.optobj.values.iso:
if not self.logicObj.setIso(self.optobj.values.iso):
return False
listDiskOptions = []
listBindOptions = []
listSwapOptions = []
@ -469,8 +476,10 @@ class install_cmd(share_cmd):
if self.logicObj.installSystem(force=force, bootDisk=bootDisk,
stdinReadPwd=stdinReadPwd, builder=builder,
flagSpinner=flagSpinner,update=update):
self.defaultPrint("\n")
self.defaultPrint(_("To apply changes you have to reboot")+".\n")
if self.logicObj.clVars.Get('os_install_root_type') != "flash":
self.defaultPrint("\n")
self.defaultPrint(_("To apply changes you have to reboot")+
".\n")
return True
else:
return False

Loading…
Cancel
Save