From dc929174095a00150de6a3e48d46355d24f223b9 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 18 Apr 2016 21:53:07 +0200 Subject: [PATCH] image / basefiles: make console password configurable Signed-off-by: Daniel Dickinson Signed-off-by: John Crispin --- package/base-files/files/etc/config/system | 1 + package/base-files/files/etc/inittab | 2 +- package/base-files/files/usr/libexec/login.sh | 5 +++++ package/utils/busybox/Config-defaults.in | 4 ++-- target/linux/adm5120/base-files/etc/inittab | 6 +++--- target/linux/ar71xx/base-files/etc/inittab | 2 +- target/linux/arm64/base-files/etc/inittab | 6 +++--- target/linux/brcm2708/base-files/etc/inittab | 4 ++-- target/linux/ipq806x/base-files/etc/inittab | 2 +- target/linux/lantiq/base-files/etc/inittab | 2 +- target/linux/malta/base-files/etc/inittab | 10 +++++----- target/linux/mediatek/base-files/etc/inittab | 2 +- target/linux/mxs/base-files/etc/inittab | 2 +- target/linux/omap/base-files/etc/inittab | 6 +++--- target/linux/omap24xx/base-files/etc/inittab | 6 +++--- target/linux/ppc44x/base-files/etc/inittab | 4 ++-- target/linux/ramips/base-files/etc/inittab | 2 +- target/linux/realview/base-files/etc/inittab | 6 +++--- target/linux/sunxi/base-files/etc/inittab | 6 +++--- target/linux/x86/base-files/etc/inittab | 4 ++-- target/linux/x86/xen_domu/base-files/etc/inittab | 6 +++--- target/linux/zynq/base-files/etc/inittab | 2 +- 22 files changed, 48 insertions(+), 42 deletions(-) create mode 100755 package/base-files/files/usr/libexec/login.sh diff --git a/package/base-files/files/etc/config/system b/package/base-files/files/etc/config/system index 20517f9a530..80c3f9b0a8f 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 7817185937f..9820e7144be 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 00000000000..02ac9c828bc --- /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 ee42fa12f02..52406169725 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 9f7c0aee35c..d81d5d943be 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 7817185937f..9820e7144be 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 d9d571e8d9c..be235d87926 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 a6c0bc85a62..b944a93ada4 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 19a6e119501..809bba5e5ff 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 46a1312c67c..21fa8d58ef6 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 88567b245f2..26977238049 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 870b3cc76d1..b169c82745c 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 09359b79d81..9991ac49093 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 502c6f87afa..33897e10207 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 1360dc9e28c..192115826a2 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 67c36a6a9ec..c929c3deac7 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 7817185937f..9820e7144be 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 d9d571e8d9c..be235d87926 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 e9de30bcc49..be81ab3e238 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 ca90fd8a2ab..d1b5a0fa22d 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 469b8a9a9f6..72e19c5b3d8 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 ecccc8218b0..9820e7144be 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 -- 2.30.2