]> git.siccegge.de Git - forks/vmdebootstrap.git/commitdiff
Add --no-kernel option
authorRichard Maw <richard.maw@codethink.co.uk>
Thu, 11 Oct 2012 09:13:36 +0000 (10:13 +0100)
committerRichard Maw <richard.maw@codethink.co.uk>
Thu, 11 Oct 2012 09:13:36 +0000 (10:13 +0100)
This prevents vmdebootstrap automatically adding a kernel.

This is arguably required, since vmdebootstrap may be used for
a platform which does not have a kernel in the standard repositories.

vmdebootstrap

index 36a8998ee869788860de180cf22d987e340fb4f4..98211646f54968e8fa7335f375abdf185a728b91 100755 (executable)
@@ -53,6 +53,7 @@ class VmDebootstrap(cliapp.Application):
                                   'install package in DEB file onto system '
                                     '(not from mirror)',
                                   metavar='DEB')
+        self.settings.boolean(['no-kernel'], 'do not install a linux package')
         self.settings.boolean(['enable-dhcp'], 'enable DHCP on eth0')
         self.settings.string(['root-password'], 'set root password',
                              metavar='PASSWORD')
@@ -174,13 +175,16 @@ class VmDebootstrap(cliapp.Application):
     def debootstrap(self, rootdir):
         self.message('Debootstrapping')
 
-        if self.settings['arch'] == 'i386':
-            kernel_arch = '686'
-        else:
-            kernel_arch = self.settings['arch']
-        kernel_image = 'linux-image-2.6-%s' % kernel_arch
+        include = self.settings['package']
+
+        if not self.settings['no-kernel']:
+            if self.settings['arch'] == 'i386':
+                kernel_arch = '686'
+            else:
+                kernel_arch = self.settings['arch']
+            kernel_image = 'linux-image-2.6-%s' % kernel_arch
+            include.append(kernel_image)
 
-        include = [kernel_image] + self.settings['package']
         if self.settings['sudo'] and 'sudo' not in include:
             include.append('sudo')