add a feature: when run install program you can skip partition
by use parameter -p or --skip-partition. modified: main/setup modified: operation/configure_fstab.sh modified: text/ri_main.py
This commit is contained in:
18
main/setup
18
main/setup
@@ -19,7 +19,6 @@
|
||||
#
|
||||
#===================================================================================
|
||||
#
|
||||
|
||||
#===================================================================================
|
||||
#Set variables
|
||||
#===================================================================================
|
||||
@@ -27,13 +26,15 @@ workdir="/usr/lib/new_install/text"
|
||||
exec_file='xinitrc_setup'
|
||||
work_write_dir='/var/install'
|
||||
configfile="../xml/install_cfg.xml"
|
||||
install_step_list_file="install_step_list.py"
|
||||
#===================================================================================
|
||||
#Performance function
|
||||
#===================================================================================
|
||||
usage(){
|
||||
echo "usage: $0 [-s|--style style][-g|--graph][-l|--language language][-n|--noXserver][-h|--help]"
|
||||
echo "usage: $0 [-s|--style style][-g|--graph][-l|--language language][-n|--noXserver][-p|--skip-partition][-h|--help]"
|
||||
echo "style [text|graph]"
|
||||
echo "language [english|chinese]"
|
||||
echo "skip-partition text install but skip partition"
|
||||
echo "default text install"
|
||||
}
|
||||
|
||||
@@ -52,16 +53,26 @@ config_execfile(){
|
||||
fi
|
||||
echo "python ri_main.py -l $2 -c $configfile" >> ${work_write_dir}/${exec_file}
|
||||
fi
|
||||
|
||||
echo "#!/usr/bin/env python" > ${work_write_dir}/${install_step_list_file}
|
||||
|
||||
if test "$skip_partition" == "yes"
|
||||
then
|
||||
echo "list = ['welcome','mountpoint','serialnumber','network','group','service','information']" >> ${work_write_dir}/${install_step_list_file}
|
||||
else
|
||||
echo "list = ['welcome','partition','raid','mountpoint','serialnumber','network','group','service','information']" >> ${work_write_dir}/${install_step_list_file}
|
||||
fi
|
||||
}
|
||||
|
||||
main(){
|
||||
local style='text'
|
||||
local language='chinese'
|
||||
local xstart='no'
|
||||
local skip_partition='no'
|
||||
#local dialog=''
|
||||
|
||||
#tmp=$(getopt -o c:dsl:nh --long style:,configfile:,language:,noXserver,help -- "$@")
|
||||
tmp=$(getopt -o c:sgl:nh --long configfile:,style,graph,language:,noXserver,help -- "$@")
|
||||
tmp=$(getopt -o c:sgl:nph --long configfile:,style,graph,language:,noXserver,skip-partition,help -- "$@")
|
||||
eval set -- "$tmp"
|
||||
|
||||
mkdir -p $work_write_dir
|
||||
@@ -73,6 +84,7 @@ main(){
|
||||
'-s'|'--style') xstart='no';style="text" ;workdir="/usr/lib/new_install/text";shift ;;
|
||||
'-l'|'--language') language="$2" ;shift 2;;
|
||||
'-n'|'--noXserver') xstart='no' ;shift ;;
|
||||
'-p'|'--skip-partition') skip_partition='yes' ;shift ;;
|
||||
'-h'|'--help') usage ; exit 0 ;;
|
||||
'--') shift; break ;;
|
||||
*) usage ; exit 1 ;;
|
||||
|
||||
@@ -73,7 +73,7 @@ configure_fstab ()
|
||||
# other device set 0.
|
||||
case $fs_type in
|
||||
ext2|ext3|ext4|reiserfs)
|
||||
[ -z "$fs_mntops" ] && fs_mntops="acl"
|
||||
[ -z "$fs_mntops" ] && fs_mntops="acl,data=writeback"
|
||||
;;
|
||||
swap)
|
||||
[ -z "$fs_mntops" ] && fs_mntops="defaults"
|
||||
|
||||
@@ -2,39 +2,40 @@ import os
|
||||
import sys
|
||||
sys.path.append('../interface/')
|
||||
sys.path.append('../new_partition/')
|
||||
sys.path.append('/var/install')
|
||||
import ri_data
|
||||
import partition_data
|
||||
import interface_partition
|
||||
import ri_newt
|
||||
import install_step_list
|
||||
|
||||
list=['welcome','partition','raid','mountpoint','serialnumber','network','group','service','information']
|
||||
#list=['welcome','partition','raid','mountpoint','serialnumber','network','group','service','information']
|
||||
list = install_step_list.list
|
||||
|
||||
init_partition_from_os_flag = True
|
||||
init_flag = True
|
||||
init_raid_from_os = True
|
||||
count=0
|
||||
while True :
|
||||
if count == 1:
|
||||
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
|
||||
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
|
||||
if init_flag:
|
||||
ri_data.init()
|
||||
init_flag = False
|
||||
|
||||
if list[count] == 'partition':
|
||||
s = interface_partition.main()
|
||||
|
||||
if init_flag:
|
||||
ri_data.init()
|
||||
init_flag = False
|
||||
if len(ri_newt.Raid.init_from_internal()) < 2 and len(ri_data.Raid.dict) == 0:
|
||||
if list[2] == 'raid':
|
||||
del list[2]
|
||||
if list[count+1] == 'raid':
|
||||
del list[count+1]
|
||||
else:
|
||||
#if init_raid_from_os:
|
||||
# ri_data.Raid.init_from_os()
|
||||
# init_raid_from_os = False
|
||||
if list[2] != 'raid':
|
||||
list.insert(2, 'raid')
|
||||
if list[count+1] != 'raid':
|
||||
list.insert(count+1, 'raid')
|
||||
else:
|
||||
if list[count] == 'welcome':
|
||||
ri_newt.Welcome()
|
||||
|
||||
Reference in New Issue
Block a user