Skip to content

Commit 117ca05

Browse files
committed
DO NOT MERGE: proper implementation of "askfirst" shell
Now it matches full implementation submitted upstream: http://patchwork.ozlabs.org/patch/420980/ Signed-off-by: Alexey Brodkin <[email protected]>
1 parent 3240634 commit 117ca05

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

system/Config.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ config BR2_TARGET_GENERIC_GETTY_OPTIONS
311311
endmenu
312312
endif
313313

314+
config BR2_TARGET_ASKFIRST_SHELL
315+
bool "Start an \"askfirst\" shell on the console (whatever that may be)"
316+
depends on BR2_INIT_BUSYBOX
317+
depends on !BR2_TARGET_GENERIC_GETTY
318+
314319
config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW
315320
bool "remount root filesystem read-write during boot"
316321
default y

system/skeleton/etc/inittab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ null::sysinit:/bin/hostname -F /etc/hostname
2424
::sysinit:/etc/init.d/rcS
2525

2626
# Start an "askfirst" shell on the console (whatever that may be)
27-
::askfirst:-/bin/sh
27+
#::askfirst:-/bin/sh # ASKFIRST_SHELL
2828

2929
# Put a getty on the serial port
3030
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL

system/system.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ endif
7676
TARGET_FINALIZE_HOOKS += SYSTEM_GETTY
7777
endif
7878

79+
ifeq ($(BR2_TARGET_ASKFIRST_SHELL),y)
80+
# Add askfirst shell to busybox inittab
81+
define SYSTEM_ASKFIRST
82+
$(SED) '/# ASKFIRST_SHELL$$/s~^.*#~::askfirst:-/bin/sh #~' \
83+
$(TARGET_DIR)/etc/inittab
84+
endef
85+
TARGET_FINALIZE_HOOKS += SYSTEM_ASKFIRST
86+
endif
87+
7988
ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
8089
# Find commented line, if any, and remove leading '#'s
8190
define SYSTEM_REMOUNT_RW

0 commit comments

Comments
 (0)