Files
new_install/operation/finish_install.py
Peng Zhihui 8da1885d4d Get the cmdline instmod value in finish_install.py
modified:   interface/ri_oper.py
	modified:   operation/finish_install.py
2014-02-24 13:53:53 +08:00

27 lines
640 B
Python
Executable File

#!/usr/bin/env python
# run finish_install scripts
#
import os,sys
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()
f.close()
instmode = cmdline.split(' ')[0].split('=')[1]
if instmode == 'StateGrid':
os.system("chroot /mnt /opt/finish_install/StateGrid/setup.sh %s %s %s" %(username, homedir, shell))
# run post_add scripts
os.system("chroot /mnt /opt/finish_install/99finish_install.sh")