Fix autoinstalls to work around a modern d-i bug
[invirt/packages/invirt-xen-config.git] / invirt-database
index e5ceec1..98ede48 100644 (file)
@@ -27,7 +27,7 @@ if machine_type.hvm:
     # Disable populate-on-demand
     maxmem = memory
 else:
     # Disable populate-on-demand
     maxmem = memory
 else:
-    maxmem = '2048'
+    maxmem = max(memory, 4096)
 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))
 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))
@@ -72,6 +72,7 @@ if 'installer_options' in locals(): #Installer
             # For debugging, add "DEBCONF_DEBUG=5" to the arguments.
             extras = ["auto=true",
                       "debconf/priority=critical",
             # For debugging, add "DEBCONF_DEBUG=5" to the arguments.
             extras = ["auto=true",
                       "debconf/priority=critical",
+                      'preseed/early_command="grep -v tty0 /etc/inittab >/etc/inittab.new; mv -f /etc/inittab.new /etc/inittab"',
                       "debian-installer/locale=en_US.UTF-8",
                       "debian-installer/exit/always_halt=true",
                       "url="+install['preseed'],
                       "debian-installer/locale=en_US.UTF-8",
                       "debian-installer/exit/always_halt=true",
                       "url="+install['preseed'],