Skip to content

Commit 04d05f8

Browse files
authored
Merge pull request #2727 from OSInside/allow_dialog_timeout
Add rd.kiwi.dialog.timeout option
2 parents 08b3605 + c90c1c1 commit 04d05f8

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

doc/source/concept_and_workflow/customize_the_boot_process.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ the available kernel boot parameters for these modules:
194194
Activates the debug log file for the {kiwi} part of
195195
the boot process in :file:`/run/initramfs/log/boot.kiwi`.
196196

197+
``rd.kiwi.dialog.timeout=seconds|off``
198+
Sets a timeout value for dialogs invoked by kiwi dracut
199+
modules. By default the timeout is set to 60 seconds.
200+
If set to the special value `off`, the dialog will never
201+
timeout.
202+
197203
``rd.kiwi.install.pxe``
198204
Instructs an OEM installation image to lookup the system
199205
image on a remote location specified in `rd.kiwi.install.image`.

dracut/modules.d/99kiwi-lib/kiwi-dialog-lib.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,25 @@ function _fbiterm_ok {
126126
return 0
127127
}
128128

129+
function dialog_timeout {
130+
local timeout=60
131+
custom_timeout=$(getarg "rd.kiwi.dialog.timeout=")
132+
[ -n "${custom_timeout}" ] && timeout="${custom_timeout}"
133+
echo "${timeout}"
134+
}
135+
129136
function show_log_and_quit {
130137
local text_message="$1"
131138
local log_file="$2"
132-
run_dialog --timeout 60 --backtitle "\"${text_message}\"" \
133-
--textbox "${log_file}" 15 80
139+
local timeout
140+
timeout=$(dialog_timeout)
141+
if [ "${timeout}" = "off" ];then
142+
run_dialog --backtitle "\"${text_message}\"" \
143+
--textbox "${log_file}" 15 80
144+
else
145+
run_dialog --timeout "${timeout}" --backtitle "\"${text_message}\"" \
146+
--textbox "${log_file}" 15 80
147+
fi
134148
if getargbool 0 rd.debug; then
135149
die "${text_message}"
136150
else
@@ -140,7 +154,13 @@ function show_log_and_quit {
140154

141155
function report_and_quit {
142156
local text_message="$1"
143-
run_dialog --timeout 60 --msgbox "\"${text_message}\"" 5 80
157+
local timeout
158+
timeout=$(dialog_timeout)
159+
if [ "${timeout}" = "off" ];then
160+
run_dialog --msgbox "\"${text_message}\"" 5 80
161+
else
162+
run_dialog --timeout "${timeout}" --msgbox "\"${text_message}\"" 5 80
163+
fi
144164
if getargbool 0 rd.debug; then
145165
die "${text_message}"
146166
else

0 commit comments

Comments
 (0)