From ec5f3d3dbbc054cf704a658d2734b67df466926b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 25 Feb 2019 12:37:39 +0100 Subject: console: forbid ctrlc during startup When global.autoboot_abort_key is set to ctrl-c then the user is expected to press ctrl-c to get to the prompt. The user might press ctrl-c before the init script runs the "timeout" command. In this case the init script is aborted at arbitrary places which leads to inconsistent results depending on the place it is aborted. This patch introduces the global.console.ctrlc_allowed variable. When this variable is set to false ctrl-c is ignored entirely. The variable is set to false by default and changed to true in the init script. Signed-off-by: Sascha Hauer --- defaultenv/defaultenv-2-base/bin/init | 2 ++ 1 file changed, 2 insertions(+) (limited to 'defaultenv') diff --git a/defaultenv/defaultenv-2-base/bin/init b/defaultenv/defaultenv-2-base/bin/init index 8d02e3d3ab..a5d3a984f7 100644 --- a/defaultenv/defaultenv-2-base/bin/init +++ b/defaultenv/defaultenv-2-base/bin/init @@ -60,6 +60,8 @@ if [ "$autoboot" = 0 ]; then autoboot="$?" fi +global.console.ctrlc_allowed=true + if [ "${key}" = "q" ]; then exit fi -- cgit v1.2.3