diff --git a/interface/mine/install_xml.py b/interface/mine/install_xml.py deleted file mode 100644 index 85b28f7..0000000 --- a/interface/mine/install_xml.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/python - -import sys -from xml.dom import minidom -import Tkinter - -def attr_to_dict(attr): - ''' convert (widget or grid_location) attributes into a dict ''' - dict = {} - for a in attr.values(): - if a.name == 'image': - dict[a.name] = Tkinter.PhotoImage(file=a.value) - elif a.name == 'command': - module = sys.modules[__name__] - dict[a.name] = getattr(module, a.value) - else: - dict[a.name] = a.value - return dict - -def construct_widget_dict(): - ''' Go through all widget xml nodes on first level, I mean, those widgets defined -inside other widget will not be checked. If the widget has a name, it will -be recorded in the widget_dict.''' - widgets = [e for e in xmldoc.firstChild.childNodes - if e.nodeType == e.ELEMENT_NODE and e.nodeName == "widget"] - for w in widgets: - if "name" in w.attributes.keys(): - widget_dict[w.attributes["name"].value] = w - -def widget(w_xml, p_win): - ''' create a widget. - w_xml is a xml node describing the widget. - p_win is the parent widget.''' - func = getattr(Tkinter, w_xml.attributes["type"].value) - # convert attributes into dictionary - wa_list = [wa for wa in w_xml.childNodes - if wa.nodeType == wa.ELEMENT_NODE and wa.nodeName =="widget_attribute"] - if wa_list: - # only process the first element, and there should be only one element. - attr_dict = attr_to_dict(wa_list[0].attributes) - w_win = func(p_win, attr_dict) - else: - w_win = func(p_win) - - gm_list = [m for m in w_xml.childNodes - if m.nodeType == m.ELEMENT_NODE and m.nodeName == "grid_management"] - gl_list = [l for l in w_xml.childNodes - if l.nodeType == l.ELEMENT_NODE and l.nodeName == "grid_location"] - w_list = [ w for w in w_xml.childNodes - if w.nodeType == w.ELEMENT_NODE and w.nodeName == "widget" ] - - for w in w_list: - widget(w, w_win) - - for m in gm_list: - for cf in m.childNodes: - if cf.nodeType != m.ELEMENT_NODE or cf.nodeName != "configure": - continue - if "row" in cf.attributes.keys(): - cf_func = getattr(w_win, "rowconfigure") - n = cf.attributes["row"].value - elif "column" in cf.attributes.keys(): - cf_func = getattr(w_win, "columnconfigure") - n = cf.attributes["column"].value - else: - continue - cf_func(n, weight=cf.attributes["weight"].value) - # only process the first item - break - - for l in gl_list: - ld = attr_to_dict(l.attributes) - w_win.grid(ld) - # only process the first item - break - -def display(): - ''' Display a series of widgets ''' - root_window = Tkinter.Tk() - - # first display the main frame - widget(widget_dict["main"], root_window) - root_window.columnconfigure(0, weight=1) - root_window.rowconfigure(0, weight=1) - root_window.geometry('800x600+0+0') - root_window.mainloop() - -# commands for buttons -def quit(): - print "quit" - -def previous_step(): - print "previous step" - -def next_step(): - - print "next step" - -xmldoc = minidom.parse("../../xml/interface_t.xml") - -widget_dict={} -construct_widget_dict() - -sequence_dict={} -construct_sequence_dict() - -display() diff --git a/interface/ri_data.py b/interface/ri_data.py index e616e27..08660e9 100644 --- a/interface/ri_data.py +++ b/interface/ri_data.py @@ -10,7 +10,7 @@ install_xml = '../xml/install.xml' config_xml = '../xml/config.xml' def to_xml_attr(doc, node, cls, name): - ''' This method is called by to_xml. Its function is to create an attribute, and set its value based on Network data member + ''' This method is called by to_xml. Its function is to create an attribute, and set its value based on xml data member doc - xml document node - xml node cls - python class/python instance @@ -55,7 +55,6 @@ class Partition: @staticmethod def init_from_os(): ''' create a Partition instance from hardware info''' - device_list=[] Partition.unit='GB' cmd_cat = 'cat /proc/partitions' @@ -82,7 +81,7 @@ class Partition: l = [ s.split()[-1] for s in o.splitlines() if re.match(r'\s*\d+', s)] # devices : 1) sda, sdb(first if ), or md0 (second if) for d in [ i for i in l if not re.search(r'\d+', i) - or re.search(r'([a-zA-Z]+)', i).group(1) not in l] + or re.search(r'([a-zA-Z]+)', i).group(1) not in l]: st,o=commands.getstatusoutput('parted /dev/%s unit %s print'%(d,Partition.unit)) if st: print "Error parted execute error" @@ -114,14 +113,14 @@ class Partition: flg_i= s.find('Flags') if tp_i < 0: tp_i=fs_i located = True - - if located: + elif located: Partition(d+s[nm_i:st_i].strip(), # device name - s[st_i:end_i].strip(), # start + s[st_i:end_i].strip().rstrip(Partition.unit), # start s[sz_i:tp_i].strip().rstrip(Partition.unit), # size s[tp_i:fs_i].strip(), # type re.search('swap', s[fs_i:flg_i]) and 'swap' or s[fs_i:flg_i].strip(), # file system - s[flg_i:].strip() # flags + s[flg_i:].strip(), # flags + 'yes' ) @staticmethod @@ -148,7 +147,8 @@ p_node - xml node (parent node)''' unit_attr = doc.createAttribute('unit') unit_attr.value = Partition.unit pts.setAttributeNode(unit_attr) - for p in Partition.list: + for k in Partition.dict.keys().sort(): + p = Partition.dict[k] pt = doc.createElement('partition') dev_attr = doc.createAttribute('device') start_attr = doc.createAttribute('start') @@ -173,10 +173,13 @@ p_node - xml node (parent node)''' pt.setAttributeNode(from_attr) pts.appendChild(pt) p_node.appendChild(pts) - # ri_tk_cmd.py use + @staticmethod def get_size(dev): - return Partition.dict[dev].size + try: + return Partition.dict[dev].size + except: + return None class Raid: ''' raid information ''' @@ -252,7 +255,8 @@ l - list doc - xml document instance p_node - xml node (parent node) ''' raids = doc.createElement('raids') - for r in Raid.list: + for k in Raid.dict.keys().sort(): + r = Raid.dict[k] rd = doc.createElement('raid') rd_dev_attr = doc.createAttribute('device') @@ -289,8 +293,12 @@ p_node - xml node (parent node) ''' #ri_tk_cmd.py use @staticmethod def get_size(dev): - # need fill - pass + ''' calculate raid device size ''' + rd = Raid.dict[dev] + sz = min([ float(Partition.dict[d].size) for d in rd.active_components]) + if rd.level == '0': return sz*len(rd.active_components) + elif rd.level == '1': return sz*len(rd.active_components)/2 + elif rd.level == '5': return sz*(len(rd.active_components)-1) @staticmethod def get_next_device(): @@ -306,7 +314,7 @@ p_node - xml node (parent node) ''' def dev_in_raid(): """if the device in raid or not""" devices_in_raid=set() - for r in Raid.list: + for r in Raid.dict.values(): devices_in_raid.update(r.active_components) devices_in_raid.update(r.spare_components) return devices_in_raid @@ -339,13 +347,13 @@ class MountPoint: MountPoint(dev, fs=Partition.dict[dev].filesystem) for dev in Raid.dict.keys(): - if MountPoint.dict.has_key(dev) - continue + if MountPoint.dict.has_key(dev): continue MountPoint(dev) - # now process whether a partition or raid was removed + # now delete unexist partition/raid mount point, or + # partition that used in raid. s1 = set(MountPoint.dict.keys()) - s2 = set(Partition.dict.keys() + Raid.dict.keys()) + s2 = set(Partition.dict.keys() + Raid.dict.keys()) - set(dev_in_raid) for dev in s1-s2: del MountPoint.dict[dev] @@ -366,7 +374,8 @@ class MountPoint: doc - xml document instance p_node - xml node (parent node)''' mps = doc.createElement('mount-points') - for m in MountPoint.list: + for k in MountPoint.dict.keys().sort(): + m = MountPoint.dict[k] mp = doc.createElement('mount-point') dev_attr = doc.createAttribute('device') dir_attr = doc.createAttribute('directory') @@ -383,6 +392,14 @@ p_node - xml node (parent node)''' mps.appendChild(mp) p_node.appendChild(mps) + @staticmethod + def get_size(dev): + '''get size of this mount point ''' + if dev in Partition.dict.keys(): + return Partition.get_size(dev) + elif dev in Raid.dict.keys(): + return Raid.get_size(dev) + class Network: ''' network ''' hostname ='' @@ -527,6 +544,20 @@ p_node - xml node (parent node)''' grp.appendChild(optl) grps.appendChild(grp) p_node.appendChild(grps) + @staticmethod + def get_install_pkgs(): + ''' get package names that should be installed ''' + l = [] + for g in Group.dict.values(): + if g.install != 'no': + l.extend([ p for p in g.mandatory ]) + if g.selection == 'manual': + l.extend([ p[0] for p in g.optional if p[1] == 'yes' ]) + elif g.selection == 'all': + l.extend([ p[0] for p in g.optional ]) + else: # selection is 'none' + pass + return l class Service: ''' service ''' @@ -564,16 +595,7 @@ p - pkg, that includes this service def change_state(): ''' Based on package information in Group class, change 'start' data member from 'disable' to 'no', or from 'yes'/'no' to 'disable' ''' - l = [] - for g in Group.dict.values(): - if g.install == 'mandatory' or g.install == 'yes': - l.extend(g.mandatory) - if g.selection == 'all': - l.extend([ n for n, i in g.optional]) - elif g.selection == 'manual': - l.extend([ n for n, i in g.optional if i == 'yes']) - else: # selection is 'none' - pass + l = Group.get_install_pkgs() for s in Service.list: if s.package in l: diff --git a/interface/ri_dep.py b/interface/ri_dep.py index a36dff9..8b42694 100644 --- a/interface/ri_dep.py +++ b/interface/ri_dep.py @@ -62,16 +62,7 @@ def construct_depended(): Depended.dict[dep].depended_by.add(d.name) def get_extra_depending(pkg_list = []): - l = [] - for g in ri_data.Group.dict.values(): - if g.install != 'no': - l.extend([ p for p in g.mandatory ]) - if g.selection == 'manual': - l.extend([ p[0] for p in g.optional if p[1] == 'yes' ]) - else: - l.extend([ p[0] for p in g.optional ]) - - l = l + pkg_list + l = ri_data.Group.get_install_pkgs() + pkg_list set1 = set(l) set2 = set(set1) @@ -79,9 +70,12 @@ def get_extra_depending(pkg_list = []): for d in set1: set2.update(Depending.dict[d].depending) + global extra_pkgs + extra_pkgs = set2.difference(set1) res = {} - for d in set2.difference(set1): + for d in extra_pkgs: res[d] = Depended.dict[d].depended_by.intersection(set1) return res +extra_pkgs = [] diff --git a/interface/ri_func_dep.py b/interface/ri_func_dep.py index 8f7b9a5..1462e7c 100644 --- a/interface/ri_func_dep.py +++ b/interface/ri_func_dep.py @@ -3,27 +3,27 @@ import ri_data class Pkg(): - pkg_list = [] + list = [] @staticmethod - def set_pkg_list (): + def set_list (): for i in ri_data.Group.dict.values(): if i.install != 'no': - Pkg.pkg_list += i.mandatory + Pkg.list += i.mandatory if i.selection == 'all': - Pkg.pkg_list += [ j[0] for j in i.optional ] + Pkg.list += [ j[0] for j in i.optional ] else: - Pkg.pkg_list += [ j[0] for j in i.optional if j[1] == 'yes' ] + Pkg.list += [ j[0] for j in i.optional if j[1] == 'yes' ] class FsType(): - mp_fstype_list = [] + list = [] @staticmethod - def set_mp_fstype_list (): + def set_list (): for fs in ri_data.MountPoint.list: - FsType.mp_fstype_list.append(fs.filesystem) + FsType.list.append(fs.filesystem) -class FunctionDepending: +class FunctionDepending(): list = [] def __init__(self, pkg): self.package = pkg @@ -37,13 +37,13 @@ class FunctionDepending: class FileSystem(FunctionDepending): - mp_fstype_list = [] + list = [] def __init__(self, fs_type, fs_pkg): self.filesystem_type = fs_type FunctionDepending.__init__(self, fs_pkg) def check(self): - if self.filesystem_type in FsType.mp_fstype_list and self.package not in Pkg.pkg_list: + if self.filesystem_type in FsType.list and self.package not in Pkg.list: return False return True @@ -56,7 +56,7 @@ class DHCP(FunctionDepending): FunctionDepending.__init__(self, 'dhcpcd') def check(self): - if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.pkg_list: + if ri_data.Network.configuration == 'dynamic' and 'dhcpcd' not in Pkg.list: return False return True @@ -68,7 +68,7 @@ class RAID(FunctionDepending): FunctionDepending.__init__(self, 'mdadm') def check(self): - if 'mdadm' not in Pkg.pkg_list: + if 'mdadm' not in Pkg.list: for i in ri_data.Raid.list: if i.from_os == 'no': return False @@ -79,8 +79,8 @@ class RAID(FunctionDepending): def check_function_depending(): - Pkg.set_pkg_list() - FsType.set_mp_fstype_list() + Pkg.set_list() + FsType.set_list() func_dep_dict = {} FileSystem("xfs", "xfsprogs") @@ -96,5 +96,4 @@ def check_function_depending(): func_dep_dict.update(tmp) return func_dep_dict -#check_function_depending() diff --git a/interface/ri_inst_tk.py b/interface/ri_inst_tk.py index 130e978..9b85af2 100644 --- a/interface/ri_inst_tk.py +++ b/interface/ri_inst_tk.py @@ -66,34 +66,30 @@ lab_progress_bar=Label(root,text='%s:'%(language=="chinese" and u"进度" \ lab_operation=Label(root,text="") lab_linx=Label(root,text="Linx") -txt_suboperation=Text(root,width=70,height=10) +txt_suboperation=Text(root,width=100,height=10) #operation lable and taskname -lab_task.grid (row=1, column=0, sticky='SEW') -lab_operation.grid (row=1, column=1, columnspan=2,sticky="S") -txt_suboperation.grid(row=2, column=1,columnspan=2) -lab_progress_bar.grid(row=3, column=0, sticky='NEW') -lab_linx.grid (row=4, column=1, sticky='E') +lab_task.grid (row=1, column=0, sticky='E') +lab_operation.grid (row=1, column=1, sticky='') +txt_suboperation.grid(row=2, column=1) +lab_progress_bar.grid(row=3, column=0) +lab_linx.grid (row=4, column=1, sticky='') #logo photo_bm = PhotoImage(file="%s/../data/linxlogo.gif"\ %os.path.split(os.path.realpath(__file__))[0]) logo_label=Label(root,image=photo_bm) -logo_label.grid(row=0,column=0,padx=50,pady=50,sticky='NW') +logo_label.grid(row=0,column=0,padx=50, pady=50, sticky='NW') #progress bar scl_progress=Scale(root,orient=HORIZONTAL,resolution=0.01,digits=4,from_=0,to=100,variable=stringvar_bar,label='%') -scl_progress.grid(row=3,column=1,columnspan=2,sticky='NEW') +scl_progress.grid(row=3,column=1,padx=50, sticky='NEW') #root root.rowconfigure(0,weight=1) root.rowconfigure(1,weight=1) -root.rowconfigure(2,weight=1) root.rowconfigure(3,weight=1) root.rowconfigure(4,weight=1) -root.columnconfigure(0,weight=1) root.columnconfigure(1,weight=1) -root.columnconfigure(2,weight=1) -root.columnconfigure(3,weight=1) diff --git a/interface/ri_oper.py b/interface/ri_oper.py index 20b9c7b..1a53f5d 100644 --- a/interface/ri_oper.py +++ b/interface/ri_oper.py @@ -4,7 +4,7 @@ # # SCRIPT NAME: ri_oper.py # -# MENTOR: Li zhi +# MENTOR: Li Zhi # # AUTHOR: Ling Fen # @@ -17,292 +17,310 @@ # Ling Fen 2010-09-04 create import ri_data +import ri_dep import os import subprocess +if os.path.isfile("../xml/install.xml"): + ri_data.init_from_xml() + display_operation = None display_sub_operation = None display_scale = None language = 'english' class Rate: - ''' class for installing progress, value is from 0 to 100''' - value = 0 - @staticmethod - def increase(n, max=100): - if Rate.value+n <= max: - Rate.value += n - @staticmethod - def set(n): - Rate.value = n + ''' class for installing progress, value is from 0 to 100''' + value = 0 + @staticmethod + def increase(n, max=100): + if Rate.value+n <= max: + Rate.value += n + @staticmethod + def set(n): + Rate.value = n class Operation: - ''' This is a common base class for all install operations. - The instances of its derived class should have the following - data members: + ''' This is a common base class for all install operations. + The instances of its derived class should have the following + data members: chinese_name - operation name english_name - operation name script - shell script name return_value - shell script return value score - an abstract value, for example score is 5, - steps - the subprocess of the number of runs - step - the subprocess run one time -total is 100, if this operations is completed, 5% work is done. + steps - the subprocess of the number of runs + current_step - the subprocess run one time + total is 100, if this operations is completed, 5% work is done. - and the following methods: - get_arguments - prepare arguments for scipt + and the following methods: + get_arguments - prepare arguments for script get_stdin - prepare stdin for script - install - install progress ''' + install - install progress ''' - def __init__(self,e,c,s,scr): - ''' Operation(base class) init method - return_value is a dict, key is return code, value is a tuple, first - element is English, second element is Chinese.''' - self.return_value = {0:('success', u'成功'), \ - 1:('argument error',u'参数错误'), \ - 2:('deivce node do not exist',u'设备节点不存在'),\ - 3:('filesystem no implement',u'文件系统没有实现'),\ - } - self.english_name = e - self.chinese_name = c - self.script = s - self.score = scr - self.steps = 1 - self.step = 0 + def __init__(self,e,c,s,scr): + ''' Operation(base class) init method + return_value is a dict, key is return code, value is a tuple, first + element is English, second element is Chinese.''' + self.return_value = {0:('Success', u'成功'), \ + 1:('Argument error',u'参数错误'), \ + 2:("Deivce node doesn't exist",u"设备节点不存在"),\ + 3:("File system hasn't been implemented",u'文件系统没有实现'),\ + } + self.english_name = e + self.chinese_name = c + self.script = s + self.score = scr + self.steps = 1 + self.current_step = 0 - def install(self): - if display_operation: - display_operation(language == 'chinese' and self.chinese_name or self.english_name) + def install(self): + if display_operation: + display_operation(language == 'chinese' and self.chinese_name or self.english_name) - max = Rate.value+self.score <100 and Rate.value+self.score or 100 - process = subprocess.Popen("./%s " %self.script + ' '.join(self.get_arguments()),\ - stdin=subprocess.PIPE,stdout=subprocess.PIPE, shell=True, \ - cwd="%s/../operation"%os.path.split(os.path.realpath(__file__))[0]) - process.stdin.write(self.get_stdin()) - process.stdin.close() - while True: - line = process.stdout.readline() - if not line: - break - if line[0] == '@' and self.step < self.steps: - self.step += 1 - if display_sub_operation: - display_sub_operation(line[1:]) - Rate.increase(float(self.score)/self.steps, max) - if display_scale: display_scale() - ret = process.wait() - Rate.set(max) - if display_scale: display_scale() - return ret + max = Rate.value+self.score <100 and Rate.value+self.score or 100 + process = subprocess.Popen("./%s " %self.script + ' '.join(self.get_arguments()),\ + stdin=subprocess.PIPE,stdout=subprocess.PIPE, shell=True, \ + cwd="%s/../operation" %os.path.split(os.path.realpath(__file__))[0]) + process.stdin.write(self.get_stdin()) + process.stdin.close() + while True: + line = process.stdout.readline() + if not line: + break + if line[0] == '@' and self.current_step < self.steps: + self.current_step += 1 + if display_sub_operation: + display_sub_operation(line[1:]) + Rate.increase(float(self.score)/self.steps, max) + if display_scale: display_scale() + ret = process.wait() + Rate.set(max) + if display_scale: display_scale() + return ret - def get_arguments(self): - return [] - def get_stdin(self): - return '' + def get_arguments(self): + return [] + def get_stdin(self): + return '' class Format(Operation): - ''' class for format partition ''' - def __init__(self, scr): - Operation.__init__(self, 'format partition', u'格式化分区', 'format_partition.sh', scr) - self.return_value[127] = ('format partition utils not found', u'没有格式化硬盘功能') + ''' class for format partition ''' + def __init__(self, scr): + Operation.__init__(self, 'Format partition', u'格式化分区', 'format_partition.sh', scr) + self.return_value[127] = ('No tool to format partitions', u'没有格式化硬盘分区的工具') - def get_stdin(self): - format='' - n = 0 - for instance in ri_data.MountPoint.list: - if instance.format == "yes" and instance.filesystem != '': - format+="/dev/%s %s\n"%(instance.device,instance.filesystem) - n += 1 - self.steps += n - return format + def get_stdin(self): + format='' + n = 0 + for instance in ri_data.MountPoint.dict.values(): + if instance.format == "yes" and instance.filesystem != '': + format+="/dev/%s %s\n"%(instance.device,instance.filesystem) + n += 1 + self.steps += n + return format class MakeRaid(Operation): - """class for make raid""" - flag=False - def __init__(self,scr): - Operation.__init__(self,"make RAID",u"正在制作RAID磁盘阵列","mkraid_wrapper.sh",scr) - def get_stdin(self): - args = '' - n = 0 - for instance in ri_data.Raid.list: - if instance.from_os == 'no': - MakeRaid.flag=True - args += '-n /dev/%s -l %s -s %s -a %s\n' %(instance.device, instance.level, \ - ','.join([ '/dev/%s' %sp for sp in instance.spare_components]), \ - ','.join([ '/dev/%s' %ac for ac in instance.active_components])) - n += 1 - self.steps += n - return args + """class for make raid""" + def __init__(self,scr): + Operation.__init__(self,"Making a RAID", u"正在制作RAID磁盘阵列", "mkraid_wrapper.sh", scr) + def get_stdin(self): + args = '' + n = 0 + for instance in ri_data.Raid.dict.values(): + if instance.from_os == 'no': + args += '-n /dev/%s -l %s -s %s -a %s\n' %(instance.device, instance.level, \ + ','.join([ '/dev/%s' %sp for sp in instance.spare_components]), \ + ','.join([ '/dev/%s' %ac for ac in instance.active_components])) + n += 1 + self.steps += n + return args class MakeRaidConfigure(Operation): - """class for make raid configure""" - def __init__(self,scr): - Operation.__init__(self,"make raid configure file",u"配置raid配置文件","mkraidconf.sh",scr) - def install(self): - if MakeRaid.flag: - Operation.install(self) - else: - max = Rate.value+self.score <100 and Rate.value+self.score or 100 - Rate.set(max) - return 0 + """class for make raid configure""" + def __init__(self,scr): + Operation.__init__(self,"Generate /etc/mdadm.conf",u"生成raid配置文件","mkraidconf.sh",scr) + def install(self): + if ri_data.Raid.dict.values(): + return Operation.install(self) + else: + max = Rate.value+self.score <100 and Rate.value+self.score or 100 + Rate.set(max) + return 0 - def get_arguments(self): - return ["/etc/mdadm.conf"] + def get_arguments(self): + return ["/etc/mdadm.conf"] class Mount(Operation): - """class for mount partition""" - def __init__(self,scr): - Operation.__init__(self,'mount partition',u'挂载分区','mount_partition.sh',scr) - self.return_value[2]=("device node doesn't exist",u"设备结点不存在") + """class for mount partition""" + def __init__(self,scr): + Operation.__init__(self, 'Mount partition', u'挂载分区', 'mount_partition.sh',scr) - def get_stdin(self): - mount='' - n = 0 - for instance in ri_data.MountPoint.list: - if instance.directory != '' and instance.filesystem !='': - mount+="/dev/%s %s %s\n"%(instance.device,instance.directory,instance.filesystem) - n += 1 - self.steps += n - return mount + def get_stdin(self): + mount='' + n = 0 + for instance in ri_data.MountPoint.dict.values(): + if instance.directory != '' and instance.filesystem !='': + mount+="/dev/%s %s %s\n"%(instance.device,instance.directory,instance.filesystem) + n += 1 + self.steps += n + return mount class InstallPkg(Operation): - """class for install packages""" - def __init__(self,scr): - Operation.__init__(self,'install packages',u'安装软件包','install_pkg.sh',scr) - self.return_value[2]=("source directory pkg_source_dir doesn't exist",u"软件包所在目录不存在") - self.return_value[3]=("package in source doesn't exist",u"软件包不存在") - - def get_stdin(self): - pkgname=[] - for i in ri_data.Group.dict.values(): - if i.install=='no': - continue - else: - pkgname+=i.mandatory - if i.selection=='all': - pkgname += [ j[0] for j in i.optional ] - else: - pkgname += [ j[0] for j in i.optional if j[1] == 'yes' ] + """class for install packages""" + def __init__(self,scr): + Operation.__init__(self,'Install packages',u'安装软件包','install_pkg.sh',scr) + self.return_value[2]=("Software source directory doesn't exist",u"软件包所在目录不存在") + self.return_value[3]=("Software package doesn't exist",u"软件包不存在") - self.steps += len(pkgname) - return '\n'.join(pkgname) - - def get_arguments(self): - return ["-s","/Rocky/packages"] + def get_stdin(self): + pkgname = ri_data.Group.get_install_pkgs() + ri_dep.extra_pkgs + self.steps += len(pkgname) + return '\n'.join(pkgname) + + def get_arguments(self): + return ["-s","/Rocky/packages"] class ConfigureFstab(Mount): - """class for configure /etc/fstab""" - def __init__(self,scr): - Operation.__init__(self,'configure fstab',u'配置/etc/fstab文件','configure_fstab.sh',scr) - self.return_value[2]=("fstab doesn't exist",u"/etc/fstab文件不存在") + """class for configure /etc/fstab""" + def __init__(self,scr): + Operation.__init__(self,'Configure /etc/fstab',u'配置/etc/fstab文件','configure_fstab.sh',scr) + self.return_value[2]=("/etc/fstab doesn't exist",u"/etc/fstab文件不存在") + + def get_stdin(self): + fstab='' + flag=True + for d in MountPoint.dict.values(): + if d.filesystem != '' and d.directory !='': + fstab += "/dev/%s %s %s\n" %(d.device, d.directory, d.filesystem) + elif d.filesystem == 'swap' and flag: + fstab += "/dev/%s swap swap\n" %d.device + flag=False + return fstab class GenerateIssue(Operation): - """class for generate /etc/issue""" - def __init__(self,scr): - Operation.__init__(self,'generate issue',u'生成/etc/issue文件','generate_issue.sh',scr) + """class for generate /etc/issue""" + def __init__(self,scr): + Operation.__init__(self,'Generate /etc/issue',u'生成/etc/issue文件','generate_issue.sh',scr) - def get_arguments(self): - args=[] - # FIXME if tag file format is error? - if os.path.isfile("/tag") : - fd=open("/tag","r") - string = fd.read() - list = string.split('\n')[0].split('-') - args = ['-v']+[list[0][5:]]+["-a"]+[list[1]]+["-r"]+[list[2]]+['-d']+['-'.join(list[3:])] - return args + def get_arguments(self): + args=[] + # FIXME if tag file format is error? + if os.path.isfile("/tag"): + fd=open("/tag","r") + string = fd.read() + list = string.split('\n')[0].split('-') + args = ['-v']+[list[0][5:]]+["-a"]+[list[1]]+["-r"]+[list[2]]+['-d']+['-'.join(list[3:])] + fd.close() + return args class ConfigureNetwork(Operation): - """class for configure network""" - def __init__(self,scr): - Operation.__init__(self,'configure network',u'配置网络','configure_network.sh',scr) - self.return_value[2]=("ip or netmask or geteway address incorrect",u"ip或子网掩码或网关不正确") - self.return_value[3]=("hosts/resolv.conf/ifcfg-eth0/network doesn't exist",u"文件hosts、resolv.conf、ifcfg-eht0、network 不存在") + """class for configure network""" + def __init__(self,scr): + Operation.__init__(self,'Configure network',u'配置网络','configure_network.sh',scr) + self.return_value[2]=("Ip address, network, or geteway is incorrect",u"Ip地址、子网掩码、网关不正确") + self.return_value[3]=("/etc/hosts, /etc/resolv.conf, /etc/sysconfig/network-devices/ifcfg.template, or /etc/sysconfig/network doesn't exist",\ + u"文件/etc/hosts,/etc/resolv.conf,/etc/sysconfig/network-devices/ifcfg.template或/etc/sysconfig/network文件不存在") - def get_arguments(self): - network='' - data=ri_data.Network - if data.configuration == "static": - network+="-t static " - if data.hostname is not '': - network+="-h %s "%data.hostname - if data.domain is not '': - network+="-d %s "%data.domain - if data.ip is not '': - network+="-i %s "%data.ip - if data.mask is not '': - network+="-n %s "%data.mask - if data.gateway is not '': - network+="-g %s "%data.gateway - if data.primary_dns is not '': - network+="-p %s "%data.primary_dns - if data.secondary_dns is not '': - network+="-s %s "%data.secondary_dns - else: - network+="-t dynamic " - if data.hostname is not '': - network+="-h %s "%data.hostname - return [network] - + def get_arguments(self): + network='' + data=ri_data.Network + if data.configuration == "static": + network+="-t static " + if data.hostname is not '': + network+="-h %s "%data.hostname + if data.domain is not '': + network+="-d %s "%data.domain + if data.ip is not '': + network+="-i %s "%data.ip + if data.mask is not '': + network+="-n %s "%data.mask + if data.gateway is not '': + network+="-g %s "%data.gateway + if data.primary_dns is not '': + network+="-p %s "%data.primary_dns + if data.secondary_dns is not '': + network+="-s %s "%data.secondary_dns + else: + network+="-t dynamic " + if data.hostname is not '': + network+="-h %s "%data.hostname + return [network] + class MakeServiceAutoBoot(Operation): - """class for make service autoboot""" - def __init__(self,scr): - Operation.__init__(self,"make service autoboot",u"启动服务器","mk_serv_autoboot.sh",scr) - self.return_value[2]=("boot script doesn't exist",u"引导脚本不存在") + """class for make service autoboot""" + def __init__(self,scr): + Operation.__init__(self,"Make service autoboot",u"启动服务器","mk_serv_autoboot.sh",scr) + self.return_value[2]=("Boot script doesn't exist",u"引导脚本不存在") - def get_stdin(self): - serv='' - n = 0 - for i in ri_data.Service.list: - if i.start == "yes": - serv+='%s %s %s %s\n'%(i.package,i.script,i.name,i.number) - n += 1 - self.steps += n - return serv - + def get_stdin(self): + serv='' + n = 0 + for i in ri_data.Service.list: + if i.start == "yes": + serv+='%s %s %s %s\n'%(i.package,i.script,i.name,i.number) + n += 1 + self.steps += n + return serv + class CopyKernel(Operation): - """class for copy kernel""" - def __init__(self,scr): - Operation.__init__(self,"copy kernle",u"拷贝内核","copy_kernels.sh",scr) - self.return_value[1]=("kernel directory/modules directory/initrd.gz/makeinitrd doesn't exist",u"内核目录、模块目录、initrd.gz、makeinitrd 不存在") + """class for copy kernel""" + def __init__(self,scr): + Operation.__init__(self,"Copy kernle",u"拷贝内核","copy_kernels.sh",scr) + self.return_value[1]=("kernel directory, modules directory, initrd.gz, or makeinitrd doesn't exist",u"内核目录、模块目录、initrd.gz文件、makeinitrd指令不存在") class ExecFinishInstall(Operation): - """class for exec finish install""" - def __init__(self,scr): - Operation.__init__(self,"exec finish install",u"安装完成执行的脚本","exec_finish_install.sh",scr) - def get_stdin(self): - return "99finish_install.sh\n" - -class BootLoader(Operation): - """class for bootloader""" - def __init__(self,scr): - Operation.__init__(self,"install bootloader",u"安装引导程序","install_bootloader.sh",scr) - self.return_value[2]=("bootloader type doesn't specify",u"没有指定引导程序的类型") - self.return_value[3]=("bootloader no implement",u"没有执行bootloader") - self.return_value[127]=("bootloader utils not found",u"没发现bootloader的utils") + """class for exec finish install""" + def __init__(self,scr): + Operation.__init__(self,"Exec finish_install script",u"安装完成执行的脚本","exec_finish_install.sh",scr) + def get_stdin(self): + return "99finish_install.sh\n" - def get_arguments(self): - # only grub? - return ["-t grub"] +class BootLoader(Operation): + """class for bootloader""" + def __init__(self,scr): + Operation.__init__(self,"Install bootloader",u"安装引导程序","install_bootloader.sh",scr) + self.return_value[2]=("Bootloader type hasn't been specified",u"没有指定引导程序的类型") + self.return_value[3]=("Bootloader hasn't been implemented",u"没有实现bootloader") + self.return_value[127]=("No tool to bootloader. E.g grub",u"没有安装引导程序的工具。如grub等") + + def get_arguments(self): + # only grub? + return ["-t grub"] class ConfigureBootloader(Operation): - """class for configure bootloader file""" - def __init__(self,scr): - Operation.__init__(self,"configure bootloader",u"配置bootloader","configure_bootloader_cnf.sh",scr) - self.return_value[2]=("bootloader type doesn't specify",u"没有指定引导程序的类型") - self.return_value[3]=("bootloader configure file doesn't exist",u"引导程序配置文件不存在") - self.return_value[4]=("bootloader configuration file doesn't exist",u"引导程序配置文件不存在") + """class for configure bootloader file""" + def __init__(self,scr): + Operation.__init__(self,"Configure bootloader",u"配置bootloader","configure_bootloader_cnf.sh",scr) + self.return_value[2]=("Bootloader type hasn't specified",u"没有指定引导程序的类型") + self.return_value[3]=("Bootloader hasn't been implemented",u"没有实现bootloader") + self.return_value[4]=("Bootloader configuration file doesn't exist",u"引导程序配置文件不存在") - def get_arguments(self): - bootloader=[] - # FIXME if tag file format is error? - if os.path.isfile("/tag"): - fd = open("/tag","r") - string = fd.read() - list = string.split('-') - for instance in ri_data.MountPoint.list: - if instance.directory == '/': - # only grub? - bootloader=['-t','grub','-r',instance.device,'-k',ri_data.SerialNumber.value,'-o',list[0][5:].split('.')[0]+'.'+list[0][5:].split('.')[1]] - break - return bootloader + def get_arguments(self): + list=[] + tp="grub" + isboot=False + isroot=False + # FIXME if tag file format is error? + if os.path.isfile("/tag"): + fd = open("/tag","r") + string = fd.read() + list = string.split('-') + fd.close() + + bootloader=['-t',tp,'-o',list[0][5:].split('.')[0]+'.'+list[0][5:].split('.')[1]] + + for instance in ri_data.MountPoint.dict.values(): + if instance.directory == '/' and not isroot: + bootloader+=['-r',instance.device] + isroot=True + continue + if isroot and instance.directory == '/boot' and not isboot : + bootloader+=['-b',instance.device] + isboot=True + continue + + if ri_data.SerialNumber.value: + bootloader+=['-k',"linx_serial=%s" %ri_data.SerialNumber.value] + return bootloader diff --git a/interface/ri_tk.py b/interface/ri_tk.py index c20d605..5849248 100644 --- a/interface/ri_tk.py +++ b/interface/ri_tk.py @@ -6,6 +6,7 @@ import tkMessageBox import sys import ri_cmd import ri_widget +import os.path var_dict={} # language should be all lower case letters @@ -55,8 +56,6 @@ def create_widget(w): set_step_info(w.name) set_help_info('#'+w.name+'.help') -import os.path - class MyImage: ''' MyImage - a dummy class to hold Image variable ''' count = 0 @@ -97,6 +96,8 @@ def create_widget_sub(w, p_win): if not v_n in var_dict.keys(): # if not yet in dict, create it var_dict[v_n] = getattr(Tkinter, v_t)(value=v_v) + else: + print 'error: variable(%s) already defined' %v_n # change attr, if needed to suit tk tk_attr = dict(w.attr) @@ -217,7 +218,6 @@ class SoftwarePackageWindow(): class member --------------------------- dict - class static member - --------------------------- instance member --------------------------- @@ -343,6 +343,9 @@ class SoftwarePackageWindow(): Tkinter.Button(win, text='OK', command=self.ok).grid(column=0, row=6, pady=2) Tkinter.Button(win, text='Cancel', command=self.cancel).grid(column=1, row=6, pady=2) + # bind WM_DELETE_WINDOW + win.protocol("WM_DELETE_WINDOW", self.cancel) + win.after_idle(lambda : cnv1.configure(scrollregion=(0,0, fr1.winfo_width(), fr1.winfo_height()))) win.after_idle(lambda : cnv2.configure(scrollregion=(0,0, fr2.winfo_width(), fr2.winfo_height()))) diff --git a/interface/ri_tk_cmd.py b/interface/ri_tk_cmd.py index 017839d..94188b5 100644 --- a/interface/ri_tk_cmd.py +++ b/interface/ri_tk_cmd.py @@ -22,9 +22,7 @@ def mount_list_init(): ri_data.MountPoint.init_from_internal() for d in ri_data.MountPoint.dict.keys().sort(): # get size from Partition info - sz = ri_data.Partition.get_size(d) - if not sz: - sz = ri_data.Raid.get_size(d) + sz = MountPoint.get_size(d) m = ri_data.MountPoint.dict[d] s = m.device.ljust(10) + m.directory.ljust(10) + m.filesystem.ljust(10) + m.format.ljust(4) + sz.ljust(6) l.append(s) @@ -41,15 +39,16 @@ def mp_top_init(): idxs = ml_win.curselection() if len(idxs) == 1: idx = int(idxs[0]) - mp = ri_data.MountPoint.list[idx] - dev = mp.device - dir = mp.directory + l = eval(display.var_dict['mount.list'].get()) + dev = l[idx].split()[0] + mp = ri_data.MountPoint.dict[dev] + dr = mp.directory fs = mp.filesystem fm = mp.format - sz = mp.size + sz = MountPoint.get_size(dev) display.var_dict['mp_top_dev'].set(value=dev) display.var_dict['mp_top_size'].set(value=sz) - display.var_dict['mp_top_dir'].set(value=dir) + display.var_dict['mp_top_dir'].set(value=dr) if fm == 'yes': ri_widget.Widget.dict['mp_top_format'].tk_widget.select() else: @@ -66,24 +65,24 @@ def mp_top_ok(): for itm in eval(display.var_dict['mount.list'].get()): dev = itm.split()[0] dev2 = display.var_dict['mp_top_dev'].get() - base_fs='' if dev == dev2: sz = display.var_dict['mp_top_size'].get() - dir = display.var_dict['mp_top_dir'].get() + dr = display.var_dict['mp_top_dir'].get() fm = display.var_dict['mp_top_format'].get() idxs2 = ri_widget.Widget.dict['mp_top_fs'].tk_widget.curselection() - for m in ri_data.Partition.list: - if m.device == dev2: - base_fs = m.filesystem if len(idxs2) and fm =='yes' : - idx2 = int(idxs2[0]) - fs = eval(display.var_dict['mp_top_fs'].get())[idx2] - elif fm=='no': - fs = base_fs - s2 = dev.ljust(10) + dir.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6) + # if format, use the filesystem just set + idx2 = int(idxs2[0]) + fs = eval(display.var_dict['mp_top_fs'].get())[idx2] + elif dev in Partition.dict.keys(): + # else use the filesystem in Partition + fs = Partition.dict[dev].filesystem + else: + fs = ' ' + s2 = dev.ljust(10) + dr.ljust(10) + fs.ljust(10) + fm.ljust(4) + sz.ljust(6) + ri_data.Partition.unit l.append(s2) # make change in internal data structure - ri_data.MountPoint.change(dev2, dir, fs, fm) + ri_data.MountPoint.change(dev, dir, fs, fm) else: l.append(itm) @@ -133,12 +132,12 @@ class GroupButton(object): dict={} def __init__(self, g): self.name = g.name + self.win = display.SoftwarePackageWindow(g) GroupButton.dict[g.name] = self - display.SoftwarePackageWindow(g) + def __call__(self): - print self.name - display.SoftwarePackageWindow.dict[self.name].show() + self.win.show() class GroupCheck(GroupButton): ''' A function class called whenever the group check button is checked ''' @@ -191,10 +190,8 @@ def software_group_optional_quit(): ''' software group window quit, record optional group state ''' opt = [ o for o in ri_data.Group.dict.values() if o.install != 'mandatory' ] for i in opt: - print i.name vn = "software_group_%s" %(i.name) i.install = display.var_dict[vn].get() - print i.name, i.install def dependency_list_init(): ''' init function for list in dependency step ''' @@ -261,13 +258,10 @@ def raid_raw_init(): if not raid_raw_initialized: raid_raw_initialized = True # get all component devices already in raid - dev_in_raid = set() - for r in ri_data.Raid.list: - dev_in_raid.update(r.active_components) - dev_in_raid.update(r.spare_components) + dev_in_raid = ri_data.Raid.dev_in_raid() - raw_devs = [ p.device for p in ri_data.Partition.list - if p.flags=='yes' and p.device not in dev_in_raid ] + raw_devs = [ d for d in ri_data.Partition.dict.keys() + if re.search('raid', ri_data.Partition.dict[d].flags) and d not in dev_in_raid ].sort() display.var_dict['raid_raw_devs'].set(value=tuple(raw_devs)) def list_to_list(list_from, var_from, var_to): @@ -284,7 +278,7 @@ def list_to_list(list_from, var_from, var_to): l_to = list(eval(display.var_dict[var_to].get())) l_to.append(itm) else: - l_to = [ itm ] + l_to = [ itm ].sort() display.var_dict[var_to].set(value=tuple(l_to)) def raid_raw_to_active(): @@ -305,49 +299,35 @@ def raid_spare_to_raw(): def raid_device_init(): ''' initialize raid device list ''' - raid_devs = [ r.device for r in ri_data.Raid.list ] + raid_devs = [ k for k in ri_data.Raid.keys() ].sort() display.var_dict['raid_devs'].set(value=tuple(raid_devs)) -def raid_calc_size(level, devs): - ''' calculate raid device size -level - raid level (0/1/5) -devs - raid component devices -''' - # all devs shall have same size. - unit=ri_data.Partition.unit - sz=99999999999 - for p in ri_data.Partition.list: - if p.device in devs: - if float(p.size[:-len(unit)])< float(sz): - sz = float(p.size[:-len(unit)]) - if level == '0': - sz=sz*len(devs) - return "%d%s"%(sz,unit) - elif level == '1': - return "%d%s"%(sz,unit) - elif level == '5': - sz=sz*(len(devs)-1) - return "%d%s"%(sz,unit) - def raid_device_add(): ''' add a new raid device ''' - if display.var_dict['raid_active_devs'].get()=='': - ri_widget.MessageBox.dict["raid_add_active_warning"].show() - return - else: + try: active = list(eval(display.var_dict['raid_active_devs'].get())) - if display.var_dict['raid_spare_devs'].get()=='': - spare=[] - else: + except: + active = [] + + try: spare = list(eval(display.var_dict['raid_spare_devs'].get())) + except: + spare = [] + level = display.var_dict['raid_level'].get() if not active or not level: ri_widget.MessageBox.dict["raid_add_warning"].show() return + elif int(level) < 2 and len(active) < 2: + ri_widget.MessageBox.dict["raid_add_active_numbers"].show() + return + elif str(level) == "5" and len(active)<3: + ri_widget.MessageBox.dict["raid_add_active_numbers_2"].show() + return dev = ri_data.Raid.get_next_device() - ri_data.Raid(dev, "no", level, raid_calc_size(level, active), active, spare) + ri_data.Raid(dev, "no", level, active, spare) raid_device_init() display.var_dict['raid_active_devs'].set(value='') display.var_dict['raid_spare_devs'].set(value='') @@ -361,25 +341,30 @@ def raid_device_delete(): idxs = win_dev.curselection() if len(idxs) == 1: idx = int(idxs[0]) - r = ri_data.Raid.list[idx] + try: + l = eval(display.var_dict['raid_devs'].get()) + except: + # a null string? + return + dev = l[idx].split()[0] + r = ri_data.Raid.dict[dev] if r.from_os == 'yes': ri_widget.MessageBox.dict["raid_delete_warning"].show() return - if display.var_dict['raid_active_devs'].get() == '': - active=[] - else: + try: active = list(eval(display.var_dict['raid_active_devs'].get())) - if display.var_dict['raid_spare_devs'].get()=='': - spare=[] - else: + except: + active=[] + try: spare = list(eval(display.var_dict['raid_spare_devs'].get())) - + except: + spare=[] active.extend(r.active_components) spare.extend(r.spare_components) # do not touch level display.var_dict['raid_active_devs'].set(value=tuple(active)) display.var_dict['raid_spare_devs'].set(value=tuple(spare)) - del ri_data.Raid.list[idx] + del ri_data.Raid.dict[dev] raid_device_init() def raid_device_list_detail(*args): @@ -388,16 +373,21 @@ def raid_device_list_detail(*args): idxs = win.curselection() if len(idxs) == 1: idx = int(idxs[0]) - r = ri_data.Raid.list[idx] + try: + l = eval(display.var_dict['raid_devs'].get()) + except: + # a null string? + return + dev = l[idx].split()[0] + r = ri_data.Raid.dict[dev] display.var_dict['raid_detail_active'].set(value='active: %s' %(str(r.active_components))) display.var_dict['raid_detail_spare'].set(value='spare: %s' %(str(r.spare_components))) display.var_dict['raid_detail_level'].set(value='level: %s' %(str(r.level))) -raid_raw_initialized = False - def prepar_installation_init(): '''install information initialize''' ins_info = ri_data.prepar_installation() t= ri_widget.Widget.dict['prepar_installation.text'].tk_widget t.insert(1.0,ins_info) +raid_raw_initialized = False diff --git a/operation/install.txt b/operation/install.txt index 717a568..959c318 100644 --- a/operation/install.txt +++ b/operation/install.txt @@ -65,7 +65,7 @@ Usage: 配置fstab,configure_fstab.sh 输入: stdin - 1)block devices:块设备,(swap则用by-id,其他都用by-uuid) + 1)block devices:块设备 2)mount point:挂载点 3)filesystem type:文件系统类型 以下参数为可选参数,如果不指定,会有默认的配置,如果指定5)那么4)也需要指定,依次类推 diff --git a/xml/interface.xml b/xml/interface.xml index e493cc1..48a8178 100644 --- a/xml/interface.xml +++ b/xml/interface.xml @@ -726,7 +726,8 @@ row 4 | | - + + ". Hard disk will turn into active box or free box. If the hard disk turns into the active box, you can make a raid. After performing the operation, please choose level in Level box. In the end, you can make a raid according to press '-->'. + RAID is a technology that provides increased storage reliability through redundancy, combining multiple low-cost, less-reliable disk drives components into a logical unit where all drives in the array are interdependent. + If you don't want to make a RAID, you could click "next" to skip this step. The installation will go on normally. + The partitions whose file system type are raid are listed in the Original frame, e.g., sda2, sdb2. The RAID are listed in the Device frame, e.g., md0, md1. The partitions to make a RAID are listed in the Active frame, and the spare partitions for the RAID are listed in the Spare frame. + The original RAID will be retained. If you want to make a new RAID, select partitions in the original frame, then click "-->" to move them to the Active frame or Spare frame, according to their roles. There must be one or more partitions in the Active frame, relating to the raid level you want to make, but the spare partitions are not essential. A new RAID, named mdX (X stands for the number of the RAID), will be listed in the Device frame after you click "-->" beside the Device frame. 磁盘陈列技术(RAID)诞生于1987年,由美国加州大学伯克利分校提出。该技术是把多块独立的硬盘(物理硬盘)按不同的方式组合起来形成一个硬盘组(逻辑硬盘),从而提供比单个硬盘更高的存储性能和提供数据备份技术。 如果用户不懂该技术可以直接点击下一步,系统将不制作RAID,并不影响系统的安装及运行。 - 原始框中是满足制作RAID的硬盘分区,如sda1、sdb2等。设备框中是原本系统已经制作好的RAID,如md0、md1等。系装安装时将保留原有的RAID设备。若要制作新RAID,请在原始框中选中硬盘分区后通过点击"->",硬盘分区会进入活动框或空闲框中。要制作RAID,活动框中必须要有硬盘分区,可以有一个或多个。空闲框中硬盘分区是可选的,可以有一个或多个,也可以没有。完成上步操作后在级别框中选择raid的级别,最后点击"->"在设备框中产生新的mdX设备。 + 原始框中是满足制作RAID的硬盘分区,如sda1、sdb2等。设备框中是原本系统已经制作好的RAID,如md0、md1等。系装安装时将保留原有的RAID设备。若要制作新RAID,请在原始框中选中硬盘分区后通过点击"->",硬盘分区会进入使用框或备用框中。要制作RAID,使用框中必须要有硬盘分区,可以有一个或多个。备用框中硬盘分区是可选的,可以有一个或多个,也可以没有。完成上步操作后在级别框中选择raid的级别,最后点击"->"在设备框中产生新的mdX设备。 - The serial number is that computer systems security operations of the Linx. In the serial number display frame, please input correct serial number so that the Rocky system can be start after the operating system installed. - How to get the serial number?please contact Linx. - web: www.linx-info.com + Serial number is the permission to run secure functions of Linx Rocky Secure OS. + Please Input the correct serial number in the frame, so that secure functions could run. + Please contact Linx Technology Co.,Ltd. to get the serial number. + Website: www.linx-info.com 安装序列号是计算机运行凝思磐石安全操作系统的许可,请在序列号框内输入正确的序列号,以便操作系统的安全功能,能从计算机启动。 @@ -970,7 +981,8 @@ row 4 | | - Display frame illustrate which type of service will be supported after installation. Gray box means this service cann't be supported because there is no match with software package. + The color of the servers listed in the frame suggests whether they are self-starting since system startup. Gary means no, and the probable + reason is packages providing the servers haven't been selected to install. 显示框中表示系统启动过程中自动启动的服务。 @@ -979,14 +991,15 @@ row 4 | | - Package group was divided into required and optional parts. They system will be installed by default which in the Required Software. To install the optional packages, you can first click on an optional package group and find it. - Base package group is required parts. Basic package include required and optional aparts. Required packages are installed by default, the optional package can be free to choose. - Development package group, including C, C++, DDD and other developed tolls are available. You can choose to install. - Graphics software package group, including the various procedures related XII. Graphics software package can be divided into the required and optional package. When you select to choose this kind of package, the required one is installed by default and the optional one is free. - Network service package group is optional package , various network services package and network service software can choose to install. - Internet software, including World Wide Web browser and Firefox, divided into required and optional packages. The first is installed by default and the last one is free to choose. - Multimedia package group, including a variety of media library. Multimedia software packages are optional packages can choose to install. - Another package group is optional one, so you can choose to install freely. + There are two kinds of packages and package groups, one is mandatory, the other is optional. + The mandatory packages of a group will be installed by default if you select the group. You could first click a group, and then select optional packages want to install in the pop-up dialog box. + Base group is the only mandatory group to install, consist of packages for a base system. The mandatory packages of Base group will be installed by default, you could select optional packages of it. + Development group is consist of tools of C, C++, DDD, etc. There's no mandatory package in Development group, you could select optional packages of it. + GUI group is consist of various packages relating to X11. There are mandatory packages and optional packages. Mandatory packages will be installed by default if you select this group. You could select optional packages freely. + Network group is consist of various network sevices packages. There's no mandatory package, you could select optional packages of it. + Internet group is consist of software like World Wide Web browser Firefox. There are mandatory packages and optional packages. Mandatory packages will be installed by default if you select this group. You could select optional packages freely. + Multimedia group is consist of a variety of media libraries.There's no mandatory package, you could select optional packages of it. + Others group is consist of packages that are not included in groups above, e.g., kde, vm, network tools. There's no mandatory package, you could select optional packages of it. 软件包组分为必选软件包组和可选软件包。系统默认时会安装必选软件包组里的必选软件包。在安装软件包时,先点击软件包组,在弹出的对话框中选上所须要的软件包。 @@ -1007,22 +1020,10 @@ row 4 | | - Respect of user, hello! welcome to use that the operating system. Rocky! + Dear user, welcome to Linx Rocky Secure OS! 尊敬的用户,你好!欢迎使用凝思磐石操作系统。 - 凝思磐石安全操作系统遵循国内外安全操作系统GB17859、GB/T18336、GJB4936、 GJB4937、GB/T20272以及POSIX、TCSEC、ISO15408等标准进行设计和实现,为我国用户提供拥有自主知识产权、高安全、高可用和高效的操作系统平台。凝思科技经过多年的研究,开发出的凝思磐石安全操作系统具有以下主要特点: - 高安全性 - 安全性是凝思磐石安全操作系统的主要特征,充分结合凝思科技的独有技术与国内外多项安全标准的要求,在操作系统和应用程序的各个层次进行安全增强,使系统成为安全的有机整体。主要安全机制有一下几点:强制运行机制(MEC)、强制能力控制(MCC)、访问控制列表(ACL)、强制访问控制(MAC)、四权分立的系统管理 - 高可用性 - 凝思磐石安全操作系统发布前进行了长时间的压力测试,能够保证高内存和CPU负载环境下的稳定运行,为各类应用提供稳定运行平台。 - 高兼容性 - 凝思磐石安全操作系统系列产品包括安全服务器版、安全工作站版、安全专用设备版和安全桌面版,适用于从大型计算到桌面办公等各种环境,支持各类通用和专业应用,具有良好的软、硬件兼容性. - 凝思磐石安全操作系统提供丰富的驱动程序,支持各类主流磁盘驱动器、网卡驱动器和显示控制器等硬件设备。兼容国内外各大主流厂商的多款服务器和桌面计算机。凝思科技还可协助第三方硬件厂商完成驱动程序的研发和移植,实现加密卡等专用硬件设备支持。 - 高效性 - 凝思磐石安全操作系统的每一款产品均针对服务器、工作站、专用设备和桌面环境进行特别优化,能够获得比通用操作系统更高的运行效率. - 易维护性 - 凝思磐石安全操作系统的配置、使用和维护方法与传统UNIX和Linux保持一致,提供丰富的管理和维护软件,既可通过命令行工具完成系统配置和维护,又可通过图形界面完成相关操作,简化用户操作步骤,减少系统管理员的维护工作量。 @@ -1033,7 +1034,7 @@ row 4 | | Active - 活动 + 使用 @@ -1223,7 +1224,7 @@ row 4 | | Spare - 空闲 + 备用