Modify partition-tools:

chage the base unit from 'B' to 's'
    correct 4k align
Modify network configure:
    provide a default network configure
Todo:
    support making raid

       modified:   dialog/di_main.py
       modified:   dialog/di_newt.py
       modified:   interface/ri_data.py
       modified:   interface/ri_oper.py
       modified:   new_partition/interface_partition.py
       modified:   new_partition/partition_data.py
       modified:   operation/partition_disks.sh
This commit is contained in:
Peng Zhihui
2014-01-13 10:05:10 +08:00
parent fafdb9b843
commit 5c7c4af1bc
7 changed files with 277 additions and 173 deletions

View File

@@ -441,11 +441,11 @@ class Network:
''' network '''
hostname ='localhost'
configuration =''
domain = ''
ip = ''
mask = ''
gateway = ''
primary_dns = ''
domain = 'in.linx'
ip = '192.168.0.1'
mask = '255.255.255.0'
gateway = '192.168.0.254'
primary_dns = '192.168.0.254'
secondary_dns = ''
@staticmethod

View File

@@ -126,6 +126,8 @@ class MakePartitions(Operation):
disks = p_d.Partition.dict.keys()
disks.sort()
for d in disks:
if p_d.Partition.dict[d]['partition_table'] == '':
continue
if p_d.Partition.dict[d]['from_os'] == 'no':
args += '%s mklabel %s\n' %(d, p_d.Partition.dict[d]['partition_table'])
partitions = p_d.sort_partitions(p_d.Partition.dict, d, 'partition')
@@ -139,12 +141,6 @@ class MakePartitions(Operation):
#fs_type = p_d.Partition.dict[d]['partition'][p]['filesystem']
end = p_d.Partition.dict[d]['partition'][p]['end']
start = p_d.Partition.dict[d]['partition'][p]['start']
start = str(int(filter(str.isdigit,p_d.Partition.dict[d]['partition'][p]['start'])) + 511)+'B'
#support 4k align
if int(filter(str.isdigit,start)) < 2*1000*1000:
start = '1048576B'
if int(filter(str.isdigit,end)) < 2*1000*1000:
end = '2000000'
p_type = p_d.Partition.dict[d]['partition'][p]['type']
partition = p_d.Partition.dict[d]['partition'][p]['num']
flags = p_d.Partition.dict[d]['partition'][p]['flags']