demizer/archzfs — pull request #7 by jasonrm (2013-04-11 03:47:30+00:00)
Title: Find dataset when multiple pools exist on boot

On my system `rpool` is the internal pool that I boot from. I have an external set of drives that make up the `external` pool. The current zfs hook would only check the first line of the zfs list output and then fail to boot.

With this change, if the `zfs` kernel parameter is set to `bootfs` and multiple pools are available, it will check each pool for the bootfs property and set the first it finds.

As far as I am aware, there are only three possible strings that might be returned by `zpool list -H -o bootfs`, an empty string, `-`, and a dataset name. If this is not the case this change has the potential to break existing systems.