'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')
self.create_users(rootdir)
self.remove_udev_persistent_rules(rootdir)
self.setup_networking(rootdir)
- self.install_extlinux(rootdev, rootdir)
self.customize(rootdir)
+ self.install_extlinux(rootdev, rootdir)
except BaseException, e:
self.message('EEEK! Something bad happened...')
self.cleanup_system()
self.cleanup_system()
def message(self, msg):
+ logging.info(msg)
if self.settings['verbose']:
print msg
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')
- 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']
script = self.settings['customize']
if script:
self.message('Running customize script %s' % script)
- self.runcmd([script, rootdir])
+ with open('/dev/tty', 'w') as tty:
+ cliapp.runcmd([script, rootdir], stdout=tty, stderr=tty)
if __name__ == '__main__':