Skip to content

Conversation

@ahesford
Copy link
Member

Rather than define import_args in zfsbootmenu-parse-commandline.sh
based on the value of force_import and read_write on the ZBM kernel
command line, the parser just defines force_import and read_write
variables based on these arguments. The import_pool function uses
these variables directly to determine the right command-line arguments
to pass to zpool import.

This is a bit cleaner and allows for a construct like

read_write=yes import_pool zpool

to force rw imports rathern than rewriting import_args. Note that
passing read_write=yes in that call does not override the value in the
environment, so other calls to import_pool will fall back to expected
behavior.

Rather than define `import_args` in zfsbootmenu-parse-commandline.sh
based on the value of `force_import` and `read_write` on the ZBM kernel
command line, the parser just defines `force_import` and `read_write`
variables based on these arguments. The `import_pool` function uses
these variables directly to determine the right command-line arguments
to pass to `zpool import`.

This is a bit cleaner and allows for a construct like

    read_write=yes import_pool zpool

to force rw imports rathern than rewriting `import_args`. Note that
passing `read_write=yes` in that call does not override the value in the
environment, so other calls to `import_pool` will fall back to expected
behavior.
@ahesford ahesford requested a review from zdykstra August 23, 2020 00:24
Copy link
Member

@zdykstra zdykstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a cleaner solution than randomly replacing variable values in a shared string, full merge ahead!

@ahesford ahesford closed this in 999e6c2 Aug 23, 2020
@ahesford ahesford deleted the import branch August 23, 2020 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants