From 99d7453b43dc0ef04a35e461ef14db72e1326c7c Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 8 Nov 2025 15:04:51 +1100 Subject: [PATCH] libzpool: add BE_POSIX_VENDOR for userspace bootenv This is mostly a placeholder; it's not actually clear if a boot environment makes any sense for userspace. Still, "posix" is the likely future name of libzpool as a port, and this define is mandatory, so lets roll with it for now. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Signed-off-by: Rob Norris Closes #17861 --- include/sys/zfs_bootenv.h | 1 + lib/libzpool/include/Makefile.am | 1 + lib/libzpool/include/sys/zfs_bootenv_os.h | 39 +++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 lib/libzpool/include/sys/zfs_bootenv_os.h diff --git a/include/sys/zfs_bootenv.h b/include/sys/zfs_bootenv.h index 074e7e759..4c4b2ab1a 100644 --- a/include/sys/zfs_bootenv.h +++ b/include/sys/zfs_bootenv.h @@ -31,6 +31,7 @@ extern "C" { #define BE_FREEBSD_VENDOR "freebsd" #define BE_GRUB_VENDOR "grub" #define BE_LINUX_VENDOR "linux" +#define BE_POSIX_VENDOR "posix" #include diff --git a/lib/libzpool/include/Makefile.am b/lib/libzpool/include/Makefile.am index 420b6f646..6cfa2d5ce 100644 --- a/lib/libzpool/include/Makefile.am +++ b/lib/libzpool/include/Makefile.am @@ -3,5 +3,6 @@ libzpool_sys_HEADERS = \ %D%/sys/abd_os.h \ %D%/sys/abd_impl_os.h \ %D%/sys/trace_zfs.h \ + %D%/sys/zfs_bootenv_os.h \ %D%/sys/zfs_context_os.h \ %D%/sys/zfs_debug_os.h diff --git a/lib/libzpool/include/sys/zfs_bootenv_os.h b/lib/libzpool/include/sys/zfs_bootenv_os.h new file mode 100644 index 000000000..44afbb6f5 --- /dev/null +++ b/lib/libzpool/include/sys/zfs_bootenv_os.h @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: CDDL-1.0 +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or https://opensource.org/licenses/CDDL-1.0. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2025, Rob Norris + */ + +#ifndef _ZFS_BOOTENV_OS_H +#define _ZFS_BOOTENV_OS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_OS BE_POSIX_VENDOR + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_OS_H */