From aab83d8d7d5aad539444c882c174443b04f7db6a Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 11 Jun 2013 11:44:02 -0300 Subject: [PATCH] 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 --- vmdebootstrap | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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']) -- 2.39.2