image / basefiles: make console password configurable
authorLuka Perkov <luka@openwrt.org>
Tue, 10 May 2016 22:36:25 +0000 (22:36 +0000)
committerLuka Perkov <luka@openwrt.org>
Tue, 10 May 2016 22:36:25 +0000 (22:36 +0000)
Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
Signed-off-by: John Crispin <john@phrozen.org>
SVN-Revision: 49325

22 files changed:
package/base-files/files/etc/config/system
package/base-files/files/etc/inittab
package/base-files/files/usr/libexec/login.sh [new file with mode: 0644]
package/utils/busybox/Config-defaults.in
target/linux/adm5120/base-files/etc/inittab
target/linux/ar71xx/base-files/etc/inittab
target/linux/arm64/base-files/etc/inittab
target/linux/brcm2708/base-files/etc/inittab
target/linux/ipq806x/base-files/etc/inittab
target/linux/lantiq/base-files/etc/inittab
target/linux/malta/base-files/etc/inittab
target/linux/mediatek/base-files/etc/inittab
target/linux/mxs/base-files/etc/inittab
target/linux/omap/base-files/etc/inittab
target/linux/omap24xx/base-files/etc/inittab
target/linux/ppc44x/base-files/etc/inittab
target/linux/ramips/base-files/etc/inittab
target/linux/realview/base-files/etc/inittab
target/linux/sunxi/base-files/etc/inittab
target/linux/x86/base-files/etc/inittab
target/linux/x86/xen_domu/base-files/etc/inittab
target/linux/zynq/base-files/etc/inittab

index 3dfbfc4fc8a5a8fd6cd5eb814f84430ddc390250..ea0b821f935ae3cb03549b5bc3dc7db98eb2ec2a 100644 (file)
@@ -1,6 +1,7 @@
 config system
        option hostname OpenWrt
        option timezone UTC
+       option ttylogin 0
 
 config timeserver ntp
        list server     0.openwrt.pool.ntp.org
index 7817185937f9ddb30fca2a417717be1a46e8ac11..9820e7144bed618f1375661f4e413f1b4979b584 100644 (file)
@@ -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 100644 (file)
index 0000000..02ac9c8
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ "$(uci get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login
+
+exec /bin/login
index ee42fa12f02c1c01e157b2ff923e9490ea3d8cd3..52406169725348aafc9aa6e7ebf65bd4138b7369 100644 (file)
@@ -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
index 9f7c0aee35c8a5d0acefc6d4ce51b397c3ee3687..d81d5d943be92283403ae067c4836581bfb904da 100644 (file)
@@ -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
index 7817185937f9ddb30fca2a417717be1a46e8ac11..9820e7144bed618f1375661f4e413f1b4979b584 100644 (file)
@@ -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
index d9d571e8d9c49a438d9882b1b9b7132be2cb4c87..be235d8792635a653a0d3cca4a86c9bd8eea868e 100644 (file)
@@ -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
index a6c0bc85a62b85c3725c6f117acfc78e5e820668..b944a93ada4b5ac92bb9ce3ba6981639abca741c 100644 (file)
@@ -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
index 19a6e1195011277d10810374e78132c4dcadc569..809bba5e5ff49869429c91cf791cea73ab67d14e 100644 (file)
@@ -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
index 46a1312c67ce4ec17a0c1400d979777e94742f2f..21fa8d58ef623243fd460cc8364b746302208772 100644 (file)
@@ -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
index 88567b245f2b9c5034a602fb183a10c236ad533d..269772380499fd6496a3cd8048e2e9e347582b2c 100644 (file)
@@ -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
index 870b3cc76d1259ed730a720a1ef87acb290532a9..b169c82745ce014fe124274dfd4ba0e32dde6b52 100644 (file)
@@ -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
index 09359b79d816f3812bd7c87b13e7e77122f50bd2..9991ac490937aa706472125bf2fe62fb3a91880b 100644 (file)
@@ -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
index 502c6f87afaf5f6366b930765b8c7f93438b7ff2..33897e10207744037d0766dd08e4719c8109b29b 100644 (file)
@@ -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
index 1360dc9e28c7f992f8edd6afeb513d601bb8ffd6..192115826a2d96d346d084cfab4f93025b4444dc 100644 (file)
@@ -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
index 67c36a6a9ec6236dbb8bedcc9b8afe79cd88b7de..c929c3deac70661d6e1f585d572c2ae409c6016d 100644 (file)
@@ -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
index 7817185937f9ddb30fca2a417717be1a46e8ac11..9820e7144bed618f1375661f4e413f1b4979b584 100644 (file)
@@ -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
index d9d571e8d9c49a438d9882b1b9b7132be2cb4c87..be235d8792635a653a0d3cca4a86c9bd8eea868e 100644 (file)
@@ -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
index e9de30bcc49c487a33981257f357a2c6f8fd72d1..be81ab3e23879f817b4bf09f5fe50e21c9b8ff54 100644 (file)
@@ -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
index ca90fd8a2abd4f27e6ef78e0d5629e241b6d5d50..d1b5a0fa22d46f57920b6efa9a3731f20f3cd3c7 100644 (file)
@@ -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
index 469b8a9a9f61d425b3ff7d7014f3dd4777e9a3f0..72e19c5b3d89198b502960d89d278949c96ac724 100644 (file)
@@ -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
index ecccc8218b05d36651227cffad988eabb4446333..9820e7144bed618f1375661f4e413f1b4979b584 100644 (file)
@@ -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