Add auto install, HdInstall and state grid custom install
new file: AutoInstall/auto_install.py new file: StateGrid/state_grid.py modified: interface/ri_data.py modified: operation/exec_finish_install.sh new file: operation/finish_install.py renamed: operation/99finish_install.sh -> operation/finish_install/99finish_install.sh new file: xml/install.xml
This commit is contained in:
64
AutoInstall/auto_install.py
Normal file
64
AutoInstall/auto_install.py
Normal file
@@ -0,0 +1,64 @@
|
||||
import os,sys
|
||||
from xml.dom import minidom
|
||||
from xml.dom.ext import PrettyPrint
|
||||
sys.path.append('../interface/')
|
||||
sys.path.append('../new_partition/')
|
||||
sys.path.append('../text/')
|
||||
import ri_data
|
||||
import partition_data
|
||||
import interface_partition
|
||||
import ri_newt
|
||||
|
||||
list=['partition','raid','mountpoint']
|
||||
install_xml = '/var/install/install.xml'
|
||||
|
||||
init_partition_from_os_flag = True
|
||||
init_mountpoint_flag = True
|
||||
init_raid_from_os = True
|
||||
count=0
|
||||
while True :
|
||||
if count == 0:
|
||||
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
|
||||
s = interface_partition.main()
|
||||
|
||||
if init_mountpoint_flag:
|
||||
ri_data.MountPoint.init_from_internal()
|
||||
init_mountpoint_flag = False
|
||||
if len(ri_newt.Raid.init_from_internal()) < 2 and len(ri_data.Raid.dict) == 0:
|
||||
if list[1] == 'raid':
|
||||
del list[1]
|
||||
else:
|
||||
if list[1] != 'raid':
|
||||
list.insert(1, 'raid')
|
||||
else:
|
||||
if list[count] == 'raid':
|
||||
ri_newt.Raid()
|
||||
elif list[count] == 'mountpoint':
|
||||
ri_newt.MountPoint()
|
||||
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':
|
||||
xmldoc = minidom.parse(install_xml)
|
||||
root = xmldoc.firstChild
|
||||
f = file(install_xml, 'w')
|
||||
partition_data.Partition.to_xml(xmldoc, root)
|
||||
ri_data.Raid.to_xml(xmldoc, root)
|
||||
PrettyPrint(xmldoc, f)
|
||||
f.close()
|
||||
os.system("python ../interface/ri_install.py")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user