igor@34: #### igor@34: # igor@34: # External variables: igor@34: # * network igor@34: # * domain igor@34: igor@34: igor@35: try: igor@35: domain igor@35: except NameError: igor@35: import sys igor@35: network=sys.modules['__main__'].network igor@35: domain=sys.modules['__main__'].domain igor@34: nata@36: import os nata@36: sys.path.append(os.environ['HOME']+"/xentaur") nata@36: os.environ['xendomain']=domain nata@36: igor@35: #try: igor@34: igor@35: exec 'from %s import *' % (network) igor@35: #except: igor@35: # print "Can't find or interpret module %s with topology description" %(network) igor@35: # sys.exit(1) igor@34: igor@34: igor@35: N = str(domains.index(domain)) igor@35: name=domain igor@34: igor@34: pae=1 igor@34: if pae: igor@40: kernel = "/boot/vmlinuz-2.6.18-4-xen-686" igor@40: ramdisk = "/boot/initrd.img-2.6.18-4-xen-686" igor@34: else: igor@34: kernel = "/boot/vmlinuz-2.6.18-without-PAE-4-xen-686" igor@34: ramdisk = "/boot/initrd.img-2.6.18-without-PAE-4-xen-686-domU" igor@34: igor@34: #builder='linux' igor@34: cpu_cap = 10 igor@34: igor@34: igor@34: vbridges = vbridges_table[name] igor@34: igor@34: vif=[] igor@34: x=1 igor@34: for i in vbridges: igor@34: vif.append('bridge='+i+',mac=00:16:3e:01:'+hex(int(N))[2:]+':'+hex(int('c0',16)+x)[2:]) igor@34: x+=1 igor@34: igor@34: disk = [ 'file:'+xenomips_dir+'xenomips1.img,hda1,r', 'file:'+xenomips_dir+'xenomips-ios1.img,hda2,r', 'file:'+xenomips_dir+'xenomips-config'+N+'.img,hda3,w' ] igor@34: root = "/dev/hda1 ro" igor@34: igor@42: platform_option="" igor@42: if platform != '7200': igor@42: platform_option=' -P '+platform igor@42: igor@42: npe_option="" igor@42: if platform == '7200': igor@42: npe_option=" -t "+npe_type igor@42: igor@42: xenomips='/xenomips/ios/'+ios_name+platform_option+npe_option+' -m 00:16:3e:01:'+hex(int(N))[2:]+':01' igor@34: igor@34: for i in range(len(vbridges)-1): igor@34: xenomips += ' -p '+str(i+1)+':PA-FE-TX' igor@34: igor@34: for i in range(len(vbridges)): igor@34: xenomips += ' -s '+str(i)+':0:gen_eth:eth'+str(i) igor@34: igor@34: if domain_types[int(N)] == 'quagga': igor@34: extra = "quagga" igor@34: else: igor@34: extra = "xenomips=\""+xenomips+"\"" igor@34: igor@34: on_poweroff = 'destroy' igor@34: on_reboot = 'restart' igor@34: on_crash = 'restart' igor@34: