Merge "serial-console: Use udev rules to startup getty"
This commit is contained in:
commit
73c3b2c404
@ -1,4 +1,4 @@
|
|||||||
Start getty on ttyS0 and/or ttyS1
|
Start getty on active serial consoles.
|
||||||
|
|
||||||
With ILO and other remote admin environments, having a serial console can be
|
With ILO and other remote admin environments, having a serial console can be
|
||||||
useful for debugging and troubleshooting.
|
useful for debugging and troubleshooting.
|
||||||
@ -7,4 +7,4 @@ For upstart:
|
|||||||
If ttyS1 exists, getty will run on that, otherwise on ttyS0.
|
If ttyS1 exists, getty will run on that, otherwise on ttyS0.
|
||||||
|
|
||||||
For systemd:
|
For systemd:
|
||||||
Try to start getty on both ttyS0 and ttyS1.
|
We dynamically start a getty on any active serial port via udev rules.
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
home=$(dirname $0)
|
|
||||||
set -uex
|
set -uex
|
||||||
|
SCRIPTDIR=$(dirname $0)
|
||||||
|
|
||||||
DIB_INIT_SYSTEM=$(dib-init-system)
|
DIB_INIT_SYSTEM=$(dib-init-system)
|
||||||
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
|
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
|
||||||
install -m 0644 -o root -g root $home/ttySx.conf /etc/init/ttySx.conf
|
install -m 0644 -o root -g root ${SCRIPTDIR}/ttySx.conf /etc/init/ttySx.conf
|
||||||
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
|
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
|
||||||
ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service
|
install -D -g root -o root -m 0644 ${SCRIPTDIR}/serial-console-udev.rules /etc/udev/rules.d/99-serial-console.rules
|
||||||
ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS1.service
|
|
||||||
fi
|
fi
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
SUBSYSTEM=="tty", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="getty@$name.service", ATTRS{type}=="4"
|
Loading…
x
Reference in New Issue
Block a user