summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Terceiro <antonio.terceiro@linaro.org>2013-06-11 11:44:02 -0300
committerLars Wirzenius <liw@liw.fi>2013-07-14 17:03:28 +0100
commitaab83d8d7d5aad539444c882c174443b04f7db6a (patch)
tree9f3ef35f6608e48651d2c08f513e867611789cf5
parent7dba6126d384b61280b2b73e9f4aa1e4bc67908f (diff)
downloadvmdebootstrap-aab83d8d7d5aad539444c882c174443b04f7db6a.tar.gz
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
-rwxr-xr-xvmdebootstrap8
1 files changed, 7 insertions, 1 deletions
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'])