summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/base-files/etc/uci-defaults
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-09-23 19:56:38 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-09-23 19:56:38 +0000
commita46904b68e5ee48e9bfd8a1da1e1c48c1aa4b63a (patch)
tree0ecd3407a1c4621f3d052a6d5eca3e20f8cb20b6 /target/linux/ar71xx/base-files/etc/uci-defaults
parent1ec1b71c3c524abaf636ae7909402e39e7777ee0 (diff)
ar71xx: enable login only on the system console by default
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28294 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/base-files/etc/uci-defaults')
-rwxr-xr-xtarget/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup25
1 files changed, 25 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 0000000000..4836817bef
--- /dev/null
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/inittab-console-fixup
@@ -0,0 +1,25 @@
+#!/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