2 .\" Copyright (c) 2017 Kyle Kneitinger
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" This manual page is based on the mp(3X) manual page from Sun Release
27 .\" 4.1, dated 7 September 1989. It's an old, crufty, and relatively ugly
28 .\" manual page, but it does document what appears to be the "traditional"
38 .Nd library for creating, destroying and modifying ZFS boot environments.
42 Function prototypes are given in the main body of the text.
44 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
58 .Fn libbe_init "void" ;
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_root_path "libbe_handle_t *" ;
73 .Fn libbe_handle_t "libbe_handle_t " ;
76 .Fn be_create "libbe_handle_t *, char *" ;
79 .Fn be_create_from_existing "libbe_handle_t *, const char *, const char *" ;
82 .Fn be_rename "libbe_handle_t *, char *, char *" ;
84 .\" TODO: Write up of destroy options
86 .\" BE_DESTROY_FORCE = 1 << 0,
87 .\" } be_destroy_opt_t;
89 .Fn be_destroy "libbe_handle_t *, char *, int" ;
92 .Fn be_nicenum "uint64_t, char *, size_t" ;
94 .\" TODO: Write up of mount options
96 .\" BE_MNT_FORCE = 1 << 0,
97 .\" BE_MNT_DEEP = 1 << 1,
100 .Fn be_mount "libbe_handle_t *, char *, char *, int" ;
103 .Fn be_mounted_at "libbe_handle_t *, const char *, nvlist_t" ;
106 .Fn be_unmount "libbe_handle_t *, char *, int" ;
109 .Fn libbe_errno "libbe_handle_t *" ;
111 .Ft "const char *" Ns
112 .Fn libbe_error_description "libbe_handle_t *" ;
115 .Fn libbe_print_on_error "libbe_handle_t *, bool" ;
118 .Fn be_root_concat "libbe_handle_t *, const char *, char *" ;
121 .Fn be_validate_name "libbe_handle_t *, const char *" ;
124 .Fn be_validate_snap "libbe_handle_t *, const char *" ;
127 .Fn be_exists "libbe_handle_t *, char *" ;
130 .Fn be_export "libbe_handle_t *, char *, int fd" ;
133 .Fn be_import "libbe_handle_t *, char *, int fd" ;
136 .Fn be_add_child "libbe_handle_t *, char *, bool" ;
139 .Fn be_prop_list_alloc "nvlist_t **" ;
142 .Fn be_get_bootenv_props "libbe_handle_t *, nvlist_t *" ;
145 .Fn be_get_dataset_props "libbe_handle_t *, const char *, nvlist_t *" ;
148 .Fn be_get_dataset_snapshots "libbe_handle_t *, const char *, nvlist_t *" ;
151 .Fn be_prop_list_free "nvlist_t *" ;
153 .\" .Fn mp_mfree "MINT *mp" ;
154 .\" .Bd -ragged -offset indent
158 .\" with the value of
163 .\" with the value of
165 .\" which is treated to be in hexadecimal.
166 .\" The return values from
170 .\" must be released with
172 .\" when they are no longer needed.
174 .\" returns a null-terminated hexadecimal string having the value of
176 .\" its return value must be released with
179 .\" when it is no longer needed.
183 Upon error, one of the following values will be returned.
184 .\" TODO: make each entry on its own line.
185 .Bd -ragged -offset indent
206 and it's corresponding command,
208 were written as a 2017 Google Summer of Code project with Allan Jude serving
210 .\" TODO: update when implementation complete.