aboutsummaryrefslogtreecommitdiff
path: root/lib/libbe
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libbe')
-rw-r--r--lib/libbe/Makefile4
-rw-r--r--lib/libbe/be.c65
-rw-r--r--lib/libbe/be.h25
-rw-r--r--lib/libbe/be_access.c67
-rw-r--r--lib/libbe/be_error.c25
-rw-r--r--lib/libbe/be_impl.h26
-rw-r--r--lib/libbe/be_info.c32
-rw-r--r--lib/libbe/libbe.360
-rw-r--r--lib/libbe/tests/Makefile1
-rw-r--r--lib/libbe/tests/Makefile.depend17
10 files changed, 150 insertions, 172 deletions
diff --git a/lib/libbe/Makefile b/lib/libbe/Makefile
index 87c032ae3a0c..b04becc38d74 100644
--- a/lib/libbe/Makefile
+++ b/lib/libbe/Makefile
@@ -1,4 +1,3 @@
-
SHLIBDIR?= /lib
.include <src.opts.mk>
@@ -58,10 +57,11 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzfs
+CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
CFLAGS+= -I${SRCTOP}/sys
CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
-CFLAGS+= -DHAVE_ISSETUGID
+CFLAGS+= -DHAVE_ISSETUGID -DHAVE_STRLCAT -DHAVE_STRLCPY
CFLAGS.be.c= -Wno-cast-qual
CFLAGS.be_access.c= -Wno-cast-qual
CFLAGS.be_error.c= -Wno-cast-qual
diff --git a/lib/libbe/be.c b/lib/libbe/be.c
index 38e5e44abb53..613235d5e908 100644
--- a/lib/libbe/be.c
+++ b/lib/libbe/be.c
@@ -1,31 +1,9 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
+/*
* Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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
- * SUCH DAMAGE.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
-#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/module.h>
#include <sys/mount.h>
@@ -176,6 +154,9 @@ libbe_init(const char *root)
strcmp(altroot, "-") != 0)
lbh->altroot_len = strlen(altroot);
+ (void) lzbe_get_boot_device(zpool_get_name(lbh->active_phandle),
+ &lbh->bootonce);
+
return (lbh);
err:
if (lbh != NULL) {
@@ -200,6 +181,8 @@ libbe_close(libbe_handle_t *lbh)
if (lbh->active_phandle != NULL)
zpool_close(lbh->active_phandle);
libzfs_fini(lbh->lzh);
+
+ free(lbh->bootonce);
free(lbh);
}
@@ -444,6 +427,12 @@ be_destroy_internal(libbe_handle_t *lbh, const char *name, int options,
return (set_error(lbh, BE_ERR_DESTROYMNT));
}
}
+
+ /* Handle destroying bootonce */
+ if (lbh->bootonce != NULL &&
+ strcmp(path, lbh->bootonce) == 0)
+ (void) lzbe_set_boot_device(
+ zpool_get_name(lbh->active_phandle), lzbe_add, NULL);
} else {
/*
* If we're initially destroying a snapshot, origin options do
@@ -670,8 +659,20 @@ be_deep_clone_prop(int prop, void *cb)
dccb = cb;
/* Skip some properties we don't want to touch */
- if (prop == ZFS_PROP_CANMOUNT)
+ switch (prop) {
+ /*
+ * libzfs insists on these being naturally inherited in the
+ * cloning process.
+ */
+ case ZFS_PROP_KEYFORMAT:
+ case ZFS_PROP_KEYLOCATION:
+ case ZFS_PROP_ENCRYPTION:
+ case ZFS_PROP_PBKDF2_ITERS:
+
+ /* FALLTHROUGH */
+ case ZFS_PROP_CANMOUNT: /* Forced by libbe */
return (ZPROP_CONT);
+ }
/* Don't copy readonly properties */
if (zfs_prop_readonly(prop))
@@ -1022,11 +1023,17 @@ be_rename(libbe_handle_t *lbh, const char *old, const char *new)
.nounmount = 1,
};
err = zfs_rename(zfs_hdl, full_new, flags);
+ if (err != 0)
+ goto error;
+
+ /* handle renaming bootonce */
+ if (lbh->bootonce != NULL &&
+ strcmp(full_old, lbh->bootonce) == 0)
+ err = be_activate(lbh, new, true);
+error:
zfs_close(zfs_hdl);
- if (err != 0)
- return (set_error(lbh, BE_ERR_UNKNOWN));
- return (0);
+ return (set_error(lbh, err));
}
@@ -1151,7 +1158,7 @@ be_create_child_noent(libbe_handle_t *lbh, const char *active,
static int
be_create_child_cloned(libbe_handle_t *lbh, const char *active)
{
- char buf[BE_MAXPATHLEN], tmp[BE_MAXPATHLEN];;
+ char buf[BE_MAXPATHLEN], tmp[BE_MAXPATHLEN];
zfs_handle_t *zfs;
int err;
diff --git a/lib/libbe/be.h b/lib/libbe/be.h
index 0e4486fbb6d2..01ee94fd03ca 100644
--- a/lib/libbe/be.h
+++ b/lib/libbe/be.h
@@ -1,28 +1,7 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
+/*
* Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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
- * SUCH DAMAGE.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef _LIBBE_H
diff --git a/lib/libbe/be_access.c b/lib/libbe/be_access.c
index 67b30d3fb4fb..a7eb6b703cda 100644
--- a/lib/libbe/be_access.c
+++ b/lib/libbe/be_access.c
@@ -1,30 +1,9 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
+/*
* Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
* Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
* Copyright (c) 2019 Wes Maag <wes@jwmaag.org>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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
- * SUCH DAMAGE.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
#include <sys/cdefs.h>
@@ -33,6 +12,8 @@
#include "be.h"
#include "be_impl.h"
+#define LIBBE_MOUNT_PREFIX "be_mount."
+
struct be_mountcheck_info {
const char *path;
char *name;
@@ -164,7 +145,11 @@ be_umount_iter(zfs_handle_t *zfs_hdl, void *data)
if (!zfs_is_mounted(zfs_hdl, &mountpoint)) {
return (0);
}
- free(mountpoint);
+
+ if (info->depth == 0 && info->mountpoint == NULL)
+ info->mountpoint = mountpoint;
+ else
+ free(mountpoint);
if (zfs_unmount(zfs_hdl, NULL, info->mntflags) != 0) {
switch (errno) {
@@ -255,7 +240,17 @@ be_mount(libbe_handle_t *lbh, const char *bootenv, const char *mountpoint,
/* Create mountpoint if it is not specified */
if (mountpoint == NULL) {
- strlcpy(mnt_temp, "/tmp/be_mount.XXXX", sizeof(mnt_temp));
+ const char *tmpdir;
+
+ tmpdir = getenv("TMPDIR");
+ if (tmpdir == NULL)
+ tmpdir = _PATH_TMP;
+
+ if (snprintf(mnt_temp, sizeof(mnt_temp), "%s%s%sXXXX", tmpdir,
+ tmpdir[strlen(tmpdir) - 1] == '/' ? "" : "/",
+ LIBBE_MOUNT_PREFIX) >= (int)sizeof(mnt_temp))
+ return (set_error(lbh, BE_ERR_PATHLEN));
+
if (mkdtemp(mnt_temp) == NULL)
return (set_error(lbh, BE_ERR_IO));
}
@@ -307,10 +302,32 @@ be_unmount(libbe_handle_t *lbh, const char *bootenv, int flags)
info.depth = 0;
if ((err = be_umount_iter(root_hdl, &info)) != 0) {
+ free(__DECONST(char *, info.mountpoint));
zfs_close(root_hdl);
return (err);
}
+ /*
+ * We'll attempt to remove the directory if we created it on a
+ * best-effort basis. rmdir(2) failure will not be reported.
+ */
+ if (info.mountpoint != NULL) {
+ const char *mdir;
+
+ mdir = strrchr(info.mountpoint, '/');
+ if (mdir == NULL)
+ mdir = info.mountpoint;
+ else
+ mdir++;
+
+ if (strncmp(mdir, LIBBE_MOUNT_PREFIX,
+ sizeof(LIBBE_MOUNT_PREFIX) - 1) == 0) {
+ (void)rmdir(info.mountpoint);
+ }
+ }
+
+ free(__DECONST(char *, info.mountpoint));
+
zfs_close(root_hdl);
return (BE_ERR_SUCCESS);
}
diff --git a/lib/libbe/be_error.c b/lib/libbe/be_error.c
index f515fe136f12..bb1e1ed88c5d 100644
--- a/lib/libbe/be_error.c
+++ b/lib/libbe/be_error.c
@@ -1,28 +1,7 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
+/*
* Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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
- * SUCH DAMAGE.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
#include <sys/cdefs.h>
diff --git a/lib/libbe/be_impl.h b/lib/libbe/be_impl.h
index d5fd26c4f072..11d1e0ddca28 100644
--- a/lib/libbe/be_impl.h
+++ b/lib/libbe/be_impl.h
@@ -1,28 +1,7 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
+/*
* Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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
- * SUCH DAMAGE.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef _LIBBE_IMPL_H
@@ -36,6 +15,7 @@ struct libbe_handle {
char root[BE_MAXPATHLEN];
char rootfs[BE_MAXPATHLEN];
char bootfs[BE_MAXPATHLEN];
+ char *bootonce;
size_t altroot_len;
zpool_handle_t *active_phandle;
libzfs_handle_t *lzh;
diff --git a/lib/libbe/be_info.c b/lib/libbe/be_info.c
index 88a9b17bf421..4b0f611ce421 100644
--- a/lib/libbe/be_info.c
+++ b/lib/libbe/be_info.c
@@ -1,29 +1,8 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
+/*
* Copyright (c) 2017 Kyle J. Kneitinger <kyle@kneit.in>
* Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org>
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * 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
- * SUCH DAMAGE.
+ * SPDX-License-Identifier: BSD-2-Clause
*/
#include <sys/cdefs.h>
@@ -181,8 +160,8 @@ prop_list_builder_cb(zfs_handle_t *zfs_hdl, void *data_p)
dataset = zfs_get_name(zfs_hdl);
nvlist_add_string(props, "dataset", dataset);
- if (data->bootonce != NULL &&
- strcmp(dataset, data->bootonce) == 0)
+ if (data->lbh->bootonce != NULL &&
+ strcmp(dataset, data->lbh->bootonce) == 0)
nvlist_add_boolean_value(props, "bootonce", true);
name = strrchr(dataset, '/') + 1;
@@ -252,9 +231,6 @@ be_proplist_update(prop_data_t *data)
ZFS_TYPE_FILESYSTEM)) == NULL)
return (BE_ERR_ZFSOPEN);
- (void) lzbe_get_boot_device(zpool_get_name(data->lbh->active_phandle),
- &data->bootonce);
-
/* XXX TODO: some error checking here */
zfs_iter_filesystems(root_hdl, prop_list_builder_cb, data);
diff --git a/lib/libbe/libbe.3 b/lib/libbe/libbe.3
index de2c29c65268..3b10711dd0f9 100644
--- a/lib/libbe/libbe.3
+++ b/lib/libbe/libbe.3
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 18, 2020
+.Dd April 20, 2025
.Dt LIBBE 3
.Os
.Sh NAME
@@ -147,8 +147,8 @@
.Sh DESCRIPTION
.Nm
interfaces with libzfs to provide a set of functions for various operations
-regarding ZFS boot environments including "deep" boot environments in which
-a boot environments has child datasets.
+regarding ZFS boot environments, including "deep" boot environments in which
+a boot environment has child datasets.
.Pp
A context structure is passed to each function, allowing for a small amount
of state to be retained, such as errors from previous operations.
@@ -178,14 +178,22 @@ If a BE root is supplied,
.Nm
will only operate out of that pool and BE root.
An error may occur if:
-.Bl -column
-.It /boot and / are not on the same filesystem and device,
-.It libzfs fails to initialize,
-.It The system has not been properly booted with a ZFS boot
+.Bl -bullet
+.It
+.Pa /boot
+and
+.Pa /
+are not on the same filesystem and device,
+.It
+libzfs fails to initialize,
+.It
+The system has not been properly booted with a ZFS boot
environment,
-.It Nm
+.It
+.Nm
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.
.El
.Pp
@@ -226,9 +234,8 @@ function creates a snapshot of
.Fa be_name
named
.Fa snap_name .
-A
+A value of
.Dv NULL
-.Fa snap_name
may be used, indicating that
.Fn be_snaphot
should derive the snapshot name from the current date and time.
@@ -351,6 +358,10 @@ If
is
.Dv NULL ,
a mount point will be generated in
+.Ev TMPDIR
+or, if
+.Ev TMPDIR
+is not set,
.Pa /tmp
using
.Xr mkdtemp 3 .
@@ -385,6 +396,13 @@ This list of properties matches the properties collected by
The
.Fn be_unmount
function will unmount the given boot environment.
+If the mount point looks like it was created by
+.Fn be_mount ,
+then
+.Fn be_unmount
+will attempt to
+.Xr rmdir 2
+the mountpoint after a successful unmount.
Setting the
.Dv BE_MNT_FORCE
flag will pass
@@ -520,7 +538,7 @@ The
function will free the property list.
.Sh DIAGNOSTICS
Upon error, one of the following values will be returned:
-.Bl -dash -offset indent -compact
+.Bl -bullet -offset indent -compact
.It
BE_ERR_SUCCESS
.It
@@ -567,10 +585,16 @@ BE_ERR_INVORIGIN
.Sh SEE ALSO
.Xr bectl 8
.Sh HISTORY
+.Xr bectl 8
+and
.Nm
-and its corresponding command,
-.Xr bectl 8 ,
-were written as a 2017 Google Summer of Code project with Allan Jude serving
-as a mentor.
-Later work was done by
-.An Kyle Evans Aq Mt kevans@FreeBSD.org .
+were written by
+.An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in
+as a 2017 Google Summer of Code project, with
+.An Allan Jude (allanjude) Aq Mt allanjude@freebsd.org
+as mentor.
+.Sh AUTHORS
+Kyle Kneitinger, mentored as above.
+.Pp
+Post-GSoC changes were written by
+.An Kyle Evans (kevans) Aq Mt kevans@freebsd.org .
diff --git a/lib/libbe/tests/Makefile b/lib/libbe/tests/Makefile
index 7a16bc486d70..20a4e1ddfeb7 100644
--- a/lib/libbe/tests/Makefile
+++ b/lib/libbe/tests/Makefile
@@ -1,4 +1,3 @@
-
PACKAGE= tests
ATF_TESTS_SH+= be_create
diff --git a/lib/libbe/tests/Makefile.depend b/lib/libbe/tests/Makefile.depend
new file mode 100644
index 000000000000..670634e1722a
--- /dev/null
+++ b/lib/libbe/tests/Makefile.depend
@@ -0,0 +1,17 @@
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ cddl/lib/libnvpair \
+ cddl/lib/libspl \
+ cddl/lib/libzfs \
+ lib/${CSU_DIR} \
+ lib/libbe \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif