diff --git a/cloud-init-templates/boothook_ubuntu.jinja2 b/cloud-init-templates/boothook_ubuntu.jinja2 index b526f28..182f1f6 100644 --- a/cloud-init-templates/boothook_ubuntu.jinja2 +++ b/cloud-init-templates/boothook_ubuntu.jinja2 @@ -97,3 +97,27 @@ cloud-init-per instance skel_bash cp -f /etc/skel/.bash* /root/ cloud-init-per instance hiera_puppet mkdir -p /etc/puppet /var/lib/hiera cloud-init-per instance touch_puppet touch /var/lib/hiera/common.yaml /etc/puppet/hiera.yaml /var/log/puppet.log cloud-init-per instance chmod_puppet chmod 600 /var/log/puppet.log + +cloud-init-per instance upstart_console /bin/sh -c 'for i in $(seq 0 1); do +cat >/etc/init/ttyS${i}.conf <<-EOF +# ttyS${i} - getty + +start on stopped rc RUNLEVEL=[12345] +stop on runlevel [!12345] + +respawn + +pre-start script + # exit if console not present on ttyS${i} + cat /proc/cmdline | grep -q "console=ttyS${i}" +end script + +script + # get console speed if provded with "console=ttySx,38400" + SPEED=\$(cat /proc/cmdline | sed -e"s/^.*console=ttyS${i}[,]*\([^ ]*\)[ ]*.*\$/\1/g") + # or use 9600 console speed as default + exec /sbin/getty -L \${SPEED:-9600} ttyS${i} +end script +EOF +done +' diff --git a/contrib/fuel_bootstrap/files/trusty/etc/init/ttyS0.conf b/contrib/fuel_bootstrap/files/trusty/etc/init/ttyS0.conf new file mode 100644 index 0000000..718db01 --- /dev/null +++ b/contrib/fuel_bootstrap/files/trusty/etc/init/ttyS0.conf @@ -0,0 +1,18 @@ +# ttyS0 - getty + +start on stopped rc RUNLEVEL=[12345] +stop on runlevel [!12345] + +respawn + +pre-start script + # exit if console not present on ttyS0 + cat /proc/cmdline | grep -q "console=ttyS0" +end script + +script + # get console speed if provded with "console=ttySx,38400" + SPEED=$(cat /proc/cmdline | sed -e"s/^.*console=ttyS0[,]*\([^ ]*\)[ ]*.*$/\1/g") + # or use 9600 console speed as default + exec /sbin/getty -L ${SPEED:-9600} ttyS0 +end script diff --git a/contrib/fuel_bootstrap/files/trusty/etc/init/ttyS1.conf b/contrib/fuel_bootstrap/files/trusty/etc/init/ttyS1.conf new file mode 100644 index 0000000..5d954a4 --- /dev/null +++ b/contrib/fuel_bootstrap/files/trusty/etc/init/ttyS1.conf @@ -0,0 +1,18 @@ +# 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