self.settings.string_list(['user'],
'create USER with PASSWORD',
metavar='USER/PASSWORD')
+ self.settings.boolean(['serial-console'],
+ 'configure image to use a serial console')
def process_args(self, args):
if not self.settings['image']:
label linux
kernel %(kernel)s
-append initrd=%(initrd)s root=UUID=%(uuid)s ro quiet
+append initrd=%(initrd)s root=UUID=%(uuid)s ro quiet %(kserial)s
+%(extserial)s
''' % {
'kernel': kernel_image,
'initrd': initrd_image,
'uuid': uuid,
+ 'kserial':
+ 'console=ttyS0,115200' if self.settings['serial-console'] else '',
+ 'extserial': 'serial 0 115200' if self.settings['serial-console'] else '',
})
f.close()
+
+ if self.settings['serial-console']:
+ logging.debug('adding getty to serial console')
+ inittab = os.path.join(rootdir, 'etc/inittab')
+ with open(inittab, 'a') as f:
+ f.write('\nS0:23:respawn:/sbin/getty -L ttyS0 115200 vt100\n')
self.runcmd(['extlinux', '--install', rootdir])
self.runcmd(['sync'])