about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-22 17:02:01 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-22 17:15:31 +0200
commit3e5c185446e41e698bfdd64504bd3b5fe6226664 (patch)
treeba933764102bb357897bc74d7f83001135d7eda2
parent52f9477c32749aee8b3c4ae080a9905e4ae9f3c9 (diff)
downloadhrmpf-3e5c185446e41e698bfdd64504bd3b5fe6226664.tar.gz
hrmpf-3e5c185446e41e698bfdd64504bd3b5fe6226664.tar.xz
hrmpf-3e5c185446e41e698bfdd64504bd3b5fe6226664.zip
enable serial getty when using serial console
-rw-r--r--dracut/getty-serial.sh12
-rw-r--r--dracut/module-setup.sh1
2 files changed, 13 insertions, 0 deletions
diff --git a/dracut/getty-serial.sh b/dracut/getty-serial.sh
new file mode 100644
index 0000000..0b85af5
--- /dev/null
+++ b/dracut/getty-serial.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+
+CONSOLE=$(getarg console)
+case "$CONSOLE" in
+*ttyS0*)
+        ln -s /etc/sv/agetty-ttyS0 ${NEWROOT}/etc/runit/runsvdir/default/
+        ;;
+esac
diff --git a/dracut/module-setup.sh b/dracut/module-setup.sh
index 4170620..abdf7f8 100644
--- a/dracut/module-setup.sh
+++ b/dracut/module-setup.sh
@@ -26,6 +26,7 @@ install() {
     inst_hook pre-pivot 01 "$moddir/adduser.sh"
     inst_hook pre-pivot 02 "$moddir/display-manager-autologin.sh"
     inst_hook pre-pivot 02 "$moddir/getty-autologin.sh"
+    inst_hook pre-pivot 02 "$moddir/getty-serial.sh"
     inst_hook pre-pivot 03 "$moddir/copy-initramfs.sh"
     inst_hook pre-pivot 04 "$moddir/locale.sh"
     inst_hook pre-pivot 05 "$moddir/services.sh"