From: Richard Maw Date: Thu, 11 Oct 2012 09:13:36 +0000 (+0100) Subject: Add --no-kernel option X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=a2eb55aaed8f72ae842ec484f0384b5e2fa8fa61;p=forks%2Fvmdebootstrap.git Add --no-kernel option 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. --- diff --git a/vmdebootstrap b/vmdebootstrap index 36a8998..9821164 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -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')