Get the cmdline instmod value in finish_install.py

modified:   interface/ri_oper.py
	modified:   operation/finish_install.py
This commit is contained in:
Peng Zhihui
2014-02-24 13:53:53 +08:00
parent 10ac06e064
commit 8da1885d4d
2 changed files with 4 additions and 2 deletions

View File

@@ -87,7 +87,6 @@ class Operation:
process.stdin.close()
while True:
line = process.stdout.readline()
print line
if not line:
break
if line[0] == '@' and self.current_step < self.steps:

View File

@@ -14,7 +14,10 @@ homedir = ri_data.StateGrid.home_dir
shell = ri_data.StateGrid.shell
# run state grid custom scripts
instmode = os.system("cat /proc/cmdline | sed 's/.*instmode=\([^ ]*\).*/\1/'")
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))