Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libbe/libbe.3
Show All 22 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd August 31, 2018 | .Dd November 17, 2018 | ||||
.Dt LIBBE 3 | .Dt LIBBE 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm libbe | .Nm libbe | ||||
.Nd library for creating, destroying and modifying ZFS boot environments | .Nd library for creating, destroying and modifying ZFS boot environments | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libbe | .Lb libbe | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In be.h | .In be.h | ||||
.Ft "libbe_handle_t *hdl" Ns | .Ft "libbe_handle_t *hdl" Ns | ||||
.Fn libbe_init void | .Fn libbe_init "const char *be_root" | ||||
.Pp | .Pp | ||||
.Ft void | .Ft void | ||||
.Fn libbe_close "libbe_handle_t *hdl" | .Fn libbe_close "libbe_handle_t *hdl" | ||||
.Pp | .Pp | ||||
.Ft const char * Ns | .Ft const char * Ns | ||||
.Fn be_active_name "libbe_handle_t *hdl" | .Fn be_active_name "libbe_handle_t *hdl" | ||||
.Pp | .Pp | ||||
.Ft const char * Ns | .Ft const char * Ns | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
.Vt int | .Vt int | ||||
return 0 on success, or a | return 0 on success, or a | ||||
.Nm | .Nm | ||||
errno otherwise as described in | errno otherwise as described in | ||||
.Sx DIAGNOSTICS . | .Sx DIAGNOSTICS . | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn libbe_init | .Fn libbe_init | ||||
function initializes | function takes an optional BE root and initializes | ||||
.Nm , | .Nm , | ||||
returning a | returning a | ||||
.Vt "libbe_handle_t *" | .Vt "libbe_handle_t *" | ||||
on success, or | on success, or | ||||
.Dv NULL | .Dv NULL | ||||
on error. | on error. | ||||
If a BE root is supplied, | |||||
.Nm | |||||
will only operate out of that pool and BE root. | |||||
An error may occur if: | An error may occur if: | ||||
.Bl -column | .Bl -column | ||||
.It /boot and / are not on the same filesystem and device, | .It /boot and / are not on the same filesystem and device, | ||||
.It libzfs fails to initialize, | .It libzfs fails to initialize, | ||||
.It The system has not been properly booted with a ZFS boot | .It The system has not been properly booted with a ZFS boot | ||||
environment, | environment, | ||||
.It Nm | .It Nm | ||||
fails to open the zpool the active boot environment resides on, or | fails to open the zpool the active boot environment resides on, or | ||||
.It Nm | .It Nm | ||||
fails to locate the boot environment that is currently mounted. | fails to locate the boot environment that is currently mounted. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn libbe_close | .Fn libbe_close | ||||
function frees all resources previously acquired in | function frees all resources previously acquired in | ||||
.Fn libbe_init , | .Fn libbe_init , | ||||
invalidating the handle in the process. | invalidating the handle in the process. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn be_active_name | .Fn be_active_name | ||||
function returns the name of the currently booted boot environment, | function returns the name of the currently booted boot environment. | ||||
This boot environment may not belong to the same BE root as the root libbe | |||||
is operating on! | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn be_active_path | .Fn be_active_path | ||||
function returns the full path of the currently booted boot environment. | function returns the full path of the currently booted boot environment. | ||||
This boot environment may not belong to the same BE root as the root libbe | |||||
is operating on! | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn be_nextboot_name | .Fn be_nextboot_name | ||||
function returns the name of the boot environment that will be active on reboot. | function returns the name of the boot environment that will be active on reboot. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn be_nextboot_path | .Fn be_nextboot_path | ||||
function returns the full path of the boot environment that will be | function returns the full path of the boot environment that will be | ||||
▲ Show 20 Lines • Show All 270 Lines • Show Last 20 Lines |