Skip to content

Commit 07d6e73

Browse files
committed
zfsbootmenu-preinit: single-quote values written to /etc/zfsbootmenu.conf
These values are interpolated during preinit when they are written, so the file will only contain string literals that should not be further interpreted. This also works around an issue where appending '\' to parameters (e.g., 'zbm.prefer=pool\' on the command line) would cause a parsing error while sourcing the configuration.
1 parent 23bdb71 commit 07d6e73

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

zfsbootmenu/pre-init/zfsbootmenu-preinit.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ export BASE="/zfsbootmenu"
2121
# shellcheck disable=SC2154
2222
cat >> "/etc/zfsbootmenu.conf" <<EOF
2323
# BEGIN additions by zfsbootmenu-preinit.sh
24-
export BASE="${BASE}"
25-
export spl_hostid="${spl_hostid}"
26-
export import_policy="${import_policy}"
27-
export menu_timeout="${menu_timeout}"
28-
export loglevel="${loglevel}"
29-
export zbm_prefer_pool="${zbm_prefer_pool}"
30-
export zbm_require_pool="${zbm_require_pool}"
24+
export BASE='${BASE}'
25+
export spl_hostid='${spl_hostid}'
26+
export import_policy='${import_policy}'
27+
export menu_timeout='${menu_timeout}'
28+
export loglevel='${loglevel}'
29+
export zbm_prefer_pool='${zbm_prefer_pool}'
30+
export zbm_require_pool='${zbm_require_pool}'
3131
export default_hostid=00bab10c
32-
export zbm_sort="${zbm_sort}"
33-
export zbm_set_hostid="${zbm_set_hostid}"
34-
export zbm_import_delay="${zbm_import_delay}"
35-
export zbm_hook_root="${zbm_hook_root}"
36-
export control_term="${control_term}"
32+
export zbm_sort='${zbm_sort}'
33+
export zbm_set_hostid='${zbm_set_hostid}'
34+
export zbm_import_delay='${zbm_import_delay}'
35+
export zbm_hook_root='${zbm_hook_root}'
36+
export control_term='${control_term}'
3737
# END additions by zfsbootmenu-preinit.sh
3838
EOF
3939

0 commit comments

Comments
 (0)