freebsd-dev/lib/libbe
Kyle Evans 4ab5187d38 libbe(3): Handle non-ZFS rootfs better
If rootfs isn't ZFS, current version will emit an error claiming so and fail
to initialize libbe. As a consumer, bectl -r (undocumented) can be specified
to operate on a BE independently of whether on a UFS or ZFS root.

Unbreak this for the UFS case by only erroring out the init if we can't
determine a ZFS dataset for rootfs and no BE root was specified. Consumers
of libbe should take care to ensure that rootfs is non-empty if they're
trying to use it, because this could certainly be the case.

Some check is needed before zfs_path_to_zhandle because it will
unconditionally emit to stderr if the path isn't a ZFS filesystem, which is
unhelpful for our purposes.

This should also unbreak the bectl(8) tests on a UFS root, as is the case in
Jenkins' -test runs.

MFC after:	3 days
2018-11-19 16:47:21 +00:00
..
be_access.c libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2) 2018-11-17 19:19:37 +00:00
be_error.c libbe(3): Fix error handling with respect to be_exists 2018-09-01 02:22:26 +00:00
be_impl.h libbe(3): Properly account for altroot when creating new BEs 2018-11-19 02:16:20 +00:00
be_info.c bectl(3)/libbe(3): Allow BE root to be specified 2018-11-19 02:12:08 +00:00
be.c libbe(3): Handle non-ZFS rootfs better 2018-11-19 16:47:21 +00:00
be.h bectl(3)/libbe(3): Allow BE root to be specified 2018-11-19 02:12:08 +00:00
libbe.3 bectl(3)/libbe(3): Allow BE root to be specified 2018-11-19 02:12:08 +00:00
Makefile libbe(3)/bectl(8): Make consistent with beadm 2018-08-24 20:44:58 +00:00