From: Antonio Terceiro Date: Tue, 11 Jun 2013 14:44:02 +0000 (-0300) Subject: Allow custom command to handle the serial console X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=aab83d8d7d5aad539444c882c174443b04f7db6a;p=forks%2Fvmdebootstrap.git Allow custom command to handle the serial console The need I am addressing with this is making the serial console auto-login as root. For this right now I'm using the auto-serial-console program from the linaro-overlay package: https://launchpad.net/~linaro-maintainers/+archive/overlay/+files/linaro-overlay_1112.2.dsc In the near future I plan to port the generic parts of that package to Debian under the name auto-serial-console or some similar --- diff --git a/vmdebootstrap b/vmdebootstrap index ea5edff..f857bac 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -73,6 +73,11 @@ class VmDebootstrap(cliapp.Application): metavar='USER/PASSWORD') self.settings.boolean(['serial-console'], 'configure image to use a serial console') + self.settings.string(['serial-console-command'], + 'command to manage the serial console, appended ' + 'to /etc/inittab (%default)', + metavar='COMMAND', + default='/sbin/getty -L ttyS0 115200 vt100') self.settings.boolean(['sudo'], 'install sudo, and if user is created, add them ' 'to sudo group') @@ -345,10 +350,11 @@ append initrd=%(initrd)s root=UUID=%(uuid)s ro %(kserial)s f.close() if self.settings['serial-console']: + serial_command = self.settings['serial-console-command'] 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') + f.write('\nS0:23:respawn:%s\n' % serial_command) self.runcmd(['extlinux', '--install', rootdir]) self.runcmd(['sync'])