Maksim Malchuk 06ab1390fa Run console on the serial port if required
This commit adds the ability to use IPMI SOL console when the nodes
provisioned with an option 'console=ttySx' or 'console=ttySx,speed',
where x is 0 for the COM1 and 1 for COM2. If speed parameter doesn't
provided so 9600 used as default. This feature can be used for the
bootstrap nodes too.

DocImpact
Closes-Bug: #1544820
Change-Id: I210001c5692281add2439843f4ad69d65c8f6e17
Signed-off-by: Maksim Malchuk <mmalchuk@mirantis.com>
2016-06-16 14:16:53 +03:00

19 lines
451 B
Plaintext

# ttyS1 - getty
start on stopped rc RUNLEVEL=[12345]
stop on runlevel [!12345]
respawn
pre-start script
# exit if console not present on ttyS1
cat /proc/cmdline | grep -q "console=ttyS1"
end script
script
# get console speed if provded with "console=ttySx,38400"
SPEED=$(cat /proc/cmdline | sed -e"s/^.*console=ttyS1[,]*\([^ ]*\)[ ]*.*$/\1/g")
# or use 9600 console speed as default
exec /sbin/getty -L ${SPEED:-9600} ttyS1
end script