Skip to content

Commit 98f7dac

Browse files
committed
zfsbootmenu: generalize zbm.import_delay as zbm.retry_delay
1 parent 075cba0 commit 98f7dac

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

docs/man/zfsbootmenu.7.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ These options are set on the kernel command line when booting the initramfs or U
3535
If a literal *!!* has been appended to the pool name, ZFSBootMenu will insist on successfully importing the named pool and no others.
3636

3737

38-
**zbm.import_delay=<time>**
38+
**zbm.retry_delay=<time>**
3939

40-
Should ZFSBootMenu fail to successfully import any pool, it will repeat import attempts indefinitely until at least one pool can be imported or the user chooses to drop to a recovery shell. Each subsequent attempt will proceed after a delay of **<time>** seconds. When **<time>** is unspecified or is anything other than a positive integer, a default value of 5 seconds will be used.
40+
This option determines the interval between repeated attempts of required steps. When **<time>** is unspecified or is anything other than a positive integer, a default value of 5 seconds will be used. Should ZFSBootMenu fail to successfully import any pool, it will repeat import attempts indefinitely until at least one pool can be imported or the user chooses to drop to a recovery shell. Additionally, should any required devices be configured via **zbm.wait_for**, device checks will repeat on this interval.
4141

4242
**zbm.import_policy**
4343

@@ -143,13 +143,13 @@ These options are set on the kernel command line when booting the initramfs or U
143143

144144
Enable automatic font resizing of the kernel console to normalize the apparent resolution for both low resolution and high resolution displays. This option is enabled by default.
145145

146-
**zbm.waitfor=device,device,...**
146+
**zbm.wait_for=device,device,...**
147147

148148
Ensure that one or more devices are present before starting the pool import process. Devices may be specified as full paths to device nodes (*e.g.*, **/dev/sda** or **/dev/disk/by-id/wwn-0x500a07510ee65912**) or, for convenience, as a typed indicator of the form **TYPE=VALUE**, which will be expanded internally as
149149

150150
**/dev/disk/by-TYPE/VALUE**
151151

152-
The use of full device paths other than descendants of **/dev/disk/** is fragile and should be avoided.
152+
The use of full device paths other than descendants of **/dev/disk/** is fragile and should be avoided. The delay interval between device checks can be controlled by **zbm.retry_delay**.
153153

154154
Deprecated Parameters
155155
---------------------
@@ -170,6 +170,9 @@ Deprecated Parameters
170170

171171
Deprecated; use **zbm.import_policy=force**.
172172

173+
**zbm.import_delay**
174+
175+
Deprecated; use **zbm.retry_delay**
173176

174177
.. _zfs-properties:
175178

zfsbootmenu/libexec/zfsbootmenu-init

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ fi
8080

8181
# Wait for devices to show up
8282

83-
if [ -n "${zbm_waitfor_devices}" ]; then
84-
IFS=',' read -r -a user_devices <<<"${zbm_waitfor_devices}"
83+
if [ -n "${zbm_wait_for_devices}" ]; then
84+
IFS=',' read -r -a user_devices <<<"${zbm_wait_for_devices}"
8585
while true; do
8686
FOUND=0
8787
EXPECTED=0
@@ -116,8 +116,8 @@ if [ -n "${zbm_waitfor_devices}" ]; then
116116
if [ ${FOUND} -eq ${EXPECTED} ]; then
117117
break
118118
else
119-
if ! timed_prompt -d 3 -e "to cancel" \
120-
-m "" \
119+
if ! timed_prompt -d "${zbm_retry_delay:-5}" \
120+
-e "to cancel" -m "" \
121121
-m "$( colorize red "One or more required devices are missing" )" \
122122
-p "retrying in $( colorize yellow "%0.2d" ) seconds" ; then
123123
for dev in "${missing[@]}" ; do
@@ -214,7 +214,7 @@ while true; do
214214
zinfo "unable to import a pool on attempt ${zbm_import_attempt}"
215215

216216
# Just keep retrying after a delay until the user presses ESC
217-
if timed_prompt -d "${zbm_import_delay:-5}" \
217+
if timed_prompt -d "${zbm_retry_delay:-5}" \
218218
-p "Unable to import $( colorize magenta "${try_pool:-pool}" ), retrying in $( colorize yellow "%0.2d" ) seconds" \
219219
-r "to retry immediately" \
220220
-e "for a recovery shell"; then

zfsbootmenu/pre-init/zfsbootmenu-parse-commandline.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ else
127127
zinfo "defaulting menu timeout to ${menu_timeout}"
128128
fi
129129

130-
if zbm_import_delay=$( get_zbm_arg zbm.import_delay ) && [ "${zbm_import_delay:-0}" -gt 0 ] 2>/dev/null ; then
131-
# Again, this validates that zbm_import_delay is numeric in addition to logging
132-
zinfo "import retry delay is ${zbm_import_delay} seconds"
130+
if zbm_retry_delay=$( get_zbm_arg zbm.retry_delay zbm.import_delay ) && [ "${zbm_retry_delay:-0}" -gt 0 ] 2>/dev/null ; then
131+
# Again, this validates that zbm_retry_delay is numeric in addition to logging
132+
zinfo "import/waitfor retry delay is ${zbm_retry_delay} seconds"
133133
else
134-
zbm_import_delay=5
134+
zbm_retry_delay=5
135135
fi
136136

137137
# Allow setting of console size; ensure lines/columns are integers > 0
@@ -226,9 +226,9 @@ if zbm_prefer_pool=$( get_zbm_arg zbm.prefer ) ; then
226226
zinfo "preferring ${zbm_prefer_pool} for bootfs"
227227
fi
228228

229-
zbm_waitfor_devices=
230-
if zbm_waitfor_devices=$( get_zbm_arg zbm.waitfor ) ; then
231-
zinfo "system will wait for ${zbm_waitfor_devices}"
229+
zbm_wait_for_devices=
230+
if zbm_wait_for_devices=$( get_zbm_arg zbm.wait_for ) ; then
231+
zinfo "system will wait for ${zbm_wait_for_devices}"
232232
fi
233233

234234
# pool! : this pool must be imported before all others

zfsbootmenu/pre-init/zfsbootmenu-preinit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export zbm_require_pool='${zbm_require_pool}'
3131
export default_hostid=00bab10c
3232
export zbm_sort='${zbm_sort}'
3333
export zbm_set_hostid='${zbm_set_hostid}'
34-
export zbm_import_delay='${zbm_import_delay}'
34+
export zbm_retry_delay='${zbm_retry_delay}'
3535
export zbm_hook_root='${zbm_hook_root}'
36-
export zbm_waitfor_devices='${zbm_waitfor_devices}'
36+
export zbm_wait_for_devices='${zbm_wait_for_devices}'
3737
export control_term='${control_term}'
3838
# END additions by zfsbootmenu-preinit.sh
3939
EOF

0 commit comments

Comments
 (0)