summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-04-18 21:53:07 +0200
committerJohn Crispin <blogic@openwrt.org>2016-04-18 21:53:07 +0200
commitdc929174095a00150de6a3e48d46355d24f223b9 (patch)
treef1106ba7c0d71f8072e5158c481f71aeee8db066
parent5e85ae9e4c85e9ec43f38aa350c5bd0f0e7bea2b (diff)
downloadmtk-20170518-dc929174095a00150de6a3e48d46355d24f223b9.zip
mtk-20170518-dc929174095a00150de6a3e48d46355d24f223b9.tar.gz
mtk-20170518-dc929174095a00150de6a3e48d46355d24f223b9.tar.bz2
image / basefiles: make console password configurable
Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com> Signed-off-by: John Crispin <john@phrozen.org>
-rw-r--r--package/base-files/files/etc/config/system1
-rw-r--r--package/base-files/files/etc/inittab2
-rwxr-xr-xpackage/base-files/files/usr/libexec/login.sh5
-rw-r--r--package/utils/busybox/Config-defaults.in4
-rw-r--r--target/linux/adm5120/base-files/etc/inittab6
-rw-r--r--target/linux/ar71xx/base-files/etc/inittab2
-rw-r--r--target/linux/arm64/base-files/etc/inittab6
-rw-r--r--target/linux/brcm2708/base-files/etc/inittab4
-rw-r--r--target/linux/ipq806x/base-files/etc/inittab2
-rw-r--r--target/linux/lantiq/base-files/etc/inittab2
-rw-r--r--target/linux/malta/base-files/etc/inittab10
-rw-r--r--target/linux/mediatek/base-files/etc/inittab2
-rw-r--r--target/linux/mxs/base-files/etc/inittab2
-rw-r--r--target/linux/omap/base-files/etc/inittab6
-rw-r--r--target/linux/omap24xx/base-files/etc/inittab6
-rw-r--r--target/linux/ppc44x/base-files/etc/inittab4
-rw-r--r--target/linux/ramips/base-files/etc/inittab2
-rw-r--r--target/linux/realview/base-files/etc/inittab6
-rw-r--r--target/linux/sunxi/base-files/etc/inittab6
-rw-r--r--target/linux/x86/base-files/etc/inittab4
-rw-r--r--target/linux/x86/xen_domu/base-files/etc/inittab6
-rw-r--r--target/linux/zynq/base-files/etc/inittab2
22 files changed, 48 insertions, 42 deletions
diff --git a/package/base-files/files/etc/config/system b/package/base-files/files/etc/config/system
index 20517f9..80c3f9b 100644
--- a/package/base-files/files/etc/config/system
+++ b/package/base-files/files/etc/config/system
@@ -1,6 +1,7 @@
config system
option hostname lede
option timezone UTC
+ option ttylogin 0
config timeserver ntp
list server 0.openwrt.pool.ntp.org
diff --git a/package/base-files/files/etc/inittab b/package/base-files/files/etc/inittab
index 7817185..9820e71 100644
--- a/package/base-files/files/etc/inittab
+++ b/package/base-files/files/etc/inittab
@@ -1,3 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-::askconsole:/bin/ash --login
+::askconsole:/usr/libexec/login.sh
diff --git a/package/base-files/files/usr/libexec/login.sh b/package/base-files/files/usr/libexec/login.sh
new file mode 100755
index 0000000..02ac9c8
--- /dev/null
+++ b/package/base-files/files/usr/libexec/login.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ "$(uci get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
+
+exec /bin/login
diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in
index ee42fa1..5240616 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -1212,10 +1212,10 @@ config BUSYBOX_DEFAULT_GETTY
default n
config BUSYBOX_DEFAULT_LOGIN
bool
- default n
+ default y
config BUSYBOX_DEFAULT_LOGIN_SESSION_AS_CHILD
bool
- default n
+ default y
config BUSYBOX_DEFAULT_LOGIN_SCRIPTS
bool
default n
diff --git a/target/linux/adm5120/base-files/etc/inittab b/target/linux/adm5120/base-files/etc/inittab
index 9f7c0ae..d81d5d9 100644
--- a/target/linux/adm5120/base-files/etc/inittab
+++ b/target/linux/adm5120/base-files/etc/inittab
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/bin/ash --login
-ttyAM0::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+tts/0::askfirst:/usr/libexec/login.sh
+ttyAM0::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/ar71xx/base-files/etc/inittab b/target/linux/ar71xx/base-files/etc/inittab
index 7817185..9820e71 100644
--- a/target/linux/ar71xx/base-files/etc/inittab
+++ b/target/linux/ar71xx/base-files/etc/inittab
@@ -1,3 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-::askconsole:/bin/ash --login
+::askconsole:/usr/libexec/login.sh
diff --git a/target/linux/arm64/base-files/etc/inittab b/target/linux/arm64/base-files/etc/inittab
index d9d571e..be235d8 100644
--- a/target/linux/arm64/base-files/etc/inittab
+++ b/target/linux/arm64/base-files/etc/inittab
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/bin/ash --login
-ttyAMA0::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+tts/0::askfirst:/usr/libexec/login.sh
+ttyAMA0::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/brcm2708/base-files/etc/inittab b/target/linux/brcm2708/base-files/etc/inittab
index a6c0bc8..b944a93 100644
--- a/target/linux/brcm2708/base-files/etc/inittab
+++ b/target/linux/brcm2708/base-files/etc/inittab
@@ -1,4 +1,4 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-::askconsole:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+::askconsole:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/ipq806x/base-files/etc/inittab b/target/linux/ipq806x/base-files/etc/inittab
index 19a6e11..809bba5 100644
--- a/target/linux/ipq806x/base-files/etc/inittab
+++ b/target/linux/ipq806x/base-files/etc/inittab
@@ -1,4 +1,4 @@
# Copyright (c) 2013 The Linux Foundation. All rights reserved.
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-ttyMSM0::askfirst:/bin/ash --login
+ttyMSM0::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/lantiq/base-files/etc/inittab b/target/linux/lantiq/base-files/etc/inittab
index 46a1312..21fa8d5 100644
--- a/target/linux/lantiq/base-files/etc/inittab
+++ b/target/linux/lantiq/base-files/etc/inittab
@@ -1,3 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
-ttyLTQ0::askfirst:/bin/ash --login
+ttyLTQ0::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/malta/base-files/etc/inittab b/target/linux/malta/base-files/etc/inittab
index 88567b2..2697723 100644
--- a/target/linux/malta/base-files/etc/inittab
+++ b/target/linux/malta/base-files/etc/inittab
@@ -1,7 +1,7 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/bin/ash --login
-ttyS0::askfirst:/bin/ash --login
-ttyS1::askfirst:/bin/ash --login
-ttyS2::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+tts/0::askfirst:/usr/libexec/login.sh
+ttyS0::askfirst:/usr/libexec/login.sh
+ttyS1::askfirst:/usr/libexec/login.sh
+ttyS2::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/mediatek/base-files/etc/inittab b/target/linux/mediatek/base-files/etc/inittab
index 870b3cc..b169c82 100644
--- a/target/linux/mediatek/base-files/etc/inittab
+++ b/target/linux/mediatek/base-files/etc/inittab
@@ -1,3 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-ttyS0::askfirst:/bin/ash --login
+ttyS0::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/mxs/base-files/etc/inittab b/target/linux/mxs/base-files/etc/inittab
index 09359b7..9991ac4 100644
--- a/target/linux/mxs/base-files/etc/inittab
+++ b/target/linux/mxs/base-files/etc/inittab
@@ -1,3 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-ttyAMA0::askfirst:/bin/ash --login
+ttyAMA0::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/omap/base-files/etc/inittab b/target/linux/omap/base-files/etc/inittab
index 502c6f8..33897e1 100644
--- a/target/linux/omap/base-files/etc/inittab
+++ b/target/linux/omap/base-files/etc/inittab
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-ttyO0::askfirst:/bin/ash --login
-ttyO2::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+ttyO0::askfirst:/usr/libexec/login.sh
+ttyO2::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/omap24xx/base-files/etc/inittab b/target/linux/omap24xx/base-files/etc/inittab
index 1360dc9..1921158 100644
--- a/target/linux/omap24xx/base-files/etc/inittab
+++ b/target/linux/omap24xx/base-files/etc/inittab
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/bin/ash --login
-ttyO2::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+tts/0::askfirst:/usr/libexec/login.sh
+ttyO2::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/ppc44x/base-files/etc/inittab b/target/linux/ppc44x/base-files/etc/inittab
index 67c36a6..c929c3d 100644
--- a/target/linux/ppc44x/base-files/etc/inittab
+++ b/target/linux/ppc44x/base-files/etc/inittab
@@ -1,4 +1,4 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-ttyS0::askfirst:/bin/ash --login
-ttyS1::askfirst:/bin/ash --login
+ttyS0::askfirst:/usr/libexec/login.sh
+ttyS1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/ramips/base-files/etc/inittab b/target/linux/ramips/base-files/etc/inittab
index 7817185..9820e71 100644
--- a/target/linux/ramips/base-files/etc/inittab
+++ b/target/linux/ramips/base-files/etc/inittab
@@ -1,3 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-::askconsole:/bin/ash --login
+::askconsole:/usr/libexec/login.sh
diff --git a/target/linux/realview/base-files/etc/inittab b/target/linux/realview/base-files/etc/inittab
index d9d571e..be235d8 100644
--- a/target/linux/realview/base-files/etc/inittab
+++ b/target/linux/realview/base-files/etc/inittab
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/bin/ash --login
-ttyAMA0::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+tts/0::askfirst:/usr/libexec/login.sh
+ttyAMA0::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/sunxi/base-files/etc/inittab b/target/linux/sunxi/base-files/etc/inittab
index e9de30b..be81ab3 100644
--- a/target/linux/sunxi/base-files/etc/inittab
+++ b/target/linux/sunxi/base-files/etc/inittab
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-tts/0::askfirst:/bin/ash --login
-ttyS0::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+tts/0::askfirst:/usr/libexec/login.sh
+ttyS0::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/x86/base-files/etc/inittab b/target/linux/x86/base-files/etc/inittab
index ca90fd8..d1b5a0f 100644
--- a/target/linux/x86/base-files/etc/inittab
+++ b/target/linux/x86/base-files/etc/inittab
@@ -1,4 +1,4 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-ttyS0::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+ttyS0::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/x86/xen_domu/base-files/etc/inittab b/target/linux/x86/xen_domu/base-files/etc/inittab
index 469b8a9..72e19c5 100644
--- a/target/linux/x86/xen_domu/base-files/etc/inittab
+++ b/target/linux/x86/xen_domu/base-files/etc/inittab
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
-tts/0::askfirst:/bin/ash --login
-hvc0::askfirst:/bin/ash --login
-tty1::askfirst:/bin/ash --login
+tts/0::askfirst:/usr/libexec/login.sh
+hvc0::askfirst:/usr/libexec/login.sh
+tty1::askfirst:/usr/libexec/login.sh
diff --git a/target/linux/zynq/base-files/etc/inittab b/target/linux/zynq/base-files/etc/inittab
index ecccc82..9820e71 100644
--- a/target/linux/zynq/base-files/etc/inittab
+++ b/target/linux/zynq/base-files/etc/inittab
@@ -1,3 +1,3 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
-::askconsole:/bin/ash --login \ No newline at end of file
+::askconsole:/usr/libexec/login.sh