Files
new_install/operation/finish_install/95state_grid_custom.py
Peng Zhihui 513f9756bf Modify finish_install interface:
exec_finish_install will run all executable scripts in the
    finish_install dir in turn.
Add support to ext4 in mount_partition.sh
move auto_install.py and state_grid.py to text dir

	modified:   operation/exec_finish_install.sh
	new file:   operation/finish_install/95state_grid_custom.py
	modified:   operation/finish_install/99finish_install.sh
	new file:   operation/finish_install/exec_post_add.sh
	modified:   operation/install.txt
	modified:   operation/mount_partition.sh
	renamed:    AutoInstall/auto_install.py -> text/auto_install.py
	renamed:    StateGrid/state_grid.py -> text/state_grid.py
2014-02-26 09:33:28 +08:00

26 lines
626 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("cp -r /usr/lib/StateGrid /mnt/opt/")
os.system("chroot /mnt /opt/StateGrid/setup.sh %s %s %s" %(username, homedir, shell))
os.system("rm -rf /mnt/opt/StateGrid")