update
modified: di_dialog.py modified: di_main.py modified: ../interface/ri_data.py modified: ../main/setup
This commit is contained in:
@@ -56,15 +56,9 @@ class Raid(Dialog):
|
||||
self.width=width
|
||||
self.text=text
|
||||
|
||||
def check_device(self):
|
||||
print ri_data.Raid.dict.keys()
|
||||
if ri_data.Raid.dict.keys():
|
||||
return True
|
||||
return False
|
||||
|
||||
def raid_raw_init(self):
|
||||
@staticmethod
|
||||
def raid_raw_init():
|
||||
''' initialize raid raw devices (parttion with id 'fd' '''
|
||||
#global raid_raw_initialized
|
||||
# get all component devices already in raid
|
||||
dev_in_raid = ri_data.Raid.dev_in_raid()
|
||||
|
||||
@@ -75,7 +69,7 @@ class Raid(Dialog):
|
||||
|
||||
def raid_raw_map(self):
|
||||
list=[]
|
||||
fd=self.raid_raw_init()
|
||||
fd=Raid.raid_raw_init()
|
||||
for d in fd:
|
||||
list.append((d,'','off'))
|
||||
return list
|
||||
@@ -122,7 +116,7 @@ class Raid(Dialog):
|
||||
return s
|
||||
|
||||
def make_raid(self):
|
||||
fd_devices=self.raid_raw_init()
|
||||
fd_devices=Raid.raid_raw_init()
|
||||
|
||||
# from os
|
||||
raid_text=''
|
||||
@@ -163,23 +157,23 @@ class Raid(Dialog):
|
||||
def set_data(self):
|
||||
while True:
|
||||
list = [('Making the raid device',''),('Delect raid device','')]
|
||||
fd_devices=self.raid_raw_init()
|
||||
fd_devices=Raid.raid_raw_init()
|
||||
fd_devices_test=''
|
||||
raid_text=''
|
||||
|
||||
from_os_list= [ R.from_os for R in ri_data.Raid.dict.values() ]
|
||||
from_os_list= [ R.from_os for R in ri_data.Raid.dict.values() if R.from_os == 'no' ]
|
||||
|
||||
if len(fd_devices) < 3 and not from_os_list :
|
||||
return 0
|
||||
|
||||
if not fd_devices :
|
||||
del list[0]
|
||||
del list[list.index(('Making the raid device',''))]
|
||||
else:
|
||||
fd_devices_test='fd: '+','.join(fd_devices)
|
||||
|
||||
|
||||
if 'no' not in from_os_list:
|
||||
del list[1]
|
||||
if not from_os_list:
|
||||
del list[list.index(('Delect raid device',''))]
|
||||
else:
|
||||
for R in ri_data.Raid.dict.values():
|
||||
raid_text+='%s (%s):\n active %s; spare %s\n'%(R.device,R.from_os,R.active_components,R.spare_components)
|
||||
@@ -266,20 +260,14 @@ class MountPoint(Dialog):
|
||||
|
||||
# check date
|
||||
if not ri_data.MountPoint.check_data(string, # device
|
||||
ri_data.MountPoint.dict[string].directory.rstrip('/'), # mountpoint
|
||||
ri_data.MountPoint.dict[string].directory, # mountpoint
|
||||
ri_data.MountPoint.dict[string].filesystem): # filesystem
|
||||
|
||||
ri_data.MountPoint.dict[string].directory = ''
|
||||
Dialog.message("The mount point couldn't be mounted on because it has been used or it's particular.")
|
||||
elif exit_info == 1 :
|
||||
# back
|
||||
break
|
||||
else:
|
||||
# next
|
||||
exit_info = 0
|
||||
break
|
||||
return (exit_info == 'help' and 0 or exit_info)
|
||||
|
||||
return exit_info
|
||||
|
||||
class Network(Dialog):
|
||||
def __init__(self,height=10,width=30,text='Configure network'):
|
||||
|
||||
@@ -4,8 +4,6 @@ sys.path.append('../interface/')
|
||||
import ri_data
|
||||
import di_dialog
|
||||
|
||||
list=['welcome','raid','mountpoint','serialnumber','network','group','service','information']
|
||||
|
||||
di_dialog.Welcome(30,70)
|
||||
di_dialog.Raid(30,70)
|
||||
di_dialog.MountPoint(30,70)
|
||||
@@ -15,6 +13,12 @@ di_dialog.Group(30,70)
|
||||
di_dialog.Service(25,50)
|
||||
di_dialog.Prepar_installation(40,100)
|
||||
|
||||
|
||||
list=['welcome','raid','mountpoint','serialnumber','network','group','service','information']
|
||||
|
||||
if len(di_dialog.Raid.raid_raw_init()) < 3:
|
||||
del list[1]
|
||||
|
||||
count=0
|
||||
while True :
|
||||
s = di_dialog.Dialog.dict[list[count]].set_data()
|
||||
|
||||
@@ -415,6 +415,10 @@ p_node - xml node (parent node)'''
|
||||
if dr and dr in [ m.directory for m in MountPoint.dict.values() if m.device !=dev ]:
|
||||
return False
|
||||
|
||||
# if fs is swap, then dr must be none
|
||||
if fs == 'swap' and dr:
|
||||
return False
|
||||
|
||||
# check mount point is special or not
|
||||
if dr in ['/etc','/bin','/sbin','/lib']:
|
||||
return False
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#===================================================================================
|
||||
#Set variables
|
||||
#===================================================================================
|
||||
workdir="$(pwd)/../interface"
|
||||
workdir="/usr/lib/new_install/interface"
|
||||
exec_file='xinitrc_setup'
|
||||
work_write_dir='/var/install'
|
||||
configfile="../xml/config.xml"
|
||||
@@ -68,7 +68,7 @@ main(){
|
||||
while true;do
|
||||
case "$1" in
|
||||
'-c'|'--configfile') configfile="$2" ; shift 2;;
|
||||
'-s'|'--style') xstart='no';style="dialog" ;workdir="$(pwd)/../dialog";shift ;;
|
||||
'-s'|'--style') xstart='no';style="dialog" ;workdir="/usr/lib/new_install/dialog";shift ;;
|
||||
'-l'|'--language') language="$2" ;shift 2;;
|
||||
'-n'|'--noXserver') xstart='no' ;shift ;;
|
||||
'-h'|'--help') usage ; exit 0 ;;
|
||||
|
||||
Reference in New Issue
Block a user