Files
new_install/text/ri_main.py
Peng Zhihui edd0de8e28 add a feature: when run install program you can skip partition
by use parameter -p or --skip-partition.

	modified:   main/setup
	modified:   operation/configure_fstab.sh
	modified:   text/ri_main.py
2014-03-18 14:29:05 +08:00

71 lines
1.7 KiB
Python

import os
import sys
sys.path.append('../interface/')
sys.path.append('../new_partition/')
sys.path.append('/var/install')
import ri_data
import partition_data
import interface_partition
import ri_newt
import install_step_list
#list=['welcome','partition','raid','mountpoint','serialnumber','network','group','service','information']
list = install_step_list.list
init_partition_from_os_flag = True
init_flag = True
init_raid_from_os = True
count=0
while True :
if init_raid_from_os:
ri_data.Raid.init_from_os()
init_raid_from_os = False
if init_partition_from_os_flag:
partition_data.Partition.init_from_os(unit='s')
init_partition_from_os_flag = False
if init_flag:
ri_data.init()
init_flag = False
if list[count] == 'partition':
s = interface_partition.main()
if len(ri_newt.Raid.init_from_internal()) < 2 and len(ri_data.Raid.dict) == 0:
if list[count+1] == 'raid':
del list[count+1]
else:
if list[count+1] != 'raid':
list.insert(count+1, 'raid')
else:
if list[count] == 'welcome':
ri_newt.Welcome()
elif list[count] == 'raid':
ri_newt.Raid()
elif list[count] == 'mountpoint':
ri_newt.MountPoint()
elif list[count] == 'serialnumber':
ri_newt.SerialNumber()
elif list[count] == 'network':
ri_newt.Network()
elif list[count] == 'group':
ri_newt.Group()
elif list[count] == 'service':
ri_newt.Service()
elif list[count] == 'information':
ri_newt.Prepar_installation()
s = ri_newt.Screen.dict[list[count]].set_data()
if int(s) == 0:
count = count + 1
else:
count = count - 1
if count < 0 or count > len(list) - 1:
ri_newt.Screen.screen.finish()
break
if s == 0:
os.system("python ../interface/ri_install.py")