Skip to content

Commit

Permalink
zfsbootmenu-preinit: single-quote values written to /etc/zfsbootmenu.…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
ahesford committed Dec 2, 2023
1 parent 23bdb71 commit 07d6e73
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions zfsbootmenu/pre-init/zfsbootmenu-preinit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ export BASE="/zfsbootmenu"
# shellcheck disable=SC2154
cat >> "/etc/zfsbootmenu.conf" <<EOF
# BEGIN additions by zfsbootmenu-preinit.sh
export BASE="${BASE}"
export spl_hostid="${spl_hostid}"
export import_policy="${import_policy}"
export menu_timeout="${menu_timeout}"
export loglevel="${loglevel}"
export zbm_prefer_pool="${zbm_prefer_pool}"
export zbm_require_pool="${zbm_require_pool}"
export BASE='${BASE}'
export spl_hostid='${spl_hostid}'
export import_policy='${import_policy}'
export menu_timeout='${menu_timeout}'
export loglevel='${loglevel}'
export zbm_prefer_pool='${zbm_prefer_pool}'
export zbm_require_pool='${zbm_require_pool}'
export default_hostid=00bab10c
export zbm_sort="${zbm_sort}"
export zbm_set_hostid="${zbm_set_hostid}"
export zbm_import_delay="${zbm_import_delay}"
export zbm_hook_root="${zbm_hook_root}"
export control_term="${control_term}"
export zbm_sort='${zbm_sort}'
export zbm_set_hostid='${zbm_set_hostid}'
export zbm_import_delay='${zbm_import_delay}'
export zbm_hook_root='${zbm_hook_root}'
export control_term='${control_term}'
# END additions by zfsbootmenu-preinit.sh
EOF

Expand Down

0 comments on commit 07d6e73

Please sign in to comment.