Choose what kernel to use for the autoinstaller based on what dom0 is
[invirt/packages/invirt-xen-config.git] / invirt-database
index 4f793ed..b914701 100644 (file)
@@ -25,7 +25,7 @@ if 'cdrom_image' in locals():
     check(cdrom is not None)
 
 memory = machine.memory
-maxmem = memory
+maxmem = '2048'
 check(re.match('^[A-Za-z0-9][A-Za-z0-9._-]*$', machine.name))
 name = prefix + machine.name
 check(re.match('^[0-9a-f-]+$', machine.uuid))
@@ -52,8 +52,10 @@ else:
 if 'installer_options' in locals(): #Installer
     disk.append('phy:/dev/xenvg/s_install_hda,hdb,r')
 
-    kernel = '/boot/vmlinuz-2.6.24-19-xen' #From hardy
-    ramdisk = '/boot/initrd.img-2.6.24-19-xen'
+    import os
+    release = os.uname()[2]
+    kernel = '/boot/vmlinuz-%s' % release
+    ramdisk = '/boot/initrd.img-%s' % release
 
     if not machine.nics:
         raise RuntimeError('You must have a nic to autoinstall')
@@ -84,7 +86,7 @@ elif codepath == 'paravm':
 
 for n in machine.nics:
     check(re.match('^[0-9a-fA-F:]+$', n.mac_addr) and re.match('^[0-9.]*$', n.ip))
-    d = '%smac=%s, ip=%s, script=vif-invirtroute' % (viftype, n.mac_addr, n.ip)
+    d = '%smac=%s, ip=%s, script=vif-invirtroute netdev=eth2' % (viftype, n.mac_addr, n.ip)
     vif.append(d)
 
 for d in machine.disks: