aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup')
-rwxr-xr-xtarget/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup b/target/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup
new file mode 100755
index 000000000..4098b37a7
--- /dev/null
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+enable_console_login() {
+ local cons=$1
+ local initline="$cons::askfirst:/bin/ash --login"
+
+ grep -qs "^$initline" /etc/inittab || {
+ echo "$initline" >> /etc/inittab
+ sync
+ kill -HUP 1
+ }
+}
+
+inittab_console_fixup() {
+ for cons in ttyS0 ttyATH0; do
+ grep -qs "console=$cons" /proc/cmdline && {
+ enable_console_login $cons
+ }
+ done
+}
+
+inittab_console_fixup
+
+exit 0