modified: main/begin-install modified: operation/finish_install/98state_grid_custom.py new file: operation/finish_install/exec_install_40.sh modified: operation/functions new file: xml/install-40-d5000.xml Signed-off-by: Xu, Shunxuan <sxxu@linx-info.com>
34 lines
863 B
Python
Executable File
34 lines
863 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
# run finish_install scripts
|
|
#
|
|
|
|
import os,sys,re
|
|
sys.path.append('../interface')
|
|
import ri_data
|
|
|
|
# get data from install.xml
|
|
ri_data.init_from_xml()
|
|
username = ri_data.StateGrid.username
|
|
homedir = ri_data.StateGrid.home_dir
|
|
shell = ri_data.StateGrid.shell
|
|
|
|
# run state grid custom scripts
|
|
#f = open('/proc/cmdline', 'r')
|
|
#cmdline = f.readline().strip()
|
|
#f.close()
|
|
#for i in cmdline.split(' '):
|
|
# if re.match('instmode=',i):
|
|
# instmode = i.split('=')[1]
|
|
# break
|
|
try:
|
|
instmode = os.environ["instmode"]
|
|
except:
|
|
instmode = 'Text'
|
|
if instmode == 'StateGrid':
|
|
os.system("cp -r /usr/lib/StateGrid /mnt/opt/")
|
|
os.system("source /usr/lib/new_install/operation/finish_install/exec_install_40.sh")
|
|
os.system("chroot /mnt /opt/StateGrid/setup.sh %s %s %s" %(username, homedir, shell))
|
|
os.system("rm -rf /mnt/opt/StateGrid")
|
|
|