Since the kernel may not be included any more, it is possible to
get an empty include list, which debootstrap complains is invalid.
To solve this, restructure the runcmd, so that it checks the include
list before attempting to add --include to the argument list.
if self.settings['sudo'] and 'sudo' not in include:
include.append('sudo')
if self.settings['sudo'] and 'sudo' not in include:
include.append('sudo')
- self.runcmd(['debootstrap',
- '--arch=%s' % self.settings['arch'],
- '--include=%s' % ','.join(include),
- self.settings['distribution'],
- rootdir,
- self.settings['mirror']])
+ args = ['debootstrap', '--arch=%s' % self.settings['arch']]
+ if include: args.append('--include=%s' % ','.join(include))
+ args += [self.settings['distribution'],
+ rootdir, self.settings['mirror']]
+ self.runcmd(args)
def set_hostname(self, rootdir):
hostname = self.settings['hostname']
def set_hostname(self, rootdir):
hostname = self.settings['hostname']