2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright (c) 2017 Kyle Kneitinger
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Nd library for creating, destroying and modifying ZFS boot environments
41 Function prototypes are given in the
45 Applications using this interface must be linked with
49 interfaces with libzfs to provide a set of functions for various operations
50 regarding ZFS boot environments including "deep" boot environments in which
51 a boot environments has child datasets.
53 A context structure is passed to each function, allowing for a small amount
54 of state to be retained, such as errors from previous operations.
55 .\" TODO: describe break on err functionality
57 .Ft "libbe_handle_t *" Ns
61 .Fn libbe_close "libbe_handle_t *" ;
64 .Fn be_active_name "libbe_handle_t *" ;
67 .Fn be_active_path "libbe_handle_t *" ;
70 .Fn be_nextboot_name "libbe_handle_t *" ;
73 .Fn be_nextboot_path "libbe_handle_t *" ;
76 .Fn be_root_path "libbe_handle_t *" ;
79 .Fn be_create "libbe_handle_t *" "const char *" ;
82 .Fn be_create_from_existing "libbe_handle_t *" "const char *" "const char *" ;
85 .Fn be_create_from_existing_snap "libbe_handle_t *" "const char *" "const char *" ;
88 .Fn be_rename "libbe_handle_t *" "const char *" "const char *" ;
91 .Fn be_activate "libbe_handle_t *" "const char *" "bool" ;
92 .\" TODO: Write up of destroy options
94 .\" BE_DESTROY_FORCE = 1 << 0,
95 .\" } be_destroy_opt_t;
97 .Fn be_destroy "libbe_handle_t *" "const char *" "int" ;
100 .Fn be_nicenum uint64_t" "char *" "size_t" ;
102 .\" TODO: Write up of mount options
104 .\" BE_MNT_FORCE = 1 << 0,
105 .\" BE_MNT_DEEP = 1 << 1,
106 .\" } be_mount_opt_t;
108 .Fn be_mount "libbe_handle_t *" "char *" "char *" "int" ;
111 .Fn be_mounted_at "libbe_handle_t *" "const char *" "nvlist_t" ;
114 .Fn be_unmount "libbe_handle_t *" "char *" "int" ;
117 .Fn libbe_errno "libbe_handle_t *" ;
120 .Fn libbe_error_description "libbe_handle_t *" ;
123 .Fn libbe_print_on_error "libbe_handle_t *" "bool" ;
126 .Fn be_root_concat "libbe_handle_t *" "const char *" "char *" ;
129 .Fn be_validate_name "libbe_handle_t *" "const char *" ;
132 .Fn be_validate_snap "libbe_handle_t *" "const char *" ;
135 .Fn be_exists "libbe_handle_t *" "char *" ;
138 .Fn be_export "libbe_handle_t *" "const char *" "int fd" ;
141 .Fn be_import "libbe_handle_t *" "const char *" "int fd" ;
144 .Fn be_prop_list_alloc "nvlist_t **" ;
147 .Fn be_get_bootenv_props "libbe_handle_t *" "nvlist_t *" ;
150 .Fn be_get_dataset_props "libbe_handle_t *" "const char *" "nvlist_t *" ;
153 .Fn be_get_dataset_snapshots "libbe_handle_t *" "const char *" "nvlist_t *" ;
156 .Fn be_prop_list_free "nvlist_t *" ;
158 Upon error, one of the following values will be returned.
159 .\" TODO: make each entry on its own line.
160 .Bd -ragged -offset indent
186 and its corresponding command,
188 were written as a 2017 Google Summer of Code project with Allan Jude serving
190 .\" TODO: update when implementation complete.