From owner-svn-src-projects@freebsd.org Sun Aug 5 04:16:01 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BAE51062F83 for ; Sun, 5 Aug 2018 04:16:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0265378736; Sun, 5 Aug 2018 04:16:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D78A9194A2; Sun, 5 Aug 2018 04:16:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w754G03M047148; Sun, 5 Aug 2018 04:16:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w754G0Ms047147; Sun, 5 Aug 2018 04:16:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808050416.w754G0Ms047147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 5 Aug 2018 04:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337341 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 04:16:01 -0000 Author: kevans Date: Sun Aug 5 04:16:00 2018 New Revision: 337341 URL: https://svnweb.freebsd.org/changeset/base/337341 Log: bectl(8): Take -H parameter to list into account -H is for a scripted format, where all fields are tab-delimited and the headers go away. We accomplish this by splitting out pad printing to a separate function that'll take into account whether we're supposed to be scripted or not. This has the nice side effect of maintaining positive column sizes again. Modified: projects/bectl/sbin/bectl/bectl.c Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Sat Aug 4 22:41:17 2018 (r337340) +++ projects/bectl/sbin/bectl/bectl.c Sun Aug 5 04:16:00 2018 (r337341) @@ -59,7 +59,7 @@ struct printc { int current_indent; int mount_colsz; int space_colsz; - bool hide_headers; + bool script_fmt; bool show_all_datasets; bool show_snaps; bool show_space; @@ -73,6 +73,7 @@ static int bectl_cmd_import(int argc, char *argv[]); static int bectl_cmd_add(int argc, char *argv[]); static int bectl_cmd_jail(int argc, char *argv[]); static const char *get_origin_props(nvlist_t *dsprops, nvlist_t **originprops); +static void print_padding(const char *fval, int colsz, struct printc *pc); static void print_info(const char *name, nvlist_t *dsprops, struct printc *pc); static void print_headers(nvlist_t *props, struct printc *pc); static int bectl_cmd_list(int argc, char *argv[]); @@ -456,7 +457,20 @@ get_origin_props(nvlist_t *dsprops, nvlist_t **originp return (NULL); } +static void +print_padding(const char *fval, int colsz, struct printc *pc) +{ + if (pc->script_fmt) { + printf("\t"); + return; + } + + if (fval != NULL) + colsz -= strlen(fval); + printf("%*s ", colsz, ""); +} + static void print_info(const char *name, nvlist_t *dsprops, struct printc *pc) { @@ -470,8 +484,7 @@ print_info(const char *name, nvlist_t *dsprops, struct boolean_t active_now, active_reboot; originprops = NULL; - printf("%*s%*s ", pc->current_indent, "", - pc->be_colsz + pc->current_indent, name); + printf("%*s%s", pc->current_indent, "", name); /* Recurse at the base level if we're breaking info down */ if (pc->current_indent == 0 && (pc->show_all_datasets || @@ -489,7 +502,8 @@ print_info(const char *name, nvlist_t *dsprops, struct } pc->current_indent = 0; return; - } + } else + print_padding(name, pc->be_colsz - pc->current_indent, pc); active_colsz = pc->active_colsz_def; if (nvlist_lookup_boolean_value(dsprops, "active", @@ -506,11 +520,14 @@ print_info(const char *name, nvlist_t *dsprops, struct printf("-"); active_colsz--; } - printf("%*s ", -active_colsz, " "); - if (nvlist_lookup_string(dsprops, "mountpoint", &propstr) == 0) - printf("%*s ", pc->mount_colsz, propstr); - else - printf("%*s ", pc->mount_colsz, "-"); + print_padding(NULL, active_colsz, pc); + if (nvlist_lookup_string(dsprops, "mountpoint", &propstr) == 0){ + printf("%s", propstr); + print_padding(propstr, pc->mount_colsz, pc); + } else { + printf("%s", "-"); + print_padding("-", pc->mount_colsz, pc); + } get_origin_props(dsprops, &originprops); @@ -524,9 +541,12 @@ print_info(const char *name, nvlist_t *dsprops, struct /* Alas, there's more to it,. */ humanize_number(buf, 6, space, "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE | HN_B); - printf("%*s ", pc->space_colsz, buf); - } else - printf("%*s ", pc->space_colsz, "-"); + printf("%s", buf); + print_padding(buf, pc->space_colsz, pc); + } else { + printf("%s", "-"); + print_padding("-", pc->space_colsz, pc); + } if (nvlist_lookup_string(dsprops, "creation", &propstr) == 0) { ctimenum = strtoull(propstr, NULL, 10); @@ -573,13 +593,11 @@ print_headers(nvlist_t *props, struct printc *pc) strlen(propstr) + INDENT_INCREMENT * 2); } - pc->be_colsz = -be_maxcol; - /* To be made negative after calculating final col sz */ + pc->be_colsz = be_maxcol; pc->active_colsz_def = strlen(HEADER_ACTIVE); - pc->mount_colsz = -(int)strlen(HEADER_MOUNT); - pc->space_colsz = -(int)strlen(HEADER_SPACE); - /* XXX TODO: Take -H into account */ - printf("%*s %s %s %s %s\n", pc->be_colsz, chosen_be_header, + pc->mount_colsz = strlen(HEADER_MOUNT); + pc->space_colsz = strlen(HEADER_SPACE); + printf("%*s %s %s %s %s\n", -pc->be_colsz, chosen_be_header, HEADER_ACTIVE, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); /* @@ -612,7 +630,7 @@ bectl_cmd_list(int argc, char *argv[]) pc.show_space = true; break; case 'H': - pc.hide_headers = true; + pc.script_fmt = true; break; case 's': pc.show_snaps = true; @@ -641,7 +659,8 @@ bectl_cmd_list(int argc, char *argv[]) return (1); } - print_headers(props, &pc); + if (!pc.script_fmt) + print_headers(props, &pc); /* Do a first pass to print active and next active first */ for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; cur = nvlist_next_nvpair(props, cur)) { From owner-svn-src-projects@freebsd.org Sun Aug 5 04:40:15 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A5471064148 for ; Sun, 5 Aug 2018 04:40:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 517C679D2B; Sun, 5 Aug 2018 04:40:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32974197F7; Sun, 5 Aug 2018 04:40:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w754eEsP057813; Sun, 5 Aug 2018 04:40:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w754eEGF057808; Sun, 5 Aug 2018 04:40:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808050440.w754eEGF057808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 5 Aug 2018 04:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337343 - in projects/bectl: lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 04:40:15 -0000 Author: kevans Date: Sun Aug 5 04:40:13 2018 New Revision: 337343 URL: https://svnweb.freebsd.org/changeset/base/337343 Log: bectl: Implement -D ("space if origin datasets were deleted") This also accomplishes the following: - Proxy through zfs_nicenum as be_nicenum, because it looks better than humanize_number and would presumably be useful to other libbe consumers. - Rename be_get_snapshot_props to be_get_dataset_props, make it more useful Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/be.h projects/bectl/lib/libbe/be_info.c projects/bectl/lib/libbe/libbe.3 projects/bectl/sbin/bectl/bectl.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Sun Aug 5 04:20:52 2018 (r337342) +++ projects/bectl/lib/libbe/be.c Sun Aug 5 04:40:13 2018 (r337343) @@ -171,6 +171,15 @@ libbe_close(libbe_handle_t *lbh) free(lbh); } +/* + * Proxy through to libzfs for the moment. + */ +void +be_nicenum(uint64_t num, char *buf, size_t buflen) +{ + + zfs_nicenum(num, buf, buflen); +} /* * Destroy the boot environment or snapshot specified by the name Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Sun Aug 5 04:20:52 2018 (r337342) +++ projects/bectl/lib/libbe/be.h Sun Aug 5 04:40:13 2018 (r337343) @@ -67,7 +67,7 @@ const char *be_nextboot_path(libbe_handle_t *); const char *be_root_path(libbe_handle_t *); int be_get_bootenv_props(libbe_handle_t *, nvlist_t *); -int be_get_snapshot_props(libbe_handle_t *, const char *, nvlist_t *); +int be_get_dataset_props(libbe_handle_t *, const char *, nvlist_t *); int be_prop_list_alloc(nvlist_t **be_list); void be_prop_list_free(nvlist_t *be_list); @@ -116,5 +116,6 @@ int be_export(libbe_handle_t *, char *, int fd); int be_import(libbe_handle_t *, char *, int fd); int be_add_child(libbe_handle_t *, char *, bool); +void be_nicenum(uint64_t num, char *buf, size_t buflen); #endif /* _LIBBE_H */ Modified: projects/bectl/lib/libbe/be_info.c ============================================================================== --- projects/bectl/lib/libbe/be_info.c Sun Aug 5 04:20:52 2018 (r337342) +++ projects/bectl/lib/libbe/be_info.c Sun Aug 5 04:40:13 2018 (r337343) @@ -99,7 +99,7 @@ be_get_bootenv_props(libbe_handle_t *lbh, nvlist_t *ds } int -be_get_snapshot_props(libbe_handle_t *lbh, const char *name, nvlist_t *props) +be_get_dataset_props(libbe_handle_t *lbh, const char *name, nvlist_t *props) { zfs_handle_t *snap_hdl; prop_data_t data; @@ -109,7 +109,7 @@ be_get_snapshot_props(libbe_handle_t *lbh, const char data.list = props; data.single_object = true; if ((snap_hdl = zfs_open(lbh->lzh, name, - ZFS_TYPE_SNAPSHOT)) == NULL) + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT)) == NULL) return (BE_ERR_ZFSOPEN); ret = prop_list_builder_cb(snap_hdl, &data); Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Sun Aug 5 04:20:52 2018 (r337342) +++ projects/bectl/lib/libbe/libbe.3 Sun Aug 5 04:40:13 2018 (r337343) @@ -88,6 +88,9 @@ of state to be retained, such as errors from previous .Ft int .Fn be_destroy "libbe_handle_t *, char *, int" ; .Pp +.Ft void +.Fn be_nicenum "uint64_t, char *, size_t" ; +.Pp .\" TODO: Write up of mount options .\" typedef enum { .\" BE_MNT_FORCE = 1 << 0, @@ -139,7 +142,7 @@ of state to be retained, such as errors from previous .Fn be_get_bootenv_props "libbe_handle_t *, nvlist_t *" ; .Pp .Ft int -.Fn be_get_snapshot_props "libbe_handle_t *, const char *, nvlist_t *" ; +.Fn be_get_dataset_props "libbe_handle_t *, const char *, nvlist_t *" ; .Pp .Ft void .Fn be_prop_list_free "nvlist_t *" ; Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Sun Aug 5 04:20:52 2018 (r337342) +++ projects/bectl/sbin/bectl/bectl.c Sun Aug 5 04:40:13 2018 (r337343) @@ -445,7 +445,7 @@ get_origin_props(nvlist_t *dsprops, nvlist_t **originp "bectl list: failed to allocate origin prop nvlist\n"); return (NULL); } - if (be_get_snapshot_props(be, propstr, *originprops) != 0) { + if (be_get_dataset_props(be, propstr, *originprops) != 0) { /* XXX TODO: Real errors */ fprintf(stderr, "bectl list: failed to fetch origin properties\n"); @@ -471,6 +471,40 @@ print_padding(const char *fval, int colsz, struct prin printf("%*s ", colsz, ""); } +static unsigned long long +dataset_space(const char *oname) +{ + unsigned long long space; + char *dsname, *propstr, *sep; + nvlist_t *dsprops; + + space = 0; + dsname = strdup(oname); + if (dsname == NULL) + return (0); + + if ((sep = strchr(dsname, '@')) != NULL) + *sep = '\0'; + + if (be_prop_list_alloc(&dsprops) != 0) { + free(dsname); + return (0); + } + + if (be_get_dataset_props(be, dsname, dsprops) != 0) { + nvlist_free(dsprops); + free(dsname); + return (0); + } + + if (nvlist_lookup_string(dsprops, "used", &propstr) == 0) + space = strtoull(propstr, NULL, 10); + + nvlist_free(dsprops); + free(dsname); + return (space); +} + static void print_info(const char *name, nvlist_t *dsprops, struct printc *pc) { @@ -529,7 +563,7 @@ print_info(const char *name, nvlist_t *dsprops, struct print_padding("-", pc->mount_colsz, pc); } - get_origin_props(dsprops, &originprops); + oname = get_origin_props(dsprops, &originprops); if (nvlist_lookup_string(dsprops, "used", &propstr) == 0) { space = strtoull(propstr, NULL, 10); @@ -538,9 +572,12 @@ print_info(const char *name, nvlist_t *dsprops, struct nvlist_lookup_string(originprops, "used", &propstr) == 0) space += strtoull(propstr, NULL, 10); + if (!pc->show_all_datasets && pc->show_space && oname != NULL) + /* Get the used space of the origin's dataset, too. */ + space += dataset_space(oname); + /* Alas, there's more to it,. */ - humanize_number(buf, 6, space, "", HN_AUTOSCALE, - HN_DECIMAL | HN_NOSPACE | HN_B); + be_nicenum(space, buf, 6); printf("%s", buf); print_padding(buf, pc->space_colsz, pc); } else { From owner-svn-src-projects@freebsd.org Sun Aug 5 18:27:37 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7EB310599A3 for ; Sun, 5 Aug 2018 18:27:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ADD0701FF; Sun, 5 Aug 2018 18:27:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5735121DC0; Sun, 5 Aug 2018 18:27:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75IRbsW082514; Sun, 5 Aug 2018 18:27:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75IRbl4082513; Sun, 5 Aug 2018 18:27:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808051827.w75IRbl4082513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 5 Aug 2018 18:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337355 - projects/clang700-import/share/mk X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang700-import/share/mk X-SVN-Commit-Revision: 337355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 18:27:37 -0000 Author: dim Date: Sun Aug 5 18:27:36 2018 New Revision: 337355 URL: https://svnweb.freebsd.org/changeset/base/337355 Log: Disable the new clang 7.0.0 -Watomic-alignment warning ("misaligned or large atomic operation may incur significant performance penalty" ) for arm before armv6. Since on these older architectures atomic operations are always translated to libcalls, and this is expected, the warning is not really useful there. Modified: projects/clang700-import/share/mk/bsd.sys.mk Modified: projects/clang700-import/share/mk/bsd.sys.mk ============================================================================== --- projects/clang700-import/share/mk/bsd.sys.mk Sun Aug 5 18:24:35 2018 (r337354) +++ projects/clang700-import/share/mk/bsd.sys.mk Sun Aug 5 18:27:36 2018 (r337355) @@ -80,6 +80,10 @@ CWARNFLAGS.clang+= -Wno-unused-local-typedef .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 40000 CWARNFLAGS.clang+= -Wno-address-of-packed-member .endif +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 70000 && \ + ${MACHINE_CPUARCH} == "arm" && !${MACHINE_ARCH:Marmv[67]*} +CWARNFLAGS.clang+= -Wno-atomic-alignment +.endif .endif # WARNS <= 3 .if ${WARNS} <= 2 CWARNFLAGS.clang+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter From owner-svn-src-projects@freebsd.org Sun Aug 5 19:38:57 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7FAF105BC2A for ; Sun, 5 Aug 2018 19:38:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C25374AAB; Sun, 5 Aug 2018 19:38:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A58922922; Sun, 5 Aug 2018 19:38:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75Jcv43023784; Sun, 5 Aug 2018 19:38:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75JcuTj023779; Sun, 5 Aug 2018 19:38:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808051938.w75JcuTj023779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 5 Aug 2018 19:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337358 - in projects/bectl: lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 19:38:57 -0000 Author: kevans Date: Sun Aug 5 19:38:56 2018 New Revision: 337358 URL: https://svnweb.freebsd.org/changeset/base/337358 Log: bectl(8): Implement `bectl list -s` be_get_dataset_snapshots has been added to libbe(3), effectively returning the same information as be_get_bootenv_props but for snapshots of the given dataset. The assumption is that one will have the BE dataset name before wanting to grab snapshots. Modified: projects/bectl/lib/libbe/be.h projects/bectl/lib/libbe/be_info.c projects/bectl/lib/libbe/libbe.3 projects/bectl/sbin/bectl/bectl.c Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Sun Aug 5 19:21:50 2018 (r337357) +++ projects/bectl/lib/libbe/be.h Sun Aug 5 19:38:56 2018 (r337358) @@ -68,6 +68,7 @@ const char *be_root_path(libbe_handle_t *); int be_get_bootenv_props(libbe_handle_t *, nvlist_t *); int be_get_dataset_props(libbe_handle_t *, const char *, nvlist_t *); +int be_get_dataset_snapshots(libbe_handle_t *, const char *, nvlist_t *); int be_prop_list_alloc(nvlist_t **be_list); void be_prop_list_free(nvlist_t *be_list); Modified: projects/bectl/lib/libbe/be_info.c ============================================================================== --- projects/bectl/lib/libbe/be_info.c Sun Aug 5 19:21:50 2018 (r337357) +++ projects/bectl/lib/libbe/be_info.c Sun Aug 5 19:38:56 2018 (r337358) @@ -29,6 +29,8 @@ #include "be.h" #include "be_impl.h" +static int snapshot_prop_list_builder(zfs_handle_t *hdl, prop_data_t *data); + /* * Returns the name of the active boot environment */ @@ -117,6 +119,25 @@ be_get_dataset_props(libbe_handle_t *lbh, const char * return (ret); } +int +be_get_dataset_snapshots(libbe_handle_t *lbh, const char *name, nvlist_t *props) +{ + zfs_handle_t *ds_hdl; + prop_data_t data; + int ret; + + data.lbh = lbh; + data.list = props; + data.single_object = false; + if ((ds_hdl = zfs_open(lbh->lzh, name, + ZFS_TYPE_FILESYSTEM)) == NULL) + return (BE_ERR_ZFSOPEN); + + ret = snapshot_prop_list_builder(ds_hdl, &data); + zfs_close(ds_hdl); + return (ret); +} + /* * Internal callback function used by zfs_iter_filesystems. For each dataset in * the bootenv root, populate an nvlist_t of its relevant properties. @@ -219,6 +240,13 @@ prop_list_builder(prop_data_t *data) zfs_close(root_hdl); return (0); +} + +static int +snapshot_prop_list_builder(zfs_handle_t *hdl, prop_data_t *data) +{ + + return (zfs_iter_snapshots_sorted(hdl, prop_list_builder_cb, data)); } Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Sun Aug 5 19:21:50 2018 (r337357) +++ projects/bectl/lib/libbe/libbe.3 Sun Aug 5 19:38:56 2018 (r337358) @@ -144,6 +144,9 @@ of state to be retained, such as errors from previous .Ft int .Fn be_get_dataset_props "libbe_handle_t *, const char *, nvlist_t *" ; .Pp +.Ft int +.Fn be_get_dataset_snapshots "libbe_handle_t *, const char *, nvlist_t *" ; +.Pp .Ft void .Fn be_prop_list_free "nvlist_t *" ; .\" .Ft void Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Sun Aug 5 19:21:50 2018 (r337357) +++ projects/bectl/sbin/bectl/bectl.c Sun Aug 5 19:38:56 2018 (r337358) @@ -74,6 +74,7 @@ static int bectl_cmd_add(int argc, char *argv[]); static int bectl_cmd_jail(int argc, char *argv[]); static const char *get_origin_props(nvlist_t *dsprops, nvlist_t **originprops); static void print_padding(const char *fval, int colsz, struct printc *pc); +static int print_snapshots(const char *dsname, struct printc *pc); static void print_info(const char *name, nvlist_t *dsprops, struct printc *pc); static void print_headers(nvlist_t *props, struct printc *pc); static int bectl_cmd_list(int argc, char *argv[]); @@ -505,6 +506,28 @@ dataset_space(const char *oname) return (space); } +static int +print_snapshots(const char *dsname, struct printc *pc) +{ + nvpair_t *cur; + nvlist_t *props, *sprops; + + if (be_prop_list_alloc(&props) != 0) { + fprintf(stderr, "bectl list: failed to allocate snapshot nvlist\n"); + return (1); + } + if (be_get_dataset_snapshots(be, dsname, props) != 0) { + fprintf(stderr, "bectl list: failed to fetch boot ds snapshots\n"); + return (1); + } + for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; + cur = nvlist_next_nvpair(props, cur)) { + nvpair_value_nvlist(cur, &sprops); + print_info(nvpair_name(cur), sprops, pc); + } + return (0); +} + static void print_info(const char *name, nvlist_t *dsprops, struct printc *pc) { @@ -513,27 +536,34 @@ print_info(const char *name, nvlist_t *dsprops, struct unsigned long long ctimenum, space; nvlist_t *originprops; const char *oname; - char *propstr; + char *dsname, *propstr; int active_colsz; boolean_t active_now, active_reboot; + dsname = NULL; originprops = NULL; printf("%*s%s", pc->current_indent, "", name); + nvlist_lookup_string(dsprops, "dataset", &dsname); /* Recurse at the base level if we're breaking info down */ if (pc->current_indent == 0 && (pc->show_all_datasets || pc->show_snaps)) { printf("\n"); - if (nvlist_lookup_string(dsprops, "dataset", &propstr) != 0) + if (dsname == NULL) /* XXX TODO: Error? */ return; pc->current_indent += INDENT_INCREMENT; - print_info(propstr, dsprops, pc); + print_info(dsname, dsprops, pc); pc->current_indent += INDENT_INCREMENT; if ((oname = get_origin_props(dsprops, &originprops)) != NULL) { print_info(oname, originprops, pc); nvlist_free(originprops); } + + /* Back up a level; snapshots at the same level as dataset */ + pc->current_indent -= INDENT_INCREMENT; + if (pc->show_snaps) + print_snapshots(dsname, pc); pc->current_indent = 0; return; } else @@ -593,11 +623,8 @@ print_info(const char *name, nvlist_t *dsprops, struct } printf("\n"); - if (originprops != NULL) { - /*if (pc->show_all_datasets) { - }*/ + if (originprops != NULL) be_prop_list_free(originprops); - } #undef BUFSZ } From owner-svn-src-projects@freebsd.org Sun Aug 5 20:03:06 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E218105C590 for ; Sun, 5 Aug 2018 20:03:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2473B757A2; Sun, 5 Aug 2018 20:03:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1B1A22DEB; Sun, 5 Aug 2018 20:03:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75K35E0038503; Sun, 5 Aug 2018 20:03:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75K35ex038502; Sun, 5 Aug 2018 20:03:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808052003.w75K35ex038502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 5 Aug 2018 20:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337359 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 20:03:06 -0000 Author: kevans Date: Sun Aug 5 20:03:05 2018 New Revision: 337359 URL: https://svnweb.freebsd.org/changeset/base/337359 Log: bectl(8): Some light cleanup and commenting Modified: projects/bectl/sbin/bectl/bectl.c Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Sun Aug 5 19:38:56 2018 (r337358) +++ projects/bectl/sbin/bectl/bectl.c Sun Aug 5 20:03:05 2018 (r337359) @@ -462,6 +462,7 @@ static void print_padding(const char *fval, int colsz, struct printc *pc) { + /* -H flag handling; all delimiters/padding are a single tab */ if (pc->script_fmt) { printf("\t"); return; @@ -484,6 +485,7 @@ dataset_space(const char *oname) if (dsname == NULL) return (0); + /* Truncate snapshot to dataset name, as needed */ if ((sep = strchr(dsname, '@')) != NULL) *sep = '\0'; @@ -552,6 +554,12 @@ print_info(const char *name, nvlist_t *dsprops, struct if (dsname == NULL) /* XXX TODO: Error? */ return; + /* + * Whether we're dealing with -a or -s, we'll always print the + * dataset name/information followed by its origin. For -s, we + * additionally iterate through all snapshots of this boot + * environment and also print their information. + */ pc->current_indent += INDENT_INCREMENT; print_info(dsname, dsprops, pc); pc->current_indent += INDENT_INCREMENT; @@ -594,16 +602,23 @@ print_info(const char *name, nvlist_t *dsprops, struct } oname = get_origin_props(dsprops, &originprops); - if (nvlist_lookup_string(dsprops, "used", &propstr) == 0) { + /* + * The space used column is some composition of: + * - The "used" property of the dataset + * - The "used" property of the origin snapshot (not -a or -s) + * - The "used" property of the origin dataset (-D flag only) + * + * The -D flag is ignored if -a or -s are specified. + */ space = strtoull(propstr, NULL, 10); - if (!pc->show_all_datasets && originprops != NULL && + if (!pc->show_all_datasets && !pc->show_snaps && + originprops != NULL && nvlist_lookup_string(originprops, "used", &propstr) == 0) space += strtoull(propstr, NULL, 10); - if (!pc->show_all_datasets && pc->show_space && oname != NULL) - /* Get the used space of the origin's dataset, too. */ + if (pc->show_space && oname != NULL) space += dataset_space(oname); /* Alas, there's more to it,. */ @@ -611,7 +626,7 @@ print_info(const char *name, nvlist_t *dsprops, struct printf("%s", buf); print_padding(buf, pc->space_colsz, pc); } else { - printf("%s", "-"); + printf("-"); print_padding("-", pc->space_colsz, pc); } @@ -723,6 +738,9 @@ bectl_cmd_list(int argc, char *argv[]) return (1); } + /* Force -D off if either -a or -s are specified */ + if (pc.show_all_datasets || pc.show_snaps) + pc.show_space = false; if (!pc.script_fmt) print_headers(props, &pc); /* Do a first pass to print active and next active first */ From owner-svn-src-projects@freebsd.org Mon Aug 6 03:32:27 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E07001067DF5 for ; Mon, 6 Aug 2018 03:32:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9337484A93; Mon, 6 Aug 2018 03:32:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 751E027666; Mon, 6 Aug 2018 03:32:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w763WQTo070140; Mon, 6 Aug 2018 03:32:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w763WPS3070135; Mon, 6 Aug 2018 03:32:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808060332.w763WPS3070135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 Aug 2018 03:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337368 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 03:32:27 -0000 Author: kevans Date: Mon Aug 6 03:32:25 2018 New Revision: 337368 URL: https://svnweb.freebsd.org/changeset/base/337368 Log: bectl(8): bectl jail improvements - Support passing arbitrary jail arguments via -o - Split the related (and rewritten since the GSoC) jail bits out into a new bectl_jail.c file, to reduce clutter in bectl.c - Don't use RFC 1918 IP space [0]; we'll instead set no default IPv4 and let the user pass in any address options they wish via -o Reported by: rgrimes [0], Shawn Webb [0] Added: projects/bectl/sbin/bectl/bectl.h (contents, props changed) projects/bectl/sbin/bectl/bectl_jail.c (contents, props changed) Modified: projects/bectl/sbin/bectl/Makefile projects/bectl/sbin/bectl/bectl.8 projects/bectl/sbin/bectl/bectl.c Modified: projects/bectl/sbin/bectl/Makefile ============================================================================== --- projects/bectl/sbin/bectl/Makefile Mon Aug 6 02:10:52 2018 (r337367) +++ projects/bectl/sbin/bectl/Makefile Mon Aug 6 03:32:25 2018 (r337368) @@ -3,6 +3,8 @@ PROG= bectl MAN= bectl.8 +SRCS= bectl.c bectl_jail.c + LIBADD+= be LIBADD+= jail LIBADD+= nvpair Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Mon Aug 6 02:10:52 2018 (r337367) +++ projects/bectl/sbin/bectl/bectl.8 Mon Aug 6 03:32:25 2018 (r337368) @@ -14,7 +14,7 @@ .\" @(#)be.1 .\" $FreeBSD$ .\" -.Dd July 24, 2018 +.Dd August 5, 2018 .Dt BECTL 8 .Os FreeBSD .Sh NAME @@ -40,6 +40,7 @@ destroy .Ao Ar beName | beName@snapshot Ac .Nm jail +.Op Fl o Ar key Ns = Ns Ar value Oc Ns ... .Ao Ar jailID | jailName Ac .Ao Ar bootenv Ac .Nm @@ -123,10 +124,32 @@ Specifying will automatically unmount without confirmation. .Pp .It Ic jail +.Op Fl o Ar key Ns = Ns Ar value Oc Ns ... .Ao Ar jailID | jailName Ac .Ao Ar bootenv Ac .Pp Creates a jail of the given boot environment. +Multiple +.Fl o +arguments may be specified. +Al +.Ar key , +.Ar value +pairs are interpreted as jail parameters as described in +.Xr jail 8 . +The following default parameters are provided: +.Bl -tag -width -indent +.It Va allow.mount Ns = Ns Ar true +.It Va allow.mount.devfs Ns = Ns Ar true +.It Va enforce_statfs Ns = Ns Ar 1 +.It Va name Ns = Ns Ar bootenv +.It Va host.hostname Ns = Ns Ar bootenv +.It Va path +Set to a path in /tmp generated by +.Xr libbe 8 . +.El +.pp +All default parameters may be overwritten. .Pp .It Ic list .Op Fl a Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Mon Aug 6 02:10:52 2018 (r337367) +++ projects/bectl/sbin/bectl/bectl.c Mon Aug 6 03:32:25 2018 (r337368) @@ -27,10 +27,8 @@ */ #include -#include #include #include -#include #include #include #include @@ -43,6 +41,8 @@ #include +#include "bectl.h" + #define HEADER_BE "BE" #define HEADER_BEPLUS "BE/Dataset/Snapshot" #define HEADER_ACTIVE "Active" @@ -71,7 +71,6 @@ static int bectl_cmd_destroy(int argc, char *argv[]); static int bectl_cmd_export(int argc, char *argv[]); static int bectl_cmd_import(int argc, char *argv[]); static int bectl_cmd_add(int argc, char *argv[]); -static int bectl_cmd_jail(int argc, char *argv[]); static const char *get_origin_props(nvlist_t *dsprops, nvlist_t **originprops); static void print_padding(const char *fval, int colsz, struct printc *pc); static int print_snapshots(const char *dsname, struct printc *pc); @@ -80,14 +79,11 @@ static void print_headers(nvlist_t *props, struct prin static int bectl_cmd_list(int argc, char *argv[]); static int bectl_cmd_mount(int argc, char *argv[]); static int bectl_cmd_rename(int argc, char *argv[]); -static int bectl_search_jail_paths(const char *mnt); -static int bectl_locate_jail(const char *ident); -static int bectl_cmd_unjail(int argc, char *argv[]); static int bectl_cmd_unmount(int argc, char *argv[]); -static libbe_handle_t *be; +libbe_handle_t *be; -static int +int usage(bool explicit) { FILE *fp; @@ -102,7 +98,7 @@ usage(bool explicit) "\tbectl export sourceBe\n" "\tbectl import targetBe\n" "\tbectl add (path)*\n" - "\tbectl jail bootenv\n" + "\tbectl jail [ -o key=value ]... bootenv\n" "\tbectl list [-a] [-D] [-H] [-s]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" @@ -379,58 +375,6 @@ bectl_cmd_destroy(int argc, char *argv[]) return (err); } - -static int -bectl_cmd_jail(int argc, char *argv[]) -{ - char *bootenv; - char mnt_loc[BE_MAXPATHLEN]; - int err, jid; - - /* struct jail be_jail = { 0 }; */ - - if (argc == 1) { - fprintf(stderr, "bectl jail: missing boot environment name\n"); - return (usage(false)); - } - if (argc > 2) { - fprintf(stderr, "bectl jail: too many arguments\n"); - return (usage(false)); - } - - bootenv = argv[1]; - - /* - * XXX TODO: if its already mounted, perhaps there should be a flag to - * indicate its okay to proceed?? - */ - if ((err = be_mount(be, bootenv, NULL, 0, mnt_loc)) != BE_ERR_SUCCESS) { - fprintf(stderr, "could not mount bootenv\n"); - return (1); - } - - /* XXX TODO: Make the IP/hostname configurable? */ - jid = jail_setv(JAIL_CREATE | JAIL_ATTACH, - "name", bootenv, - "path", mnt_loc, - "host.hostname", bootenv, - "persist", "true", - "ip4.addr", "10.20.30.40", - "allow.mount", "true", - "allow.mount.devfs", "true", - "enforce_statfs", "1", - NULL); - if (jid == -1) { - fprintf(stderr, "unable to create jail. error: %d\n", errno); - return (1); - } - - /* We're attached within the jail... good bye! */ - chdir("/"); - execl("/bin/sh", "/bin/sh", NULL); - return (0); -} - /* * Given a set of dataset properties (for a BE dataset), populate originprops * with the origin's properties. @@ -850,105 +794,6 @@ bectl_cmd_rename(int argc, char *argv[]) return (0); } - -static int -bectl_search_jail_paths(const char *mnt) -{ - char jailpath[MAXPATHLEN + 1]; - int jid; - - jid = 0; - (void)mnt; - while ((jid = jail_getv(0, "lastjid", &jid, "path", &jailpath, - NULL)) != -1) { - if (strcmp(jailpath, mnt) == 0) - return (jid); - } - - return (-1); -} - -/* - * Locate a jail based on an arbitrary identifier. This may be either a name, - * a jid, or a BE name. Returns the jid or -1 on failure. - */ -static int -bectl_locate_jail(const char *ident) -{ - nvlist_t *belist, *props; - char *mnt; - int jid; - - /* Try the easy-match first */ - jid = jail_getid(ident); - if (jid != -1) - return (jid); - - /* Attempt to try it as a BE name, first */ - if (be_prop_list_alloc(&belist) != 0) - return (-1); - - if (be_get_bootenv_props(be, belist) != 0) - return (-1); - - if (nvlist_lookup_nvlist(belist, ident, &props) == 0) { - /* We'll attempt to resolve the jid by way of mountpoint */ - if (nvlist_lookup_string(props, "mountpoint", &mnt) == 0) { - jid = bectl_search_jail_paths(mnt); - be_prop_list_free(belist); - return (jid); - } - - be_prop_list_free(belist); - } - - return (-1); -} - -static int -bectl_cmd_unjail(int argc, char *argv[]) -{ - char path[MAXPATHLEN + 1]; - char *cmd, *name, *target; - int jid; - - /* Store alias used */ - cmd = argv[0]; - - if (argc != 2) { - fprintf(stderr, "bectl %s: wrong number of arguments\n", cmd); - return (usage(false)); - } - - target = argv[1]; - - /* Locate the jail */ - if ((jid = bectl_locate_jail(target)) == -1) { - fprintf(stderr, "bectl %s: failed to locate BE by '%s'\n", cmd, target); - return (1); - } - - bzero(&path, MAXPATHLEN + 1); - name = jail_getname(jid); - if (jail_getv(0, "name", name, "path", path, NULL) != jid) { - free(name); - fprintf(stderr, "bectl %s: failed to get path for jail requested by '%s'\n", cmd, target); - return (1); - } - - free(name); - - if (be_mounted_at(be, path, NULL) != 0) { - fprintf(stderr, "bectl %s: jail requested by '%s' not a BE\n", cmd, target); - return (1); - } - - jail_remove(jid); - unmount(path, 0); - - return (0); -} - static int bectl_cmd_unmount(int argc, char *argv[]) Added: projects/bectl/sbin/bectl/bectl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bectl/sbin/bectl/bectl.h Mon Aug 6 03:32:25 2018 (r337368) @@ -0,0 +1,35 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Kyle Evans + * + * 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 AUTHOR ``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 AUTHOR 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. + * + * $FreeBSD$ + */ + +int usage(bool explicit); + +int bectl_cmd_jail(int argc, char *argv[]); +int bectl_cmd_unjail(int argc, char *argv[]); + +extern libbe_handle_t *be; Added: projects/bectl/sbin/bectl/bectl_jail.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bectl/sbin/bectl/bectl_jail.c Mon Aug 6 03:32:25 2018 (r337368) @@ -0,0 +1,312 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Kyle Evans + * + * 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 AUTHOR ``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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "bectl.h" + +static void jailparam_grow(void); +static void jailparam_add(const char *name, const char *val); +static bool jailparam_addarg(char *arg); + +static int bectl_search_jail_paths(const char *mnt); +static int bectl_locate_jail(const char *ident); + +/* We'll start with 8 parameters initially and grow as needed. */ +#define INIT_PARAMCOUNT 8 + +static struct jailparam *jp; +static int jpcnt; +static int jpused; +static char mnt_loc[BE_MAXPATHLEN + 1]; + +static void +jailparam_grow(void) +{ + + jpcnt *= 2; + jp = realloc(jp, jpcnt * sizeof(*jp)); + if (jp == NULL) + err(2, "realloc"); +} + +static void +jailparam_add(const char *name, const char *val) +{ + int i; + + for (i = 0; i < jpused; ++i) { + if (strcmp(name, jp[i].jp_name) == 0) + break; + } + + if (i < jpused) + jailparam_free(&jp[i], 1); + else if (jpused == jpcnt) + /* The next slot isn't allocated yet */ + jailparam_grow(); + + if (jailparam_init(&jp[i], name) != 0) + return; + if (jailparam_import(&jp[i], val) != 0) + return; + ++jpused; +} + +static bool +jailparam_addarg(char *arg) +{ + char *name, *val; + + if (arg == NULL) + return (false); + name = arg; + if ((val = strchr(arg, '=')) == NULL) { + fprintf(stderr, "bectl jail: malformed jail option '%s'\n", + arg); + return (false); + } + + *val++ = '\0'; + if (strcmp(name, "path") == 0) { + if (strlen(val) > BE_MAXPATHLEN) { + fprintf(stderr, + "bectl jail: skipping too long path assignment '%s' (max length = %d)\n", + val, BE_MAXPATHLEN); + return (false); + } + strcpy(mnt_loc, val); + } + jailparam_add(name, val); + return (true); +} + +int +bectl_cmd_jail(int argc, char *argv[]) +{ + char *bootenv, *mountpoint; + int jid, opt; + bool default_hostname, default_name; + + default_hostname = default_name = true; + jpcnt = INIT_PARAMCOUNT; + jp = malloc(jpcnt * sizeof(*jp)); + if (jp == NULL) + err(2, "malloc"); + + jailparam_add("persist", "true"); + jailparam_add("allow.mount", "true"); + jailparam_add("allow.mount.devfs", "true"); + jailparam_add("enforce_statfs", "1"); + + while ((opt = getopt(argc, argv, "o:")) != -1) { + switch (opt) { + case 'o': + if (jailparam_addarg(optarg)) { + /* + * optarg has been modified to null terminate + * at the assignment operator. + */ + if (strcmp(optarg, "name") == 0) + default_name = false; + if (strcmp(optarg, "host.hostname") == 0) + default_hostname = false; + } + break; + default: + fprintf(stderr, "bectl jail: unknown option '-%c'\n", + optopt); + return (usage(false)); + } + } + + argc -= optind; + argv += optind; + + /* struct jail be_jail = { 0 }; */ + if (argc < 1) { + fprintf(stderr, "bectl jail: missing boot environment name\n"); + return (usage(false)); + } + if (argc > 2) { + fprintf(stderr, "bectl jail: too many arguments\n"); + return (usage(false)); + } + + bootenv = argv[0]; + + /* + * XXX TODO: if its already mounted, perhaps there should be a flag to + * indicate its okay to proceed?? + */ + if (*mnt_loc == '\0') + mountpoint = NULL; + else + mountpoint = mnt_loc; + if (be_mount(be, bootenv, mountpoint, 0, mnt_loc) != BE_ERR_SUCCESS) { + fprintf(stderr, "could not mount bootenv\n"); + return (1); + } + + if (default_name) + jailparam_add("name", bootenv); + if (default_hostname) + jailparam_add("host.hostname", bootenv); + /* + * This is our indicator that path was not set by the user, so we'll use + * the path that libbe generated for us. + */ + if (mountpoint == NULL) + jailparam_add("path", mnt_loc); + jid = jailparam_set(jp, jpused, JAIL_CREATE | JAIL_ATTACH); + if (jid == -1) { + fprintf(stderr, "unable to create jail. error: %d\n", errno); + return (1); + } + + jailparam_free(jp, jpused); + free(jp); + + /* We're attached within the jail... good bye! */ + chdir("/"); + execl("/bin/sh", "/bin/sh", NULL); + return (0); +} + +static int +bectl_search_jail_paths(const char *mnt) +{ + char jailpath[MAXPATHLEN + 1]; + int jid; + + jid = 0; + (void)mnt; + while ((jid = jail_getv(0, "lastjid", &jid, "path", &jailpath, + NULL)) != -1) { + if (strcmp(jailpath, mnt) == 0) + return (jid); + } + + return (-1); +} + +/* + * Locate a jail based on an arbitrary identifier. This may be either a name, + * a jid, or a BE name. Returns the jid or -1 on failure. + */ +static int +bectl_locate_jail(const char *ident) +{ + nvlist_t *belist, *props; + char *mnt; + int jid; + + /* Try the easy-match first */ + jid = jail_getid(ident); + if (jid != -1) + return (jid); + + /* Attempt to try it as a BE name, first */ + if (be_prop_list_alloc(&belist) != 0) + return (-1); + + if (be_get_bootenv_props(be, belist) != 0) + return (-1); + + if (nvlist_lookup_nvlist(belist, ident, &props) == 0) { + /* We'll attempt to resolve the jid by way of mountpoint */ + if (nvlist_lookup_string(props, "mountpoint", &mnt) == 0) { + jid = bectl_search_jail_paths(mnt); + be_prop_list_free(belist); + return (jid); + } + + be_prop_list_free(belist); + } + + return (-1); +} + +int +bectl_cmd_unjail(int argc, char *argv[]) +{ + char path[MAXPATHLEN + 1]; + char *cmd, *name, *target; + int jid; + + /* Store alias used */ + cmd = argv[0]; + + if (argc != 2) { + fprintf(stderr, "bectl %s: wrong number of arguments\n", cmd); + return (usage(false)); + } + + target = argv[1]; + + /* Locate the jail */ + if ((jid = bectl_locate_jail(target)) == -1) { + fprintf(stderr, "bectl %s: failed to locate BE by '%s'\n", cmd, + target); + return (1); + } + + bzero(&path, MAXPATHLEN + 1); + name = jail_getname(jid); + if (jail_getv(0, "name", name, "path", path, NULL) != jid) { + free(name); + fprintf(stderr, + "bectl %s: failed to get path for jail requested by '%s'\n", + cmd, target); + return (1); + } + + free(name); + + if (be_mounted_at(be, path, NULL) != 0) { + fprintf(stderr, "bectl %s: jail requested by '%s' not a BE\n", + cmd, target); + return (1); + } + + jail_remove(jid); + unmount(path, 0); + + return (0); +} From owner-svn-src-projects@freebsd.org Mon Aug 6 03:41:54 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCDB91068166 for ; Mon, 6 Aug 2018 03:41:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D60184FC3; Mon, 6 Aug 2018 03:41:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E57F276E3; Mon, 6 Aug 2018 03:41:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w763frjg075094; Mon, 6 Aug 2018 03:41:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w763fqX7075090; Mon, 6 Aug 2018 03:41:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808060341.w763fqX7075090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 Aug 2018 03:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337369 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 03:41:54 -0000 Author: kevans Date: Mon Aug 6 03:41:52 2018 New Revision: 337369 URL: https://svnweb.freebsd.org/changeset/base/337369 Log: bectl(8): Split list functionality out into its own file as well Added: projects/bectl/sbin/bectl/bectl_list.c (contents, props changed) Modified: projects/bectl/sbin/bectl/Makefile projects/bectl/sbin/bectl/bectl.c projects/bectl/sbin/bectl/bectl.h Modified: projects/bectl/sbin/bectl/Makefile ============================================================================== --- projects/bectl/sbin/bectl/Makefile Mon Aug 6 03:32:25 2018 (r337368) +++ projects/bectl/sbin/bectl/Makefile Mon Aug 6 03:41:52 2018 (r337369) @@ -3,7 +3,7 @@ PROG= bectl MAN= bectl.8 -SRCS= bectl.c bectl_jail.c +SRCS= bectl.c bectl_jail.c bectl_list.c LIBADD+= be LIBADD+= jail Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Mon Aug 6 03:32:25 2018 (r337368) +++ projects/bectl/sbin/bectl/bectl.c Mon Aug 6 03:41:52 2018 (r337369) @@ -43,40 +43,12 @@ #include "bectl.h" -#define HEADER_BE "BE" -#define HEADER_BEPLUS "BE/Dataset/Snapshot" -#define HEADER_ACTIVE "Active" -#define HEADER_MOUNT "Mountpoint" -#define HEADER_SPACE "Space" -#define HEADER_CREATED "Created" - -/* Spaces */ -#define INDENT_INCREMENT 2 - -struct printc { - int active_colsz_def; - int be_colsz; - int current_indent; - int mount_colsz; - int space_colsz; - bool script_fmt; - bool show_all_datasets; - bool show_snaps; - bool show_space; -}; - static int bectl_cmd_activate(int argc, char *argv[]); static int bectl_cmd_create(int argc, char *argv[]); static int bectl_cmd_destroy(int argc, char *argv[]); static int bectl_cmd_export(int argc, char *argv[]); static int bectl_cmd_import(int argc, char *argv[]); static int bectl_cmd_add(int argc, char *argv[]); -static const char *get_origin_props(nvlist_t *dsprops, nvlist_t **originprops); -static void print_padding(const char *fval, int colsz, struct printc *pc); -static int print_snapshots(const char *dsname, struct printc *pc); -static void print_info(const char *name, nvlist_t *dsprops, struct printc *pc); -static void print_headers(nvlist_t *props, struct printc *pc); -static int bectl_cmd_list(int argc, char *argv[]); static int bectl_cmd_mount(int argc, char *argv[]); static int bectl_cmd_rename(int argc, char *argv[]); static int bectl_cmd_unmount(int argc, char *argv[]); @@ -374,357 +346,6 @@ bectl_cmd_destroy(int argc, char *argv[]) return (err); } - -/* - * Given a set of dataset properties (for a BE dataset), populate originprops - * with the origin's properties. - */ -static const char * -get_origin_props(nvlist_t *dsprops, nvlist_t **originprops) -{ - char *propstr; - - if (nvlist_lookup_string(dsprops, "origin", &propstr) == 0) { - if (be_prop_list_alloc(originprops) != 0) { - fprintf(stderr, - "bectl list: failed to allocate origin prop nvlist\n"); - return (NULL); - } - if (be_get_dataset_props(be, propstr, *originprops) != 0) { - /* XXX TODO: Real errors */ - fprintf(stderr, - "bectl list: failed to fetch origin properties\n"); - return (NULL); - } - - return (propstr); - } - return (NULL); -} - -static void -print_padding(const char *fval, int colsz, struct printc *pc) -{ - - /* -H flag handling; all delimiters/padding are a single tab */ - if (pc->script_fmt) { - printf("\t"); - return; - } - - if (fval != NULL) - colsz -= strlen(fval); - printf("%*s ", colsz, ""); -} - -static unsigned long long -dataset_space(const char *oname) -{ - unsigned long long space; - char *dsname, *propstr, *sep; - nvlist_t *dsprops; - - space = 0; - dsname = strdup(oname); - if (dsname == NULL) - return (0); - - /* Truncate snapshot to dataset name, as needed */ - if ((sep = strchr(dsname, '@')) != NULL) - *sep = '\0'; - - if (be_prop_list_alloc(&dsprops) != 0) { - free(dsname); - return (0); - } - - if (be_get_dataset_props(be, dsname, dsprops) != 0) { - nvlist_free(dsprops); - free(dsname); - return (0); - } - - if (nvlist_lookup_string(dsprops, "used", &propstr) == 0) - space = strtoull(propstr, NULL, 10); - - nvlist_free(dsprops); - free(dsname); - return (space); -} - -static int -print_snapshots(const char *dsname, struct printc *pc) -{ - nvpair_t *cur; - nvlist_t *props, *sprops; - - if (be_prop_list_alloc(&props) != 0) { - fprintf(stderr, "bectl list: failed to allocate snapshot nvlist\n"); - return (1); - } - if (be_get_dataset_snapshots(be, dsname, props) != 0) { - fprintf(stderr, "bectl list: failed to fetch boot ds snapshots\n"); - return (1); - } - for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; - cur = nvlist_next_nvpair(props, cur)) { - nvpair_value_nvlist(cur, &sprops); - print_info(nvpair_name(cur), sprops, pc); - } - return (0); -} - -static void -print_info(const char *name, nvlist_t *dsprops, struct printc *pc) -{ -#define BUFSZ 64 - char buf[BUFSZ]; - unsigned long long ctimenum, space; - nvlist_t *originprops; - const char *oname; - char *dsname, *propstr; - int active_colsz; - boolean_t active_now, active_reboot; - - dsname = NULL; - originprops = NULL; - printf("%*s%s", pc->current_indent, "", name); - nvlist_lookup_string(dsprops, "dataset", &dsname); - - /* Recurse at the base level if we're breaking info down */ - if (pc->current_indent == 0 && (pc->show_all_datasets || - pc->show_snaps)) { - printf("\n"); - if (dsname == NULL) - /* XXX TODO: Error? */ - return; - /* - * Whether we're dealing with -a or -s, we'll always print the - * dataset name/information followed by its origin. For -s, we - * additionally iterate through all snapshots of this boot - * environment and also print their information. - */ - pc->current_indent += INDENT_INCREMENT; - print_info(dsname, dsprops, pc); - pc->current_indent += INDENT_INCREMENT; - if ((oname = get_origin_props(dsprops, &originprops)) != NULL) { - print_info(oname, originprops, pc); - nvlist_free(originprops); - } - - /* Back up a level; snapshots at the same level as dataset */ - pc->current_indent -= INDENT_INCREMENT; - if (pc->show_snaps) - print_snapshots(dsname, pc); - pc->current_indent = 0; - return; - } else - print_padding(name, pc->be_colsz - pc->current_indent, pc); - - active_colsz = pc->active_colsz_def; - if (nvlist_lookup_boolean_value(dsprops, "active", - &active_now) == 0 && active_now) { - printf("N"); - active_colsz--; - } - if (nvlist_lookup_boolean_value(dsprops, "nextboot", - &active_reboot) == 0 && active_reboot) { - printf("R"); - active_colsz--; - } - if (active_colsz == pc->active_colsz_def) { - printf("-"); - active_colsz--; - } - print_padding(NULL, active_colsz, pc); - if (nvlist_lookup_string(dsprops, "mountpoint", &propstr) == 0){ - printf("%s", propstr); - print_padding(propstr, pc->mount_colsz, pc); - } else { - printf("%s", "-"); - print_padding("-", pc->mount_colsz, pc); - } - - oname = get_origin_props(dsprops, &originprops); - if (nvlist_lookup_string(dsprops, "used", &propstr) == 0) { - /* - * The space used column is some composition of: - * - The "used" property of the dataset - * - The "used" property of the origin snapshot (not -a or -s) - * - The "used" property of the origin dataset (-D flag only) - * - * The -D flag is ignored if -a or -s are specified. - */ - space = strtoull(propstr, NULL, 10); - - if (!pc->show_all_datasets && !pc->show_snaps && - originprops != NULL && - nvlist_lookup_string(originprops, "used", &propstr) == 0) - space += strtoull(propstr, NULL, 10); - - if (pc->show_space && oname != NULL) - space += dataset_space(oname); - - /* Alas, there's more to it,. */ - be_nicenum(space, buf, 6); - printf("%s", buf); - print_padding(buf, pc->space_colsz, pc); - } else { - printf("-"); - print_padding("-", pc->space_colsz, pc); - } - - if (nvlist_lookup_string(dsprops, "creation", &propstr) == 0) { - ctimenum = strtoull(propstr, NULL, 10); - strftime(buf, BUFSZ, "%Y-%m-%d %H:%M", - localtime((time_t *)&ctimenum)); - printf("%s", buf); - } - - printf("\n"); - if (originprops != NULL) - be_prop_list_free(originprops); -#undef BUFSZ -} - -static void -print_headers(nvlist_t *props, struct printc *pc) -{ - const char *chosen_be_header; - nvpair_t *cur; - nvlist_t *dsprops; - char *propstr; - size_t be_maxcol; - - if (pc->show_all_datasets || pc->show_snaps) - chosen_be_header = HEADER_BEPLUS; - else - chosen_be_header = HEADER_BE; - be_maxcol = strlen(chosen_be_header); - for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; - cur = nvlist_next_nvpair(props, cur)) { - be_maxcol = MAX(be_maxcol, strlen(nvpair_name(cur))); - if (!pc->show_all_datasets && !pc->show_snaps) - continue; - nvpair_value_nvlist(cur, &dsprops); - if (nvlist_lookup_string(dsprops, "dataset", &propstr) != 0) - continue; - be_maxcol = MAX(be_maxcol, strlen(propstr) + INDENT_INCREMENT); - if (nvlist_lookup_string(dsprops, "origin", &propstr) != 0) - continue; - be_maxcol = MAX(be_maxcol, - strlen(propstr) + INDENT_INCREMENT * 2); - } - - pc->be_colsz = be_maxcol; - pc->active_colsz_def = strlen(HEADER_ACTIVE); - pc->mount_colsz = strlen(HEADER_MOUNT); - pc->space_colsz = strlen(HEADER_SPACE); - printf("%*s %s %s %s %s\n", -pc->be_colsz, chosen_be_header, - HEADER_ACTIVE, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); - - /* - * All other invocations in which we aren't using the default header - * will produce quite a bit of input. Throw an extra blank line after - * the header to make it look nicer. - */ - if (chosen_be_header != HEADER_BE) - printf("\n"); -} - -static int -bectl_cmd_list(int argc, char *argv[]) -{ - struct printc pc; - nvpair_t *cur; - nvlist_t *dsprops, *props; - int opt, printed; - boolean_t active_now, active_reboot; - - props = NULL; - printed = 0; - bzero(&pc, sizeof(pc)); - while ((opt = getopt(argc, argv, "aDHs")) != -1) { - switch (opt) { - case 'a': - pc.show_all_datasets = true; - break; - case 'D': - pc.show_space = true; - break; - case 'H': - pc.script_fmt = true; - break; - case 's': - pc.show_snaps = true; - break; - default: - fprintf(stderr, "bectl list: unknown option '-%c'\n", - optopt); - return (usage(false)); - } - } - - argc -= optind; - - if (argc != 0) { - fprintf(stderr, "bectl list: extra argument provided\n"); - return (usage(false)); - } - - if (be_prop_list_alloc(&props) != 0) { - fprintf(stderr, "bectl list: failed to allocate prop nvlist\n"); - return (1); - } - if (be_get_bootenv_props(be, props) != 0) { - /* XXX TODO: Real errors */ - fprintf(stderr, "bectl list: failed to fetch boot environments\n"); - return (1); - } - - /* Force -D off if either -a or -s are specified */ - if (pc.show_all_datasets || pc.show_snaps) - pc.show_space = false; - if (!pc.script_fmt) - print_headers(props, &pc); - /* Do a first pass to print active and next active first */ - for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; - cur = nvlist_next_nvpair(props, cur)) { - nvpair_value_nvlist(cur, &dsprops); - active_now = active_reboot = false; - - nvlist_lookup_boolean_value(dsprops, "active", &active_now); - nvlist_lookup_boolean_value(dsprops, "nextboot", - &active_reboot); - if (!active_now && !active_reboot) - continue; - if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) - printf("\n"); - print_info(nvpair_name(cur), dsprops, &pc); - printed++; - } - - /* Now pull everything else */ - for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; - cur = nvlist_next_nvpair(props, cur)) { - nvpair_value_nvlist(cur, &dsprops); - active_now = active_reboot = false; - - nvlist_lookup_boolean_value(dsprops, "active", &active_now); - nvlist_lookup_boolean_value(dsprops, "nextboot", - &active_reboot); - if (active_now || active_reboot) - continue; - if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) - printf("\n"); - print_info(nvpair_name(cur), dsprops, &pc); - printed++; - } - be_prop_list_free(props); - - return (0); -} - static int bectl_cmd_mount(int argc, char *argv[]) Modified: projects/bectl/sbin/bectl/bectl.h ============================================================================== --- projects/bectl/sbin/bectl/bectl.h Mon Aug 6 03:32:25 2018 (r337368) +++ projects/bectl/sbin/bectl/bectl.h Mon Aug 6 03:41:52 2018 (r337369) @@ -32,4 +32,6 @@ int usage(bool explicit); int bectl_cmd_jail(int argc, char *argv[]); int bectl_cmd_unjail(int argc, char *argv[]); +int bectl_cmd_list(int argc, char *argv[]); + extern libbe_handle_t *be; Added: projects/bectl/sbin/bectl/bectl_list.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bectl/sbin/bectl/bectl_list.c Mon Aug 6 03:41:52 2018 (r337369) @@ -0,0 +1,418 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Kyle Evans + * + * 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 AUTHOR ``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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +#include + +#include "bectl.h" + +struct printc { + int active_colsz_def; + int be_colsz; + int current_indent; + int mount_colsz; + int space_colsz; + bool script_fmt; + bool show_all_datasets; + bool show_snaps; + bool show_space; +}; + +static const char *get_origin_props(nvlist_t *dsprops, nvlist_t **originprops); +static void print_padding(const char *fval, int colsz, struct printc *pc); +static int print_snapshots(const char *dsname, struct printc *pc); +static void print_info(const char *name, nvlist_t *dsprops, struct printc *pc); +static void print_headers(nvlist_t *props, struct printc *pc); +static unsigned long long dataset_space(const char *oname); + +#define HEADER_BE "BE" +#define HEADER_BEPLUS "BE/Dataset/Snapshot" +#define HEADER_ACTIVE "Active" +#define HEADER_MOUNT "Mountpoint" +#define HEADER_SPACE "Space" +#define HEADER_CREATED "Created" + +/* Spaces */ +#define INDENT_INCREMENT 2 + +/* + * Given a set of dataset properties (for a BE dataset), populate originprops + * with the origin's properties. + */ +static const char * +get_origin_props(nvlist_t *dsprops, nvlist_t **originprops) +{ + char *propstr; + + if (nvlist_lookup_string(dsprops, "origin", &propstr) == 0) { + if (be_prop_list_alloc(originprops) != 0) { + fprintf(stderr, + "bectl list: failed to allocate origin prop nvlist\n"); + return (NULL); + } + if (be_get_dataset_props(be, propstr, *originprops) != 0) { + /* XXX TODO: Real errors */ + fprintf(stderr, + "bectl list: failed to fetch origin properties\n"); + return (NULL); + } + + return (propstr); + } + return (NULL); +} + +static void +print_padding(const char *fval, int colsz, struct printc *pc) +{ + + /* -H flag handling; all delimiters/padding are a single tab */ + if (pc->script_fmt) { + printf("\t"); + return; + } + + if (fval != NULL) + colsz -= strlen(fval); + printf("%*s ", colsz, ""); +} + +static unsigned long long +dataset_space(const char *oname) +{ + unsigned long long space; + char *dsname, *propstr, *sep; + nvlist_t *dsprops; + + space = 0; + dsname = strdup(oname); + if (dsname == NULL) + return (0); + + /* Truncate snapshot to dataset name, as needed */ + if ((sep = strchr(dsname, '@')) != NULL) + *sep = '\0'; + + if (be_prop_list_alloc(&dsprops) != 0) { + free(dsname); + return (0); + } + + if (be_get_dataset_props(be, dsname, dsprops) != 0) { + nvlist_free(dsprops); + free(dsname); + return (0); + } + + if (nvlist_lookup_string(dsprops, "used", &propstr) == 0) + space = strtoull(propstr, NULL, 10); + + nvlist_free(dsprops); + free(dsname); + return (space); +} + +static int +print_snapshots(const char *dsname, struct printc *pc) +{ + nvpair_t *cur; + nvlist_t *props, *sprops; + + if (be_prop_list_alloc(&props) != 0) { + fprintf(stderr, "bectl list: failed to allocate snapshot nvlist\n"); + return (1); + } + if (be_get_dataset_snapshots(be, dsname, props) != 0) { + fprintf(stderr, "bectl list: failed to fetch boot ds snapshots\n"); + return (1); + } + for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; + cur = nvlist_next_nvpair(props, cur)) { + nvpair_value_nvlist(cur, &sprops); + print_info(nvpair_name(cur), sprops, pc); + } + return (0); +} + +static void +print_info(const char *name, nvlist_t *dsprops, struct printc *pc) +{ +#define BUFSZ 64 + char buf[BUFSZ]; + unsigned long long ctimenum, space; + nvlist_t *originprops; + const char *oname; + char *dsname, *propstr; + int active_colsz; + boolean_t active_now, active_reboot; + + dsname = NULL; + originprops = NULL; + printf("%*s%s", pc->current_indent, "", name); + nvlist_lookup_string(dsprops, "dataset", &dsname); + + /* Recurse at the base level if we're breaking info down */ + if (pc->current_indent == 0 && (pc->show_all_datasets || + pc->show_snaps)) { + printf("\n"); + if (dsname == NULL) + /* XXX TODO: Error? */ + return; + /* + * Whether we're dealing with -a or -s, we'll always print the + * dataset name/information followed by its origin. For -s, we + * additionally iterate through all snapshots of this boot + * environment and also print their information. + */ + pc->current_indent += INDENT_INCREMENT; + print_info(dsname, dsprops, pc); + pc->current_indent += INDENT_INCREMENT; + if ((oname = get_origin_props(dsprops, &originprops)) != NULL) { + print_info(oname, originprops, pc); + nvlist_free(originprops); + } + + /* Back up a level; snapshots at the same level as dataset */ + pc->current_indent -= INDENT_INCREMENT; + if (pc->show_snaps) + print_snapshots(dsname, pc); + pc->current_indent = 0; + return; + } else + print_padding(name, pc->be_colsz - pc->current_indent, pc); + + active_colsz = pc->active_colsz_def; + if (nvlist_lookup_boolean_value(dsprops, "active", + &active_now) == 0 && active_now) { + printf("N"); + active_colsz--; + } + if (nvlist_lookup_boolean_value(dsprops, "nextboot", + &active_reboot) == 0 && active_reboot) { + printf("R"); + active_colsz--; + } + if (active_colsz == pc->active_colsz_def) { + printf("-"); + active_colsz--; + } + print_padding(NULL, active_colsz, pc); + if (nvlist_lookup_string(dsprops, "mountpoint", &propstr) == 0){ + printf("%s", propstr); + print_padding(propstr, pc->mount_colsz, pc); + } else { + printf("%s", "-"); + print_padding("-", pc->mount_colsz, pc); + } + + oname = get_origin_props(dsprops, &originprops); + if (nvlist_lookup_string(dsprops, "used", &propstr) == 0) { + /* + * The space used column is some composition of: + * - The "used" property of the dataset + * - The "used" property of the origin snapshot (not -a or -s) + * - The "used" property of the origin dataset (-D flag only) + * + * The -D flag is ignored if -a or -s are specified. + */ + space = strtoull(propstr, NULL, 10); + + if (!pc->show_all_datasets && !pc->show_snaps && + originprops != NULL && + nvlist_lookup_string(originprops, "used", &propstr) == 0) + space += strtoull(propstr, NULL, 10); + + if (pc->show_space && oname != NULL) + space += dataset_space(oname); + + /* Alas, there's more to it,. */ + be_nicenum(space, buf, 6); + printf("%s", buf); + print_padding(buf, pc->space_colsz, pc); + } else { + printf("-"); + print_padding("-", pc->space_colsz, pc); + } + + if (nvlist_lookup_string(dsprops, "creation", &propstr) == 0) { + ctimenum = strtoull(propstr, NULL, 10); + strftime(buf, BUFSZ, "%Y-%m-%d %H:%M", + localtime((time_t *)&ctimenum)); + printf("%s", buf); + } + + printf("\n"); + if (originprops != NULL) + be_prop_list_free(originprops); +#undef BUFSZ +} + +static void +print_headers(nvlist_t *props, struct printc *pc) +{ + const char *chosen_be_header; + nvpair_t *cur; + nvlist_t *dsprops; + char *propstr; + size_t be_maxcol; + + if (pc->show_all_datasets || pc->show_snaps) + chosen_be_header = HEADER_BEPLUS; + else + chosen_be_header = HEADER_BE; + be_maxcol = strlen(chosen_be_header); + for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; + cur = nvlist_next_nvpair(props, cur)) { + be_maxcol = MAX(be_maxcol, strlen(nvpair_name(cur))); + if (!pc->show_all_datasets && !pc->show_snaps) + continue; + nvpair_value_nvlist(cur, &dsprops); + if (nvlist_lookup_string(dsprops, "dataset", &propstr) != 0) + continue; + be_maxcol = MAX(be_maxcol, strlen(propstr) + INDENT_INCREMENT); + if (nvlist_lookup_string(dsprops, "origin", &propstr) != 0) + continue; + be_maxcol = MAX(be_maxcol, + strlen(propstr) + INDENT_INCREMENT * 2); + } + + pc->be_colsz = be_maxcol; + pc->active_colsz_def = strlen(HEADER_ACTIVE); + pc->mount_colsz = strlen(HEADER_MOUNT); + pc->space_colsz = strlen(HEADER_SPACE); + printf("%*s %s %s %s %s\n", -pc->be_colsz, chosen_be_header, + HEADER_ACTIVE, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); + + /* + * All other invocations in which we aren't using the default header + * will produce quite a bit of input. Throw an extra blank line after + * the header to make it look nicer. + */ + if (chosen_be_header != HEADER_BE) + printf("\n"); +} + +int +bectl_cmd_list(int argc, char *argv[]) +{ + struct printc pc; + nvpair_t *cur; + nvlist_t *dsprops, *props; + int opt, printed; + boolean_t active_now, active_reboot; + + props = NULL; + printed = 0; + bzero(&pc, sizeof(pc)); + while ((opt = getopt(argc, argv, "aDHs")) != -1) { + switch (opt) { + case 'a': + pc.show_all_datasets = true; + break; + case 'D': + pc.show_space = true; + break; + case 'H': + pc.script_fmt = true; + break; + case 's': + pc.show_snaps = true; + break; + default: + fprintf(stderr, "bectl list: unknown option '-%c'\n", + optopt); + return (usage(false)); + } + } + + argc -= optind; + + if (argc != 0) { + fprintf(stderr, "bectl list: extra argument provided\n"); + return (usage(false)); + } + + if (be_prop_list_alloc(&props) != 0) { + fprintf(stderr, "bectl list: failed to allocate prop nvlist\n"); + return (1); + } + if (be_get_bootenv_props(be, props) != 0) { + /* XXX TODO: Real errors */ + fprintf(stderr, "bectl list: failed to fetch boot environments\n"); + return (1); + } + + /* Force -D off if either -a or -s are specified */ + if (pc.show_all_datasets || pc.show_snaps) + pc.show_space = false; + if (!pc.script_fmt) + print_headers(props, &pc); + /* Do a first pass to print active and next active first */ + for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; + cur = nvlist_next_nvpair(props, cur)) { + nvpair_value_nvlist(cur, &dsprops); + active_now = active_reboot = false; + + nvlist_lookup_boolean_value(dsprops, "active", &active_now); + nvlist_lookup_boolean_value(dsprops, "nextboot", + &active_reboot); + if (!active_now && !active_reboot) + continue; + if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) + printf("\n"); + print_info(nvpair_name(cur), dsprops, &pc); + printed++; + } + + /* Now pull everything else */ + for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; + cur = nvlist_next_nvpair(props, cur)) { + nvpair_value_nvlist(cur, &dsprops); + active_now = active_reboot = false; + + nvlist_lookup_boolean_value(dsprops, "active", &active_now); + nvlist_lookup_boolean_value(dsprops, "nextboot", + &active_reboot); + if (active_now || active_reboot) + continue; + if (printed > 0 && (pc.show_all_datasets || pc.show_snaps)) + printf("\n"); + print_info(nvpair_name(cur), dsprops, &pc); + printed++; + } + be_prop_list_free(props); + + return (0); +} + From owner-svn-src-projects@freebsd.org Mon Aug 6 15:21:48 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33893105C180 for ; Mon, 6 Aug 2018 15:21:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D906D7C201; Mon, 6 Aug 2018 15:21:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB2EA6C84; Mon, 6 Aug 2018 15:21:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76FLlr1038580; Mon, 6 Aug 2018 15:21:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76FLltR038578; Mon, 6 Aug 2018 15:21:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808061521.w76FLltR038578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 Aug 2018 15:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337380 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 15:21:48 -0000 Author: kevans Date: Mon Aug 6 15:21:46 2018 New Revision: 337380 URL: https://svnweb.freebsd.org/changeset/base/337380 Log: bectl(8): Provide -u option to unset jail parameters All but name, host.hostname, and path may be completely unset. Modified: projects/bectl/sbin/bectl/bectl.8 projects/bectl/sbin/bectl/bectl.c projects/bectl/sbin/bectl/bectl_jail.c Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Mon Aug 6 14:40:45 2018 (r337379) +++ projects/bectl/sbin/bectl/bectl.8 Mon Aug 6 15:21:46 2018 (r337380) @@ -40,7 +40,7 @@ destroy .Ao Ar beName | beName@snapshot Ac .Nm jail -.Op Fl o Ar key Ns = Ns Ar value Oc Ns ... +.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac .Ao Ar bootenv Ac .Nm @@ -124,15 +124,32 @@ Specifying will automatically unmount without confirmation. .Pp .It Ic jail -.Op Fl o Ar key Ns = Ns Ar value Oc Ns ... +.Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac .Ao Ar bootenv Ac .Pp Creates a jail of the given boot environment. Multiple .Fl o +and +.Fl u arguments may be specified. -Al +.Fl o +will set a jail parameter, and +.Fl u +will unset a jail parameter. +.Pp +The +.Va name , +.Va host.hostname , +and +.Va path +may not actually be unset. +Attempts to unset any of these will revert them to the default values specified +below, if they have been overwritten by +.Fl o . +.Pp +All .Ar key , .Ar value pairs are interpreted as jail parameters as described in @@ -148,9 +165,8 @@ The following default parameters are provided: Set to a path in /tmp generated by .Xr libbe 8 . .El -.pp -All default parameters may be overwritten. .Pp +All default parameters may be overwritten. .It Ic list .Op Fl a .Op Fl D Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Mon Aug 6 14:40:45 2018 (r337379) +++ projects/bectl/sbin/bectl/bectl.c Mon Aug 6 15:21:46 2018 (r337380) @@ -70,7 +70,7 @@ usage(bool explicit) "\tbectl export sourceBe\n" "\tbectl import targetBe\n" "\tbectl add (path)*\n" - "\tbectl jail [ -o key=value ]... bootenv\n" + "\tbectl jail [ -o key=value | -u key ]... bootenv\n" "\tbectl list [-a] [-D] [-H] [-s]\n" "\tbectl mount beName [mountpoint]\n" "\tbectl rename origBeName newBeName\n" Modified: projects/bectl/sbin/bectl/bectl_jail.c ============================================================================== --- projects/bectl/sbin/bectl/bectl_jail.c Mon Aug 6 14:40:45 2018 (r337379) +++ projects/bectl/sbin/bectl/bectl_jail.c Mon Aug 6 15:21:46 2018 (r337380) @@ -43,7 +43,9 @@ static void jailparam_grow(void); static void jailparam_add(const char *name, const char *val); +static void jailparam_del(const char *name); static bool jailparam_addarg(char *arg); +static bool jailparam_delarg(char *arg); static int bectl_search_jail_paths(const char *mnt); static int bectl_locate_jail(const char *ident); @@ -89,6 +91,34 @@ jailparam_add(const char *name, const char *val) ++jpused; } +static void +jailparam_del(const char *name) +{ + int i; + char *val; + + for (i = 0; i < jpused; ++i) { + if (strcmp(name, jp[i].jp_name) == 0) + break; + } + + /* Not found... technically successful */ + if (i == jpused) + return; + + for (; i < jpused - 1; ++i) { + val = jailparam_export(&jp[i + 1]); + + jailparam_free(&jp[i], 1); + jailparam_init(&jp[i], jp[i + 1].jp_name); + jailparam_import(&jp[i], val); + free(val); + } + + jailparam_free(&jp[i], 1); + --jpused; +} + static bool jailparam_addarg(char *arg) { @@ -117,6 +147,23 @@ jailparam_addarg(char *arg) return (true); } +static bool +jailparam_delarg(char *arg) +{ + char *name, *val; + + if (arg == NULL) + return (false); + name = arg; + if ((val = strchr(name, '=')) != NULL) + *val++ = '\0'; + + if (strcmp(name, "path") == 0) + *mnt_loc = '\0'; + jailparam_del(name); + return (true); +} + int bectl_cmd_jail(int argc, char *argv[]) { @@ -135,7 +182,7 @@ bectl_cmd_jail(int argc, char *argv[]) jailparam_add("allow.mount.devfs", "true"); jailparam_add("enforce_statfs", "1"); - while ((opt = getopt(argc, argv, "o:")) != -1) { + while ((opt = getopt(argc, argv, "o:u:")) != -1) { switch (opt) { case 'o': if (jailparam_addarg(optarg)) { @@ -147,6 +194,14 @@ bectl_cmd_jail(int argc, char *argv[]) default_name = false; if (strcmp(optarg, "host.hostname") == 0) default_hostname = false; + } + break; + case 'u': + if (jailparam_delarg(optarg)) { + if (strcmp(optarg, "name") == 0) + default_name = true; + if (strcmp(optarg, "host.hostname") == 0) + default_hostname = true; } break; default: From owner-svn-src-projects@freebsd.org Tue Aug 7 01:56:38 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C52106D64A for ; Tue, 7 Aug 2018 01:56:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA3675275; Tue, 7 Aug 2018 01:56:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 821BD153CC; Tue, 7 Aug 2018 01:56:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w771ubOx070280; Tue, 7 Aug 2018 01:56:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w771ubn0070279; Tue, 7 Aug 2018 01:56:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070156.w771ubn0070279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 01:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337402 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 01:56:38 -0000 Author: kevans Date: Tue Aug 7 01:56:37 2018 New Revision: 337402 URL: https://svnweb.freebsd.org/changeset/base/337402 Log: libbe(3): Rewrite activate temp bits to rely less on loader Loader is still relied upon at the beginning of libbe to specify the be root, but we can derive from that the primary zpool and any vdevs that we need to set nextboot bits on. This lets me successfully `bectl activate -t test`, but UEFI loader doesn't quite yet understand so it's effectively defunct. Modified: projects/bectl/lib/libbe/be.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Tue Aug 7 00:51:49 2018 (r337401) +++ projects/bectl/lib/libbe/be.c Tue Aug 7 01:56:37 2018 (r337402) @@ -657,7 +657,7 @@ be_import(libbe_handle_t *lbh, char *bootenv, int fd) * XXX TODO: this is a very likely name for someone to already have * used... we should avoid it. */ - if ((err = be_root_concat(lbh, "be_import_temp", buf)) != 0) + if ((err = be_root_concat(lbh, "libbe_import_temp", buf)) != 0) /* XXX TODO error handle */ return (-1); @@ -798,14 +798,43 @@ be_add_child(libbe_handle_t *lbh, char *child_path, bo return (BE_ERR_SUCCESS); } +static int +be_set_nextboot(libbe_handle_t *lbh, nvlist_t *config, uint64_t pool_guid, + const char *zfsdev) +{ + nvlist_t **child; + uint64_t vdev_guid; + int c, children; + if (nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_CHILDREN, &child, + &children) == 0) { + for (c = 0; c < children; ++c) + if (be_set_nextboot(lbh, child[c], pool_guid, zfsdev) != 0) + return (1); + return (0); + } + + if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID, + &vdev_guid) != 0) { + return (1); + } + + if (zpool_nextboot(lbh->lzh, pool_guid, vdev_guid, zfsdev) != 0) { + perror("ZFS_IOC_NEXTBOOT failed"); + return (1); + } + + return (0); +} + + int be_activate(libbe_handle_t *lbh, char *bootenv, bool temporary) { char be_path[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; uint64_t pool_guid; - uint64_t vdev_guid; + nvlist_t *config, *vdevs; int err; be_root_concat(lbh, bootenv, be_path); @@ -819,33 +848,25 @@ be_activate(libbe_handle_t *lbh, char *bootenv, bool t * XXX TODO: give proper attribution to author(s) of zfsbootcfg * for this snippet. */ - - if (kenv(KENV_GET, "vfs.zfs.boot.primary_pool", buf, - sizeof(buf)) <= 0) + config = zpool_get_config(lbh->active_phandle, NULL); + if (config == NULL) { + printf("no config\n"); return (1); - pool_guid = strtoumax(buf, NULL, 10); - if (pool_guid == 0) - return (1); + } - if (kenv(KENV_GET, "vfs.zfs.boot.primary_vdev", buf, - sizeof(buf)) <= 0) + if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, + &pool_guid) != 0) return (1); - vdev_guid = strtoumax(buf, NULL, 10); - if (vdev_guid == 0) { - return (1); - } /* Expected format according to zfsbootcfg(8) man */ strcpy(buf, "zfs:"); strcat(buf, be_path); strcat(buf, ":"); - if (zpool_nextboot(lbh->lzh, pool_guid, vdev_guid, buf) != 0) { - perror("ZFS_IOC_NEXTBOOT failed"); + if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &vdevs) != 0) return (1); - } - return (BE_ERR_SUCCESS); + return (be_set_nextboot(lbh, vdevs, pool_guid, buf)); } else { /* Obtain bootenv zpool */ err = zpool_set_prop(lbh->active_phandle, "bootfs", be_path); From owner-svn-src-projects@freebsd.org Tue Aug 7 02:32:30 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED8B2106F9E9 for ; Tue, 7 Aug 2018 02:32:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A341A76E72; Tue, 7 Aug 2018 02:32:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85CE315ADF; Tue, 7 Aug 2018 02:32:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w772WT8B090440; Tue, 7 Aug 2018 02:32:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w772WTq0090439; Tue, 7 Aug 2018 02:32:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070232.w772WTq0090439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 02:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337403 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 02:32:30 -0000 Author: kevans Date: Tue Aug 7 02:32:29 2018 New Revision: 337403 URL: https://svnweb.freebsd.org/changeset/base/337403 Log: This snippet is no longer from zfsbootcfg Modified: projects/bectl/lib/libbe/be.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Tue Aug 7 01:56:37 2018 (r337402) +++ projects/bectl/lib/libbe/be.c Tue Aug 7 02:32:29 2018 (r337403) @@ -844,10 +844,6 @@ be_activate(libbe_handle_t *lbh, char *bootenv, bool t return (BE_ERR_NOENT); if (temporary) { - /* - * XXX TODO: give proper attribution to author(s) of zfsbootcfg - * for this snippet. - */ config = zpool_get_config(lbh->active_phandle, NULL); if (config == NULL) { printf("no config\n"); From owner-svn-src-projects@freebsd.org Tue Aug 7 02:40:01 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66EE5106FEB1 for ; Tue, 7 Aug 2018 02:40:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BBA2771FC; Tue, 7 Aug 2018 02:40:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6E5915B02; Tue, 7 Aug 2018 02:40:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w772e03J090849; Tue, 7 Aug 2018 02:40:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w772e0dO090848; Tue, 7 Aug 2018 02:40:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070240.w772e0dO090848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 02:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337404 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 02:40:01 -0000 Author: kevans Date: Tue Aug 7 02:40:00 2018 New Revision: 337404 URL: https://svnweb.freebsd.org/changeset/base/337404 Log: libbe(3): Rename prop_list_builder and snapshot_prop_list_builder Modified: projects/bectl/lib/libbe/be_impl.h projects/bectl/lib/libbe/be_info.c Modified: projects/bectl/lib/libbe/be_impl.h ============================================================================== --- projects/bectl/lib/libbe/be_impl.h Tue Aug 7 02:32:29 2018 (r337403) +++ projects/bectl/lib/libbe/be_impl.h Tue Aug 7 02:40:00 2018 (r337404) @@ -62,7 +62,7 @@ typedef struct prop_data { } prop_data_t; int prop_list_builder_cb(zfs_handle_t *, void *); -int prop_list_builder(prop_data_t *); +int be_proplist_update(prop_data_t *); int set_error(libbe_handle_t *, be_error_t); Modified: projects/bectl/lib/libbe/be_info.c ============================================================================== --- projects/bectl/lib/libbe/be_info.c Tue Aug 7 02:32:29 2018 (r337403) +++ projects/bectl/lib/libbe/be_info.c Tue Aug 7 02:40:00 2018 (r337404) @@ -29,7 +29,7 @@ #include "be.h" #include "be_impl.h" -static int snapshot_prop_list_builder(zfs_handle_t *hdl, prop_data_t *data); +static int snapshot_proplist_update(zfs_handle_t *hdl, prop_data_t *data); /* * Returns the name of the active boot environment @@ -97,7 +97,7 @@ be_get_bootenv_props(libbe_handle_t *lbh, nvlist_t *ds data.lbh = lbh; data.list = dsnvl; data.single_object = false; - return (prop_list_builder(&data)); + return (be_proplist_update(&data)); } int @@ -133,7 +133,7 @@ be_get_dataset_snapshots(libbe_handle_t *lbh, const ch ZFS_TYPE_FILESYSTEM)) == NULL) return (BE_ERR_ZFSOPEN); - ret = snapshot_prop_list_builder(ds_hdl, &data); + ret = snapshot_proplist_update(ds_hdl, &data); zfs_close(ds_hdl); return (ret); } @@ -141,7 +141,6 @@ be_get_dataset_snapshots(libbe_handle_t *lbh, const ch /* * Internal callback function used by zfs_iter_filesystems. For each dataset in * the bootenv root, populate an nvlist_t of its relevant properties. - * TODO: should any other properties be included? */ int prop_list_builder_cb(zfs_handle_t *zfs_hdl, void *data_p) @@ -221,12 +220,11 @@ prop_list_builder_cb(zfs_handle_t *zfs_hdl, void *data /* * Updates the properties of each bootenv in the libbe handle - * XXX TODO: rename to be_proplist_update * XXX TODO: ensure that this is always consistent (run after adds, deletes, * renames,etc */ int -prop_list_builder(prop_data_t *data) +be_proplist_update(prop_data_t *data) { zfs_handle_t *root_hdl; @@ -243,7 +241,7 @@ prop_list_builder(prop_data_t *data) } static int -snapshot_prop_list_builder(zfs_handle_t *hdl, prop_data_t *data) +snapshot_proplist_update(zfs_handle_t *hdl, prop_data_t *data) { return (zfs_iter_snapshots_sorted(hdl, prop_list_builder_cb, data)); From owner-svn-src-projects@freebsd.org Tue Aug 7 03:01:05 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FEF21070AC8 for ; Tue, 7 Aug 2018 03:01:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AABF4781CA; Tue, 7 Aug 2018 03:01:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AECE15EFB; Tue, 7 Aug 2018 03:01:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77314Pe003354; Tue, 7 Aug 2018 03:01:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77314Ww003353; Tue, 7 Aug 2018 03:01:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070301.w77314Ww003353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 03:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337405 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 03:01:05 -0000 Author: kevans Date: Tue Aug 7 03:01:04 2018 New Revision: 337405 URL: https://svnweb.freebsd.org/changeset/base/337405 Log: bectl(8): Only show mountpoint if the dataset is actually mounted This is to accomodate a later change in libbe(3) that will always return the mountpoint, whether it be the directory the dataset is actively mounted at or the "mountpoint" property. Modified: projects/bectl/sbin/bectl/bectl_list.c Modified: projects/bectl/sbin/bectl/bectl_list.c ============================================================================== --- projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 02:40:00 2018 (r337404) +++ projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 03:01:04 2018 (r337405) @@ -175,7 +175,7 @@ print_info(const char *name, nvlist_t *dsprops, struct const char *oname; char *dsname, *propstr; int active_colsz; - boolean_t active_now, active_reboot; + boolean_t active_now, active_reboot, mounted; dsname = NULL; originprops = NULL; @@ -228,7 +228,10 @@ print_info(const char *name, nvlist_t *dsprops, struct active_colsz--; } print_padding(NULL, active_colsz, pc); - if (nvlist_lookup_string(dsprops, "mountpoint", &propstr) == 0){ + if (nvlist_lookup_boolean_value(dsprops, "mounted", &mounted) != 0) + mounted = false; + if (mounted && nvlist_lookup_string(dsprops, "mountpoint", + &propstr) == 0) { printf("%s", propstr); print_padding(propstr, pc->mount_colsz, pc); } else { From owner-svn-src-projects@freebsd.org Tue Aug 7 03:07:56 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 208B41071133 for ; Tue, 7 Aug 2018 03:07:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA35078E3C; Tue, 7 Aug 2018 03:07:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95BD8160BA; Tue, 7 Aug 2018 03:07:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7737tSW007819; Tue, 7 Aug 2018 03:07:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7737tU0007818; Tue, 7 Aug 2018 03:07:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070307.w7737tU0007818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 03:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337406 - in projects/bectl: lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 03:07:56 -0000 Author: kevans Date: Tue Aug 7 03:07:54 2018 New Revision: 337406 URL: https://svnweb.freebsd.org/changeset/base/337406 Log: libbe(3): Check that dataset is to be mounted at / for be_exists This makes the be_exists behavior match the comments that assert that we've already checked that the dataset derived from the BE name is set to mount at /. Other changes of note: - bectl_list sees another change; changing mountpoint based on mount status turns out to be a bad idea, so instead make the mounted property of the returned nvlist the path that it's mounted at - Always return the "mountpoint" property in "mountpoint" if it's ste Modified: projects/bectl/lib/libbe/be_info.c projects/bectl/sbin/bectl/bectl_list.c Modified: projects/bectl/lib/libbe/be_info.c ============================================================================== --- projects/bectl/lib/libbe/be_info.c Tue Aug 7 03:01:04 2018 (r337405) +++ projects/bectl/lib/libbe/be_info.c Tue Aug 7 03:07:54 2018 (r337406) @@ -172,11 +172,14 @@ prop_list_builder_cb(zfs_handle_t *zfs_hdl, void *data nvlist_add_string(props, "name", name); mounted = zfs_is_mounted(zfs_hdl, &mountpoint); - nvlist_add_boolean_value(props, "mounted", mounted); if (mounted) - nvlist_add_string(props, "mountpoint", mountpoint); + nvlist_add_string(props, "mounted", mountpoint); + if (zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, buf, 512, + NULL, NULL, 0, 1) == 0) + nvlist_add_string(props, "mountpoint", buf); + if (zfs_prop_get(zfs_hdl, ZFS_PROP_ORIGIN, buf, 512, NULL, NULL, 0, 1) == 0) nvlist_add_string(props, "origin", buf); @@ -282,12 +285,32 @@ bool be_exists(libbe_handle_t *lbh, char *be) { char buf[BE_MAXPATHLEN]; + nvlist_t *dsprops; + char *mntpoint; + bool valid; be_root_concat(lbh, be, buf); - /* - * XXX TODO: check mountpoint prop and see if its /, AND that result - * with below expression. - */ - return (zfs_dataset_exists(lbh->lzh, buf, ZFS_TYPE_DATASET)); + if (!zfs_dataset_exists(lbh->lzh, buf, ZFS_TYPE_DATASET)) + return (false); + + /* Also check if it's mounted at / */ + if (be_prop_list_alloc(&dsprops) != 0) { + set_error(lbh, BE_ERR_UNKNOWN); + return (false); + } + + if (be_get_dataset_props(lbh, buf, dsprops) != 0) { + nvlist_free(dsprops); + return (false); + } + + if (nvlist_lookup_string(dsprops, "mountpoint", &mntpoint) == 0) { + valid = (strcmp(mntpoint, "/") == 0); + nvlist_free(dsprops); + return (valid); + } + + nvlist_free(dsprops); + return (false); } Modified: projects/bectl/sbin/bectl/bectl_list.c ============================================================================== --- projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 03:01:04 2018 (r337405) +++ projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 03:07:54 2018 (r337406) @@ -175,7 +175,7 @@ print_info(const char *name, nvlist_t *dsprops, struct const char *oname; char *dsname, *propstr; int active_colsz; - boolean_t active_now, active_reboot, mounted; + boolean_t active_now, active_reboot; dsname = NULL; originprops = NULL; @@ -228,10 +228,7 @@ print_info(const char *name, nvlist_t *dsprops, struct active_colsz--; } print_padding(NULL, active_colsz, pc); - if (nvlist_lookup_boolean_value(dsprops, "mounted", &mounted) != 0) - mounted = false; - if (mounted && nvlist_lookup_string(dsprops, "mountpoint", - &propstr) == 0) { + if (nvlist_lookup_string(dsprops, "mounted", &propstr) == 0) { printf("%s", propstr); print_padding(propstr, pc->mount_colsz, pc); } else { From owner-svn-src-projects@freebsd.org Tue Aug 7 03:25:30 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 045A01071B4D for ; Tue, 7 Aug 2018 03:25:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E18B79A04; Tue, 7 Aug 2018 03:25:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79BE116422; Tue, 7 Aug 2018 03:25:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w773PTWF017959; Tue, 7 Aug 2018 03:25:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w773PSVY017957; Tue, 7 Aug 2018 03:25:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070325.w773PSVY017957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 03:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337407 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 03:25:30 -0000 Author: kevans Date: Tue Aug 7 03:25:28 2018 New Revision: 337407 URL: https://svnweb.freebsd.org/changeset/base/337407 Log: libbe(3): Return some more proper error codes Modified: projects/bectl/lib/libbe/be.h projects/bectl/lib/libbe/be_access.c projects/bectl/lib/libbe/libbe.3 Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Tue Aug 7 03:07:54 2018 (r337406) +++ projects/bectl/lib/libbe/be.h Tue Aug 7 03:25:28 2018 (r337407) @@ -44,6 +44,8 @@ typedef enum be_error { BE_ERR_PERMS, /* insufficient permissions */ BE_ERR_DESTROYACT, /* cannot destroy active boot env */ BE_ERR_DESTROYMNT, /* destroying a mounted be requires force */ + BE_ERR_BADPATH, /* path not suitable for operation */ + BE_ERR_PATHBUSY, /* requested path is busy */ BE_ERR_PATHLEN, /* provided name exceeds maximum length limit */ BE_ERR_INVORIGIN, /* snapshot origin's mountpoint is not '/' */ BE_ERR_NOORIGIN, /* could not open snapshot's origin */ @@ -51,6 +53,7 @@ typedef enum be_error { BE_ERR_NOMOUNT, /* boot environment is not mounted */ BE_ERR_ZFSOPEN, /* calling zfs_open() failed */ BE_ERR_ZFSCLONE, /* error when calling zfs_clone to create be */ + BE_ERR_IO, /* error when doing some I/O operation */ BE_ERR_UNKNOWN, /* unknown error */ } be_error_t; Modified: projects/bectl/lib/libbe/be_access.c ============================================================================== --- projects/bectl/lib/libbe/be_access.c Tue Aug 7 03:07:54 2018 (r337406) +++ projects/bectl/lib/libbe/be_access.c Tue Aug 7 03:25:28 2018 (r337407) @@ -121,18 +121,27 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou if (mountpoint == NULL) { strcpy(mnt_temp, "/tmp/be_mount.XXXX"); if (mkdtemp(mnt_temp) == NULL) - /* XXX TODO: create error for this */ - return (set_error(lbh, BE_ERR_UNKNOWN)); + return (set_error(lbh, BE_ERR_IO)); } char opt = '\0'; if ((err = zmount(be, (mountpoint == NULL) ? mnt_temp : mountpoint, - mntflags, __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) - /* - * XXX TODO: zmount returns the nmount error, look into what - * kind of errors we can report from that - */ - return (set_error(lbh, BE_ERR_UNKNOWN)); + mntflags, __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(lbh, BE_ERR_UNKNOWN)); + } + } if (result_loc != NULL) strcpy(result_loc, mountpoint == NULL ? mnt_temp : mountpoint); @@ -156,9 +165,11 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla if ((err = be_root_concat(lbh, bootenv, be)) != 0) return (set_error(lbh, err)); - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) - /* XXX TODO correct error */ + if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) { + if (errno == EIO) + return (set_error(lbh, BE_ERR_IO)); return (set_error(lbh, BE_ERR_NOMOUNT)); + } mntpath = NULL; for (int i = 0; i < mntsize; ++i) { @@ -177,9 +188,22 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla mntflags = (flags & BE_MNT_FORCE) ? MNT_FORCE : 0; - if ((err = unmount(mntpath, mntflags)) != 0) - /* XXX TODO correct error */ - return (set_error(lbh, BE_ERR_NOMOUNT)); + if ((err = unmount(mntpath, mntflags)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(lbh, BE_ERR_UNKNOWN)); + } + } return (set_error(lbh, BE_ERR_SUCCESS)); } Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Tue Aug 7 03:07:54 2018 (r337406) +++ projects/bectl/lib/libbe/libbe.3 Tue Aug 7 03:25:28 2018 (r337407) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2018 +.Dd August 6, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -190,6 +190,8 @@ BE_ERR_NOENT, BE_ERR_PERMS, BE_ERR_DESTROYACT, BE_ERR_DESTROYMNT, +BE_ERR_BADPATH, +BE_ERR_PATHBUSY, BE_ERR_PATHLEN, BE_ERR_INVORIGIN, BE_ERR_NOORIGIN, @@ -197,6 +199,7 @@ BE_ERR_MOUNTED, BE_ERR_NOMOUNT, BE_ERR_ZFSOPEN, BE_ERR_ZFSCLONE, +BE_ERR_IO, BE_ERR_UNKNOWN .Ed .Sh SEE ALSO From owner-svn-src-projects@freebsd.org Tue Aug 7 03:26:33 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91B921071B74 for ; Tue, 7 Aug 2018 03:26:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0EA79AEF; Tue, 7 Aug 2018 03:26:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BFD716423; Tue, 7 Aug 2018 03:26:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w773QWGN018050; Tue, 7 Aug 2018 03:26:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w773QWRk018049; Tue, 7 Aug 2018 03:26:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070326.w773QWRk018049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 03:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337408 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 03:26:33 -0000 Author: kevans Date: Tue Aug 7 03:26:32 2018 New Revision: 337408 URL: https://svnweb.freebsd.org/changeset/base/337408 Log: libbe(3): Document that we'll clobber previous errors set by set_error Modified: projects/bectl/lib/libbe/be_error.c projects/bectl/lib/libbe/be_impl.h Modified: projects/bectl/lib/libbe/be_error.c ============================================================================== --- projects/bectl/lib/libbe/be_error.c Tue Aug 7 03:25:28 2018 (r337407) +++ projects/bectl/lib/libbe/be_error.c Tue Aug 7 03:26:32 2018 (r337408) @@ -107,7 +107,6 @@ int set_error(libbe_handle_t *lbh, be_error_t err) { - /* XXX TODO: should the old error be overwritten or no? */ lbh->error = err; if (lbh->print_on_err && (err != BE_ERR_SUCCESS)) fprintf(stderr, "%s\n", libbe_error_description(lbh)); Modified: projects/bectl/lib/libbe/be_impl.h ============================================================================== --- projects/bectl/lib/libbe/be_impl.h Tue Aug 7 03:25:28 2018 (r337407) +++ projects/bectl/lib/libbe/be_impl.h Tue Aug 7 03:26:32 2018 (r337408) @@ -64,6 +64,7 @@ typedef struct prop_data { int prop_list_builder_cb(zfs_handle_t *, void *); int be_proplist_update(prop_data_t *); +/* Clobbers any previous errors */ int set_error(libbe_handle_t *, be_error_t); #endif /* _LIBBE_IMPL_H */ From owner-svn-src-projects@freebsd.org Tue Aug 7 03:39:30 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D56071071F1F for ; Tue, 7 Aug 2018 03:39:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84FC97A01C; Tue, 7 Aug 2018 03:39:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63C29165C7; Tue, 7 Aug 2018 03:39:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w773dUlp023310; Tue, 7 Aug 2018 03:39:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w773dUru023309; Tue, 7 Aug 2018 03:39:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808070339.w773dUru023309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 03:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337409 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 03:39:31 -0000 Author: kevans Date: Tue Aug 7 03:39:29 2018 New Revision: 337409 URL: https://svnweb.freebsd.org/changeset/base/337409 Log: libbe(3): Destroy all children of a BE dataset, too This fixes destruction of a deep BE returning an EBUSY because child datasets still exist. Modified: projects/bectl/lib/libbe/be.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Tue Aug 7 03:26:32 2018 (r337408) +++ projects/bectl/lib/libbe/be.c Tue Aug 7 03:39:29 2018 (r337409) @@ -181,11 +181,22 @@ be_nicenum(uint64_t num, char *buf, size_t buflen) zfs_nicenum(num, buf, buflen); } +static int +be_destroy_cb(zfs_handle_t *zfs_hdl, void *data) +{ + int err; + + if ((err = zfs_iter_children(zfs_hdl, be_destroy_cb, data)) != 0) + return (err); + if ((err = zfs_destroy(zfs_hdl, false)) != 0) + return (err); + return (0); +} + /* * Destroy the boot environment or snapshot specified by the name * parameter. Options are or'd together with the possible values: * BE_DESTROY_FORCE : forces operation on mounted datasets - * TODO: Test destroying a non active but mounted be */ int be_destroy(libbe_handle_t *lbh, char *name, int options) @@ -228,13 +239,14 @@ be_destroy(libbe_handle_t *lbh, char *name, int option return (set_error(lbh, BE_ERR_DESTROYMNT)); } + if ((err = be_destroy_cb(fs, NULL)) != 0) { + /* Children are still present or the mount is referenced */ + if (err == EBUSY) + return (set_error(lbh, BE_ERR_DESTROYMNT)); + return (set_error(lbh, BE_ERR_UNKNOWN)); + } - /* XXX TODO: convert this to use zfs_iter_children first for deep BEs */ - /* XXX Note: errno 16 (device busy) occurs when chilren are present */ - if ((err = zfs_destroy(fs, false)) != 0) - fprintf(stderr, "delete failed errno: %d\n", errno); - - return (err); + return (0); } From owner-svn-src-projects@freebsd.org Tue Aug 7 13:46:08 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6291105F18F for ; Tue, 7 Aug 2018 13:46:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDAF8FBE2; Tue, 7 Aug 2018 13:46:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CF1D1C9B6; Tue, 7 Aug 2018 13:46:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Dk8Wo037429; Tue, 7 Aug 2018 13:46:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Dk6oP037421; Tue, 7 Aug 2018 13:46:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808071346.w77Dk6oP037421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 13:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337414 - in projects/bectl: lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 13:46:09 -0000 Author: kevans Date: Tue Aug 7 13:46:06 2018 New Revision: 337414 URL: https://svnweb.freebsd.org/changeset/base/337414 Log: libbe(3)/bectl(8): Standardize copyright headers - File names don't necessarily need to be repeated - Add SPDX tags - Add a missing copyright for Kyle Kneitinger in bectl.8, originally written by him in GSoC 2017; his standard copyright notice has been copied from other files within the same directory to remain consistent with how he clearly wished to portray it Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/be.h projects/bectl/lib/libbe/be_access.c projects/bectl/lib/libbe/be_error.c projects/bectl/lib/libbe/be_impl.h projects/bectl/lib/libbe/be_info.c projects/bectl/lib/libbe/libbe.3 projects/bectl/sbin/bectl/bectl.8 projects/bectl/sbin/bectl/bectl.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/lib/libbe/be.c Tue Aug 7 13:46:06 2018 (r337414) @@ -1,5 +1,5 @@ -/* - * be.c +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger * All rights reserved. Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/lib/libbe/be.h Tue Aug 7 13:46:06 2018 (r337414) @@ -1,5 +1,5 @@ -/* - * be.h +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger * All rights reserved. Modified: projects/bectl/lib/libbe/be_access.c ============================================================================== --- projects/bectl/lib/libbe/be_access.c Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/lib/libbe/be_access.c Tue Aug 7 13:46:06 2018 (r337414) @@ -1,7 +1,8 @@ -/* - * be_access.c +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger + * Copyright (c) 2018 Kyle Evans * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: projects/bectl/lib/libbe/be_error.c ============================================================================== --- projects/bectl/lib/libbe/be_error.c Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/lib/libbe/be_error.c Tue Aug 7 13:46:06 2018 (r337414) @@ -1,5 +1,5 @@ -/* - * be_error.c +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger * All rights reserved. Modified: projects/bectl/lib/libbe/be_impl.h ============================================================================== --- projects/bectl/lib/libbe/be_impl.h Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/lib/libbe/be_impl.h Tue Aug 7 13:46:06 2018 (r337414) @@ -1,5 +1,5 @@ -/* - * be_impl.h +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger * All rights reserved. Modified: projects/bectl/lib/libbe/be_info.c ============================================================================== --- projects/bectl/lib/libbe/be_info.c Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/lib/libbe/be_info.c Tue Aug 7 13:46:06 2018 (r337414) @@ -1,7 +1,8 @@ -/* - * be_info.c +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger + * Copyright (c) 2018 Kyle Evans * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/lib/libbe/libbe.3 Tue Aug 7 13:46:06 2018 (r337414) @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" .\" Copyright (c) 2017 Kyle Kneitinger .\" All rights reserved. .\" Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/sbin/bectl/bectl.8 Tue Aug 7 13:46:06 2018 (r337414) @@ -1,5 +1,8 @@ .\" -.\" be - Utility to manage Boot Environments on the ZFS filesystem +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2017 Kyle J. Kneitinger +.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Tue Aug 7 10:53:51 2018 (r337413) +++ projects/bectl/sbin/bectl/bectl.c Tue Aug 7 13:46:06 2018 (r337414) @@ -1,5 +1,5 @@ -/* - * be.c +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger * All rights reserved. From owner-svn-src-projects@freebsd.org Tue Aug 7 14:02:44 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DFBC105F950 for ; Tue, 7 Aug 2018 14:02:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00E53709D7; Tue, 7 Aug 2018 14:02:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D627C1CCF2; Tue, 7 Aug 2018 14:02:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77E2hb7049164; Tue, 7 Aug 2018 14:02:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77E2f4K049154; Tue, 7 Aug 2018 14:02:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808071402.w77E2f4K049154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 7 Aug 2018 14:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337416 - in projects/bectl: lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 14:02:44 -0000 Author: kevans Date: Tue Aug 7 14:02:41 2018 New Revision: 337416 URL: https://svnweb.freebsd.org/changeset/base/337416 Log: libbe(3)/bectl(8): Standardize $FreeBSD$ IDs Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/be.h projects/bectl/lib/libbe/be_access.c projects/bectl/lib/libbe/be_error.c projects/bectl/lib/libbe/be_impl.h projects/bectl/lib/libbe/be_info.c projects/bectl/sbin/bectl/bectl.8 projects/bectl/sbin/bectl/bectl.c projects/bectl/sbin/bectl/bectl_jail.c projects/bectl/sbin/bectl/bectl_list.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/lib/libbe/be.c Tue Aug 7 14:02:41 2018 (r337416) @@ -26,6 +26,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/lib/libbe/be.h Tue Aug 7 14:02:41 2018 (r337416) @@ -24,6 +24,8 @@ * 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. + * + * $FreeBSD$ */ #ifndef _LIBBE_H Modified: projects/bectl/lib/libbe/be_access.c ============================================================================== --- projects/bectl/lib/libbe/be_access.c Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/lib/libbe/be_access.c Tue Aug 7 14:02:41 2018 (r337416) @@ -27,6 +27,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "be.h" #include "be_impl.h" Modified: projects/bectl/lib/libbe/be_error.c ============================================================================== --- projects/bectl/lib/libbe/be_error.c Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/lib/libbe/be_error.c Tue Aug 7 14:02:41 2018 (r337416) @@ -26,6 +26,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "be.h" #include "be_impl.h" Modified: projects/bectl/lib/libbe/be_impl.h ============================================================================== --- projects/bectl/lib/libbe/be_impl.h Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/lib/libbe/be_impl.h Tue Aug 7 14:02:41 2018 (r337416) @@ -24,6 +24,8 @@ * 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. + * + * $FreeBSD$ */ #ifndef _LIBBE_IMPL_H Modified: projects/bectl/lib/libbe/be_info.c ============================================================================== --- projects/bectl/lib/libbe/be_info.c Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/lib/libbe/be_info.c Tue Aug 7 14:02:41 2018 (r337416) @@ -27,6 +27,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "be.h" #include "be_impl.h" Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/sbin/bectl/bectl.8 Tue Aug 7 14:02:41 2018 (r337416) @@ -15,6 +15,7 @@ .\" .\" .\" @(#)be.1 +.\" .\" $FreeBSD$ .\" .Dd August 5, 2018 Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/sbin/bectl/bectl.c Tue Aug 7 14:02:41 2018 (r337416) @@ -26,6 +26,9 @@ * SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include Modified: projects/bectl/sbin/bectl/bectl_jail.c ============================================================================== --- projects/bectl/sbin/bectl/bectl_jail.c Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/sbin/bectl/bectl_jail.c Tue Aug 7 14:02:41 2018 (r337416) @@ -23,9 +23,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include Modified: projects/bectl/sbin/bectl/bectl_list.c ============================================================================== --- projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 13:50:21 2018 (r337415) +++ projects/bectl/sbin/bectl/bectl_list.c Tue Aug 7 14:02:41 2018 (r337416) @@ -23,9 +23,10 @@ * 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. - * - * $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include #include From owner-svn-src-projects@freebsd.org Wed Aug 8 03:11:14 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41C2F1072A1E for ; Wed, 8 Aug 2018 03:11:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBEA18C3F7; Wed, 8 Aug 2018 03:11:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD3A524C80; Wed, 8 Aug 2018 03:11:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w783BDLE051544; Wed, 8 Aug 2018 03:11:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w783BDSo051543; Wed, 8 Aug 2018 03:11:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808080311.w783BDSo051543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 03:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337444 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 03:11:14 -0000 Author: kevans Date: Wed Aug 8 03:11:13 2018 New Revision: 337444 URL: https://svnweb.freebsd.org/changeset/base/337444 Log: Catch up on BE_ERR messages Modified: projects/bectl/lib/libbe/be_error.c Modified: projects/bectl/lib/libbe/be_error.c ============================================================================== --- projects/bectl/lib/libbe/be_error.c Wed Aug 8 02:30:34 2018 (r337443) +++ projects/bectl/lib/libbe/be_error.c Wed Aug 8 03:11:13 2018 (r337444) @@ -66,6 +66,12 @@ libbe_error_description(libbe_handle_t *lbh) case BE_ERR_DESTROYMNT: return ("cannot destroy mounted boot env unless forced"); + case BE_ERR_BADPATH: + return ("path not suitable for operation"); + + case BE_ERR_PATHBUSY: + return ("specified path is busy"); + case BE_ERR_PATHLEN: return ("provided path name exceeds maximum length limit"); @@ -86,6 +92,9 @@ libbe_error_description(libbe_handle_t *lbh) case BE_ERR_ZFSCLONE: return ("error when calling zfs_clone() to create boot env"); + + case BE_ERR_IO: + return ("input/output error"); case BE_ERR_UNKNOWN: return ("unknown error"); From owner-svn-src-projects@freebsd.org Wed Aug 8 03:25:11 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56DDD1072DBC for ; Wed, 8 Aug 2018 03:25:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C7A48C9A2; Wed, 8 Aug 2018 03:25:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E271624E7A; Wed, 8 Aug 2018 03:25:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w783PAiI060422; Wed, 8 Aug 2018 03:25:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w783PAfg060419; Wed, 8 Aug 2018 03:25:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808080325.w783PAfg060419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 03:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337445 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 03:25:11 -0000 Author: kevans Date: Wed Aug 8 03:25:10 2018 New Revision: 337445 URL: https://svnweb.freebsd.org/changeset/base/337445 Log: libbe(3): Clarify some errors While here, fix a bug with 'rename' that checked the wrong name for being the active BE. Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/be.h projects/bectl/lib/libbe/be_error.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Wed Aug 8 03:11:13 2018 (r337444) +++ projects/bectl/lib/libbe/be.c Wed Aug 8 03:25:10 2018 (r337445) @@ -287,7 +287,14 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c return (set_error(lbh, BE_ERR_INVALIDNAME)); default: - /* XXX TODO: elaborate return codes */ + /* + * The other errors that zfs_ioc_snapshot might return + * shouldn't happen if we've set things up properly, so + * we'll gloss over them and call it UNKNOWN as it will + * require further triage. + */ + if (errno == ENOTSUP) + return (set_error(lbh, BE_ERR_NOPOOL)); return (set_error(lbh, BE_ERR_UNKNOWN)); } } @@ -598,22 +605,18 @@ be_rename(libbe_handle_t *lbh, char *old, char *new) if ((err = be_root_concat(lbh, new, full_new)) != 0) return (set_error(lbh, err)); - if (be_validate_name(lbh, new) != 0) - return (BE_ERR_UNKNOWN); - /* XXX TODO set and return correct error */ + if ((err = be_validate_name(lbh, new)) != 0) + return (err); /* Check if old is active BE */ - if (strcmp(full_new, be_active_path(lbh)) == 0) - return (BE_ERR_UNKNOWN); - /* XXX TODO set and return correct error */ + if (strcmp(full_old, be_active_path(lbh)) == 0) + return (set_error(lbh, BE_ERR_MOUNTED)); if (!zfs_dataset_exists(lbh->lzh, full_old, ZFS_TYPE_DATASET)) - return (BE_ERR_UNKNOWN); - /* XXX TODO set and return correct error */ + return (set_error(lbh, BE_ERR_NOENT)); if (zfs_dataset_exists(lbh->lzh, full_new, ZFS_TYPE_DATASET)) - return (BE_ERR_UNKNOWN); - /* XXX TODO set and return correct error */ + return (set_error(lbh, BE_ERR_EXISTS)); /* XXX TODO * - What about mounted BEs? @@ -621,14 +624,11 @@ be_rename(libbe_handle_t *lbh, char *old, char *new) */ if ((zfs_hdl = zfs_open(lbh->lzh, full_old, ZFS_TYPE_FILESYSTEM)) == NULL) - return (BE_ERR_UNKNOWN); - /* XXX TODO set and return correct error */ + return (set_error(lbh, BE_ERR_ZFSOPEN)); - /* recurse, nounmount, forceunmount */ struct renameflags flags = { 0, 0, 0 }; - /* XXX TODO: error log on this call */ err = zfs_rename(zfs_hdl, NULL, full_new, flags); zfs_close(zfs_hdl); Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Wed Aug 8 03:11:13 2018 (r337444) +++ projects/bectl/lib/libbe/be.h Wed Aug 8 03:25:10 2018 (r337445) @@ -56,6 +56,7 @@ typedef enum be_error { BE_ERR_ZFSOPEN, /* calling zfs_open() failed */ BE_ERR_ZFSCLONE, /* error when calling zfs_clone to create be */ BE_ERR_IO, /* error when doing some I/O operation */ + BE_ERR_NOPOOL, /* operation not supported on this pool */ BE_ERR_UNKNOWN, /* unknown error */ } be_error_t; Modified: projects/bectl/lib/libbe/be_error.c ============================================================================== --- projects/bectl/lib/libbe/be_error.c Wed Aug 8 03:11:13 2018 (r337444) +++ projects/bectl/lib/libbe/be_error.c Wed Aug 8 03:25:10 2018 (r337445) @@ -96,6 +96,9 @@ libbe_error_description(libbe_handle_t *lbh) case BE_ERR_IO: return ("input/output error"); + case BE_ERR_NOPOOL: + return ("operation not supported on this pool"); + case BE_ERR_UNKNOWN: return ("unknown error"); From owner-svn-src-projects@freebsd.org Wed Aug 8 03:46:13 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7C571073583 for ; Wed, 8 Aug 2018 03:46:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA748D2A5; Wed, 8 Aug 2018 03:46:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F8A8251C0; Wed, 8 Aug 2018 03:46:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w783kC10070922; Wed, 8 Aug 2018 03:46:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w783kCDE070921; Wed, 8 Aug 2018 03:46:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808080346.w783kCDE070921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 03:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337446 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 03:46:13 -0000 Author: kevans Date: Wed Aug 8 03:46:12 2018 New Revision: 337446 URL: https://svnweb.freebsd.org/changeset/base/337446 Log: libbe(3): Some more light error handling... Modified: projects/bectl/lib/libbe/be.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Wed Aug 8 03:25:10 2018 (r337445) +++ projects/bectl/lib/libbe/be.c Wed Aug 8 03:46:12 2018 (r337446) @@ -652,7 +652,7 @@ be_export(libbe_handle_t *lbh, char *bootenv, int fd) be_root_concat(lbh, snap_name, buf); if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) - return (BE_ERR_ZFSOPEN); + return (set_error(lbh, BE_ERR_ZFSOPEN)); err = zfs_send_one(zfs, NULL, fd, 0); return (err); @@ -667,14 +667,22 @@ be_import(libbe_handle_t *lbh, char *bootenv, int fd) nvlist_t *props; zfs_handle_t *zfs; int err, len; + char nbuf[24]; /* - * XXX TODO: this is a very likely name for someone to already have - * used... we should avoid it. + * We don't need this to be incredibly random, just unique enough that + * it won't conflict with an existing dataset name. Chopping time + * down to 32 bits is probably good enough for this. */ - if ((err = be_root_concat(lbh, "libbe_import_temp", buf)) != 0) - /* XXX TODO error handle */ - return (-1); + snprintf(nbuf, 24, "tmp%u", + (uint32_t)(time(NULL) & 0xFFFFFFFF)); + if ((err = be_root_concat(lbh, nbuf, buf)) != 0) + /* + * Technically this is our problem, but we try to use short + * enough names that we won't run into problems except in + * worst-case BE root approaching MAXPATHLEN. + */ + return (set_error(lbh, BE_ERR_PATHLEN)); time(&rawtime); len = strlen(buf); @@ -683,18 +691,20 @@ be_import(libbe_handle_t *lbh, char *bootenv, int fd) /* lzc_receive(SNAPNAME, PROPS, ORIGIN, FORCE, fd)) { */ if ((err = lzc_receive(buf, NULL, NULL, false, fd)) != 0) { - /* TODO: go through libzfs_core's recv_impl and find returned - * errors and set appropriate BE_ERR - * edit: errors are not in libzfs_core, my assumption is - * that they use libzfs errors - * note: 17 is err for dataset already existing - */ - return (err); + switch (err) { + case EINVAL: + return (set_error(lbh, BE_ERR_NOORIGIN)); + case ENOENT: + return (set_error(lbh, BE_ERR_NOENT)); + case EIO: + return (set_error(lbh, BE_ERR_IO)); + default: + return (set_error(lbh, BE_ERR_UNKNOWN)); + } } if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_SNAPSHOT)) == NULL) - /* XXX TODO correct error */ - return (-1); + return (set_error(lbh, BE_ERR_ZFSOPEN)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); @@ -707,7 +717,7 @@ be_import(libbe_handle_t *lbh, char *bootenv, int fd) nvlist_free(props); - /* XXX TODO: recursively delete be_import_temp dataset */ + /* XXX TODO: recursively delete nbuf dataset */ return (err); } From owner-svn-src-projects@freebsd.org Fri Aug 10 04:01:42 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 213A210596D4 for ; Fri, 10 Aug 2018 04:01:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C67B876C10; Fri, 10 Aug 2018 04:01:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A73C622FA0; Fri, 10 Aug 2018 04:01:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A41fjX085949; Fri, 10 Aug 2018 04:01:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A41fL6085947; Fri, 10 Aug 2018 04:01:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808100401.w7A41fL6085947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 04:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337563 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 04:01:42 -0000 Author: kevans Date: Fri Aug 10 04:01:40 2018 New Revision: 337563 URL: https://svnweb.freebsd.org/changeset/base/337563 Log: libbe(3): more small cleanup, const'ify and light style(9) Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/be.h Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Fri Aug 10 03:28:40 2018 (r337562) +++ projects/bectl/lib/libbe/be.c Fri Aug 10 04:01:40 2018 (r337563) @@ -202,7 +202,7 @@ be_destroy_cb(zfs_handle_t *zfs_hdl, void *data) * BE_DESTROY_FORCE : forces operation on mounted datasets */ int -be_destroy(libbe_handle_t *lbh, char *name, int options) +be_destroy(libbe_handle_t *lbh, const char *name, int options) { zfs_handle_t *fs; char path[BE_MAXPATHLEN]; @@ -307,7 +307,7 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c * Create the boot environment specified by the name parameter */ int -be_create(libbe_handle_t *lbh, char *name) +be_create(libbe_handle_t *lbh, const char *name) { int err; @@ -328,11 +328,8 @@ be_deep_clone_prop(int prop, void *cb) dccb = cb; /* Skip some properties we don't want to touch */ - switch (prop) { - case ZFS_PROP_CANMOUNT: - return (ZPROP_CONT); - break; - } + if (prop == ZFS_PROP_CANMOUNT) + return (ZPROP_CONT); /* Don't copy readonly properties */ if (zfs_prop_readonly(prop)) @@ -593,7 +590,7 @@ be_validate_name(libbe_handle_t *lbh __unused, const c * usage */ int -be_rename(libbe_handle_t *lbh, char *old, char *new) +be_rename(libbe_handle_t *lbh, const char *old, const char *new) { char full_old[BE_MAXPATHLEN]; char full_new[BE_MAXPATHLEN]; @@ -638,7 +635,7 @@ be_rename(libbe_handle_t *lbh, char *old, char *new) int -be_export(libbe_handle_t *lbh, char *bootenv, int fd) +be_export(libbe_handle_t *lbh, const char *bootenv, int fd) { char snap_name[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; @@ -660,7 +657,7 @@ be_export(libbe_handle_t *lbh, char *bootenv, int fd) int -be_import(libbe_handle_t *lbh, char *bootenv, int fd) +be_import(libbe_handle_t *lbh, const char *bootenv, int fd) { char buf[BE_MAXPATHLEN]; time_t rawtime; @@ -723,14 +720,16 @@ be_import(libbe_handle_t *lbh, char *bootenv, int fd) int -be_add_child(libbe_handle_t *lbh, char *child_path, bool cp_if_exists) +be_add_child(libbe_handle_t *lbh, const char *child_path, bool cp_if_exists) { + struct stat sb; char active[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; nvlist_t *props; + const char *s; zfs_handle_t *zfs; - struct stat sb; - int err; + long snap_name; + int err, pos; /* Require absolute paths */ if (*child_path != '/') @@ -741,7 +740,7 @@ be_add_child(libbe_handle_t *lbh, char *child_path, bo strcpy(buf, active); /* Create non-mountable parent dataset(s) */ - char *s = child_path; + s = child_path; for (char *p; (p = strchr(s+1, '/')) != NULL; s = p) { size_t len = p - s; strncat(buf, s, len); @@ -753,9 +752,8 @@ be_add_child(libbe_handle_t *lbh, char *child_path, bo nvlist_free(props); } - /* Path does not exist as a descendent of / yet */ - int pos = strlen(active); + pos = strlen(active); /* XXX TODO: Verify that resulting str is less than BE_MAXPATHLEN */ strncpy(&active[pos], child_path, BE_MAXPATHLEN-pos); @@ -797,7 +795,7 @@ be_add_child(libbe_handle_t *lbh, char *child_path, bo */ /* XXX TODO: use mktemp */ - long int snap_name = random(); + snap_name = random(); snprintf(buf, BE_MAXPATHLEN, "%s@%ld", child_path, snap_name); @@ -854,7 +852,7 @@ be_set_nextboot(libbe_handle_t *lbh, nvlist_t *config, int -be_activate(libbe_handle_t *lbh, char *bootenv, bool temporary) +be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary) { char be_path[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Fri Aug 10 03:28:40 2018 (r337562) +++ projects/bectl/lib/libbe/be.h Fri Aug 10 04:01:40 2018 (r337563) @@ -78,16 +78,16 @@ int be_get_dataset_snapshots(libbe_handle_t *, const c int be_prop_list_alloc(nvlist_t **be_list); void be_prop_list_free(nvlist_t *be_list); -int be_activate(libbe_handle_t *, char *, bool); +int be_activate(libbe_handle_t *, const char *, bool); /* Bootenv creation functions */ -int be_create(libbe_handle_t *, char *); +int be_create(libbe_handle_t *, const char *); int be_create_from_existing(libbe_handle_t *, const char *, const char *); int be_create_from_existing_snap(libbe_handle_t *, const char *, const char *); int be_snapshot(libbe_handle_t *, const char *, const char *, bool, char *); /* Bootenv manipulation functions */ -int be_rename(libbe_handle_t *, char *, char *); +int be_rename(libbe_handle_t *, const char *, const char *); /* Bootenv removal functions */ @@ -95,7 +95,7 @@ typedef enum { BE_DESTROY_FORCE = 1 << 0, } be_destroy_opt_t; -int be_destroy(libbe_handle_t *, char *, int); +int be_destroy(libbe_handle_t *, const char *, int); /* Bootenv mounting functions: be_access.c */ @@ -119,10 +119,10 @@ int be_validate_name(libbe_handle_t * __unused, const int be_validate_snap(libbe_handle_t *, const char *); bool be_exists(libbe_handle_t *, char *); -int be_export(libbe_handle_t *, char *, int fd); -int be_import(libbe_handle_t *, char *, int fd); +int be_export(libbe_handle_t *, const char *, int fd); +int be_import(libbe_handle_t *, const char *, int fd); -int be_add_child(libbe_handle_t *, char *, bool); +int be_add_child(libbe_handle_t *, const char *, bool); void be_nicenum(uint64_t num, char *buf, size_t buflen); #endif /* _LIBBE_H */ From owner-svn-src-projects@freebsd.org Fri Aug 10 04:23:14 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7462105AA2C for ; Fri, 10 Aug 2018 04:23:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C37677C7E; Fri, 10 Aug 2018 04:23:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D4B223339; Fri, 10 Aug 2018 04:23:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A4NDnP097697; Fri, 10 Aug 2018 04:23:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A4ND2E097696; Fri, 10 Aug 2018 04:23:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808100423.w7A4ND2E097696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 04:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337564 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 04:23:14 -0000 Author: kevans Date: Fri Aug 10 04:23:13 2018 New Revision: 337564 URL: https://svnweb.freebsd.org/changeset/base/337564 Log: libbe(3): Plug some holes, do some more proper error returns For those returning just -1 before, have them set ERR_UNKNOWN for now. Modified: projects/bectl/lib/libbe/be.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Fri Aug 10 04:01:40 2018 (r337563) +++ projects/bectl/lib/libbe/be.c Fri Aug 10 04:23:13 2018 (r337564) @@ -615,14 +615,16 @@ be_rename(libbe_handle_t *lbh, const char *old, const if (zfs_dataset_exists(lbh->lzh, full_new, ZFS_TYPE_DATASET)) return (set_error(lbh, BE_ERR_EXISTS)); - /* XXX TODO - * - What about mounted BEs? - * - if mounted error out unless a force flag is set? - */ if ((zfs_hdl = zfs_open(lbh->lzh, full_old, ZFS_TYPE_FILESYSTEM)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); + /* XXX TODO: Allow a force flag */ + if (zfs_is_mounted(zfs_hdl, NULL)) { + zfs_close(zfs_hdl); + return (set_error(lbh, BE_ERR_MOUNTED)); + } + /* recurse, nounmount, forceunmount */ struct renameflags flags = { 0, 0, 0 }; @@ -643,8 +645,8 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in int err; if ((err = be_snapshot(lbh, bootenv, NULL, true, snap_name)) != 0) - /* XXX TODO error handle */ - return (-1); + /* Use the error set by be_snapshot */ + return (err); be_root_concat(lbh, snap_name, buf); @@ -652,6 +654,8 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in return (set_error(lbh, BE_ERR_ZFSOPEN)); err = zfs_send_one(zfs, NULL, fd, 0); + zfs_close(zfs); + return (err); } @@ -714,8 +718,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in nvlist_free(props); - /* XXX TODO: recursively delete nbuf dataset */ - return (err); + return (be_destroy(lbh, nbuf, 0)); } @@ -728,15 +731,13 @@ be_add_child(libbe_handle_t *lbh, const char *child_pa nvlist_t *props; const char *s; zfs_handle_t *zfs; - long snap_name; - int err, pos; + int err; /* Require absolute paths */ if (*child_path != '/') - /* XXX TODO: create appropriate error */ - return (-1); + return (set_error(lbh, BE_ERR_BADPATH)); - strncpy(active, be_active_path(lbh), BE_MAXPATHLEN); + strlcpy(active, be_active_path(lbh), BE_MAXPATHLEN); strcpy(buf, active); /* Create non-mountable parent dataset(s) */ @@ -753,16 +754,13 @@ be_add_child(libbe_handle_t *lbh, const char *child_pa } /* Path does not exist as a descendent of / yet */ - pos = strlen(active); + if (strlcat(active, child_path, BE_MAXPATHLEN) >= BE_MAXPATHLEN) + return (set_error(lbh, BE_ERR_PATHLEN)); - /* XXX TODO: Verify that resulting str is less than BE_MAXPATHLEN */ - strncpy(&active[pos], child_path, BE_MAXPATHLEN-pos); - if (stat(child_path, &sb) != 0) { /* Verify that error is ENOENT */ - if (errno != 2) - /* XXX TODO: create appropriate error */ - return (-1); + if (errno != ENOENT) + return (set_error(lbh, BE_ERR_NOENT)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); @@ -772,18 +770,17 @@ be_add_child(libbe_handle_t *lbh, const char *child_pa if ((err = zfs_create(lbh->lzh, active, ZFS_TYPE_DATASET, props)) != 0) /* XXX TODO handle error */ - return (-1); + return (set_error(lbh, BE_ERR_UNKNOWN)); nvlist_free(props); if ((zfs = zfs_open(lbh->lzh, active, ZFS_TYPE_DATASET)) == NULL) - /* XXX TODO handle error */ - return (-1); + return (set_error(lbh, BE_ERR_ZFSOPEN)); /* Set props */ if ((err = zfs_prop_set(zfs, "canmount", "noauto")) != 0) /* TODO handle error */ - return (-1); + return (set_error(lbh, BE_ERR_UNKNOWN)); } else if (cp_if_exists) { /* Path is already a descendent of / and should be copied */ @@ -793,30 +790,28 @@ be_add_child(libbe_handle_t *lbh, const char *child_pa * Establish if the existing path is a zfs dataset or just * the subdirectory of one */ + strlcpy(buf, "/tmp/be_snap.XXXXX", sizeof(buf)); + if (mktemp(buf) == NULL) + return (set_error(lbh, BE_ERR_UNKNOWN)); - /* XXX TODO: use mktemp */ - snap_name = random(); - - snprintf(buf, BE_MAXPATHLEN, "%s@%ld", child_path, snap_name); - if ((err = zfs_snapshot(lbh->lzh, buf, false, NULL)) != 0) /* XXX TODO correct error */ - return (-1); + return (set_error(lbh, BE_ERR_UNKNOWN)); /* Clone */ if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_SNAPSHOT)) == NULL) - /* XXX TODO correct error */ - return (-1); + return (BE_ERR_ZFSOPEN); if ((err = zfs_clone(zfs, active, NULL)) != 0) /* XXX TODO correct error */ - return (-1); + return (set_error(lbh, BE_ERR_UNKNOWN)); /* set props */ + zfs_close(zfs); } else /* TODO: error code for exists, but not cp? */ - return (-1); + return (set_error(lbh, BE_ERR_EXISTS)); return (BE_ERR_SUCCESS); } From owner-svn-src-projects@freebsd.org Fri Aug 10 21:02:34 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C78E01075096 for ; Fri, 10 Aug 2018 21:02:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75B6B7B07C; Fri, 10 Aug 2018 21:02:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 574B95A85; Fri, 10 Aug 2018 21:02:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AL2Xd4016592; Fri, 10 Aug 2018 21:02:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AL2T8W016570; Fri, 10 Aug 2018 21:02:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808102102.w7AL2T8W016570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 10 Aug 2018 21:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337590 - in projects/clang700-import: . bin/date bin/date/tests bin/dd bin/ls cddl/contrib/opensolaris/lib/libdtrace/common cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/open... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang700-import: . bin/date bin/date/tests bin/dd bin/ls cddl/contrib/opensolaris/lib/libdtrace/common cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/comm... X-SVN-Commit-Revision: 337590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 21:02:34 -0000 Author: dim Date: Fri Aug 10 21:02:28 2018 New Revision: 337590 URL: https://svnweb.freebsd.org/changeset/base/337590 Log: Merge ^/head r337286 through r337585. Added: projects/clang700-import/contrib/file/magic/Magdir/dataone - copied unchanged from r337585, head/contrib/file/magic/Magdir/dataone projects/clang700-import/contrib/file/python/CHANGELOG.md - copied unchanged from r337585, head/contrib/file/python/CHANGELOG.md projects/clang700-import/contrib/file/python/LICENSE - copied unchanged from r337585, head/contrib/file/python/LICENSE projects/clang700-import/contrib/file/python/README.md - copied unchanged from r337585, head/contrib/file/python/README.md projects/clang700-import/contrib/file/python/tests.py - copied unchanged from r337585, head/contrib/file/python/tests.py projects/clang700-import/contrib/file/tests/JW07022A.mp3.result - copied unchanged from r337585, head/contrib/file/tests/JW07022A.mp3.result projects/clang700-import/contrib/file/tests/JW07022A.mp3.testfile - copied unchanged from r337585, head/contrib/file/tests/JW07022A.mp3.testfile projects/clang700-import/lib/libc/gen/timespec_get.3 - copied unchanged from r337585, head/lib/libc/gen/timespec_get.3 projects/clang700-import/lib/libc/gen/timespec_get.c - copied unchanged from r337585, head/lib/libc/gen/timespec_get.c projects/clang700-import/sbin/savecore/minfree - copied unchanged from r337585, head/sbin/savecore/minfree projects/clang700-import/share/vt/keymaps/us.macbook.kbd - copied unchanged from r337585, head/share/vt/keymaps/us.macbook.kbd projects/clang700-import/tools/build/options/WITH_LLVM_TARGET_BPF - copied unchanged from r337585, head/tools/build/options/WITH_LLVM_TARGET_BPF projects/clang700-import/usr.sbin/autofs/auto_master - copied unchanged from r337585, head/usr.sbin/autofs/auto_master projects/clang700-import/usr.sbin/autofs/autofs/ - copied from r337585, head/usr.sbin/autofs/autofs/ projects/clang700-import/usr.sbin/freebsd-update/freebsd-update.conf - copied unchanged from r337585, head/usr.sbin/freebsd-update/freebsd-update.conf projects/clang700-import/usr.sbin/nfsd/pnfsserver.4 - copied unchanged from r337585, head/usr.sbin/nfsd/pnfsserver.4 projects/clang700-import/usr.sbin/portsnap/portsnap/portsnap.conf - copied unchanged from r337585, head/usr.sbin/portsnap/portsnap/portsnap.conf Deleted: projects/clang700-import/contrib/file/python/README projects/clang700-import/etc/auto_master projects/clang700-import/etc/autofs/ projects/clang700-import/etc/freebsd-update.conf projects/clang700-import/etc/minfree projects/clang700-import/etc/portsnap.conf Modified: projects/clang700-import/Makefile.inc1 projects/clang700-import/UPDATING projects/clang700-import/bin/date/date.1 projects/clang700-import/bin/date/date.c projects/clang700-import/bin/date/tests/format_string_test.sh projects/clang700-import/bin/dd/args.c projects/clang700-import/bin/dd/dd.1 projects/clang700-import/bin/dd/dd.c projects/clang700-import/bin/dd/dd.h projects/clang700-import/bin/dd/extern.h projects/clang700-import/bin/dd/misc.c projects/clang700-import/bin/ls/ls.1 projects/clang700-import/bin/ls/ls.c projects/clang700-import/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c projects/clang700-import/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h projects/clang700-import/contrib/elftoolchain/readelf/readelf.c projects/clang700-import/contrib/file/ChangeLog projects/clang700-import/contrib/file/Makefile.in projects/clang700-import/contrib/file/README projects/clang700-import/contrib/file/aclocal.m4 projects/clang700-import/contrib/file/compile projects/clang700-import/contrib/file/config.guess projects/clang700-import/contrib/file/config.h.in projects/clang700-import/contrib/file/config.sub projects/clang700-import/contrib/file/configure projects/clang700-import/contrib/file/configure.ac projects/clang700-import/contrib/file/depcomp projects/clang700-import/contrib/file/doc/Makefile.in projects/clang700-import/contrib/file/doc/file.man projects/clang700-import/contrib/file/doc/magic.man projects/clang700-import/contrib/file/install-sh projects/clang700-import/contrib/file/ltmain.sh projects/clang700-import/contrib/file/magic/Magdir/animation projects/clang700-import/contrib/file/magic/Magdir/archive projects/clang700-import/contrib/file/magic/Magdir/audio projects/clang700-import/contrib/file/magic/Magdir/cad projects/clang700-import/contrib/file/magic/Magdir/console projects/clang700-import/contrib/file/magic/Magdir/database projects/clang700-import/contrib/file/magic/Magdir/dbpf projects/clang700-import/contrib/file/magic/Magdir/dump projects/clang700-import/contrib/file/magic/Magdir/elf projects/clang700-import/contrib/file/magic/Magdir/fsav projects/clang700-import/contrib/file/magic/Magdir/images projects/clang700-import/contrib/file/magic/Magdir/linux projects/clang700-import/contrib/file/magic/Magdir/make projects/clang700-import/contrib/file/magic/Magdir/measure projects/clang700-import/contrib/file/magic/Magdir/msdos projects/clang700-import/contrib/file/magic/Magdir/msooxml projects/clang700-import/contrib/file/magic/Magdir/pdf projects/clang700-import/contrib/file/magic/Magdir/sgi projects/clang700-import/contrib/file/magic/Makefile.am projects/clang700-import/contrib/file/magic/Makefile.in projects/clang700-import/contrib/file/missing projects/clang700-import/contrib/file/python/Makefile.am projects/clang700-import/contrib/file/python/Makefile.in projects/clang700-import/contrib/file/python/magic.py projects/clang700-import/contrib/file/python/setup.py projects/clang700-import/contrib/file/src/Makefile.in projects/clang700-import/contrib/file/src/apprentice.c projects/clang700-import/contrib/file/src/compress.c projects/clang700-import/contrib/file/src/der.c projects/clang700-import/contrib/file/src/file.h projects/clang700-import/contrib/file/src/funcs.c projects/clang700-import/contrib/file/src/readcdf.c projects/clang700-import/contrib/file/src/readelf.c projects/clang700-import/contrib/file/src/readelf.h projects/clang700-import/contrib/file/src/seccomp.c projects/clang700-import/contrib/file/src/softmagic.c projects/clang700-import/contrib/file/tests/Makefile.am projects/clang700-import/contrib/file/tests/Makefile.in projects/clang700-import/contrib/flex/main.c projects/clang700-import/contrib/mdocml/apropos.1 projects/clang700-import/contrib/mdocml/main.c projects/clang700-import/contrib/mdocml/man.1 projects/clang700-import/contrib/mdocml/mandoc.1 projects/clang700-import/contrib/netbsd-tests/lib/libpthread/t_mutex.c projects/clang700-import/contrib/tnftp/src/ftp_var.h projects/clang700-import/etc/Makefile projects/clang700-import/etc/mtree/BSD.var.dist projects/clang700-import/etc/root/dot.cshrc projects/clang700-import/etc/root/dot.profile projects/clang700-import/include/time.h projects/clang700-import/lib/clang/include/llvm/Config/AsmParsers.def projects/clang700-import/lib/clang/include/llvm/Config/AsmPrinters.def projects/clang700-import/lib/clang/include/llvm/Config/Disassemblers.def projects/clang700-import/lib/clang/include/llvm/Config/Targets.def projects/clang700-import/lib/clang/libllvm/Makefile projects/clang700-import/lib/clang/llvm.build.mk projects/clang700-import/lib/libc/gen/Makefile.inc projects/clang700-import/lib/libc/gen/Symbol.map projects/clang700-import/lib/libc/gen/ftok.c projects/clang700-import/lib/libc/inet/inet_addr.c projects/clang700-import/lib/libc/sys/gettimeofday.2 projects/clang700-import/lib/libgcc_eh/Makefile.inc projects/clang700-import/lib/libnv/Makefile projects/clang700-import/release/Makefile.ec2 projects/clang700-import/release/tools/arm.subr projects/clang700-import/release/tools/gce.conf projects/clang700-import/sbin/dhclient/dhclient.8 projects/clang700-import/sbin/dhclient/dhclient.c projects/clang700-import/sbin/ifconfig/ifconfig.c projects/clang700-import/sbin/init/init.8 projects/clang700-import/sbin/init/init.c projects/clang700-import/sbin/init/rc.d/dhclient projects/clang700-import/sbin/ipfw/ipfw.8 projects/clang700-import/sbin/ipfw/ipfw2.c projects/clang700-import/sbin/ldconfig/ldconfig.c projects/clang700-import/sbin/mount/mount.8 projects/clang700-import/sbin/mount/mount.c projects/clang700-import/sbin/savecore/Makefile projects/clang700-import/share/man/man4/cxgbe.4 projects/clang700-import/share/man/man4/ddb.4 projects/clang700-import/share/man/man4/pf.4 projects/clang700-import/share/man/man4/tcp.4 projects/clang700-import/share/man/man4/uep.4 projects/clang700-import/share/man/man5/src.conf.5 projects/clang700-import/share/man/man7/arch.7 projects/clang700-import/share/man/man8/rc.subr.8 projects/clang700-import/share/man/man9/VOP_LOOKUP.9 projects/clang700-import/share/mk/bsd.dirs.mk projects/clang700-import/share/mk/bsd.own.mk projects/clang700-import/share/mk/src.opts.mk projects/clang700-import/share/skel/dot.cshrc projects/clang700-import/share/skel/dot.mailrc projects/clang700-import/share/skel/dot.profile projects/clang700-import/share/vt/keymaps/INDEX.keymaps projects/clang700-import/share/vt/keymaps/Makefile projects/clang700-import/stand/i386/gptboot/gptboot.c projects/clang700-import/stand/i386/isoboot/isoboot.c projects/clang700-import/stand/i386/libi386/biosdisk.c projects/clang700-import/stand/i386/libi386/pxe.h projects/clang700-import/stand/i386/zfsboot/zfsboot.c projects/clang700-import/stand/libsa/dosfs.c projects/clang700-import/stand/libsa/gets.c projects/clang700-import/stand/libsa/gzipfs.c projects/clang700-import/stand/man/loader.8 projects/clang700-import/sys/amd64/amd64/efirt_machdep.c (contents, props changed) projects/clang700-import/sys/amd64/linux/linux_machdep.c projects/clang700-import/sys/amd64/linux/linux_support.s projects/clang700-import/sys/amd64/linux32/linux32_machdep.c projects/clang700-import/sys/amd64/linux32/linux32_support.s projects/clang700-import/sys/arm/allwinner/aw_sid.c projects/clang700-import/sys/arm/allwinner/aw_sid.h projects/clang700-import/sys/arm/allwinner/aw_thermal.c projects/clang700-import/sys/arm/allwinner/clkng/ccu_a64.c projects/clang700-import/sys/arm/allwinner/files.allwinner projects/clang700-import/sys/arm/allwinner/if_awg.c projects/clang700-import/sys/arm/allwinner/if_emac.c projects/clang700-import/sys/arm/arm/pmap-v6.c projects/clang700-import/sys/arm/conf/NOTES projects/clang700-import/sys/arm/include/atomic-v4.h projects/clang700-import/sys/arm/include/pmap-v6.h projects/clang700-import/sys/arm64/arm64/efirt_machdep.c projects/clang700-import/sys/cam/cam_ccb.h projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h projects/clang700-import/sys/compat/cloudabi/cloudabi_sock.c projects/clang700-import/sys/compat/freebsd32/freebsd32_misc.c projects/clang700-import/sys/compat/linux/linux_socket.c projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic-long.h projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic.h projects/clang700-import/sys/compat/linuxkpi/common/include/asm/atomic64.h projects/clang700-import/sys/compat/linuxkpi/common/include/linux/bitops.h projects/clang700-import/sys/compat/linuxkpi/common/include/linux/sched.h projects/clang700-import/sys/compat/linuxkpi/common/include/linux/types.h projects/clang700-import/sys/compat/linuxkpi/common/include/linux/workqueue.h projects/clang700-import/sys/compat/linuxkpi/common/src/linux_work.c projects/clang700-import/sys/conf/NOTES projects/clang700-import/sys/conf/newvers.sh projects/clang700-import/sys/conf/options projects/clang700-import/sys/contrib/ck/include/gcc/ppc/ck_pr.h projects/clang700-import/sys/contrib/ck/include/spinlock/hclh.h projects/clang700-import/sys/contrib/ck/src/ck_barrier_combining.c projects/clang700-import/sys/contrib/ipfilter/netinet/ip_compat.h projects/clang700-import/sys/contrib/ipfilter/netinet/ip_nat.c projects/clang700-import/sys/ddb/db_ps.c projects/clang700-import/sys/dev/ath/if_ath_rx_edma.c projects/clang700-import/sys/dev/bwi/if_bwi.c projects/clang700-import/sys/dev/cxgbe/adapter.h projects/clang700-import/sys/dev/cxgbe/common/common.h projects/clang700-import/sys/dev/cxgbe/common/t4_hw.c projects/clang700-import/sys/dev/cxgbe/offload.h projects/clang700-import/sys/dev/cxgbe/t4_filter.c projects/clang700-import/sys/dev/cxgbe/t4_main.c projects/clang700-import/sys/dev/cxgbe/t4_netmap.c projects/clang700-import/sys/dev/cxgbe/t4_sched.c projects/clang700-import/sys/dev/cxgbe/t4_sge.c projects/clang700-import/sys/dev/cxgbe/tom/t4_cpl_io.c projects/clang700-import/sys/dev/cxgbe/tom/t4_tom.c projects/clang700-import/sys/dev/efidev/efirt.c (contents, props changed) projects/clang700-import/sys/dev/extres/clk/clk_div.c projects/clang700-import/sys/dev/hyperv/pcib/vmbus_pcib.c projects/clang700-import/sys/dev/mii/icsphy.c projects/clang700-import/sys/dev/mii/miidevs projects/clang700-import/sys/dev/usb/input/uep.c projects/clang700-import/sys/dev/usb/input/wmt.c projects/clang700-import/sys/dev/usb/net/if_muge.c projects/clang700-import/sys/dev/vt/hw/vga/vt_vga.c projects/clang700-import/sys/fs/ext2fs/ext2_dir.h projects/clang700-import/sys/fs/ext2fs/ext2_htree.c projects/clang700-import/sys/fs/ext2fs/ext2_lookup.c projects/clang700-import/sys/fs/ext2fs/ext2_vnops.c projects/clang700-import/sys/fs/fuse/fuse_file.c projects/clang700-import/sys/fs/fuse/fuse_vfsops.c projects/clang700-import/sys/fs/fuse/fuse_vnops.c projects/clang700-import/sys/fs/msdosfs/msdosfs_fat.c projects/clang700-import/sys/fs/nfs/nfs_commonkrpc.c projects/clang700-import/sys/fs/nfsserver/nfs_nfsdport.c projects/clang700-import/sys/fs/nfsserver/nfs_nfsdstate.c projects/clang700-import/sys/i386/include/atomic.h projects/clang700-import/sys/kern/kern_sig.c projects/clang700-import/sys/kern/link_elf_obj.c projects/clang700-import/sys/kern/subr_epoch.c projects/clang700-import/sys/kern/subr_gtaskqueue.c projects/clang700-import/sys/kern/subr_msgbuf.c projects/clang700-import/sys/kern/subr_prf.c projects/clang700-import/sys/kern/sys_process.c projects/clang700-import/sys/kern/uipc_sockbuf.c projects/clang700-import/sys/kern/uipc_syscalls.c projects/clang700-import/sys/kern/uipc_usrreq.c projects/clang700-import/sys/modules/usb/uep/Makefile projects/clang700-import/sys/net/pfvar.h projects/clang700-import/sys/net80211/ieee80211_node.c projects/clang700-import/sys/netinet/in_mcast.c projects/clang700-import/sys/netinet/tcp_hpts.c projects/clang700-import/sys/netinet/tcp_reass.c projects/clang700-import/sys/netinet/tcp_stacks/rack.c projects/clang700-import/sys/netinet6/in6_mcast.c projects/clang700-import/sys/netpfil/ipfw/pmod/tcpmod.c projects/clang700-import/sys/powerpc/powernv/opal_dev.c projects/clang700-import/sys/powerpc/powerpc/db_disasm.c projects/clang700-import/sys/riscv/include/atomic.h projects/clang700-import/sys/riscv/include/vmparam.h projects/clang700-import/sys/riscv/riscv/uma_machdep.c projects/clang700-import/sys/sys/cdefs.h projects/clang700-import/sys/sys/efi.h projects/clang700-import/sys/sys/mbuf.h projects/clang700-import/sys/sys/msgbuf.h projects/clang700-import/sys/sys/param.h projects/clang700-import/sys/sys/proc.h projects/clang700-import/sys/sys/sockbuf.h projects/clang700-import/sys/sys/stdatomic.h projects/clang700-import/sys/ufs/ffs/ffs_alloc.c projects/clang700-import/sys/ufs/ffs/ffs_balloc.c projects/clang700-import/sys/ufs/ffs/ffs_extern.h projects/clang700-import/sys/ufs/ffs/ffs_inode.c projects/clang700-import/sys/ufs/ffs/ffs_snapshot.c projects/clang700-import/sys/ufs/ffs/ffs_softdep.c projects/clang700-import/sys/ufs/ffs/ffs_vfsops.c projects/clang700-import/sys/ufs/ffs/softdep.h projects/clang700-import/sys/ufs/ufs/ufsmount.h projects/clang700-import/sys/vm/swap_pager.c projects/clang700-import/sys/vm/vm_fault.c projects/clang700-import/sys/vm/vm_pageout.c projects/clang700-import/sys/vm/vm_swapout.c projects/clang700-import/tests/sys/kern/unix_passfd_test.c projects/clang700-import/tools/tools/git/git-svn-init projects/clang700-import/tools/tools/nanobsd/pcengines/Files/root/.cshrc projects/clang700-import/tools/tools/nanobsd/rescue/Files/root/.cshrc projects/clang700-import/tools/tools/sysbuild/sysbuild.sh projects/clang700-import/usr.bin/apply/apply.c projects/clang700-import/usr.bin/kdump/kdump.c projects/clang700-import/usr.bin/mail/cmd1.c projects/clang700-import/usr.bin/mail/mail.1 projects/clang700-import/usr.bin/mail/pathnames.h projects/clang700-import/usr.bin/man/man.1 projects/clang700-import/usr.bin/man/man.sh projects/clang700-import/usr.bin/msgs/msgs.1 projects/clang700-import/usr.bin/msgs/pathnames.h projects/clang700-import/usr.bin/printf/printf.c projects/clang700-import/usr.bin/sed/compile.c projects/clang700-import/usr.bin/top/machine.c projects/clang700-import/usr.sbin/autofs/Makefile projects/clang700-import/usr.sbin/cxgbetool/cxgbetool.8 projects/clang700-import/usr.sbin/cxgbetool/cxgbetool.c projects/clang700-import/usr.sbin/freebsd-update/Makefile projects/clang700-import/usr.sbin/freebsd-update/freebsd-update.sh projects/clang700-import/usr.sbin/mergemaster/mergemaster.8 projects/clang700-import/usr.sbin/mergemaster/mergemaster.sh projects/clang700-import/usr.sbin/newsyslog/Makefile projects/clang700-import/usr.sbin/newsyslog/newsyslog.c projects/clang700-import/usr.sbin/nfsd/Makefile projects/clang700-import/usr.sbin/nfsd/nfsd.8 projects/clang700-import/usr.sbin/nfsd/pnfs.4 projects/clang700-import/usr.sbin/pnfsdscopymr/pnfsdscopymr.c projects/clang700-import/usr.sbin/portsnap/portsnap/Makefile projects/clang700-import/usr.sbin/route6d/route6d.c projects/clang700-import/usr.sbin/tzsetup/tzsetup.c Directory Properties: projects/clang700-import/ (props changed) projects/clang700-import/cddl/ (props changed) projects/clang700-import/cddl/contrib/opensolaris/ (props changed) projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/ (props changed) projects/clang700-import/contrib/elftoolchain/ (props changed) projects/clang700-import/contrib/file/ (props changed) projects/clang700-import/contrib/mdocml/ (props changed) projects/clang700-import/contrib/netbsd-tests/ (props changed) projects/clang700-import/contrib/tnftp/ (props changed) projects/clang700-import/sys/cddl/contrib/opensolaris/ (props changed) projects/clang700-import/sys/contrib/ck/ (props changed) projects/clang700-import/sys/contrib/ipfilter/ (props changed) Modified: projects/clang700-import/Makefile.inc1 ============================================================================== --- projects/clang700-import/Makefile.inc1 Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/Makefile.inc1 Fri Aug 10 21:02:28 2018 (r337590) @@ -830,6 +830,13 @@ IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh .else IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} .endif + +# When generating install media, do not allow user and group information from +# the build host to affect the contents of the distribution. +.if make(distributeworld) +DB_FROM_SRC= yes +.endif + .if defined(DB_FROM_SRC) INSTALLFLAGS+= -N ${.CURDIR}/etc MTREEFLAGS+= -N ${.CURDIR}/etc @@ -1936,13 +1943,17 @@ update: .PHONY _elftoolchain_libs= lib/libelf lib/libdwarf .endif +# libnv and libl are both requirements for config(8), which is an unconditional +# bootstrap-tool. +_config_deps= lib/libnv usr.bin/lex/lib + legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false .endif -.for _tool in tools/build ${_elftoolchain_libs} lib/libnv +.for _tool in tools/build ${_elftoolchain_libs} ${_config_deps} ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ Modified: projects/clang700-import/UPDATING ============================================================================== --- projects/clang700-import/UPDATING Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/UPDATING Fri Aug 10 21:02:28 2018 (r337590) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180808: + The default pager for most commands has been changed to "less". To + restore the old behavior, set PAGER="more" and MANPAGER="more -s" in + your environment. + 20180731: The jedec_ts(4) driver has been removed. A superset of its functionality is available in the jedec_dimm(4) driver, and the manpage for that Modified: projects/clang700-import/bin/date/date.1 ============================================================================== --- projects/clang700-import/bin/date/date.1 Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/date/date.1 Fri Aug 10 21:02:28 2018 (r337590) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 1, 2018 +.Dd August 4, 2018 .Dt DATE 1 .Os .Sh NAME @@ -64,6 +64,13 @@ .Nm .Op Fl d Ar dst .Op Fl t Ar minutes_west +.Nm +.Op Fl jnu +.Op Fl I Ns Op Ar FMT +.Op Fl f Ar input_fmt +.Op Fl r Ar ... +.Op Fl v Ar ... +.Op Ar new_date .Sh DESCRIPTION When invoked without arguments, the .Nm @@ -113,6 +120,33 @@ provided rather than using the default format. Parsing is done using .Xr strptime 3 . +.It Fl I Ns Op Ar FMT +Use +.St -iso8601 +output format. +.Ar FMT +may be omitted, in which case the default is +.Sq date . +Valid +.Ar FMT +values are +.Sq date , +.Sq hours , +.Sq minutes , +and +.Sq seconds . +The date and time is formatted to the specified precision. +When +.Ar FMT +is +.Sq hours +(or the more precise +.Sq minutes +or +.Sq seconds ) , +the +.St -iso8601 +format includes the timezone. .It Fl j Do not try to set the date. This allows you to use the @@ -401,6 +435,14 @@ sets the time to .Li "2:32 PM" , without modifying the date. .Pp +The command +.Pp +.Dl "TZ=America/Los_Angeles date -Iseconds -r 1533415339" +.Pp +will display +.Pp +.Dl "2018-08-04T13:42:19-07:00" +.Pp Finally the command: .Pp .Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`date`"" ""+%s""" @@ -425,6 +467,19 @@ between and .Xr timed 8 fails. +.Pp +It is invalid to combine the +.Fl I +flag with either +.Fl R +or an output format +.Dq ( + Ns ... ) +operand. +If this occurs, +.Nm +prints: +.Ql multiple output formats specified +and exits with an error status. .Sh SEE ALSO .Xr locale 1 , .Xr gettimeofday 2 , @@ -443,12 +498,22 @@ The utility is expected to be compatible with .St -p1003.2 . The -.Fl d , f , j , n , r , t , +.Fl d , f , I , j , n , r , t , and .Fl v options are all extensions to the standard. +.Pp +The format selected by the +.Fl I +flag is compatible with +.St -iso8601 . .Sh HISTORY A .Nm command appeared in .At v1 . +.Pp +The +.Fl I +flag was added in +.Fx 12.0 . Modified: projects/clang700-import/bin/date/date.c ============================================================================== --- projects/clang700-import/bin/date/date.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/date/date.c Fri Aug 10 21:02:28 2018 (r337590) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -68,10 +69,25 @@ __FBSDID("$FreeBSD$"); static time_t tval; int retval; -static void setthetime(const char *, const char *, int, int); static void badformat(void); +static void iso8601_usage(const char *); +static void multipleformats(void); +static void printdate(const char *); +static void printisodate(struct tm *); +static void setthetime(const char *, const char *, int, int); static void usage(void); +static const struct iso8601_fmt { + const char *refname; + const char *format_string; +} iso8601_fmts[] = { + { "date", "%Y-%m-%d" }, + { "hours", "T%H" }, + { "minutes", ":%M" }, + { "seconds", ":%S" }, +}; +static const struct iso8601_fmt *iso8601_selected; + static const char *rfc2822_format = "%a, %d %b %Y %T %z"; int @@ -79,7 +95,7 @@ main(int argc, char *argv[]) { struct timezone tz; int ch, rflag; - int jflag, nflag, Rflag; + bool Iflag, jflag, nflag, Rflag; const char *format; char buf[1024]; char *endptr, *fmt; @@ -89,15 +105,16 @@ main(int argc, char *argv[]) const struct vary *badv; struct tm *lt; struct stat sb; + size_t i; v = NULL; fmt = NULL; (void) setlocale(LC_TIME, ""); tz.tz_dsttime = tz.tz_minuteswest = 0; rflag = 0; - jflag = nflag = Rflag = 0; + Iflag = jflag = nflag = Rflag = 0; set_timezone = 0; - while ((ch = getopt(argc, argv, "d:f:jnRr:t:uv:")) != -1) + while ((ch = getopt(argc, argv, "d:f:I::jnRr:t:uv:")) != -1) switch((char)ch) { case 'd': /* daylight savings time */ tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0; @@ -108,6 +125,22 @@ main(int argc, char *argv[]) case 'f': fmt = optarg; break; + case 'I': + if (Rflag) + multipleformats(); + Iflag = 1; + if (optarg == NULL) { + iso8601_selected = iso8601_fmts; + break; + } + for (i = 0; i < nitems(iso8601_fmts); i++) + if (strcmp(optarg, iso8601_fmts[i].refname) == 0) + break; + if (i == nitems(iso8601_fmts)) + iso8601_usage(optarg); + + iso8601_selected = &iso8601_fmts[i]; + break; case 'j': jflag = 1; /* don't set time */ break; @@ -115,6 +148,8 @@ main(int argc, char *argv[]) nflag = 1; break; case 'R': /* RFC 2822 datetime format */ + if (Iflag) + multipleformats(); Rflag = 1; break; case 'r': /* user specified seconds */ @@ -163,6 +198,8 @@ main(int argc, char *argv[]) /* allow the operands in any order */ if (*argv && **argv == '+') { + if (Iflag) + multipleformats(); format = *argv + 1; ++argv; } @@ -173,8 +210,11 @@ main(int argc, char *argv[]) } else if (fmt != NULL) usage(); - if (*argv && **argv == '+') + if (*argv && **argv == '+') { + if (Iflag) + multipleformats(); format = *argv + 1; + } lt = localtime(&tval); if (lt == NULL) @@ -188,6 +228,9 @@ main(int argc, char *argv[]) } vary_destroy(v); + if (Iflag) + printisodate(lt); + if (format == rfc2822_format) /* * When using RFC 2822 datetime format, don't honor the @@ -196,12 +239,40 @@ main(int argc, char *argv[]) setlocale(LC_TIME, "C"); (void)strftime(buf, sizeof(buf), format, lt); + printdate(buf); +} + +static void +printdate(const char *buf) +{ (void)printf("%s\n", buf); if (fflush(stdout)) err(1, "stdout"); exit(retval); } +static void +printisodate(struct tm *lt) +{ + const struct iso8601_fmt *it; + char fmtbuf[32], buf[32], tzbuf[8]; + + fmtbuf[0] = 0; + for (it = iso8601_fmts; it <= iso8601_selected; it++) + strlcat(fmtbuf, it->format_string, sizeof(fmtbuf)); + + (void)strftime(buf, sizeof(buf), fmtbuf, lt); + + if (iso8601_selected > iso8601_fmts) { + (void)strftime(tzbuf, sizeof(tzbuf), "%z", lt); + memmove(&tzbuf[4], &tzbuf[3], 3); + tzbuf[3] = ':'; + strlcat(buf, tzbuf, sizeof(buf)); + } + + printdate(buf); +} + #define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0')) static void @@ -327,12 +398,27 @@ badformat(void) } static void +iso8601_usage(const char *badarg) +{ + errx(1, "invalid argument '%s' for -I", badarg); +} + +static void +multipleformats(void) +{ + errx(1, "multiple output formats specified"); +} + +static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", - "usage: date [-jnRu] [-d dst] [-r seconds] [-t west] " - "[-v[+|-]val[ymwdHMS]] ... ", + (void)fprintf(stderr, "%s\n%s\n%s\n", + "usage: date [-jnRu] [-d dst] [-r seconds|file] [-t west] " + "[-v[+|-]val[ymwdHMS]]", " " - "[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]"); + "[-I[date | hours | minutes | seconds]]", + " " + "[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]" + ); exit(1); } Modified: projects/clang700-import/bin/date/tests/format_string_test.sh ============================================================================== --- projects/clang700-import/bin/date/tests/format_string_test.sh Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/date/tests/format_string_test.sh Fri Aug 10 21:02:28 2018 (r337590) @@ -48,6 +48,55 @@ ${desc}_test_body() { atf_add_test_case ${desc}_test } +iso8601_check() +{ + local arg flags exp_output_1 exp_output_2 + + arg="${1}" + flags="${2}" + exp_output_1="${3}" + exp_output_2="${4}" + + atf_check -o "inline:${exp_output_1}\n" \ + date $flags -r ${TEST1} "-I${arg}" + atf_check -o "inline:${exp_output_2}\n" \ + date $flags -r ${TEST2} "-I${arg}" +} + +iso8601_string_test() +{ + local desc arg exp_output_1 exp_output_2 flags + + desc="${1}" + arg="${2}" + flags="${3}" + exp_output_1="${4}" + exp_output_2="${5}" + + atf_test_case iso8601_${desc}_test + eval " +iso8601_${desc}_test_body() { + iso8601_check '${arg}' '${flags}' '${exp_output_1}' '${exp_output_2}' +}" + atf_add_test_case iso8601_${desc}_test + + if [ -z "$flags" ]; then + atf_test_case iso8601_${desc}_parity + eval " +iso8601_${desc}_parity_body() { + local exp1 exp2 + + atf_require_prog gdate + + exp1=\"\$(gdate --date '@${TEST1}' '-I${arg}')\" + exp2=\"\$(gdate --date '@${TEST2}' '-I${arg}')\" + + iso8601_check '${arg}' '' \"\${exp1}\" \"\${exp2}\" +}" + atf_add_test_case iso8601_${desc}_parity + fi +} + atf_init_test_cases() { format_string_test A A Saturday Monday @@ -89,4 +138,12 @@ atf_init_test_cases() format_string_test z z +0000 +0000 format_string_test percent % % % format_string_test plus + "Sat Feb 7 07:04:03 UTC 1970" "Mon Nov 12 21:20:00 UTC 2001" + + iso8601_string_test default "" "" "1970-02-07" "2001-11-12" + iso8601_string_test date date "" "1970-02-07" "2001-11-12" + iso8601_string_test hours hours "" "1970-02-07T07+00:00" "2001-11-12T21+00:00" + iso8601_string_test minutes minutes "" "1970-02-07T07:04+00:00" "2001-11-12T21:20+00:00" + iso8601_string_test seconds seconds "" "1970-02-07T07:04:03+00:00" "2001-11-12T21:20:00+00:00" + # BSD date(1) does not support fractional seconds at this time. + #iso8601_string_test ns ns "" "1970-02-07T07:04:03,000000000+00:00" "2001-11-12T21:20:00,000000000+00:00" } Modified: projects/clang700-import/bin/dd/args.c ============================================================================== --- projects/clang700-import/bin/dd/args.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/dd/args.c Fri Aug 10 21:02:28 2018 (r337590) @@ -306,6 +306,8 @@ f_status(char *arg) ddflags |= C_NOINFO; else if (strcmp(arg, "noxfer") == 0) ddflags |= C_NOXFER; + else if (strcmp(arg, "progress") == 0) + ddflags |= C_PROGRESS; else errx(1, "unknown status %s", arg); } Modified: projects/clang700-import/bin/dd/dd.1 ============================================================================== --- projects/clang700-import/bin/dd/dd.1 Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/dd/dd.1 Fri Aug 10 21:02:28 2018 (r337590) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd April 2, 2017 +.Dd August 8, 2018 .Dt DD 1 .Os .Sh NAME @@ -164,12 +164,14 @@ bytes per second. Where .Cm value is one of the symbols from the following list. -.Bl -tag -width "noxfer" +.Bl -tag -width "progress" .It Cm noxfer Do not print the transfer statistics as the last line of status output. .It Cm none Do not print the status output. Error messages are shown; informational messages are not. +.It Cm progress +Print basic transfer statistics once per second. .El .It Cm conv Ns = Ns Ar value Ns Op , Ns Ar value ... Where Modified: projects/clang700-import/bin/dd/dd.c ============================================================================== --- projects/clang700-import/bin/dd/dd.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/dd/dd.c Fri Aug 10 21:02:28 2018 (r337590) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -89,6 +90,7 @@ const u_char *ctab; /* conversion table */ char fill_char; /* Character to fill with if defined */ size_t speed = 0; /* maximum speed, in bytes per second */ volatile sig_atomic_t need_summary; +volatile sig_atomic_t need_progress; int main(int argc __unused, char *argv[]) @@ -102,6 +104,7 @@ main(int argc __unused, char *argv[]) err(1, "unable to enter capability mode"); (void)signal(SIGINFO, siginfo_handler); + (void)signal(SIGALRM, sigalrm_handler); (void)signal(SIGINT, terminate); atexit(summary); @@ -281,6 +284,14 @@ setup(void) ctab = casetab; } + if ((ddflags & C_PROGRESS)) { + struct itimerval timer = { + .it_interval = { .tv_sec = 1, .tv_usec = 0 }, + .it_value = { .tv_sec = 1, .tv_usec = 0 }, + }; + setitimer(ITIMER_REAL, &timer, NULL); + } + if (clock_gettime(CLOCK_MONOTONIC, &st.start)) err(1, "clock_gettime"); } @@ -460,6 +471,9 @@ dd_in(void) (*cfunc)(); if (need_summary) { summary(); + } + if (need_progress) { + progress(); } } } Modified: projects/clang700-import/bin/dd/dd.h ============================================================================== --- projects/clang700-import/bin/dd/dd.h Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/dd/dd.h Fri Aug 10 21:02:28 2018 (r337590) @@ -100,5 +100,6 @@ typedef struct { #define C_STATUS 0x08000000 #define C_NOXFER 0x10000000 #define C_NOINFO 0x20000000 +#define C_PROGRESS 0x40000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: projects/clang700-import/bin/dd/extern.h ============================================================================== --- projects/clang700-import/bin/dd/extern.h Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/dd/extern.h Fri Aug 10 21:02:28 2018 (r337590) @@ -46,7 +46,9 @@ void pos_in(void); void pos_out(void); double secs_elapsed(void); void summary(void); +void progress(void); void siginfo_handler(int); +void sigalrm_handler(int); void terminate(int); void unblock(void); void unblock_close(void); @@ -66,3 +68,4 @@ extern const u_char a2ibm_32V[], a2ibm_POSIX[]; extern u_char casetab[]; extern char fill_char; extern volatile sig_atomic_t need_summary; +extern volatile sig_atomic_t need_progress; Modified: projects/clang700-import/bin/dd/misc.c ============================================================================== --- projects/clang700-import/bin/dd/misc.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/dd/misc.c Fri Aug 10 21:02:28 2018 (r337590) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include "dd.h" #include "extern.h" +static int need_newline; + double secs_elapsed(void) { @@ -83,6 +85,9 @@ summary(void) if (ddflags & C_NOINFO) return; + if (need_newline && !need_summary) + fprintf(stderr, "\n"); + secs = secs_elapsed(); (void)fprintf(stderr, @@ -102,12 +107,42 @@ summary(void) need_summary = 0; } +void +progress(void) +{ + double secs; + static int lastlen; + int len; + + secs = secs_elapsed(); + len = fprintf(stderr, + "\r%ju bytes transferred in %.0f secs (%.0f bytes/sec)", + st.bytes, secs, st.bytes / secs); + + if (len > 0) { + if (len < lastlen) + (void)fprintf(stderr, "%*s", len - lastlen, ""); + lastlen = len; + } + + need_newline = 1; + need_progress = 0; +} + /* ARGSUSED */ void siginfo_handler(int signo __unused) { need_summary = 1; +} + +/* ARGSUSED */ +void +sigalrm_handler(int signo __unused) +{ + + need_progress = 1; } /* ARGSUSED */ Modified: projects/clang700-import/bin/ls/ls.1 ============================================================================== --- projects/clang700-import/bin/ls/ls.1 Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/ls/ls.1 Fri Aug 10 21:02:28 2018 (r337590) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd January 17, 2018 +.Dd August 8, 2018 .Dt LS 1 .Os .Sh NAME @@ -132,6 +132,8 @@ after each that is a Enable colorized output. This option is equivalent to defining .Ev CLICOLOR +or +.Ev COLORTERM in the environment. (See below.) This functionality can be compiled out by removing the definition of @@ -628,6 +630,10 @@ The variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use. +.It Ev COLORTERM +See description for +.Ev CLICOLOR +above. .It Ev COLUMNS If this variable contains a string representing a decimal integer, it is used as the @@ -652,7 +658,9 @@ for more information. .It Ev LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with -.Ev CLICOLOR . +.Ev CLICOLOR +or +.Ev COLORTERM . This string is a concatenation of pairs of the format .Ar f Ns Ar b , where @@ -759,6 +767,8 @@ option for more details. .It Ev TERM The .Ev CLICOLOR +and +.Ev COLORTERM functionality depends on a terminal type with color capabilities. .It Ev TZ The timezone to use when displaying dates. Modified: projects/clang700-import/bin/ls/ls.c ============================================================================== --- projects/clang700-import/bin/ls/ls.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/bin/ls/ls.c Fri Aug 10 21:02:28 2018 (r337590) @@ -368,7 +368,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if (getenv("CLICOLOR") && + if ((getenv("CLICOLOR") || getenv("COLORTERM")) && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { Modified: projects/clang700-import/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- projects/clang700-import/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 10 21:02:28 2018 (r337590) @@ -343,13 +343,13 @@ static const dt_ident_t _dtrace_globals[] = { &dt_idops_func, "void(@)" }, { "mod", DT_IDENT_ACTFUNC, 0, DT_ACT_MOD, DT_ATTR_STABCMN, DT_VERS_1_2, &dt_idops_func, "_symaddr(uintptr_t)" }, +#ifdef illumos { "msgdsize", DT_IDENT_FUNC, 0, DIF_SUBR_MSGDSIZE, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "size_t(mblk_t *)" }, { "msgsize", DT_IDENT_FUNC, 0, DIF_SUBR_MSGSIZE, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "size_t(mblk_t *)" }, -#ifdef illumos { "mutex_owned", DT_IDENT_FUNC, 0, DIF_SUBR_MUTEX_OWNED, DT_ATTR_EVOLCMN, DT_VERS_1_0, &dt_idops_func, "int(genunix`kmutex_t *)" }, Modified: projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Aug 10 21:02:28 2018 (r337590) @@ -787,15 +787,13 @@ typedef struct mnttab_node { static int libzfs_mnttab_cache_compare(const void *arg1, const void *arg2) { - const mnttab_node_t *mtn1 = arg1; - const mnttab_node_t *mtn2 = arg2; + const mnttab_node_t *mtn1 = (const mnttab_node_t *)arg1; + const mnttab_node_t *mtn2 = (const mnttab_node_t *)arg2; int rv; rv = strcmp(mtn1->mtn_mt.mnt_special, mtn2->mtn_mt.mnt_special); - if (rv == 0) - return (0); - return (rv > 0 ? 1 : -1); + return (AVL_ISIGN(rv)); } void Modified: projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Aug 10 21:02:28 2018 (r337590) @@ -272,12 +272,7 @@ zfs_snapshot_compare(const void *larg, const void *rar lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG); rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG); - if (lcreate < rcreate) - return (-1); - else if (lcreate > rcreate) - return (+1); - else - return (0); + return (AVL_CMP(lcreate, rcreate)); } int Modified: projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Aug 10 21:02:28 2018 (r337590) @@ -489,15 +489,10 @@ typedef struct fsavl_node { static int fsavl_compare(const void *arg1, const void *arg2) { - const fsavl_node_t *fn1 = arg1; - const fsavl_node_t *fn2 = arg2; + const fsavl_node_t *fn1 = (const fsavl_node_t *)arg1; + const fsavl_node_t *fn2 = (const fsavl_node_t *)arg2; - if (fn1->fn_guid > fn2->fn_guid) - return (+1); - else if (fn1->fn_guid < fn2->fn_guid) - return (-1); - else - return (0); + return (AVL_CMP(fn1->fn_guid, fn2->fn_guid)); } /* Modified: projects/clang700-import/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- projects/clang700-import/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Aug 10 21:02:28 2018 (r337590) @@ -670,6 +670,9 @@ extern zoneid_t getzoneid(void); #define root_mount_wait() do { } while (0) #define root_mounted() (1) +#define noinline __attribute__((noinline)) +#define likely(x) __builtin_expect((x), 1) + struct file { void *dummy; }; Modified: projects/clang700-import/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- projects/clang700-import/contrib/elftoolchain/readelf/readelf.c Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/contrib/elftoolchain/readelf/readelf.c Fri Aug 10 21:02:28 2018 (r337590) @@ -1189,6 +1189,7 @@ note_type_gnu(unsigned int nt) case 2: return "NT_GNU_HWCAP (Hardware capabilities)"; case 3: return "NT_GNU_BUILD_ID (Build id set by ld(1))"; case 4: return "NT_GNU_GOLD_VERSION (GNU gold version)"; + case 5: return "NT_GNU_PROPERTY_TYPE_0"; default: return (note_type_unknown(nt)); } } Modified: projects/clang700-import/contrib/file/ChangeLog ============================================================================== --- projects/clang700-import/contrib/file/ChangeLog Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/contrib/file/ChangeLog Fri Aug 10 21:02:28 2018 (r337590) @@ -1,3 +1,15 @@ +2018-07-25 8:50 Christos Zoulas + + * release 5.34 + +2018-06-22 16:38 Christos Zoulas + + * Add Quad indirect offsets + +2018-05-24 14:10 Christos Zoulas + + * Enable parsing of ELF dynamic sections to handle PIE better + 2018-04-15 14:52 Christos Zoulas * release 5.33 Modified: projects/clang700-import/contrib/file/Makefile.in ============================================================================== --- projects/clang700-import/contrib/file/Makefile.in Fri Aug 10 20:37:32 2018 (r337589) +++ projects/clang700-import/contrib/file/Makefile.in Fri Aug 10 21:02:28 2018 (r337590) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,23 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ @@ -49,11 +87,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ - README TODO compile config.guess config.sub depcomp install-sh \ - missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -61,6 +94,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -124,6 +159,9 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ + COPYING ChangeLog INSTALL NEWS README TODO compile \ + config.guess config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -178,6 +216,7 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -193,6 +232,7 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -306,7 +346,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__c echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -327,8 +366,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -357,13 +396,12 @@ distclean-libtool: # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ @@ -538,10 +576,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -576,16 +620,17 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Fri Aug 10 21:03:19 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4282410750B4 for ; Fri, 10 Aug 2018 21:03:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF27D7B173; Fri, 10 Aug 2018 21:03:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD2A25A86; Fri, 10 Aug 2018 21:03:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AL3IjZ016678; Fri, 10 Aug 2018 21:03:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AL3Hnp016675; Fri, 10 Aug 2018 21:03:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808102103.w7AL3Hnp016675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 10 Aug 2018 21:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337591 - in projects/clang700-import/sys: dev/cx i386/include net80211 netinet X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang700-import/sys: dev/cx i386/include net80211 netinet X-SVN-Commit-Revision: 337591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 21:03:19 -0000 Author: dim Date: Fri Aug 10 21:03:17 2018 New Revision: 337591 URL: https://svnweb.freebsd.org/changeset/base/337591 Log: Merge ^/head r337586 through r337590. Modified: projects/clang700-import/sys/dev/cx/cxddk.c projects/clang700-import/sys/i386/include/cserial.h projects/clang700-import/sys/net80211/ieee80211_hwmp.c projects/clang700-import/sys/netinet/sctp_indata.c Directory Properties: projects/clang700-import/ (props changed) Modified: projects/clang700-import/sys/dev/cx/cxddk.c ============================================================================== --- projects/clang700-import/sys/dev/cx/cxddk.c Fri Aug 10 21:02:28 2018 (r337590) +++ projects/clang700-import/sys/dev/cx/cxddk.c Fri Aug 10 21:03:17 2018 (r337591) @@ -215,7 +215,7 @@ void cx_enable_receive (cx_chan_t *c, int on) } /* - * Turn the transmiter on/off. + * Turn the transmitter on/off. */ void cx_enable_transmit (cx_chan_t *c, int on) { Modified: projects/clang700-import/sys/i386/include/cserial.h ============================================================================== --- projects/clang700-import/sys/i386/include/cserial.h Fri Aug 10 21:02:28 2018 (r337590) +++ projects/clang700-import/sys/i386/include/cserial.h Fri Aug 10 21:03:17 2018 (r337591) @@ -89,7 +89,7 @@ struct e3_statistics { #define ER_SCC_FRAMING 7 /* subchannel framing error */ #define ER_SCC_OVERFLOW 8 /* subchannel receive buffer overflow */ #define ER_SCC_OVERRUN 9 /* subchannel receiver overrun */ -#define ER_SCC_UNDERRUN 10 /* subchannel transmiter underrun */ +#define ER_SCC_UNDERRUN 10 /* subchannel transmitter underrun */ #define ER_BUS 11 /* system bus is too busy (e.g PCI) */ /* Modified: projects/clang700-import/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/clang700-import/sys/net80211/ieee80211_hwmp.c Fri Aug 10 21:02:28 2018 (r337590) +++ projects/clang700-import/sys/net80211/ieee80211_hwmp.c Fri Aug 10 21:03:17 2018 (r337591) @@ -920,7 +920,7 @@ hwmp_update_transmitter(struct ieee80211vap *vap, stru rttran->rt_metric > metric) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "%s path to transmiter %6D of %s, metric %d:%d", + "%s path to transmitter %6D of %s, metric %d:%d", rttran->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ? "prefer" : "update", ni->ni_macaddr, ":", hwmp_frame, rttran->rt_metric, metric); Modified: projects/clang700-import/sys/netinet/sctp_indata.c ============================================================================== --- projects/clang700-import/sys/netinet/sctp_indata.c Fri Aug 10 21:02:28 2018 (r337590) +++ projects/clang700-import/sys/netinet/sctp_indata.c Fri Aug 10 21:03:17 2018 (r337591) @@ -3078,7 +3078,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru tp1->whoTo->net_ack += tp1->send_size; if (tp1->snd_count < 2) { /*- - * True non-retransmited chunk + * True non-retransmitted chunk */ tp1->whoTo->net_ack2 += tp1->send_size; @@ -4056,7 +4056,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 tp1->whoTo->net_ack += tp1->send_size; if (tp1->snd_count < 2) { /* - * True non-retransmited + * True non-retransmitted * chunk */ tp1->whoTo->net_ack2 += @@ -4676,7 +4676,7 @@ hopeless_peer: if (tp1->snd_count < 2) { /* - * True non-retransmited + * True non-retransmitted * chunk */ tp1->whoTo->net_ack2 += From owner-svn-src-projects@freebsd.org Fri Aug 10 21:23:58 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE7181075429 for ; Fri, 10 Aug 2018 21:23:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A44B67B8BF; Fri, 10 Aug 2018 21:23:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 860B45DBA; Fri, 10 Aug 2018 21:23:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ALNvEC027139; Fri, 10 Aug 2018 21:23:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ALNuKm027136; Fri, 10 Aug 2018 21:23:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808102123.w7ALNuKm027136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 21:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337592 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 21:23:58 -0000 Author: kevans Date: Fri Aug 10 21:23:56 2018 New Revision: 337592 URL: https://svnweb.freebsd.org/changeset/base/337592 Log: libbe(3): More error handling bits be_add_child functionality gets split out into separate places as a bonus. A lot of places here we'll gloss over libzfs errors, because they shouldn't be happening given the conditions that we're operating under. "Unknown error" is what I'm intending to use for the moment to indicate an exceptional circumstance- exceptional enough that we can't tell the consumer did because we're not so certain that they did anything. Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/be.h projects/bectl/lib/libbe/be_error.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Fri Aug 10 21:03:17 2018 (r337591) +++ projects/bectl/lib/libbe/be.c Fri Aug 10 21:23:56 2018 (r337592) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include "be.h" #include "be_impl.h" +static int be_create_child_noent(libbe_handle_t *lbh, const char *active, + const char *child_path); +static int be_create_child_cloned(libbe_handle_t *lbh, const char *active); + /* * Iterator function for locating the rootfs amongst the children of the * zfs_be_root set by loader(8). data is expected to be a libbe_handle_t *. @@ -721,17 +725,111 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in return (be_destroy(lbh, nbuf, 0)); } +static int +be_create_child_noent(libbe_handle_t *lbh, const char *active, + const char *child_path) +{ + nvlist_t *props; + zfs_handle_t *zfs; + int err; + nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); + nvlist_add_string(props, "canmount", "noauto"); + nvlist_add_string(props, "mountpoint", child_path); + + /* Create */ + if ((err = zfs_create(lbh->lzh, active, ZFS_TYPE_DATASET, + props)) != 0) { + switch (err) { + case EZFS_EXISTS: + return (set_error(lbh, BE_ERR_EXISTS)); + case EZFS_NOENT: + return (set_error(lbh, BE_ERR_NOENT)); + case EZFS_BADTYPE: + case EZFS_BADVERSION: + return (set_error(lbh, BE_ERR_NOPOOL)); + case EZFS_BADPROP: + default: + /* We set something up wrong, probably... */ + return (set_error(lbh, BE_ERR_UNKNOWN)); + } + } + nvlist_free(props); + + if ((zfs = zfs_open(lbh->lzh, active, ZFS_TYPE_DATASET)) == NULL) + return (set_error(lbh, BE_ERR_ZFSOPEN)); + + /* Set props */ + if ((err = zfs_prop_set(zfs, "canmount", "noauto")) != 0) { + zfs_close(zfs); + /* + * Similar to other cases, this shouldn't fail unless we've + * done something wrong. This is a new dataset that shouldn't + * have been mounted anywhere between creation and now. + */ + if (err == EZFS_NOMEM) + return (set_error(lbh, BE_ERR_NOMEM)); + return (set_error(lbh, BE_ERR_UNKNOWN)); + } + zfs_close(zfs); + return (BE_ERR_SUCCESS); +} + +static int +be_create_child_cloned(libbe_handle_t *lbh, const char *active) +{ + char buf[BE_MAXPATHLEN]; + zfs_handle_t *zfs; + int err; + + /* XXX TODO ? */ + + /* + * Establish if the existing path is a zfs dataset or just + * the subdirectory of one + */ + strlcpy(buf, "/tmp/be_snap.XXXXX", sizeof(buf)); + if (mktemp(buf) == NULL) + return (set_error(lbh, BE_ERR_UNKNOWN)); + + if ((err = zfs_snapshot(lbh->lzh, buf, false, NULL)) != 0) { + switch (err) { + case EZFS_INVALIDNAME: + return (set_error(lbh, BE_ERR_INVALIDNAME)); + + default: + /* + * The other errors that zfs_ioc_snapshot might return + * shouldn't happen if we've set things up properly, so + * we'll gloss over them and call it UNKNOWN as it will + * require further triage. + */ + if (errno == ENOTSUP) + return (set_error(lbh, BE_ERR_NOPOOL)); + return (set_error(lbh, BE_ERR_UNKNOWN)); + } + } + + /* Clone */ + if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_SNAPSHOT)) == NULL) + return (BE_ERR_ZFSOPEN); + + if ((err = zfs_clone(zfs, active, NULL)) != 0) + /* XXX TODO correct error */ + return (set_error(lbh, BE_ERR_UNKNOWN)); + + /* set props */ + zfs_close(zfs); + return (BE_ERR_SUCCESS); +} + int be_add_child(libbe_handle_t *lbh, const char *child_path, bool cp_if_exists) { struct stat sb; - char active[BE_MAXPATHLEN]; - char buf[BE_MAXPATHLEN]; + char active[BE_MAXPATHLEN], buf[BE_MAXPATHLEN]; nvlist_t *props; const char *s; - zfs_handle_t *zfs; - int err; /* Require absolute paths */ if (*child_path != '/') @@ -760,60 +858,12 @@ be_add_child(libbe_handle_t *lbh, const char *child_pa if (stat(child_path, &sb) != 0) { /* Verify that error is ENOENT */ if (errno != ENOENT) - return (set_error(lbh, BE_ERR_NOENT)); - - nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); - nvlist_add_string(props, "canmount", "noauto"); - nvlist_add_string(props, "mountpoint", child_path); - - /* Create */ - if ((err = - zfs_create(lbh->lzh, active, ZFS_TYPE_DATASET, props)) != 0) - /* XXX TODO handle error */ return (set_error(lbh, BE_ERR_UNKNOWN)); - nvlist_free(props); - - if ((zfs = - zfs_open(lbh->lzh, active, ZFS_TYPE_DATASET)) == NULL) - return (set_error(lbh, BE_ERR_ZFSOPEN)); - - /* Set props */ - if ((err = zfs_prop_set(zfs, "canmount", "noauto")) != 0) - /* TODO handle error */ - return (set_error(lbh, BE_ERR_UNKNOWN)); - } else if (cp_if_exists) { + return (be_create_child_noent(lbh, active, child_path)); + } else if (cp_if_exists) /* Path is already a descendent of / and should be copied */ - - /* XXX TODO ? */ - - /* - * Establish if the existing path is a zfs dataset or just - * the subdirectory of one - */ - strlcpy(buf, "/tmp/be_snap.XXXXX", sizeof(buf)); - if (mktemp(buf) == NULL) - return (set_error(lbh, BE_ERR_UNKNOWN)); - - if ((err = zfs_snapshot(lbh->lzh, buf, false, NULL)) != 0) - /* XXX TODO correct error */ - return (set_error(lbh, BE_ERR_UNKNOWN)); - - /* Clone */ - if ((zfs = - zfs_open(lbh->lzh, buf, ZFS_TYPE_SNAPSHOT)) == NULL) - return (BE_ERR_ZFSOPEN); - - if ((err = zfs_clone(zfs, active, NULL)) != 0) - /* XXX TODO correct error */ - return (set_error(lbh, BE_ERR_UNKNOWN)); - - /* set props */ - zfs_close(zfs); - } else - /* TODO: error code for exists, but not cp? */ - return (set_error(lbh, BE_ERR_EXISTS)); - - return (BE_ERR_SUCCESS); + return (be_create_child_cloned(lbh, active)); + return (set_error(lbh, BE_ERR_EXISTS)); } static int @@ -863,22 +913,24 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, if (temporary) { config = zpool_get_config(lbh->active_phandle, NULL); - if (config == NULL) { - printf("no config\n"); - return (1); - } + if (config == NULL) + /* config should be fetchable... */ + return (set_error(lbh, BE_ERR_UNKNOWN)); if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, &pool_guid) != 0) - return (1); + /* Similarly, it shouldn't be possible */ + return (set_error(lbh, BE_ERR_UNKNOWN)); /* Expected format according to zfsbootcfg(8) man */ strcpy(buf, "zfs:"); strcat(buf, be_path); strcat(buf, ":"); - if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &vdevs) != 0) - return (1); + /* We have no config tree */ + if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, + &vdevs) != 0) + return (set_error(lbh, BE_ERR_NOPOOL)); return (be_set_nextboot(lbh, vdevs, pool_guid, buf)); } else { Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Fri Aug 10 21:03:17 2018 (r337591) +++ projects/bectl/lib/libbe/be.h Fri Aug 10 21:23:56 2018 (r337592) @@ -57,6 +57,7 @@ typedef enum be_error { BE_ERR_ZFSCLONE, /* error when calling zfs_clone to create be */ BE_ERR_IO, /* error when doing some I/O operation */ BE_ERR_NOPOOL, /* operation not supported on this pool */ + BE_ERR_NOMEM, /* insufficient memory */ BE_ERR_UNKNOWN, /* unknown error */ } be_error_t; Modified: projects/bectl/lib/libbe/be_error.c ============================================================================== --- projects/bectl/lib/libbe/be_error.c Fri Aug 10 21:03:17 2018 (r337591) +++ projects/bectl/lib/libbe/be_error.c Fri Aug 10 21:23:56 2018 (r337592) @@ -99,6 +99,9 @@ libbe_error_description(libbe_handle_t *lbh) case BE_ERR_NOPOOL: return ("operation not supported on this pool"); + case BE_ERR_NOMEM: + return ("insufficient memory"); + case BE_ERR_UNKNOWN: return ("unknown error"); From owner-svn-src-projects@freebsd.org Fri Aug 10 21:40:29 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D0E51075C1B for ; Fri, 10 Aug 2018 21:40:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E47AB7C2DC; Fri, 10 Aug 2018 21:40:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C66F25F4E; Fri, 10 Aug 2018 21:40:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ALeSRA033202; Fri, 10 Aug 2018 21:40:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ALeSBY033201; Fri, 10 Aug 2018 21:40:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808102140.w7ALeSBY033201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 10 Aug 2018 21:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337593 - projects/clang700-import/contrib/libc++/include X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang700-import/contrib/libc++/include X-SVN-Commit-Revision: 337593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 21:40:29 -0000 Author: dim Date: Fri Aug 10 21:40:28 2018 New Revision: 337593 URL: https://svnweb.freebsd.org/changeset/base/337593 Log: Upstream libc++ added a using ::timespec_get line, when in C++17 or higher mode, in . Since we do not yet have this C11 function, comment out the line for now, as a workaround for a number of failing ports. Discussion with upstream is ongoing about an acceptable permanent fix. PR: 230400 Reported by: jbeich Modified: projects/clang700-import/contrib/libc++/include/ctime Modified: projects/clang700-import/contrib/libc++/include/ctime ============================================================================== --- projects/clang700-import/contrib/libc++/include/ctime Fri Aug 10 21:23:56 2018 (r337592) +++ projects/clang700-import/contrib/libc++/include/ctime Fri Aug 10 21:40:28 2018 (r337593) @@ -74,7 +74,7 @@ using ::localtime; #endif using ::strftime; #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES) -using ::timespec_get; +//using ::timespec_get; #endif _LIBCPP_END_NAMESPACE_STD From owner-svn-src-projects@freebsd.org Fri Aug 10 21:44:21 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C2D9107628A for ; Fri, 10 Aug 2018 21:44:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CBE17C96D; Fri, 10 Aug 2018 21:44:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B5881A1DD; Fri, 10 Aug 2018 21:44:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f49.google.com with SMTP id a4-v6so7560557lff.5; Fri, 10 Aug 2018 14:44:20 -0700 (PDT) X-Gm-Message-State: AOUpUlEKhzoGaKxf9Mp88DAmx7lb9lkXCs+ACu5yioG9oPcXS8hqntDS SPxVHocikKKJR/9ir90IqGHTzUbfBd8qe3xggUg= X-Google-Smtp-Source: AA+uWPwH0MUFIlH7uISmymN9jvEui7P49n7IY6oT86QHmcNGzsZZwITP+P5RJBI+Z/2eBYn88uD48qhUnJLKUhvKuk4= X-Received: by 2002:a19:1604:: with SMTP id m4-v6mr5310095lfi.120.1533937459101; Fri, 10 Aug 2018 14:44:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Fri, 10 Aug 2018 14:43:58 -0700 (PDT) In-Reply-To: <201808102140.w7ALeSBY033201@repo.freebsd.org> References: <201808102140.w7ALeSBY033201@repo.freebsd.org> From: Kyle Evans Date: Fri, 10 Aug 2018 16:43:58 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337593 - projects/clang700-import/contrib/libc++/include To: Dimitry Andric Cc: src-committers , svn-src-projects@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 21:44:21 -0000 On Fri, Aug 10, 2018 at 4:40 PM, Dimitry Andric wrote: > Author: dim > Date: Fri Aug 10 21:40:28 2018 > New Revision: 337593 > URL: https://svnweb.freebsd.org/changeset/base/337593 > > Log: > Upstream libc++ added a using ::timespec_get line, when in C++17 or > higher mode, in . Since we do not > yet have this C11 function, comment out the line for now, as a > workaround for a number of failing ports. Discussion with upstream is > ongoing about an acceptable permanent fix. > > PR: 230400 > Reported by: jbeich > Is the timespec_get that got added in r337576 just today not suitable for this? Thanks, Kyle Evans From owner-svn-src-projects@freebsd.org Fri Aug 10 21:44:53 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B9210762B2 for ; Fri, 10 Aug 2018 21:44:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 262757CA70 for ; Fri, 10 Aug 2018 21:44:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id BBC0FA1DE for ; Fri, 10 Aug 2018 21:44:52 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f51.google.com with SMTP id n96-v6so7561501lfi.1 for ; Fri, 10 Aug 2018 14:44:52 -0700 (PDT) X-Gm-Message-State: AOUpUlHVvUBCY6d/yGgeB+jwWXXrLSJPwVCDMt8L5Rg0GbmV5NcbLFeN 0o6I1+fsciKumbAqcU6iRzkyBB9jVTF3W0oHbeY= X-Received: by 2002:a19:2194:: with SMTP id h142-v6mt5893986lfh.75.1533937491567; Fri, 10 Aug 2018 14:44:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Fri, 10 Aug 2018 14:44:30 -0700 (PDT) In-Reply-To: References: <201808102140.w7ALeSBY033201@repo.freebsd.org> From: Kyle Evans Date: Fri, 10 Aug 2018 16:44:30 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337593 - projects/clang700-import/contrib/libc++/include Cc: Dimitry Andric , src-committers , svn-src-projects@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 21:44:53 -0000 On Fri, Aug 10, 2018 at 4:43 PM, Kyle Evans wrote: > On Fri, Aug 10, 2018 at 4:40 PM, Dimitry Andric wrote: >> Author: dim >> Date: Fri Aug 10 21:40:28 2018 >> New Revision: 337593 >> URL: https://svnweb.freebsd.org/changeset/base/337593 >> >> Log: >> Upstream libc++ added a using ::timespec_get line, when in C++17 or >> higher mode, in . Since we do not >> yet have this C11 function, comment out the line for now, as a >> workaround for a number of failing ports. Discussion with upstream is >> ongoing about an acceptable permanent fix. >> >> PR: 230400 >> Reported by: jbeich >> > > Is the timespec_get that got added in r337576 just today not suitable for this? > > Thanks, > > Kyle Evans Ah, failure to read the mentioned PR... please disregard. From owner-svn-src-projects@freebsd.org Fri Aug 10 21:46:50 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C9AE1076334 for ; Fri, 10 Aug 2018 21:46:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE27D7CC76 for ; Fri, 10 Aug 2018 21:46:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id p81-v6so4682617itp.1 for ; Fri, 10 Aug 2018 14:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zMYEvStb7deVNIlocgQ4nQjmcBNWiMlsgyQkZMO+SHY=; b=OIadLkbLSlyNLoWDt3zbdV7bIY4i977pAG5cm2Gvos6Og8Z/AdHfoZSQifqlTU5DTP 18wqpO8T1Xm4w3IJllxZFzaeoyDo/jV2H7v5rMjp4NOOP+4i4uFAqJ9xdhzqSSwzCp+U kcuCdPQ7AAoW/YgxzYHuk9nFVFs3tUU/NihYv1FRi7Jo9Crb8WtdFlgV/Q3QsvFukjDk SQI2WAYaLbp/WxoI6Mx0YJSqpdfhzjcVVHUq5fMHFRarBKROgeoWJFJ8Dtd8/OWkO8Oy HF4TU7o0Pb2+4Z6fUot1qI1938q0m48lu0j+xjQgE3p4IFshX5PfhfSPJRhl7y+BEzvL YX2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zMYEvStb7deVNIlocgQ4nQjmcBNWiMlsgyQkZMO+SHY=; b=V+kaU2zeuEeFltcEsy44I93jmSWmG5NBi+NbxwJ8BphZ6SjwukY8JyZGVmMQaTZZuS zb/phwGHX5rPCHwndXlcP3MBN9HyxrDdwxiy1XwzQqT341qvB1guY1CK0SUN4cqD6nAP u+iV+nVxiL+uOWB2bxZoOozTq+1bM2gFHRIkOIPdc3q51epaZbquIHHn+oe6kBKRMHcV pDLLQ5HfwUyM5/tfHcs2RzHHKcAgXUTvyE9BzqZqAowV0fCCQ1mFtRrZEdZqFlv5GulQ MCpNvYF0hAxBUgAJN0MeV10loJ5YaUjP+JNshcsHtOWk9iGRduCuBPfNYxUDrPuwP1+m +aig== X-Gm-Message-State: AOUpUlEcDuEjOTi/fDiCSIjsPEArWgNx0YAJKyX/ZZSSEgmbeNbqEPcz Q3dbCIpzYlLYNhj67ZcctgrcfCga3IbQuhfyvJ1L/w== X-Google-Smtp-Source: AA+uWPwhI23Ygvr7F6OFiAYvhJCXHr4Og/QwTo9HThXqzTjst5660fKzf6MPpJcQSd7X49swjg6LA5/oi3bOW1FWaKo= X-Received: by 2002:a24:b211:: with SMTP id u17-v6mr3573781ite.1.1533937608863; Fri, 10 Aug 2018 14:46:48 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Fri, 10 Aug 2018 14:46:48 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201808102140.w7ALeSBY033201@repo.freebsd.org> References: <201808102140.w7ALeSBY033201@repo.freebsd.org> From: Warner Losh Date: Fri, 10 Aug 2018 15:46:48 -0600 X-Google-Sender-Auth: Zu1pMLw2H59zmxQqhezG0Z4AJss Message-ID: Subject: Re: svn commit: r337593 - projects/clang700-import/contrib/libc++/include To: Dimitry Andric Cc: src-committers , svn-src-projects@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 21:46:50 -0000 On Fri, Aug 10, 2018 at 3:40 PM, Dimitry Andric wrote: > Author: dim > Date: Fri Aug 10 21:40:28 2018 > New Revision: 337593 > URL: https://svnweb.freebsd.org/changeset/base/337593 > > Log: > Upstream libc++ added a using ::timespec_get line, when in C++17 or > higher mode, in . Since we do not > yet have this C11 function, comment out the line for now, as a > workaround for a number of failing ports. Discussion with upstream is > ongoing about an acceptable permanent fix. > As of FreeBSD_version 1200077, we have this. I plan to MFC it eventually. Warner From owner-svn-src-projects@freebsd.org Sat Aug 11 01:02:28 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E751105209E for ; Sat, 11 Aug 2018 01:02:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 144068363A; Sat, 11 Aug 2018 01:02:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E99F5100BC; Sat, 11 Aug 2018 01:02:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B12R3a040376; Sat, 11 Aug 2018 01:02:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B12RlQ040373; Sat, 11 Aug 2018 01:02:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110102.w7B12RlQ040373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 01:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337596 - in projects/bectl: lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 01:02:28 -0000 Author: kevans Date: Sat Aug 11 01:02:27 2018 New Revision: 337596 URL: https://svnweb.freebsd.org/changeset/base/337596 Log: libbe(3)/bectl(8): Kill off the 'add' functionality for now The mostly-undocumented 'add' functionality, from initial read-through, is intended for construction of deep ("bdrewery style") boot environments. However, it's mostly broken at this point. `#if SOON` it out on both sides so that we're not exposing a broken API/feature. Work will resume on it in due time. Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/be.h projects/bectl/sbin/bectl/bectl.c Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Sat Aug 11 00:08:59 2018 (r337595) +++ projects/bectl/lib/libbe/be.c Sat Aug 11 01:02:27 2018 (r337596) @@ -44,9 +44,11 @@ __FBSDID("$FreeBSD$"); #include "be.h" #include "be_impl.h" +#if SOON static int be_create_child_noent(libbe_handle_t *lbh, const char *active, const char *child_path); static int be_create_child_cloned(libbe_handle_t *lbh, const char *active); +#endif /* * Iterator function for locating the rootfs amongst the children of the @@ -725,6 +727,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in return (be_destroy(lbh, nbuf, 0)); } +#if SOON static int be_create_child_noent(libbe_handle_t *lbh, const char *active, const char *child_path) @@ -778,7 +781,7 @@ be_create_child_noent(libbe_handle_t *lbh, const char static int be_create_child_cloned(libbe_handle_t *lbh, const char *active) { - char buf[BE_MAXPATHLEN]; + char buf[BE_MAXPATHLEN], tmp[BE_MAXPATHLEN];; zfs_handle_t *zfs; int err; @@ -788,10 +791,12 @@ be_create_child_cloned(libbe_handle_t *lbh, const char * Establish if the existing path is a zfs dataset or just * the subdirectory of one */ - strlcpy(buf, "/tmp/be_snap.XXXXX", sizeof(buf)); - if (mktemp(buf) == NULL) + strlcpy(tmp, "tmp/be_snap.XXXXX", sizeof(tmp)); + if (mktemp(tmp) == NULL) return (set_error(lbh, BE_ERR_UNKNOWN)); + be_root_concat(lbh, tmp, buf); + printf("Here %s?\n", buf); if ((err = zfs_snapshot(lbh->lzh, buf, false, NULL)) != 0) { switch (err) { case EZFS_INVALIDNAME: @@ -865,6 +870,7 @@ be_add_child(libbe_handle_t *lbh, const char *child_pa return (be_create_child_cloned(lbh, active)); return (set_error(lbh, BE_ERR_EXISTS)); } +#endif /* SOON */ static int be_set_nextboot(libbe_handle_t *lbh, nvlist_t *config, uint64_t pool_guid, Modified: projects/bectl/lib/libbe/be.h ============================================================================== --- projects/bectl/lib/libbe/be.h Sat Aug 11 00:08:59 2018 (r337595) +++ projects/bectl/lib/libbe/be.h Sat Aug 11 01:02:27 2018 (r337596) @@ -123,7 +123,9 @@ bool be_exists(libbe_handle_t *, char *); int be_export(libbe_handle_t *, const char *, int fd); int be_import(libbe_handle_t *, const char *, int fd); +#if SOON int be_add_child(libbe_handle_t *, const char *, bool); +#endif void be_nicenum(uint64_t num, char *buf, size_t buflen); #endif /* _LIBBE_H */ Modified: projects/bectl/sbin/bectl/bectl.c ============================================================================== --- projects/bectl/sbin/bectl/bectl.c Sat Aug 11 00:08:59 2018 (r337595) +++ projects/bectl/sbin/bectl/bectl.c Sat Aug 11 01:02:27 2018 (r337596) @@ -51,7 +51,9 @@ static int bectl_cmd_create(int argc, char *argv[]); static int bectl_cmd_destroy(int argc, char *argv[]); static int bectl_cmd_export(int argc, char *argv[]); static int bectl_cmd_import(int argc, char *argv[]); +#if SOON static int bectl_cmd_add(int argc, char *argv[]); +#endif static int bectl_cmd_mount(int argc, char *argv[]); static int bectl_cmd_rename(int argc, char *argv[]); static int bectl_cmd_unmount(int argc, char *argv[]); @@ -72,7 +74,9 @@ usage(bool explicit) "\tbectl destroy [-F] beName | beName@snapshot⟩\n" "\tbectl export sourceBe\n" "\tbectl import targetBe\n" +#if SOON "\tbectl add (path)*\n" +#endif "\tbectl jail [ -o key=value | -u key ]... bootenv\n" "\tbectl list [-a] [-D] [-H] [-s]\n" "\tbectl mount beName [mountpoint]\n" @@ -100,7 +104,9 @@ static struct command_map_entry command_map[] = { "destroy", bectl_cmd_destroy }, { "export", bectl_cmd_export }, { "import", bectl_cmd_import }, +#if SOON { "add", bectl_cmd_add }, +#endif { "jail", bectl_cmd_jail }, { "list", bectl_cmd_list }, { "mount", bectl_cmd_mount }, @@ -295,7 +301,7 @@ bectl_cmd_import(int argc, char *argv[]) return (err); } - +#if SOON static int bectl_cmd_add(int argc, char *argv[]) { @@ -313,7 +319,7 @@ bectl_cmd_add(int argc, char *argv[]) return (0); } - +#endif static int bectl_cmd_destroy(int argc, char *argv[]) From owner-svn-src-projects@freebsd.org Sat Aug 11 01:05:45 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 532311052115 for ; Sat, 11 Aug 2018 01:05:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAF3C837D6; Sat, 11 Aug 2018 01:05:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACBC4100C7; Sat, 11 Aug 2018 01:05:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B15iTB040553; Sat, 11 Aug 2018 01:05:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B15i2k040552; Sat, 11 Aug 2018 01:05:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110105.w7B15i2k040552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 01:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337597 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 01:05:46 -0000 Author: kevans Date: Sat Aug 11 01:05:44 2018 New Revision: 337597 URL: https://svnweb.freebsd.org/changeset/base/337597 Log: libbe(3): Bring man page back into reality Modified: projects/bectl/lib/libbe/libbe.3 Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Sat Aug 11 01:02:27 2018 (r337596) +++ projects/bectl/lib/libbe/libbe.3 Sat Aug 11 01:05:44 2018 (r337597) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 6, 2018 +.Dd August 10, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -75,20 +75,20 @@ of state to be retained, such as errors from previous .Fn libbe_handle_t "libbe_handle_t " ; .Pp .Ft int -.Fn be_create "libbe_handle_t *, char *" ; +.Fn be_create "libbe_handle_t *, const char *" ; .Pp .Ft int .Fn be_create_from_existing "libbe_handle_t *, const char *, const char *" ; .Pp .Ft int -.Fn be_rename "libbe_handle_t *, char *, char *" ; +.Fn be_rename "libbe_handle_t *, const char *, const char *" ; .Pp .\" TODO: Write up of destroy options .\" typedef enum { .\" BE_DESTROY_FORCE = 1 << 0, .\" } be_destroy_opt_t; .Ft int -.Fn be_destroy "libbe_handle_t *, char *, int" ; +.Fn be_destroy "libbe_handle_t *, const char *, int" ; .Pp .Ft void .Fn be_nicenum "uint64_t, char *, size_t" ; @@ -129,15 +129,12 @@ of state to be retained, such as errors from previous .Fn be_exists "libbe_handle_t *, char *" ; .Pp .Ft int -.Fn be_export "libbe_handle_t *, char *, int fd" ; +.Fn be_export "libbe_handle_t *, const char *, int fd" ; .Pp .Ft int -.Fn be_import "libbe_handle_t *, char *, int fd" ; +.Fn be_import "libbe_handle_t *, const char *, int fd" ; .Pp .Ft int -.Fn be_add_child "libbe_handle_t *, char *, bool" ; -.Pp -.Ft int .Fn be_prop_list_alloc "nvlist_t **" ; .Pp .Ft int @@ -151,36 +148,6 @@ of state to be retained, such as errors from previous .Pp .Ft void .Fn be_prop_list_free "nvlist_t *" ; -.\" .Ft void -.\" .Fn mp_mfree "MINT *mp" ; -.\" .Bd -ragged -offset indent -.\" .Fn mp_itom -.\" returns an -.\" .Vt MINT -.\" with the value of -.\" .Fa n . -.\" .Fn mp_xtom -.\" returns an -.\" .Vt MINT -.\" with the value of -.\" .Fa s , -.\" which is treated to be in hexadecimal. -.\" The return values from -.\" .Fn mp_itom -.\" and -.\" .Fn mp_xtom -.\" must be released with -.\" .Fn mp_mfree -.\" when they are no longer needed. -.\" .Fn mp_mtox -.\" returns a null-terminated hexadecimal string having the value of -.\" .Fa mp ; -.\" its return value must be released with -.\" .Fn free -.\" .Pq Xr free 3 -.\" when it is no longer needed. -.\" .Ed -.\" .Pp .Sh DIAGNOSTICS Upon error, one of the following values will be returned. .\" TODO: make each entry on its own line. @@ -202,6 +169,8 @@ BE_ERR_NOMOUNT, BE_ERR_ZFSOPEN, BE_ERR_ZFSCLONE, BE_ERR_IO, +BE_ERR_NOPOOL, +BE_ERR_NOMEM, BE_ERR_UNKNOWN .Ed .Sh SEE ALSO From owner-svn-src-projects@freebsd.org Sat Aug 11 01:40:26 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E81105554F for ; Sat, 11 Aug 2018 01:40:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C04C384E92; Sat, 11 Aug 2018 01:40:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CE4510622; Sat, 11 Aug 2018 01:40:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B1ePNl056104; Sat, 11 Aug 2018 01:40:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B1ePBY056103; Sat, 11 Aug 2018 01:40:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110140.w7B1ePBY056103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 01:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337598 - in projects/bectl: lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: lib/libbe sbin/bectl X-SVN-Commit-Revision: 337598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 01:40:26 -0000 Author: kevans Date: Sat Aug 11 01:40:24 2018 New Revision: 337598 URL: https://svnweb.freebsd.org/changeset/base/337598 Log: libbe(3)/bectl(8): Make igor and mandoc -Tlint a little happier Modified: projects/bectl/lib/libbe/libbe.3 projects/bectl/sbin/bectl/bectl.8 Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Sat Aug 11 01:05:44 2018 (r337597) +++ projects/bectl/lib/libbe/libbe.3 Sat Aug 11 01:40:24 2018 (r337598) @@ -25,11 +25,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" This manual page is based on the mp(3X) manual page from Sun Release -.\" 4.1, dated 7 September 1989. It's an old, crufty, and relatively ugly -.\" manual page, but it does document what appears to be the "traditional" -.\" libmp interface. -.\" .\" $FreeBSD$ .\" .Dd August 10, 2018 @@ -37,16 +32,19 @@ .Os .Sh NAME .Nm libbe -.Nd library for creating, destroying and modifying ZFS boot environments. +.Nd library for creating, destroying and modifying ZFS boot environments +.Sh LIBRARY +.Lb be .Sh SYNOPSIS .In be.h .Pp -Function prototypes are given in the main body of the text. +Function prototypes are given in the +.Sx FUNCTION OVERVIEW +section. .Pp Applications using this interface must be linked with .Fl l Ns Ar be .Sh DESCRIPTION -.Pp .Nm interfaces with libzfs to provide a set of functions for various operations regarding ZFS boot environments including "deep" boot environments in which @@ -55,43 +53,51 @@ a boot environments has child datasets. A context structure is passed to each function, allowing for a small amount of state to be retained, such as errors from previous operations. .\" TODO: describe break on err functionality -.Pp +.Sh FUNCTION OVERVIEW .Ft "libbe_handle_t *" Ns -.Fn libbe_init "void" ; +.Fn libbe_init void ; .Pp .Ft void .Fn libbe_close "libbe_handle_t *" ; .Pp -.Ft "const char *" Ns +.Ft const char * Ns .Fn be_active_name "libbe_handle_t *" ; .Pp -.Ft "const char *" Ns +.Ft const char * Ns .Fn be_active_path "libbe_handle_t *" ; .Pp -.Ft "const char *" Ns +.Ft const char * Ns +.Fn be_nextboot_name "libbe_handle_t *" ; +.Pp +.Ft const char * Ns +.Fn be_nextboot_path "libbe_handle_t *" ; +.Pp +.Ft const char * Ns .Fn be_root_path "libbe_handle_t *" ; .Pp -.Ft "nvlist_t *" Ns -.Fn libbe_handle_t "libbe_handle_t " ; +.Ft int +.Fn be_create "libbe_handle_t *" "const char *" ; .Pp .Ft int -.Fn be_create "libbe_handle_t *, const char *" ; +.Fn be_create_from_existing "libbe_handle_t *" "const char *" "const char *" ; .Pp .Ft int -.Fn be_create_from_existing "libbe_handle_t *, const char *, const char *" ; +.Fn be_create_from_existing_snap "libbe_handle_t *" "const char *" "const char *" ; .Pp .Ft int -.Fn be_rename "libbe_handle_t *, const char *, const char *" ; +.Fn be_rename "libbe_handle_t *" "const char *" "const char *" ; .Pp +.Ft int +.Fn be_activate "libbe_handle_t *" "const char *" "bool" ; .\" TODO: Write up of destroy options .\" typedef enum { .\" BE_DESTROY_FORCE = 1 << 0, .\" } be_destroy_opt_t; .Ft int -.Fn be_destroy "libbe_handle_t *, const char *, int" ; +.Fn be_destroy "libbe_handle_t *" "const char *" "int" ; .Pp .Ft void -.Fn be_nicenum "uint64_t, char *, size_t" ; +.Fn be_nicenum uint64_t" "char *" "size_t" ; .Pp .\" TODO: Write up of mount options .\" typedef enum { @@ -99,52 +105,52 @@ of state to be retained, such as errors from previous .\" BE_MNT_DEEP = 1 << 1, .\" } be_mount_opt_t; .Ft int -.Fn be_mount "libbe_handle_t *, char *, char *, int" ; +.Fn be_mount "libbe_handle_t *" "char *" "char *" "int" ; .Pp .Ft int -.Fn be_mounted_at "libbe_handle_t *, const char *, nvlist_t" ; +.Fn be_mounted_at "libbe_handle_t *" "const char *" "nvlist_t" ; .Pp .Ft int -.Fn be_unmount "libbe_handle_t *, char *, int" ; +.Fn be_unmount "libbe_handle_t *" "char *" "int" ; .Pp .Ft int .Fn libbe_errno "libbe_handle_t *" ; .Pp -.Ft "const char *" Ns +.Ft const char * Ns .Fn libbe_error_description "libbe_handle_t *" ; .Pp .Ft void -.Fn libbe_print_on_error "libbe_handle_t *, bool" ; +.Fn libbe_print_on_error "libbe_handle_t *" "bool" ; .Pp .Ft int -.Fn be_root_concat "libbe_handle_t *, const char *, char *" ; +.Fn be_root_concat "libbe_handle_t *" "const char *" "char *" ; .Pp .Ft int -.Fn be_validate_name "libbe_handle_t *, const char *" ; +.Fn be_validate_name "libbe_handle_t *" "const char *" ; .Pp .Ft int -.Fn be_validate_snap "libbe_handle_t *, const char *" ; +.Fn be_validate_snap "libbe_handle_t *" "const char *" ; .Pp .Ft bool -.Fn be_exists "libbe_handle_t *, char *" ; +.Fn be_exists "libbe_handle_t *" "char *" ; .Pp .Ft int -.Fn be_export "libbe_handle_t *, const char *, int fd" ; +.Fn be_export "libbe_handle_t *" "const char *" "int fd" ; .Pp .Ft int -.Fn be_import "libbe_handle_t *, const char *, int fd" ; +.Fn be_import "libbe_handle_t *" "const char *" "int fd" ; .Pp .Ft int .Fn be_prop_list_alloc "nvlist_t **" ; .Pp .Ft int -.Fn be_get_bootenv_props "libbe_handle_t *, nvlist_t *" ; +.Fn be_get_bootenv_props "libbe_handle_t *" "nvlist_t *" ; .Pp .Ft int -.Fn be_get_dataset_props "libbe_handle_t *, const char *, nvlist_t *" ; +.Fn be_get_dataset_props "libbe_handle_t *" "const char *" "nvlist_t *" ; .Pp .Ft int -.Fn be_get_dataset_snapshots "libbe_handle_t *, const char *, nvlist_t *" ; +.Fn be_get_dataset_snapshots "libbe_handle_t *" "const char *" "nvlist_t *" ; .Pp .Ft void .Fn be_prop_list_free "nvlist_t *" ; @@ -174,13 +180,12 @@ BE_ERR_NOMEM, BE_ERR_UNKNOWN .Ed .Sh SEE ALSO -.Xr be 1 , +.Xr be 1 .Sh HISTORY .Nm -and it's corresponding command, -.Xr be 3 , +and its corresponding command, +.Xr bectl 8 , were written as a 2017 Google Summer of Code project with Allan Jude serving as a mentor. .\" TODO: update when implementation complete. .\" .Sh BUGS - Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 01:05:44 2018 (r337597) +++ projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 01:40:24 2018 (r337598) @@ -18,9 +18,9 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2018 +.Dd August 10, 2018 .Dt BECTL 8 -.Os FreeBSD +.Os .Sh NAME .Nm bectl .Nd Utility to manage Boot Environments on ZFS @@ -76,7 +76,6 @@ command is used to setup and interact with ZFS boot en .Pp .Em Boot Environments allows the system to be upgraded, while preserving the old system environment in a separate ZFS dataset. -.Pp .Sh COMMANDS The following commands are supported by .Nm : @@ -87,10 +86,10 @@ The following commands are supported by .Pp Activate the given .Ar beName -as the default boot filesystem. If the +as the default boot filesystem. +If the .Op Fl t flag is given, this takes effect only for the next boot. -.Pp .It Ic create .Op Fl r .Op Fl e Ar nonActiveBe | Fl e Ar beName@snapshot @@ -103,7 +102,6 @@ If the -e param is specified, the new environment will If the .Op Fl r flag is given, a recursive boot environment will be made. -.Pp .It Ic create .Op Fl r .Ao Ar beName@snapshot Ac @@ -113,7 +111,6 @@ Creates a snapshot of the existing boot environment na If the .Op Fl r flag is given, a recursive boot environment will be made. -.Pp .It Ic destroy .Op Fl F .Ao Ar beName | beName@snapshot Ac @@ -126,7 +123,6 @@ snapshot. Specifying .Fl F will automatically unmount without confirmation. -.Pp .It Ic jail .Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac @@ -167,7 +163,7 @@ The following default parameters are provided: .It Va host.hostname Ns = Ns Ar bootenv .It Va path Set to a path in /tmp generated by -.Xr libbe 8 . +.Xr libbe 3 . .El .Pp All default parameters may be overwritten. @@ -188,11 +184,11 @@ If is used, display the full space usage for each boot environment, assuming all other boot environments were destroyed. The .Fl H -option is used for scripting. It does not print headers and separate fields by a single tab instead of arbitrary white space. +option is used for scripting. +It does not print headers and separate fields by a single tab instead of arbitrary white space. If .Fl s is used, display all snapshots as well. -.Pp .It Ic mount .Ao Ar beName Ac .Op mountpoint @@ -201,14 +197,12 @@ Temporarily mount the boot environment. Mount at the specified .Ar mountpoint if provided. -.Pp .It Ic rename Ao Ar origBeName Ac Ao Ar newBeName Ac .Pp Renames the given nonactive .Ar origBeName to the given .Ar newBeName -.Pp .It Ic unmount .Op Fl f .Ao Ar beName Ac @@ -217,17 +211,15 @@ Unmount the given boot environment, if it is mounted. Specifying .Fl f will force the unmount if busy. -.Pp .It Ic unjail Ao Ar jailID | jailName | beName Ac .Pp Destroys the jail created from the given boot environment. -.Pp .El .Sh EXAMPLES .Bl -bullet .It To fill in with jail upgrade example when behavior is firm. -.Pp +.El .Sh SEE ALSO .Xr jail 8 , .Xr zfs 8 , @@ -241,19 +233,19 @@ and was implemented as a project for the 2017 Summer o .Sh AUTHORS .Bl -bullet .It -Kyle Kneitinger (kneitinger) +.An Kyle Kneitinger (kneitinger) .Ar kyle@kneit.in .Pp Creator of .Nm . .It -Slawomir Wojciech Wojtczak (vermaden) +.An Slawomir Wojciech Wojtczak (vermaden) .Ar vermaden@interia.pl .Pp Creator and maintainer of .Xr beadm 1 . .It -Bryan Drewery (bdrewery) +.An Bryan Drewery (bdrewery) .Ar bryan@shatow.net .Pp Wrote the original From owner-svn-src-projects@freebsd.org Sat Aug 11 01:54:46 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23844105609E for ; Sat, 11 Aug 2018 01:54:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5CBD85B8B; Sat, 11 Aug 2018 01:54:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A49251096E; Sat, 11 Aug 2018 01:54:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B1sjPM065958; Sat, 11 Aug 2018 01:54:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B1sj0l065957; Sat, 11 Aug 2018 01:54:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110154.w7B1sj0l065957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 01:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337599 - projects/bectl/contrib/mdocml X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/contrib/mdocml X-SVN-Commit-Revision: 337599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 01:54:46 -0000 Author: kevans Date: Sat Aug 11 01:54:45 2018 New Revision: 337599 URL: https://svnweb.freebsd.org/changeset/base/337599 Log: Add libbe(3) to mdoc Modified: projects/bectl/contrib/mdocml/lib.in Modified: projects/bectl/contrib/mdocml/lib.in ============================================================================== --- projects/bectl/contrib/mdocml/lib.in Sat Aug 11 01:40:24 2018 (r337598) +++ projects/bectl/contrib/mdocml/lib.in Sat Aug 11 01:54:45 2018 (r337599) @@ -28,6 +28,7 @@ LINE("lib80211", "802.11 Wireless Network Management L LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") +LINE("libbe", "Boot Environment Library (libbe, \\-lbe)") LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") LINE("libbsm", "Basic Security Module Library (libbsm, \\-lbsm)") LINE("libc", "Standard C\\~Library (libc, \\-lc)") From owner-svn-src-projects@freebsd.org Sat Aug 11 03:33:12 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA103105C561 for ; Sat, 11 Aug 2018 03:33:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8037B89868; Sat, 11 Aug 2018 03:33:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6151C11A39; Sat, 11 Aug 2018 03:33:11 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B3XBol017378; Sat, 11 Aug 2018 03:33:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B3XBDv017377; Sat, 11 Aug 2018 03:33:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110333.w7B3XBDv017377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 03:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337601 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 03:33:12 -0000 Author: kevans Date: Sat Aug 11 03:33:10 2018 New Revision: 337601 URL: https://svnweb.freebsd.org/changeset/base/337601 Log: libbe(3): Brain dump... Modified: projects/bectl/lib/libbe/libbe.3 Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Sat Aug 11 02:56:43 2018 (r337600) +++ projects/bectl/lib/libbe/libbe.3 Sat Aug 11 03:33:10 2018 (r337601) @@ -3,6 +3,7 @@ .\" .\" Copyright (c) 2017 Kyle Kneitinger .\" All rights reserved. +.\" Copyright (c) 2018 Kyle Evans .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -34,126 +35,394 @@ .Nm libbe .Nd library for creating, destroying and modifying ZFS boot environments .Sh LIBRARY -.Lb be +.Lb libbe .Sh SYNOPSIS .In be.h +.Ft "libbe_handle_t *hdl" Ns +.Fn libbe_init void .Pp -Function prototypes are given in the -.Sx FUNCTION OVERVIEW -section. -.Pp -Applications using this interface must be linked with -.Fl l Ns Ar be -.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. -.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. -.\" TODO: describe break on err functionality -.Sh FUNCTION OVERVIEW -.Ft "libbe_handle_t *" Ns -.Fn libbe_init void ; -.Pp .Ft void -.Fn libbe_close "libbe_handle_t *" ; +.Fn libbe_close "libbe_handle_t *hdl" .Pp .Ft const char * Ns -.Fn be_active_name "libbe_handle_t *" ; +.Fn be_active_name "libbe_handle_t *hdl" .Pp .Ft const char * Ns -.Fn be_active_path "libbe_handle_t *" ; +.Fn be_active_path "libbe_handle_t *hdl" .Pp .Ft const char * Ns -.Fn be_nextboot_name "libbe_handle_t *" ; +.Fn be_nextboot_name "libbe_handle_t *hdl" .Pp .Ft const char * Ns -.Fn be_nextboot_path "libbe_handle_t *" ; +.Fn be_nextboot_path "libbe_handle_t *hdl" .Pp .Ft const char * Ns -.Fn be_root_path "libbe_handle_t *" ; +.Fn be_root_path "libbe_handle_t *hdl" .Pp .Ft int -.Fn be_create "libbe_handle_t *" "const char *" ; +.Fn be_create "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int -.Fn be_create_from_existing "libbe_handle_t *" "const char *" "const char *" ; +.Fn be_create_from_existing "libbe_handle_t *hdl" "const char *be_name" "const char *be_origin" .Pp .Ft int -.Fn be_create_from_existing_snap "libbe_handle_t *" "const char *" "const char *" ; +.Fn be_create_from_existing_snap "libbe_handle_t *hdl" "const char *be_name" "const char *snap" .Pp .Ft int -.Fn be_rename "libbe_handle_t *" "const char *" "const char *" ; +.Fn be_rename "libbe_handle_t *hdl" "const char *be_old" "const char *be_new" .Pp .Ft int -.Fn be_activate "libbe_handle_t *" "const char *" "bool" ; -.\" TODO: Write up of destroy options -.\" typedef enum { -.\" BE_DESTROY_FORCE = 1 << 0, -.\" } be_destroy_opt_t; +.Fn be_activate "libbe_handle_t *hdl" "const char *be_name" "bool temporary" .Ft int -.Fn be_destroy "libbe_handle_t *" "const char *" "int" ; +.Fn be_destroy "libbe_handle_t *hdl" "const char *be_name" "int options" .Pp .Ft void -.Fn be_nicenum uint64_t" "char *" "size_t" ; +.Fn be_nicenum "uint64_t num" "char *buf" "size_t bufsz" .Pp .\" TODO: Write up of mount options .\" typedef enum { .\" BE_MNT_FORCE = 1 << 0, .\" BE_MNT_DEEP = 1 << 1, -.\" } be_mount_opt_t; +.\" } be_mount_opt_t .Ft int -.Fn be_mount "libbe_handle_t *" "char *" "char *" "int" ; +.Fn be_mount "libbe_handle_t *hdl" "char *be_name" "char *mntpoint" "int flags" "char *result" .Pp .Ft int -.Fn be_mounted_at "libbe_handle_t *" "const char *" "nvlist_t" ; +.Fn be_mounted_at "libbe_handle_t *hdl" "const char *path" "nvlist_t *details" .Pp .Ft int -.Fn be_unmount "libbe_handle_t *" "char *" "int" ; +.Fn be_unmount "libbe_handle_t *hdl" "char *be_name" "int flags" .Pp .Ft int -.Fn libbe_errno "libbe_handle_t *" ; +.Fn libbe_errno "libbe_handle_t *hdl" .Pp .Ft const char * Ns -.Fn libbe_error_description "libbe_handle_t *" ; +.Fn libbe_error_description "libbe_handle_t *hdl" .Pp .Ft void -.Fn libbe_print_on_error "libbe_handle_t *" "bool" ; +.Fn libbe_print_on_error "libbe_handle_t *hdl" "bool doprint" .Pp .Ft int -.Fn be_root_concat "libbe_handle_t *" "const char *" "char *" ; +.Fn be_root_concat "libbe_handle_t *hdl" "const char *be_name" "char *result" .Pp .Ft int -.Fn be_validate_name "libbe_handle_t *" "const char *" ; +.Fn be_validate_name "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int -.Fn be_validate_snap "libbe_handle_t *" "const char *" ; +.Fn be_validate_snap "libbe_handle_t *hdl" "const char *snap" .Pp .Ft bool -.Fn be_exists "libbe_handle_t *" "char *" ; +.Fn be_exists "libbe_handle_t *hdl" "char *be_name" .Pp .Ft int -.Fn be_export "libbe_handle_t *" "const char *" "int fd" ; +.Fn be_export "libbe_handle_t *hdl" "const char *be_name" "int fd" .Pp .Ft int -.Fn be_import "libbe_handle_t *" "const char *" "int fd" ; +.Fn be_import "libbe_handle_t *hdl" "const char *be_name" "int fd" .Pp .Ft int -.Fn be_prop_list_alloc "nvlist_t **" ; +.Fn be_prop_list_alloc "nvlist_t **prop_list" .Pp .Ft int -.Fn be_get_bootenv_props "libbe_handle_t *" "nvlist_t *" ; +.Fn be_get_bootenv_props "libbe_handle_t *hdl" "nvlist_t *be_list" .Pp .Ft int -.Fn be_get_dataset_props "libbe_handle_t *" "const char *" "nvlist_t *" ; +.Fn be_get_dataset_props "libbe_handle_t *hdl" "const char *ds_name" "nvlist_t *props" .Pp .Ft int -.Fn be_get_dataset_snapshots "libbe_handle_t *" "const char *" "nvlist_t *" ; +.Fn be_get_dataset_snapshots "libbe_handle_t *hdl" "const char *ds_name" "nvlist_t *snap_list" .Pp .Ft void -.Fn be_prop_list_free "nvlist_t *" ; +.Fn be_prop_list_free "nvlist_t *prop_list" +.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. +.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. +.Nm +may be configured to print the corresponding error message to +.Dv stderr +when an error is encountered with +.Fn libbe_print_on_error . +.Pp +All functions returning an +.Vt int +return 0 on success, or a +.Nm +errno otherwise as described in +.Sx DIAGNOSTICS . +.Pp +The +.Fn libbe_init +function initializes +.Nm , +returning a +.Vt "libbe_handle_t *" +on success, or +.Dv NULL +on error. +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 +environment, +.It +.Nm +fails to open the zpool the active boot environment resides on, or +.It +.Nm +fails to locate the boot environment that is currently mounted. +.El +.Pp +The +.Fn libbe_close +function frees all resources previously acquired in +.Fn libbe_init , +invalidating the handle in the process. +.Pp +The +.Fn be_active_name +function returns the name of the currently booted boot environment, +.Pp +The +.Fn be_active_path +function returns the full path of the currently booted boot environment. +.Pp +The +.Fn be_nextboot_name +function returns the name of the boot environment that will be active on reboot. +.Pp +The +.Fn be_nextboot_path +function returns the full path of the boot environment that will be +active on reboot. +.Pp +The +.Fn be_root_path +function returns the boot environment root path. +.Pp +The +.Fn be_create +function creates a boot environment with the given name. +It will be created from a snapshot of the currently booted boot environment. +.Pp +The +.Fn be_create_from_existing +function creates a boot environment with the given name from the name of an +existing boot environment. +A snapshot will be made of the base boot environment, and the new boot +environment will be created from that. +.Pp +The +.Fn be_create_from_existing_snap +function creates a boot environment with the given name from an existing +snapshot. +.Pp +The +.Fn be_rename +function renames a boot environment. +.Pp +The +.Fn be_activate +function makes a boot environment active on the next boot. +If the +.Fa temporary +flag is set, then it will be active for the next boot only, as done by +.Xr zfsbootcfg 8 . +Next boot functionality is currently only available when booting in x86 BIOS +mode. +.Pp +The +.Fn be_destroy +function will recursively destroy the given boot environment. +It will not destroy a mounted boot environment unless the +.Dv BE_DESTROY_FORCE +option is set in +.Fa options . +.Pp +The +.Fn be_nicenum +function will format +.Fa name +in a traditional ZFS humanized format, similar to +.Xr humanize_number 3 . +This function effectively proxies +.Fn zfs_nicenum +from libzfs. +.Pp +The +.Fn be_mount +function will mount the given boot environment. +If +.Fa mountpoint +is +.Dv NULL , +a mount point will be generated in +.Pa /tmp +using +.Xr mkdtemp 3 . +If +.Fa result +is not +.Dv NULL , +the final mount point will be copied into it. +Setting the +.Dv BE_MNT_FORCE +flag will pass +.Dv MNT_FORCE +to the underlying +.Xr mount 2 +call. +.Pp +The +.Fn be_mounted_at +function will check if there is a boot environment mounted at the given +.Fa path . +If +.Fa details +is not +.Dv NULL , +it will be populated with a list of the mounted dataset's properties. +This list of properties matches the properties collected by +.Fn be_get_bootenv_props . +.Pp +The +.Fn be_unmount +function will unmount the given boot environment. +Setting the +.Dv BE_MNT_FORCE +flag will pass +.Dv MNT_FORCE +to the underlying +.Xr mount 2 +call. +.Pp +The +.Fn libbe_errno +function returns the +.Nm +errno. +.Pp +The +.Fn libbe_error_description +function returns a string description of the currently set +.Nm +errno. +.Pp +The +.Fn libbe_print_on_error +function will change whether or not +.Nm +prints the description of any encountered error to +.Dv stderr , +based on +.Fa doprint . +.Pp +The +.Fn be_root_concat +function will concatenate the boot environment root and the given boot +environment name into +.Fa result . +.Pp +The +.Fn be_validate_name +function will validate the given boot environment name. +.Pp +The +.Fn be_validate_snap +function will validate the given snapshot name. +The snapshot must have a valid name, exist, and have a mountpoint of +.Pa / . +This function does not set the internal library error state. +.Pp +The +.Fn be_exists +function will check whether the given boot environment exists and has a +mountpoint of +.Pa / . +.Pp +The +.Fn be_export +function will export the given boot environment to the file specified by +.Fa fd . +A snapshot will be created of the boot environment prior to export. +.Pp +The +.Fn be_import +function will import the boot environment in the file specified by +.Fa fd , +and give it the name +.Fa be_name . +.Pp +The +.Fn be_prop_list_alloc +function allocates a property list suitable for passing to +.Fn be_get_bootenv_props , +.Fn be_get_dataset_props , +or +.Fn be_get_dataset_snapshots . +It should be freed later by +.Fa be_prop_list_free . +.Pp +The +.Fn be_get_bootenv_props +function will populate +.Fa be_list +with +.Vt nvpair_t +of boot environment names paired with an +.Vt nvlist_t +of their properties. +The following properties are currently collected as appropriate: +.Bl -column "Returned name" +.It Sy Returned name Ta Sy Description +.It dataset Ta - +.It name Ta Boot environment name +.It mounted Ta Current mount point +.It mountpoint Ta Do mountpoint Dc property +.It origin Ta Do origin Dc property +.It creation Ta Do creation Dc property +.It active Ta Currently booted environment +.It used Ta Literal Do used Dc property +.It usedds Ta Literal Do usedds Dc property +.It usedsnap Ta Literal Do usedrefreserv Dc property +.It referenced Ta Literal Do referenced Dc property +.It nextboot Ta Active on next boot +.El +.Pp +Only the +.Dq dataset , +.Dq name , +.Dq active , +and +.Dq nextboot +returned values will always be present. +All other properties may be omitted if not available. +.Pp +The +.Fn be_get_dataset_props +function will get properties of the specified dataset. +.Fa props +is populated directly with a list of the properties as returned by +.Fn be_get_bootenv_props . +.Pp +The +.Fn be_get_dataset_snapshots +function will retrieve all snapshots of the given dataset. +.Fa snap_list +will be populated with a list of +.Vt nvpair_t +exactly as specified by +.Fn be_get_bootenv_props . +.Pp +The +.Fn be_prop_list_free +function will free the property list. +.Fp .Sh DIAGNOSTICS Upon error, one of the following values will be returned. .\" TODO: make each entry on its own line. @@ -187,5 +456,7 @@ 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 . .\" TODO: update when implementation complete. .\" .Sh BUGS From owner-svn-src-projects@freebsd.org Sat Aug 11 04:01:25 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8C61105D030 for ; Sat, 11 Aug 2018 04:01:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F1EC8A383; Sat, 11 Aug 2018 04:01:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51D9311DBB; Sat, 11 Aug 2018 04:01:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B41P8t029620; Sat, 11 Aug 2018 04:01:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B41PJ1029619; Sat, 11 Aug 2018 04:01:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110401.w7B41PJ1029619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337602 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:01:25 -0000 Author: kevans Date: Sat Aug 11 04:01:24 2018 New Revision: 337602 URL: https://svnweb.freebsd.org/changeset/base/337602 Log: bectl(8): Document export/import Modified: projects/bectl/sbin/bectl/bectl.8 Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 03:33:10 2018 (r337601) +++ projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 04:01:24 2018 (r337602) @@ -43,6 +43,12 @@ destroy .Op Fl F .Ao Ar beName | beName@snapshot Ac .Nm +export +.Ao Ar sourceBe Ac +.Nm +import +.Ao Ar targetBe Ac +.Nm jail .Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac @@ -123,6 +129,22 @@ snapshot. Specifying .Fl F will automatically unmount without confirmation. +.It Ic export +.Ao Ar sourceBe Ac +.Pp +Export +.Ar sourceBe +to +.Dv stdout . +.Dv stdout +must be piped or redirected to a file. +.It Ic import +.Ao Ar targetBe Ac +.Pp +Import +.Ar targetBe +from +.Dv stdin . .It Ic jail .Oo Fl o Ar key Ns = Ns Ar value | Fl u Ar key Oc Ns ... .Ao Ar jailID | jailName Ac @@ -233,20 +255,17 @@ and was implemented as a project for the 2017 Summer o .Sh AUTHORS .Bl -bullet .It -.An Kyle Kneitinger (kneitinger) -.Ar kyle@kneit.in +.An Kyle Kneitinger (kneitinger) Aq Mt kyle@kneit.in .Pp Creator of .Nm . .It -.An Slawomir Wojciech Wojtczak (vermaden) -.Ar vermaden@interia.pl +.An Slawomir Wojciech Wojtczak (vermaden) Aq Mt vermaden@interia.pl .Pp Creator and maintainer of .Xr beadm 1 . .It -.An Bryan Drewery (bdrewery) -.Ar bryan@shatow.net +.An Bryan Drewery (bdrewery) Aq Mt bryan@shatow.net .Pp Wrote the original .Xr beadm 1 From owner-svn-src-projects@freebsd.org Sat Aug 11 04:03:06 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4149105D053 for ; Sat, 11 Aug 2018 04:03:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5876D8A53B; Sat, 11 Aug 2018 04:03:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3994A11F1E; Sat, 11 Aug 2018 04:03:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B436Hr032878; Sat, 11 Aug 2018 04:03:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B436vx032877; Sat, 11 Aug 2018 04:03:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110403.w7B436vx032877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337603 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:03:06 -0000 Author: kevans Date: Sat Aug 11 04:03:05 2018 New Revision: 337603 URL: https://svnweb.freebsd.org/changeset/base/337603 Log: bectl(8): Swap the order of ujail/umount documentation... "Despite my inconsistency, consistency is king." -Anonymous Modified: projects/bectl/sbin/bectl/bectl.8 Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 04:01:24 2018 (r337602) +++ projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 04:03:05 2018 (r337603) @@ -225,6 +225,9 @@ Renames the given nonactive .Ar origBeName to the given .Ar newBeName +.It Ic unjail Ao Ar jailID | jailName | beName Ac +.Pp +Destroys the jail created from the given boot environment. .It Ic unmount .Op Fl f .Ao Ar beName Ac @@ -233,9 +236,6 @@ Unmount the given boot environment, if it is mounted. Specifying .Fl f will force the unmount if busy. -.It Ic unjail Ao Ar jailID | jailName | beName Ac -.Pp -Destroys the jail created from the given boot environment. .El .Sh EXAMPLES .Bl -bullet From owner-svn-src-projects@freebsd.org Sat Aug 11 04:07:01 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4CF5105D09F for ; Sat, 11 Aug 2018 04:07:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49A1B8A64B; Sat, 11 Aug 2018 04:07:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F99811F20; Sat, 11 Aug 2018 04:07:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B470CV033092; Sat, 11 Aug 2018 04:07:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B470bg033091; Sat, 11 Aug 2018 04:07:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110407.w7B470bg033091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337604 - projects/bectl/share/mk X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/share/mk X-SVN-Commit-Revision: 337604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:07:01 -0000 Author: kevans Date: Sat Aug 11 04:07:00 2018 New Revision: 337604 URL: https://svnweb.freebsd.org/changeset/base/337604 Log: libbe(3): Add to bsd.libnames.mk Modified: projects/bectl/share/mk/bsd.libnames.mk Modified: projects/bectl/share/mk/bsd.libnames.mk ============================================================================== --- projects/bectl/share/mk/bsd.libnames.mk Sat Aug 11 04:03:05 2018 (r337603) +++ projects/bectl/share/mk/bsd.libnames.mk Sat Aug 11 04:07:00 2018 (r337604) @@ -23,6 +23,7 @@ LIBASN1?= ${LIBDESTDIR}${LIBDIR_BASE}/libasn1.a LIBATM?= ${LIBDESTDIR}${LIBDIR_BASE}/libatm.a LIBAUDITD?= ${LIBDESTDIR}${LIBDIR_BASE}/libauditd.a LIBAVL?= ${LIBDESTDIR}${LIBDIR_BASE}/libavl.a +LIBBE?= ${LIBDESTDIR}${LIBDIR_BASE}/libbe.a LIBBEGEMOT?= ${LIBDESTDIR}${LIBDIR_BASE}/libbegemot.a LIBBLACKLIST?= ${LIBDESTDIR}${LIBDIR_BASE}/libblacklist.a LIBBLUETOOTH?= ${LIBDESTDIR}${LIBDIR_BASE}/libbluetooth.a From owner-svn-src-projects@freebsd.org Sat Aug 11 04:09:43 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4582D105D0CE for ; Sat, 11 Aug 2018 04:09:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFA658A73F; Sat, 11 Aug 2018 04:09:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B10EA11F21; Sat, 11 Aug 2018 04:09:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B49gQb033242; Sat, 11 Aug 2018 04:09:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B49grw033241; Sat, 11 Aug 2018 04:09:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110409.w7B49grw033241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337605 - projects/bectl/lib/libbe X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/lib/libbe X-SVN-Commit-Revision: 337605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:09:43 -0000 Author: kevans Date: Sat Aug 11 04:09:42 2018 New Revision: 337605 URL: https://svnweb.freebsd.org/changeset/base/337605 Log: libbe(3): Document the import bug... Modified: projects/bectl/lib/libbe/be.c projects/bectl/lib/libbe/libbe.3 Modified: projects/bectl/lib/libbe/be.c ============================================================================== --- projects/bectl/lib/libbe/be.c Sat Aug 11 04:07:00 2018 (r337604) +++ projects/bectl/lib/libbe/be.c Sat Aug 11 04:09:42 2018 (r337605) @@ -696,7 +696,6 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in strftime(buf + len, BE_MAXPATHLEN - len, "@%F-%T", localtime(&rawtime)); - /* lzc_receive(SNAPNAME, PROPS, ORIGIN, FORCE, fd)) { */ if ((err = lzc_receive(buf, NULL, NULL, false, fd)) != 0) { switch (err) { case EINVAL: @@ -724,7 +723,8 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in nvlist_free(props); - return (be_destroy(lbh, nbuf, 0)); + /* XXX TODO: Figure out how to destroy the ghost... */ + return (BE_ERR_SUCCESS); } #if SOON Modified: projects/bectl/lib/libbe/libbe.3 ============================================================================== --- projects/bectl/lib/libbe/libbe.3 Sat Aug 11 04:07:00 2018 (r337604) +++ projects/bectl/lib/libbe/libbe.3 Sat Aug 11 04:09:42 2018 (r337605) @@ -170,11 +170,9 @@ An error may occur if: .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 @@ -422,7 +420,6 @@ exactly as specified by The .Fn be_prop_list_free function will free the property list. -.Fp .Sh DIAGNOSTICS Upon error, one of the following values will be returned. .\" TODO: make each entry on its own line. @@ -458,5 +455,9 @@ were written as a 2017 Google Summer of Code project w as a mentor. Later work was done by .An Kyle Evans Aq Mt kevans@FreeBSD.org . -.\" TODO: update when implementation complete. -.\" .Sh BUGS +.Sh BUGS +The +.Fn be_import +function does not destroy the temporary boot environment it creates for import, +because the snapshot created to do the import may not be deleted since it is the +origin of the new boot environment. From owner-svn-src-projects@freebsd.org Sat Aug 11 04:11:35 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59DBA105D26F for ; Sat, 11 Aug 2018 04:11:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1070E8A9FF; Sat, 11 Aug 2018 04:11:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5B4611F73; Sat, 11 Aug 2018 04:11:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B4BYRO036313; Sat, 11 Aug 2018 04:11:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B4BYvv036312; Sat, 11 Aug 2018 04:11:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110411.w7B4BYvv036312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337606 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:11:35 -0000 Author: kevans Date: Sat Aug 11 04:11:34 2018 New Revision: 337606 URL: https://svnweb.freebsd.org/changeset/base/337606 Log: bectl(8): Also document the import bug. Modified: projects/bectl/sbin/bectl/bectl.8 Modified: projects/bectl/sbin/bectl/bectl.8 ============================================================================== --- projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 04:09:42 2018 (r337605) +++ projects/bectl/sbin/bectl/bectl.8 Sat Aug 11 04:11:34 2018 (r337606) @@ -271,3 +271,9 @@ Wrote the original .Xr beadm 1 manual page that this one is derived from. .El +.Sh BUGS +.Nm +import +does not destroy the temporary boot environment it creates for import, because +the snapshot created to do the import may not be deleted since it is the +origin of the new boot environment. From owner-svn-src-projects@freebsd.org Sat Aug 11 04:26:36 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 033D7105D707 for ; Sat, 11 Aug 2018 04:26:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB25C8B56A; Sat, 11 Aug 2018 04:26:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D1F3122C4; Sat, 11 Aug 2018 04:26:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B4QZqk044048; Sat, 11 Aug 2018 04:26:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B4QVHp044028; Sat, 11 Aug 2018 04:26:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110426.w7B4QVHp044028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337608 - in projects/bectl: . bin/date bin/date/tests bin/dd bin/ls cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd... X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: . bin/date bin/date/tests bin/dd bin/ls cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensol... X-SVN-Commit-Revision: 337608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:26:36 -0000 Author: kevans Date: Sat Aug 11 04:26:29 2018 New Revision: 337608 URL: https://svnweb.freebsd.org/changeset/base/337608 Log: MFH @ r337607, in preparation for boarding Added: projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh - copied unchanged from r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh.out - copied unchanged from r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh.out projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh - copied unchanged from r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh.out - copied unchanged from r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh.out projects/bectl/cddl/lib/libdtrace/udplite.d - copied unchanged from r337606, head/cddl/lib/libdtrace/udplite.d projects/bectl/cddl/usr.sbin/dwatch/libexec/udplite - copied unchanged from r337606, head/cddl/usr.sbin/dwatch/libexec/udplite projects/bectl/contrib/file/magic/Magdir/dataone - copied unchanged from r337606, head/contrib/file/magic/Magdir/dataone projects/bectl/contrib/file/python/CHANGELOG.md - copied unchanged from r337606, head/contrib/file/python/CHANGELOG.md projects/bectl/contrib/file/python/LICENSE - copied unchanged from r337606, head/contrib/file/python/LICENSE projects/bectl/contrib/file/python/README.md - copied unchanged from r337606, head/contrib/file/python/README.md projects/bectl/contrib/file/python/tests.py - copied unchanged from r337606, head/contrib/file/python/tests.py projects/bectl/contrib/file/tests/JW07022A.mp3.result - copied unchanged from r337606, head/contrib/file/tests/JW07022A.mp3.result projects/bectl/contrib/file/tests/JW07022A.mp3.testfile - copied unchanged from r337606, head/contrib/file/tests/JW07022A.mp3.testfile projects/bectl/contrib/libarchive/tar/test/test_option_C_mtree.c - copied unchanged from r337606, head/contrib/libarchive/tar/test/test_option_C_mtree.c projects/bectl/lib/libc/gen/shells - copied unchanged from r337606, head/lib/libc/gen/shells projects/bectl/lib/libc/gen/timespec_get.3 - copied unchanged from r337606, head/lib/libc/gen/timespec_get.3 projects/bectl/lib/libc/gen/timespec_get.c - copied unchanged from r337606, head/lib/libc/gen/timespec_get.c projects/bectl/release/arm/GENERICSD.conf - copied unchanged from r337606, head/release/arm/GENERICSD.conf projects/bectl/release/arm64/PINE64-LTS.conf - copied unchanged from r337606, head/release/arm64/PINE64-LTS.conf projects/bectl/sbin/init/netstart - copied unchanged from r337606, head/sbin/init/netstart projects/bectl/sbin/init/network.subr - copied unchanged from r337606, head/sbin/init/network.subr projects/bectl/sbin/init/pccard_ether - copied unchanged from r337606, head/sbin/init/pccard_ether projects/bectl/sbin/init/rc - copied unchanged from r337606, head/sbin/init/rc projects/bectl/sbin/init/rc.conf - copied unchanged from r337606, head/sbin/init/rc.conf projects/bectl/sbin/init/rc.d/ - copied from r337606, head/sbin/init/rc.d/ projects/bectl/sbin/init/rc.initdiskless - copied unchanged from r337606, head/sbin/init/rc.initdiskless projects/bectl/sbin/init/rc.resume - copied unchanged from r337606, head/sbin/init/rc.resume projects/bectl/sbin/init/rc.shutdown - copied unchanged from r337606, head/sbin/init/rc.shutdown projects/bectl/sbin/init/rc.subr - copied unchanged from r337606, head/sbin/init/rc.subr projects/bectl/sbin/init/rc.suspend - copied unchanged from r337606, head/sbin/init/rc.suspend projects/bectl/sbin/savecore/minfree - copied unchanged from r337606, head/sbin/savecore/minfree projects/bectl/share/man/man4/dtrace_udplite.4 - copied unchanged from r337606, head/share/man/man4/dtrace_udplite.4 projects/bectl/share/man/man9/nvmem.9 - copied unchanged from r337606, head/share/man/man9/nvmem.9 projects/bectl/share/mk/dirdeps-options.mk - copied unchanged from r337606, head/share/mk/dirdeps-options.mk projects/bectl/share/vt/keymaps/us.macbook.kbd - copied unchanged from r337606, head/share/vt/keymaps/us.macbook.kbd projects/bectl/sys/amd64/amd64/copyout.c - copied unchanged from r337606, head/sys/amd64/amd64/copyout.c projects/bectl/sys/arm/ralink/std.ralink - copied unchanged from r337606, head/sys/arm/ralink/std.ralink projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_initialize.h - copied unchanged from r337606, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_initialize.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c - copied unchanged from r337606, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c projects/bectl/sys/dev/extres/nvmem/ - copied from r337606, head/sys/dev/extres/nvmem/ projects/bectl/sys/dev/ipmi/ipmi_opal.c - copied unchanged from r337606, head/sys/dev/ipmi/ipmi_opal.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_iwarp.h - copied unchanged from r337606, head/sys/dev/qlnx/qlnxe/ecore_iwarp.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_mng_tlv.c - copied unchanged from r337606, head/sys/dev/qlnx/qlnxe/ecore_mng_tlv.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_rdma.h - copied unchanged from r337606, head/sys/dev/qlnx/qlnxe/ecore_rdma.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_rdma_api.h - copied unchanged from r337606, head/sys/dev/qlnx/qlnxe/ecore_rdma_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_sriov.c - copied unchanged from r337606, head/sys/dev/qlnx/qlnxe/ecore_sriov.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_tcp_ip.h - copied unchanged from r337606, head/sys/dev/qlnx/qlnxe/ecore_tcp_ip.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_vf.c - copied unchanged from r337606, head/sys/dev/qlnx/qlnxe/ecore_vf.c projects/bectl/sys/mips/include/cca.h - copied unchanged from r337606, head/sys/mips/include/cca.h projects/bectl/sys/modules/qlnx/qlnxev/ - copied from r337606, head/sys/modules/qlnx/qlnxev/ projects/bectl/sys/powerpc/ofw/ofw_initrd.c - copied unchanged from r337606, head/sys/powerpc/ofw/ofw_initrd.c projects/bectl/tests/sys/audit/miscellaneous.c - copied unchanged from r337606, head/tests/sys/audit/miscellaneous.c projects/bectl/tests/sys/auditpipe/ - copied from r337606, head/tests/sys/auditpipe/ projects/bectl/tests/sys/kern/unix_socketpair_test.c - copied unchanged from r337606, head/tests/sys/kern/unix_socketpair_test.c projects/bectl/tools/build/options/WITH_LLVM_TARGET_BPF - copied unchanged from r337606, head/tools/build/options/WITH_LLVM_TARGET_BPF projects/bectl/tools/tools/git/git-svn-init - copied unchanged from r337606, head/tools/tools/git/git-svn-init projects/bectl/usr.sbin/Makefile.riscv - copied unchanged from r337606, head/usr.sbin/Makefile.riscv projects/bectl/usr.sbin/apmd/apmd.conf - copied unchanged from r337606, head/usr.sbin/apmd/apmd.conf projects/bectl/usr.sbin/autofs/auto_master - copied unchanged from r337606, head/usr.sbin/autofs/auto_master projects/bectl/usr.sbin/autofs/autofs/ - copied from r337606, head/usr.sbin/autofs/autofs/ projects/bectl/usr.sbin/blacklistd/blacklistd.conf - copied unchanged from r337606, head/usr.sbin/blacklistd/blacklistd.conf projects/bectl/usr.sbin/freebsd-update/freebsd-update.conf - copied unchanged from r337606, head/usr.sbin/freebsd-update/freebsd-update.conf projects/bectl/usr.sbin/nfsd/pnfsserver.4 - copied unchanged from r337606, head/usr.sbin/nfsd/pnfsserver.4 projects/bectl/usr.sbin/nscd/nscd.conf - copied unchanged from r337606, head/usr.sbin/nscd/nscd.conf projects/bectl/usr.sbin/pkg/FreeBSD.conf - copied unchanged from r337606, head/usr.sbin/pkg/FreeBSD.conf projects/bectl/usr.sbin/portsnap/portsnap/portsnap.conf - copied unchanged from r337606, head/usr.sbin/portsnap/portsnap/portsnap.conf Replaced: projects/bectl/lib/libc/arm/string/memcpy_xscale.S - copied unchanged from r337606, head/lib/libc/arm/string/memcpy_xscale.S projects/bectl/lib/libpmc/pmc.xscale.3 - copied unchanged from r337606, head/lib/libpmc/pmc.xscale.3 projects/bectl/sys/arm/arm/bcopyinout_xscale.S - copied unchanged from r337606, head/sys/arm/arm/bcopyinout_xscale.S projects/bectl/sys/dev/hwpmc/hwpmc_xscale.h - copied unchanged from r337606, head/sys/dev/hwpmc/hwpmc_xscale.h Deleted: projects/bectl/contrib/file/python/README projects/bectl/etc/apmd.conf projects/bectl/etc/auto_master projects/bectl/etc/autofs/ projects/bectl/etc/blacklistd.conf projects/bectl/etc/defaults/rc.conf projects/bectl/etc/freebsd-update.conf projects/bectl/etc/minfree projects/bectl/etc/netstart projects/bectl/etc/network.subr projects/bectl/etc/nscd.conf projects/bectl/etc/pccard_ether projects/bectl/etc/pkg/ projects/bectl/etc/portsnap.conf projects/bectl/etc/rc projects/bectl/etc/rc.d/ projects/bectl/etc/rc.initdiskless projects/bectl/etc/rc.resume projects/bectl/etc/rc.shutdown projects/bectl/etc/rc.subr projects/bectl/etc/rc.suspend projects/bectl/etc/shells projects/bectl/lib/libnetbsd/sys/time.h projects/bectl/release/arm/GUMSTIX.conf projects/bectl/share/man/man4/jedec_ts.4 projects/bectl/share/man/man4/man4.arm/npe.4 projects/bectl/sys/arm/arm/cpufunc_asm_fa526.S projects/bectl/sys/arm/arm/cpufunc_asm_xscale.S projects/bectl/sys/arm/arm/cpufunc_asm_xscale_c3.S projects/bectl/sys/arm/at91/ projects/bectl/sys/arm/cavium/ projects/bectl/sys/arm/conf/ALLWINNER_UP projects/bectl/sys/arm/conf/ATMEL projects/bectl/sys/arm/conf/CNS11XXNAS projects/bectl/sys/arm/conf/CRB projects/bectl/sys/arm/conf/GUMSTIX projects/bectl/sys/arm/conf/GUMSTIX-QEMU projects/bectl/sys/arm/conf/GUMSTIX.hints projects/bectl/sys/arm/conf/SAM9G20EK projects/bectl/sys/arm/include/at91_gpio.h projects/bectl/sys/arm/lpc/ projects/bectl/sys/arm/xscale/ projects/bectl/sys/dev/jedec_ts/ projects/bectl/sys/dev/nand/nfc_at91.c projects/bectl/sys/dev/nand/nfc_at91.h projects/bectl/sys/dev/usb/controller/at91dci.c projects/bectl/sys/dev/usb/controller/at91dci.h projects/bectl/sys/dev/usb/controller/at91dci_atmelarm.c projects/bectl/sys/dev/usb/controller/at91dci_fdt.c projects/bectl/sys/dev/usb/controller/atmegadci_atmelarm.c projects/bectl/sys/dev/usb/controller/musb_otg_atmelarm.c projects/bectl/sys/dev/usb/controller/uss820dci_atmelarm.c projects/bectl/sys/dts/arm/hl201.dts projects/bectl/sys/dts/arm/sam9260ek.dts projects/bectl/sys/modules/dtb/atmel/Makefile projects/bectl/sys/modules/i2c/jedec_ts/ projects/bectl/sys/modules/tcp/fastpath/ projects/bectl/sys/modules/usb/at91dci/Makefile projects/bectl/sys/netinet/tcp_stacks/fastpath.c projects/bectl/sys/powerpc/powernv/opal_ipmi.c Modified: projects/bectl/Makefile.inc1 projects/bectl/Makefile.libcompat projects/bectl/ObsoleteFiles.inc projects/bectl/UPDATING projects/bectl/bin/date/date.1 projects/bectl/bin/date/date.c projects/bectl/bin/date/tests/format_string_test.sh projects/bectl/bin/dd/args.c projects/bectl/bin/dd/dd.1 projects/bectl/bin/dd/dd.c projects/bectl/bin/dd/dd.h projects/bectl/bin/dd/extern.h projects/bectl/bin/dd/misc.c projects/bectl/bin/ls/ls.1 projects/bectl/bin/ls/ls.c projects/bectl/cddl/contrib/opensolaris/cmd/zdb/zdb.c projects/bectl/cddl/contrib/opensolaris/cmd/zfs/zfs.8 projects/bectl/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c projects/bectl/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 projects/bectl/cddl/contrib/opensolaris/cmd/zpool/zpool.8 projects/bectl/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c projects/bectl/cddl/contrib/opensolaris/cmd/ztest/ztest.c projects/bectl/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c projects/bectl/cddl/contrib/opensolaris/lib/libnvpair/nvpair_json.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c projects/bectl/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h projects/bectl/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h projects/bectl/cddl/lib/libdtrace/Makefile projects/bectl/cddl/lib/libdtrace/ip.d projects/bectl/cddl/lib/libzfs/Makefile projects/bectl/cddl/lib/libzfs_core/Makefile projects/bectl/cddl/lib/libzpool/Makefile projects/bectl/cddl/sbin/zfs/Makefile projects/bectl/cddl/sbin/zpool/Makefile projects/bectl/cddl/usr.bin/zinject/Makefile projects/bectl/cddl/usr.bin/zstreamdump/Makefile projects/bectl/cddl/usr.bin/ztest/Makefile projects/bectl/cddl/usr.sbin/dtrace/tests/common/ip/Makefile projects/bectl/cddl/usr.sbin/dtrace/tests/tools/exclude.sh projects/bectl/cddl/usr.sbin/dwatch/libexec/Makefile projects/bectl/cddl/usr.sbin/zdb/Makefile projects/bectl/cddl/usr.sbin/zfsd/Makefile.common projects/bectl/cddl/usr.sbin/zhack/Makefile projects/bectl/contrib/elftoolchain/libelf/elf_update.c projects/bectl/contrib/elftoolchain/readelf/readelf.c projects/bectl/contrib/file/ChangeLog projects/bectl/contrib/file/Makefile.in projects/bectl/contrib/file/README projects/bectl/contrib/file/aclocal.m4 projects/bectl/contrib/file/compile projects/bectl/contrib/file/config.guess projects/bectl/contrib/file/config.h.in projects/bectl/contrib/file/config.sub projects/bectl/contrib/file/configure projects/bectl/contrib/file/configure.ac projects/bectl/contrib/file/depcomp projects/bectl/contrib/file/doc/Makefile.in projects/bectl/contrib/file/doc/file.man projects/bectl/contrib/file/doc/magic.man projects/bectl/contrib/file/install-sh projects/bectl/contrib/file/ltmain.sh projects/bectl/contrib/file/magic/Magdir/animation projects/bectl/contrib/file/magic/Magdir/archive projects/bectl/contrib/file/magic/Magdir/audio projects/bectl/contrib/file/magic/Magdir/cad projects/bectl/contrib/file/magic/Magdir/console projects/bectl/contrib/file/magic/Magdir/database projects/bectl/contrib/file/magic/Magdir/dbpf projects/bectl/contrib/file/magic/Magdir/dump projects/bectl/contrib/file/magic/Magdir/elf projects/bectl/contrib/file/magic/Magdir/fsav projects/bectl/contrib/file/magic/Magdir/images projects/bectl/contrib/file/magic/Magdir/linux projects/bectl/contrib/file/magic/Magdir/make projects/bectl/contrib/file/magic/Magdir/measure projects/bectl/contrib/file/magic/Magdir/msdos projects/bectl/contrib/file/magic/Magdir/msooxml projects/bectl/contrib/file/magic/Magdir/pdf projects/bectl/contrib/file/magic/Magdir/sgi projects/bectl/contrib/file/magic/Makefile.am projects/bectl/contrib/file/magic/Makefile.in projects/bectl/contrib/file/missing projects/bectl/contrib/file/python/Makefile.am projects/bectl/contrib/file/python/Makefile.in projects/bectl/contrib/file/python/magic.py projects/bectl/contrib/file/python/setup.py projects/bectl/contrib/file/src/Makefile.in projects/bectl/contrib/file/src/apprentice.c projects/bectl/contrib/file/src/compress.c projects/bectl/contrib/file/src/der.c projects/bectl/contrib/file/src/file.h projects/bectl/contrib/file/src/funcs.c projects/bectl/contrib/file/src/readcdf.c projects/bectl/contrib/file/src/readelf.c projects/bectl/contrib/file/src/readelf.h projects/bectl/contrib/file/src/seccomp.c projects/bectl/contrib/file/src/softmagic.c projects/bectl/contrib/file/tests/Makefile.am projects/bectl/contrib/file/tests/Makefile.in projects/bectl/contrib/flex/main.c projects/bectl/contrib/libarchive/cat/bsdcat.c projects/bectl/contrib/libarchive/cpio/cpio.c projects/bectl/contrib/libarchive/libarchive/archive_entry.c projects/bectl/contrib/libarchive/libarchive/archive_entry.h projects/bectl/contrib/libarchive/libarchive/archive_openssl_hmac_private.h projects/bectl/contrib/libarchive/libarchive/archive_read.c projects/bectl/contrib/libarchive/libarchive/archive_read_support_format_lha.c projects/bectl/contrib/libarchive/libarchive/archive_read_support_format_mtree.c projects/bectl/contrib/libarchive/libarchive/archive_read_support_format_zip.c projects/bectl/contrib/libarchive/libarchive/archive_virtual.c projects/bectl/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c projects/bectl/contrib/libarchive/libarchive/archive_write_set_format_ar.c projects/bectl/contrib/libarchive/libarchive/test/test_sparse_basic.c projects/bectl/contrib/libarchive/libarchive/test/test_write_filter_gzip.c projects/bectl/contrib/libarchive/libarchive/test/test_write_filter_zstd.c projects/bectl/contrib/libarchive/tar/bsdtar.c projects/bectl/contrib/libarchive/tar/test/test_option_fflags.c projects/bectl/contrib/libarchive/tar/write.c projects/bectl/contrib/libarchive/test_utils/test_main.c projects/bectl/contrib/llvm/include/llvm/BinaryFormat/ELF.h projects/bectl/contrib/llvm/include/llvm/Support/ARMBuildAttributes.h projects/bectl/contrib/llvm/tools/lld/ELF/Arch/AArch64.cpp projects/bectl/contrib/llvm/tools/lld/ELF/Arch/ARM.cpp projects/bectl/contrib/llvm/tools/lld/ELF/Arch/X86.cpp projects/bectl/contrib/llvm/tools/lld/ELF/Config.h projects/bectl/contrib/llvm/tools/lld/ELF/InputFiles.cpp projects/bectl/contrib/mdocml/apropos.1 projects/bectl/contrib/mdocml/main.c projects/bectl/contrib/mdocml/man.1 projects/bectl/contrib/mdocml/mandoc.1 projects/bectl/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c projects/bectl/contrib/netbsd-tests/lib/libpthread/t_mutex.c projects/bectl/contrib/pf/pflogd/pflogd.8 projects/bectl/contrib/tnftp/src/ftp_var.h projects/bectl/etc/Makefile projects/bectl/etc/defaults/Makefile projects/bectl/etc/mtree/BSD.tests.dist projects/bectl/etc/mtree/BSD.var.dist projects/bectl/etc/root/dot.cshrc projects/bectl/etc/root/dot.profile projects/bectl/include/time.h projects/bectl/lib/clang/include/lld/Common/Version.inc projects/bectl/lib/clang/include/llvm/Config/AsmParsers.def projects/bectl/lib/clang/include/llvm/Config/AsmPrinters.def projects/bectl/lib/clang/include/llvm/Config/Disassemblers.def projects/bectl/lib/clang/include/llvm/Config/Targets.def projects/bectl/lib/clang/include/llvm/Config/config.h projects/bectl/lib/clang/libllvm/Makefile projects/bectl/lib/clang/llvm.build.mk projects/bectl/lib/libauditd/Makefile projects/bectl/lib/libbsm/Makefile projects/bectl/lib/libc/gen/Makefile.inc projects/bectl/lib/libc/gen/Symbol.map projects/bectl/lib/libc/gen/exec.3 projects/bectl/lib/libc/gen/ftok.c projects/bectl/lib/libc/gen/getpwent.c projects/bectl/lib/libc/gen/pw_scan.c projects/bectl/lib/libc/gen/pw_scan.h projects/bectl/lib/libc/inet/inet_addr.c projects/bectl/lib/libc/powerpcspe/gen/fabs.S projects/bectl/lib/libc/powerpcspe/gen/fpgetmask.c projects/bectl/lib/libc/powerpcspe/gen/fpsetmask.c projects/bectl/lib/libc/sys/getlogin.2 projects/bectl/lib/libc/sys/getloginclass.2 projects/bectl/lib/libc/sys/gettimeofday.2 projects/bectl/lib/libc/sys/kqueue.2 projects/bectl/lib/libclang_rt/Makefile.inc projects/bectl/lib/libgcc_eh/Makefile.inc projects/bectl/lib/libkvm/kvm_minidump_mips.c projects/bectl/lib/libnv/Makefile projects/bectl/lib/libproc/tests/proc_test.c projects/bectl/lib/libprocstat/zfs/Makefile projects/bectl/lib/libthread_db/arch/riscv/libpthread_md.c projects/bectl/lib/libutil/Makefile projects/bectl/lib/libutil/libutil.h projects/bectl/lib/libutil/pw_util.3 projects/bectl/lib/libutil/pw_util.c projects/bectl/libexec/getty/ttys.5 projects/bectl/libexec/rtld-elf/malloc.c projects/bectl/libexec/rtld-elf/paths.h projects/bectl/libexec/rtld-elf/riscv/rtld_start.S projects/bectl/libexec/rtld-elf/rtld.c projects/bectl/libexec/rtld-elf/tests/ld_library_pathfds.c projects/bectl/release/Makefile.ec2 projects/bectl/release/Makefile.mirrors projects/bectl/release/arm/BANANAPI.conf projects/bectl/release/arm/BEAGLEBONE.conf projects/bectl/release/arm/CUBIEBOARD.conf projects/bectl/release/arm/CUBIEBOARD2.conf projects/bectl/release/arm/CUBOX-HUMMINGBOARD.conf projects/bectl/release/arm/PANDABOARD.conf projects/bectl/release/arm/RPI-B.conf projects/bectl/release/arm/RPI2.conf projects/bectl/release/arm/WANDBOARD.conf projects/bectl/release/release.sh projects/bectl/release/tools/arm.subr projects/bectl/release/tools/gce.conf projects/bectl/sbin/devd/devd.cc projects/bectl/sbin/dhclient/dhclient.8 projects/bectl/sbin/dhclient/dhclient.c projects/bectl/sbin/dump/Makefile projects/bectl/sbin/fsck_ffs/fsutil.c projects/bectl/sbin/ifconfig/ifconfig.c projects/bectl/sbin/init/Makefile projects/bectl/sbin/init/init.8 projects/bectl/sbin/init/init.c projects/bectl/sbin/ipfw/ipfw.8 projects/bectl/sbin/ipfw/ipfw2.c projects/bectl/sbin/ldconfig/ldconfig.c projects/bectl/sbin/mount/mount.8 projects/bectl/sbin/mount/mount.c projects/bectl/sbin/pfctl/tests/files/Makefile projects/bectl/sbin/savecore/Makefile projects/bectl/share/man/man3/Makefile projects/bectl/share/man/man3/timeradd.3 projects/bectl/share/man/man4/Makefile projects/bectl/share/man/man4/cxgbe.4 projects/bectl/share/man/man4/ddb.4 projects/bectl/share/man/man4/dtrace_sctp.4 projects/bectl/share/man/man4/dtrace_tcp.4 projects/bectl/share/man/man4/dtrace_udp.4 projects/bectl/share/man/man4/firewire.4 projects/bectl/share/man/man4/jedec_dimm.4 projects/bectl/share/man/man4/man4.arm/Makefile projects/bectl/share/man/man4/pci.4 projects/bectl/share/man/man4/pf.4 projects/bectl/share/man/man4/qlnxe.4 projects/bectl/share/man/man4/tcp.4 projects/bectl/share/man/man4/uep.4 projects/bectl/share/man/man5/src.conf.5 projects/bectl/share/man/man7/arch.7 projects/bectl/share/man/man7/tests.7 projects/bectl/share/man/man8/rc.subr.8 projects/bectl/share/man/man9/VOP_LOOKUP.9 projects/bectl/share/man/man9/vm_map.9 projects/bectl/share/man/man9/vnet.9 projects/bectl/share/misc/bsd-family-tree projects/bectl/share/misc/committers-ports.dot projects/bectl/share/mk/Makefile projects/bectl/share/mk/atf.test.mk projects/bectl/share/mk/bsd.confs.mk projects/bectl/share/mk/bsd.cpu.mk projects/bectl/share/mk/bsd.dirs.mk projects/bectl/share/mk/bsd.files.mk projects/bectl/share/mk/bsd.lib.mk projects/bectl/share/mk/bsd.own.mk projects/bectl/share/mk/bsd.sys.mk projects/bectl/share/mk/bsd.test.mk projects/bectl/share/mk/dirdeps.mk projects/bectl/share/mk/gendirdeps.mk projects/bectl/share/mk/local.autodep.mk projects/bectl/share/mk/local.dirdeps.mk projects/bectl/share/mk/local.gendirdeps.mk projects/bectl/share/mk/local.meta.sys.mk projects/bectl/share/mk/meta.autodep.mk projects/bectl/share/mk/meta.stage.mk projects/bectl/share/mk/meta.sys.mk projects/bectl/share/mk/meta2deps.py projects/bectl/share/mk/plain.test.mk projects/bectl/share/mk/src.opts.mk projects/bectl/share/mk/tap.test.mk projects/bectl/share/skel/dot.cshrc projects/bectl/share/skel/dot.mailrc projects/bectl/share/skel/dot.profile projects/bectl/share/vt/keymaps/INDEX.keymaps projects/bectl/share/vt/keymaps/Makefile projects/bectl/stand/defs.mk projects/bectl/stand/efi/loader/bootinfo.c projects/bectl/stand/efi/loader/framebuffer.c projects/bectl/stand/efi/loader/main.c projects/bectl/stand/i386/gptboot/gptboot.c projects/bectl/stand/i386/isoboot/isoboot.c projects/bectl/stand/i386/libi386/biosdisk.c projects/bectl/stand/i386/libi386/pxe.h projects/bectl/stand/i386/zfsboot/zfsboot.c projects/bectl/stand/libsa/bootp.c projects/bectl/stand/libsa/bootp.h projects/bectl/stand/libsa/cd9660.c projects/bectl/stand/libsa/cd9660read.c projects/bectl/stand/libsa/dosfs.c projects/bectl/stand/libsa/gets.c projects/bectl/stand/libsa/gzipfs.c projects/bectl/stand/libsa/net.c projects/bectl/stand/libsa/nfs.c projects/bectl/stand/lua/config.lua projects/bectl/stand/man/loader.8 projects/bectl/stand/uboot/common/main.c projects/bectl/sys/amd64/amd64/efirt_machdep.c (contents, props changed) projects/bectl/sys/amd64/amd64/exception.S projects/bectl/sys/amd64/amd64/fpu.c projects/bectl/sys/amd64/amd64/initcpu.c projects/bectl/sys/amd64/amd64/machdep.c projects/bectl/sys/amd64/amd64/pmap.c projects/bectl/sys/amd64/amd64/support.S projects/bectl/sys/amd64/amd64/trap.c projects/bectl/sys/amd64/conf/GENERIC projects/bectl/sys/amd64/conf/NOTES projects/bectl/sys/amd64/ia32/ia32_exception.S projects/bectl/sys/amd64/include/asmacros.h projects/bectl/sys/amd64/include/vmparam.h projects/bectl/sys/amd64/linux/linux_machdep.c projects/bectl/sys/amd64/linux/linux_support.s projects/bectl/sys/amd64/linux32/linux32_machdep.c projects/bectl/sys/amd64/linux32/linux32_support.s projects/bectl/sys/amd64/vmm/vmm_dev.c projects/bectl/sys/arm/allwinner/aw_sid.c projects/bectl/sys/arm/allwinner/aw_sid.h projects/bectl/sys/arm/allwinner/aw_thermal.c projects/bectl/sys/arm/allwinner/clkng/ccu_a64.c projects/bectl/sys/arm/allwinner/files.allwinner projects/bectl/sys/arm/allwinner/if_awg.c projects/bectl/sys/arm/allwinner/if_emac.c projects/bectl/sys/arm/allwinner/std.allwinner projects/bectl/sys/arm/altera/socfpga/std.socfpga projects/bectl/sys/arm/amlogic/aml8726/std.aml8726 projects/bectl/sys/arm/annapurna/alpine/std.alpine projects/bectl/sys/arm/arm/cpufunc.c projects/bectl/sys/arm/arm/cpufunc_asm.S projects/bectl/sys/arm/arm/cpufunc_asm_arm9.S projects/bectl/sys/arm/arm/cpufunc_asm_armv5_ec.S projects/bectl/sys/arm/arm/cpufunc_asm_sheeva.S projects/bectl/sys/arm/arm/elf_trampoline.c projects/bectl/sys/arm/arm/gic.c projects/bectl/sys/arm/arm/gic.h projects/bectl/sys/arm/arm/gic_fdt.c projects/bectl/sys/arm/arm/identcpu-v4.c projects/bectl/sys/arm/arm/machdep.c projects/bectl/sys/arm/arm/mp_machdep.c projects/bectl/sys/arm/arm/pmap-v4.c projects/bectl/sys/arm/arm/pmap-v6.c projects/bectl/sys/arm/arm/trap-v4.c projects/bectl/sys/arm/arm/undefined.c projects/bectl/sys/arm/broadcom/bcm2835/std.bcm2836 projects/bectl/sys/arm/conf/GENERIC projects/bectl/sys/arm/conf/NOTES projects/bectl/sys/arm/conf/RT1310 projects/bectl/sys/arm/freescale/imx/std.imx6 projects/bectl/sys/arm/include/atomic-v4.h projects/bectl/sys/arm/include/cpufunc.h projects/bectl/sys/arm/include/pmap-v6.h projects/bectl/sys/arm/include/smp.h projects/bectl/sys/arm/mv/armada38x/std.armada38x projects/bectl/sys/arm/mv/armadaxp/armadaxp.c projects/bectl/sys/arm/mv/armadaxp/armadaxp_mp.c projects/bectl/sys/arm/nvidia/tegra124/std.tegra124 projects/bectl/sys/arm/qemu/std.virt projects/bectl/sys/arm/ralink/rt1310_intc.c projects/bectl/sys/arm/rockchip/std.rk30xx projects/bectl/sys/arm/samsung/exynos/std.exynos5250 projects/bectl/sys/arm/samsung/exynos/std.exynos5420 projects/bectl/sys/arm/ti/ti_cpuid.c projects/bectl/sys/arm/xilinx/std.zynq7 projects/bectl/sys/arm64/arm64/cpu_errata.c projects/bectl/sys/arm64/arm64/efirt_machdep.c projects/bectl/sys/arm64/arm64/exception.S projects/bectl/sys/arm64/arm64/genassym.c projects/bectl/sys/arm64/arm64/pmap.c projects/bectl/sys/arm64/conf/GENERIC projects/bectl/sys/arm64/include/pcpu.h projects/bectl/sys/cam/cam_ccb.h projects/bectl/sys/cam/cam_iosched.c projects/bectl/sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c projects/bectl/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c projects/bectl/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h projects/bectl/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c projects/bectl/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h projects/bectl/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/Makefile.files projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_removal.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_priority.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c projects/bectl/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h projects/bectl/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair_impl.h projects/bectl/sys/compat/cloudabi/cloudabi_sock.c projects/bectl/sys/compat/freebsd32/freebsd32_ioctl.c projects/bectl/sys/compat/freebsd32/freebsd32_ioctl.h projects/bectl/sys/compat/freebsd32/freebsd32_misc.c projects/bectl/sys/compat/freebsd32/freebsd32_proto.h projects/bectl/sys/compat/freebsd32/freebsd32_syscall.h projects/bectl/sys/compat/freebsd32/freebsd32_syscalls.c projects/bectl/sys/compat/freebsd32/freebsd32_sysent.c projects/bectl/sys/compat/freebsd32/freebsd32_systrace_args.c projects/bectl/sys/compat/freebsd32/syscalls.master projects/bectl/sys/compat/linux/linux_event.c projects/bectl/sys/compat/linux/linux_futex.c projects/bectl/sys/compat/linux/linux_misc.c projects/bectl/sys/compat/linux/linux_socket.c projects/bectl/sys/compat/linuxkpi/common/include/asm/atomic-long.h projects/bectl/sys/compat/linuxkpi/common/include/asm/atomic.h projects/bectl/sys/compat/linuxkpi/common/include/asm/atomic64.h projects/bectl/sys/compat/linuxkpi/common/include/linux/bitops.h projects/bectl/sys/compat/linuxkpi/common/include/linux/ktime.h projects/bectl/sys/compat/linuxkpi/common/include/linux/sched.h projects/bectl/sys/compat/linuxkpi/common/include/linux/time.h projects/bectl/sys/compat/linuxkpi/common/include/linux/types.h projects/bectl/sys/compat/linuxkpi/common/include/linux/workqueue.h projects/bectl/sys/compat/linuxkpi/common/src/linux_work.c projects/bectl/sys/conf/Makefile.arm projects/bectl/sys/conf/NOTES projects/bectl/sys/conf/files projects/bectl/sys/conf/files.amd64 projects/bectl/sys/conf/files.arm projects/bectl/sys/conf/files.powerpc projects/bectl/sys/conf/kern.mk projects/bectl/sys/conf/newvers.sh projects/bectl/sys/conf/options projects/bectl/sys/conf/options.arm projects/bectl/sys/contrib/ck/include/gcc/ppc/ck_pr.h projects/bectl/sys/contrib/ck/include/spinlock/hclh.h projects/bectl/sys/contrib/ck/src/ck_barrier_combining.c projects/bectl/sys/contrib/ipfilter/netinet/ip_compat.h projects/bectl/sys/contrib/ipfilter/netinet/ip_nat.c projects/bectl/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c projects/bectl/sys/ddb/db_ps.c projects/bectl/sys/dev/acpica/acpi_cmbat.c projects/bectl/sys/dev/acpica/acpi_smbat.c projects/bectl/sys/dev/acpica/acpi_thermal.c projects/bectl/sys/dev/ahci/ahci.c projects/bectl/sys/dev/ath/if_ath_rx_edma.c projects/bectl/sys/dev/bge/if_bge.c projects/bectl/sys/dev/bwi/if_bwi.c projects/bectl/sys/dev/cx/cxddk.c projects/bectl/sys/dev/cxgbe/adapter.h projects/bectl/sys/dev/cxgbe/common/common.h projects/bectl/sys/dev/cxgbe/common/t4_hw.c projects/bectl/sys/dev/cxgbe/offload.h projects/bectl/sys/dev/cxgbe/t4_filter.c projects/bectl/sys/dev/cxgbe/t4_main.c projects/bectl/sys/dev/cxgbe/t4_netmap.c projects/bectl/sys/dev/cxgbe/t4_sched.c projects/bectl/sys/dev/cxgbe/t4_sge.c projects/bectl/sys/dev/cxgbe/tom/t4_cpl_io.c projects/bectl/sys/dev/cxgbe/tom/t4_tom.c projects/bectl/sys/dev/drm2/i915/i915_gem.c projects/bectl/sys/dev/drm2/i915/intel_pm.c projects/bectl/sys/dev/efidev/efirt.c (contents, props changed) projects/bectl/sys/dev/efidev/efirtc.c projects/bectl/sys/dev/extres/clk/clk_div.c projects/bectl/sys/dev/filemon/filemon.c projects/bectl/sys/dev/filemon/filemon_wrapper.c projects/bectl/sys/dev/firewire/00README projects/bectl/sys/dev/flash/mx25l.c projects/bectl/sys/dev/flash/n25q.c projects/bectl/sys/dev/hwpmc/pmc_events.h projects/bectl/sys/dev/hyperv/pcib/vmbus_pcib.c projects/bectl/sys/dev/hyperv/vmbus/amd64/vmbus_vector.S projects/bectl/sys/dev/isp/isp_freebsd.c projects/bectl/sys/dev/jedec_dimm/jedec_dimm.c projects/bectl/sys/dev/joy/joy.c projects/bectl/sys/dev/mii/icsphy.c projects/bectl/sys/dev/mii/miidevs projects/bectl/sys/dev/nvme/nvme_qpair.c projects/bectl/sys/dev/ofw/ofw_cpu.c projects/bectl/sys/dev/pci/pci_user.c projects/bectl/sys/dev/psci/smccc.c projects/bectl/sys/dev/psci/smccc.h projects/bectl/sys/dev/qlnx/qlnxe/bcm_osal.h projects/bectl/sys/dev/qlnx/qlnxe/common_hsi.h projects/bectl/sys/dev/qlnx/qlnxe/ecore.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_chain.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_cxt.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_cxt.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_dbg_values.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_dcbx.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_dcbx.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_dcbx_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_dev.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_dev_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_fcoe.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_common.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_init_func.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_init_tool.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_hw.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_hw.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_init_ops.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_init_values.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_int.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_int.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_int_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_iov_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_iro.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_iro_values.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_iscsi.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_l2.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_l2.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_l2_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_ll2.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_ll2_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_mcp.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_mcp.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_mcp_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_ooo.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_proto_if.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_roce.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_roce_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_rt_defs.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_sp_commands.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_sp_commands.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_spq.c projects/bectl/sys/dev/qlnx/qlnxe/ecore_spq.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_sriov.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_utils.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_vf.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_vf_api.h projects/bectl/sys/dev/qlnx/qlnxe/ecore_vfpf_if.h projects/bectl/sys/dev/qlnx/qlnxe/eth_common.h projects/bectl/sys/dev/qlnx/qlnxe/fcoe_common.h projects/bectl/sys/dev/qlnx/qlnxe/iscsi_common.h projects/bectl/sys/dev/qlnx/qlnxe/mcp_private.h projects/bectl/sys/dev/qlnx/qlnxe/mcp_public.h projects/bectl/sys/dev/qlnx/qlnxe/nvm_cfg.h projects/bectl/sys/dev/qlnx/qlnxe/nvm_map.h projects/bectl/sys/dev/qlnx/qlnxe/qlnx_def.h projects/bectl/sys/dev/qlnx/qlnxe/qlnx_ioctl.c projects/bectl/sys/dev/qlnx/qlnxe/qlnx_ioctl.h projects/bectl/sys/dev/qlnx/qlnxe/qlnx_os.c projects/bectl/sys/dev/qlnx/qlnxe/qlnx_os.h projects/bectl/sys/dev/qlnx/qlnxe/qlnx_ver.h projects/bectl/sys/dev/qlnx/qlnxe/rdma_common.h projects/bectl/sys/dev/qlnx/qlnxe/reg_addr.h projects/bectl/sys/dev/qlnx/qlnxe/roce_common.h projects/bectl/sys/dev/qlnx/qlnxe/spad_layout.h projects/bectl/sys/dev/qlnx/qlnxe/storage_common.h projects/bectl/sys/dev/qlnx/qlnxe/tcp_common.h projects/bectl/sys/dev/sk/if_sk.c projects/bectl/sys/dev/sound/pci/hda/hdaa.c projects/bectl/sys/dev/sound/pci/hda/hdac.c projects/bectl/sys/dev/sound/pci/maestro3.c projects/bectl/sys/dev/sound/pcm/dsp.c projects/bectl/sys/dev/usb/controller/usb_controller.c projects/bectl/sys/dev/usb/input/uep.c projects/bectl/sys/dev/usb/input/wmt.c projects/bectl/sys/dev/usb/net/if_muge.c projects/bectl/sys/dev/vt/hw/vga/vt_vga.c projects/bectl/sys/dev/xen/blkfront/blkfront.c projects/bectl/sys/dev/xen/grant_table/grant_table.c projects/bectl/sys/dev/xen/timer/timer.c projects/bectl/sys/fs/cd9660/cd9660_lookup.c projects/bectl/sys/fs/cd9660/cd9660_rrip.c projects/bectl/sys/fs/cd9660/cd9660_vfsops.c projects/bectl/sys/fs/cd9660/cd9660_vnops.c projects/bectl/sys/fs/ext2fs/ext2_dir.h projects/bectl/sys/fs/ext2fs/ext2_htree.c projects/bectl/sys/fs/ext2fs/ext2_lookup.c projects/bectl/sys/fs/ext2fs/ext2_vnops.c projects/bectl/sys/fs/fuse/fuse_file.c projects/bectl/sys/fs/fuse/fuse_vfsops.c projects/bectl/sys/fs/fuse/fuse_vnops.c projects/bectl/sys/fs/msdosfs/denode.h projects/bectl/sys/fs/msdosfs/direntry.h projects/bectl/sys/fs/msdosfs/fat.h projects/bectl/sys/fs/msdosfs/msdosfs_conv.c projects/bectl/sys/fs/msdosfs/msdosfs_denode.c projects/bectl/sys/fs/msdosfs/msdosfs_fat.c projects/bectl/sys/fs/msdosfs/msdosfs_lookup.c projects/bectl/sys/fs/msdosfs/msdosfs_vfsops.c projects/bectl/sys/fs/msdosfs/msdosfs_vnops.c projects/bectl/sys/fs/nfs/nfs.h projects/bectl/sys/fs/nfs/nfs_commonkrpc.c projects/bectl/sys/fs/nfs/nfs_var.h projects/bectl/sys/fs/nfsclient/nfs_clrpcops.c projects/bectl/sys/fs/nfsclient/nfs_clstate.c projects/bectl/sys/fs/nfsserver/nfs_nfsdport.c projects/bectl/sys/fs/nfsserver/nfs_nfsdserv.c projects/bectl/sys/fs/nfsserver/nfs_nfsdstate.c projects/bectl/sys/i386/i386/copyout.c projects/bectl/sys/i386/i386/machdep.c projects/bectl/sys/i386/i386/npx.c projects/bectl/sys/i386/i386/pmap.c projects/bectl/sys/i386/i386/vm_machdep.c projects/bectl/sys/i386/include/atomic.h projects/bectl/sys/i386/include/cserial.h projects/bectl/sys/i386/include/pmap.h projects/bectl/sys/i386/include/vmparam.h projects/bectl/sys/kern/imgact_elf.c projects/bectl/sys/kern/kern_event.c projects/bectl/sys/kern/kern_intr.c projects/bectl/sys/kern/kern_jail.c projects/bectl/sys/kern/kern_sig.c projects/bectl/sys/kern/kern_syscalls.c projects/bectl/sys/kern/kern_tc.c projects/bectl/sys/kern/kern_time.c projects/bectl/sys/kern/kern_umtx.c projects/bectl/sys/kern/link_elf_obj.c projects/bectl/sys/kern/sched_ule.c projects/bectl/sys/kern/subr_epoch.c projects/bectl/sys/kern/subr_gtaskqueue.c projects/bectl/sys/kern/subr_msgbuf.c projects/bectl/sys/kern/subr_pcpu.c projects/bectl/sys/kern/subr_prf.c projects/bectl/sys/kern/subr_rtc.c projects/bectl/sys/kern/sys_process.c projects/bectl/sys/kern/uipc_mqueue.c projects/bectl/sys/kern/uipc_sem.c projects/bectl/sys/kern/uipc_sockbuf.c projects/bectl/sys/kern/uipc_syscalls.c projects/bectl/sys/kern/uipc_usrreq.c projects/bectl/sys/mips/include/cpuregs.h projects/bectl/sys/mips/include/vm.h projects/bectl/sys/mips/ingenic/jz4780_smb.c projects/bectl/sys/mips/mips/pmap.c projects/bectl/sys/modules/Makefile projects/bectl/sys/modules/dtb/am335x/Makefile projects/bectl/sys/modules/dtb/rpi/Makefile projects/bectl/sys/modules/i2c/Makefile projects/bectl/sys/modules/ipmi/Makefile projects/bectl/sys/modules/qlnx/Makefile projects/bectl/sys/modules/qlnx/qlnxe/Makefile projects/bectl/sys/modules/tcp/Makefile projects/bectl/sys/modules/usb/Makefile projects/bectl/sys/modules/usb/uep/Makefile projects/bectl/sys/net/altq/if_altq.h projects/bectl/sys/net/bpf.c projects/bectl/sys/net/ieee8023ad_lacp.c projects/bectl/sys/net/if.c projects/bectl/sys/net/if_bridge.c projects/bectl/sys/net/if_clone.c projects/bectl/sys/net/if_disc.c projects/bectl/sys/net/if_edsc.c projects/bectl/sys/net/if_enc.c projects/bectl/sys/net/if_epair.c projects/bectl/sys/net/if_ethersubr.c projects/bectl/sys/net/if_gif.c projects/bectl/sys/net/if_gre.c projects/bectl/sys/net/if_ipsec.c projects/bectl/sys/net/if_lagg.c projects/bectl/sys/net/if_llatbl.c projects/bectl/sys/net/if_loop.c projects/bectl/sys/net/if_me.c projects/bectl/sys/net/if_vlan.c projects/bectl/sys/net/iflib.c projects/bectl/sys/net/netisr.c projects/bectl/sys/net/pfvar.h projects/bectl/sys/net/route.c projects/bectl/sys/net/rtsock.c projects/bectl/sys/net/vnet.c projects/bectl/sys/net/vnet.h projects/bectl/sys/net80211/ieee80211_hwmp.c projects/bectl/sys/net80211/ieee80211_node.c projects/bectl/sys/netgraph/ng_base.c projects/bectl/sys/netgraph/ng_eiface.c projects/bectl/sys/netgraph/ng_iface.c projects/bectl/sys/netgraph/ng_iface.h projects/bectl/sys/netinet/cc/cc_cdg.c projects/bectl/sys/netinet/cc/cc_chd.c projects/bectl/sys/netinet/cc/cc_dctcp.c projects/bectl/sys/netinet/cc/cc_hd.c projects/bectl/sys/netinet/cc/cc_htcp.c projects/bectl/sys/netinet/cc/cc_newreno.c projects/bectl/sys/netinet/cc/cc_vegas.c projects/bectl/sys/netinet/if_ether.c projects/bectl/sys/netinet/igmp.c projects/bectl/sys/netinet/in.c projects/bectl/sys/netinet/in_gif.c projects/bectl/sys/netinet/in_kdtrace.c projects/bectl/sys/netinet/in_kdtrace.h projects/bectl/sys/netinet/in_mcast.c projects/bectl/sys/netinet/in_pcb.c projects/bectl/sys/netinet/in_pcb.h projects/bectl/sys/netinet/ip_carp.c projects/bectl/sys/netinet/ip_divert.c projects/bectl/sys/netinet/ip_gre.c projects/bectl/sys/netinet/ip_icmp.c projects/bectl/sys/netinet/ip_id.c projects/bectl/sys/netinet/ip_input.c projects/bectl/sys/netinet/ip_mroute.c projects/bectl/sys/netinet/ip_options.c projects/bectl/sys/netinet/ip_reass.c projects/bectl/sys/netinet/sctp_indata.c projects/bectl/sys/netinet/tcp_fastopen.c projects/bectl/sys/netinet/tcp_hostcache.c projects/bectl/sys/netinet/tcp_hpts.c projects/bectl/sys/netinet/tcp_input.c projects/bectl/sys/netinet/tcp_output.c projects/bectl/sys/netinet/tcp_reass.c projects/bectl/sys/netinet/tcp_stacks/rack.c projects/bectl/sys/netinet/tcp_subr.c projects/bectl/sys/netinet/tcp_syncache.c projects/bectl/sys/netinet/tcp_timewait.c projects/bectl/sys/netinet/tcp_usrreq.c projects/bectl/sys/netinet/udp_usrreq.c projects/bectl/sys/netinet/udplite.h projects/bectl/sys/netinet6/frag6.c projects/bectl/sys/netinet6/icmp6.c projects/bectl/sys/netinet6/in6_gif.c projects/bectl/sys/netinet6/in6_mcast.c projects/bectl/sys/netinet6/in6_proto.c projects/bectl/sys/netinet6/in6_rmx.c projects/bectl/sys/netinet6/in6_src.c projects/bectl/sys/netinet6/ip6_gre.c projects/bectl/sys/netinet6/ip6_input.c projects/bectl/sys/netinet6/ip6_mroute.c projects/bectl/sys/netinet6/mld6.c projects/bectl/sys/netinet6/nd6.c projects/bectl/sys/netinet6/nd6_nbr.c projects/bectl/sys/netinet6/nd6_rtr.c projects/bectl/sys/netinet6/scope6.c projects/bectl/sys/netinet6/send.c projects/bectl/sys/netinet6/udp6_usrreq.c projects/bectl/sys/netipsec/ipsec.c projects/bectl/sys/netipsec/key.c projects/bectl/sys/netipsec/keysock.c projects/bectl/sys/netpfil/ipfw/ip_fw2.c projects/bectl/sys/netpfil/ipfw/ip_fw_bpf.c projects/bectl/sys/netpfil/ipfw/ip_fw_dynamic.c projects/bectl/sys/netpfil/ipfw/ip_fw_pfil.c projects/bectl/sys/netpfil/ipfw/ip_fw_sockopt.c projects/bectl/sys/netpfil/ipfw/nptv6/nptv6.c projects/bectl/sys/netpfil/ipfw/pmod/tcpmod.c projects/bectl/sys/netpfil/pf/if_pflog.c projects/bectl/sys/netpfil/pf/if_pfsync.c projects/bectl/sys/netpfil/pf/pf.c projects/bectl/sys/netpfil/pf/pf_if.c projects/bectl/sys/netpfil/pf/pf_ioctl.c projects/bectl/sys/netpfil/pf/pf_norm.c projects/bectl/sys/netpfil/pf/pf_osfp.c projects/bectl/sys/netpfil/pf/pf_table.c projects/bectl/sys/netsmb/smb_iod.c projects/bectl/sys/netsmb/smb_trantcp.c projects/bectl/sys/ofed/include/rdma/ib_sa.h projects/bectl/sys/opencrypto/crypto.c projects/bectl/sys/powerpc/include/ieeefp.h projects/bectl/sys/powerpc/powernv/opal_dev.c projects/bectl/sys/powerpc/powerpc/db_disasm.c projects/bectl/sys/powerpc/powerpc/genassym.c projects/bectl/sys/powerpc/powerpc/pmap_dispatch.c projects/bectl/sys/powerpc/powerpc/swtch32.S projects/bectl/sys/riscv/conf/GENERIC projects/bectl/sys/riscv/include/atomic.h projects/bectl/sys/riscv/include/cpu.h projects/bectl/sys/riscv/include/vmparam.h projects/bectl/sys/riscv/riscv/copyinout.S projects/bectl/sys/riscv/riscv/machdep.c projects/bectl/sys/riscv/riscv/pmap.c projects/bectl/sys/riscv/riscv/soc.c projects/bectl/sys/riscv/riscv/swtch.S projects/bectl/sys/riscv/riscv/uma_machdep.c projects/bectl/sys/riscv/riscv/vm_machdep.c projects/bectl/sys/security/mac/mac_framework.c projects/bectl/sys/sparc64/include/atomic.h projects/bectl/sys/sparc64/sparc64/pmap.c projects/bectl/sys/sys/cdefs.h projects/bectl/sys/sys/efi.h projects/bectl/sys/sys/elf_common.h projects/bectl/sys/sys/interrupt.h projects/bectl/sys/sys/jail.h projects/bectl/sys/sys/mbuf.h projects/bectl/sys/sys/msgbuf.h projects/bectl/sys/sys/param.h projects/bectl/sys/sys/pciio.h projects/bectl/sys/sys/pcpu.h projects/bectl/sys/sys/proc.h projects/bectl/sys/sys/sockbuf.h projects/bectl/sys/sys/socketvar.h projects/bectl/sys/sys/sockopt.h projects/bectl/sys/sys/stdatomic.h projects/bectl/sys/sys/time.h projects/bectl/sys/sys/unpcb.h projects/bectl/sys/ufs/ffs/ffs_alloc.c projects/bectl/sys/ufs/ffs/ffs_balloc.c projects/bectl/sys/ufs/ffs/ffs_extern.h projects/bectl/sys/ufs/ffs/ffs_inode.c projects/bectl/sys/ufs/ffs/ffs_snapshot.c projects/bectl/sys/ufs/ffs/ffs_softdep.c projects/bectl/sys/ufs/ffs/ffs_suspend.c projects/bectl/sys/ufs/ffs/ffs_vfsops.c projects/bectl/sys/ufs/ffs/softdep.h projects/bectl/sys/ufs/ufs/ufsmount.h projects/bectl/sys/vm/pmap.h projects/bectl/sys/vm/swap_pager.c projects/bectl/sys/vm/vm_fault.c projects/bectl/sys/vm/vm_kern.c projects/bectl/sys/vm/vm_map.c projects/bectl/sys/vm/vm_mmap.c projects/bectl/sys/vm/vm_object.c projects/bectl/sys/vm/vm_pageout.c projects/bectl/sys/vm/vm_phys.c projects/bectl/sys/vm/vm_swapout.c projects/bectl/sys/x86/iommu/intel_dmar.h projects/bectl/sys/x86/x86/cpu_machdep.c projects/bectl/sys/x86/x86/stack_machdep.c projects/bectl/tests/sys/Makefile projects/bectl/tests/sys/audit/Makefile projects/bectl/tests/sys/geom/class/nop/nop_test.sh projects/bectl/tests/sys/kern/Makefile projects/bectl/tests/sys/kern/unix_passfd_test.c projects/bectl/tests/sys/kqueue/libkqueue/common.h projects/bectl/tests/sys/kqueue/libkqueue/main.c projects/bectl/tests/sys/kqueue/libkqueue/timer.c projects/bectl/tools/boot/rootgen.sh projects/bectl/tools/build/beinstall.sh projects/bectl/tools/regression/posixsem/posixsem.c projects/bectl/tools/regression/sockets/udp_pingpong/udp_pingpong.c projects/bectl/tools/regression/sockets/unix_cmsg/uc_check_time.c projects/bectl/tools/tools/git/HOWTO projects/bectl/tools/tools/nanobsd/pcengines/Files/root/.cshrc projects/bectl/tools/tools/nanobsd/rescue/Files/root/.cshrc projects/bectl/tools/tools/netrate/juggle/juggle.c projects/bectl/tools/tools/netrate/tcpp/tcpp_client.c projects/bectl/tools/tools/sysbuild/sysbuild.sh projects/bectl/tools/tools/syscall_timing/syscall_timing.c projects/bectl/usr.bin/apply/apply.c projects/bectl/usr.bin/calendar/calendars/calendar.freebsd projects/bectl/usr.bin/diff/diffreg.c projects/bectl/usr.bin/diff/tests/diff_test.sh projects/bectl/usr.bin/find/find.c projects/bectl/usr.bin/find/misc.c projects/bectl/usr.bin/kdump/kdump.c projects/bectl/usr.bin/mail/cmd1.c projects/bectl/usr.bin/mail/mail.1 projects/bectl/usr.bin/mail/pathnames.h projects/bectl/usr.bin/man/man.1 projects/bectl/usr.bin/man/man.sh projects/bectl/usr.bin/msgs/msgs.1 projects/bectl/usr.bin/msgs/pathnames.h projects/bectl/usr.bin/printf/printf.c projects/bectl/usr.bin/procstat/tests/procstat_test.sh projects/bectl/usr.bin/sed/Makefile projects/bectl/usr.bin/sed/compile.c projects/bectl/usr.bin/sed/extern.h projects/bectl/usr.bin/sed/process.c projects/bectl/usr.bin/stat/stat.c projects/bectl/usr.bin/tar/tests/Makefile projects/bectl/usr.bin/top/display.c projects/bectl/usr.bin/top/machine.c projects/bectl/usr.bin/top/screen.c projects/bectl/usr.bin/top/utils.c projects/bectl/usr.bin/top/utils.h projects/bectl/usr.bin/truncate/truncate.c projects/bectl/usr.bin/truss/setup.c projects/bectl/usr.bin/truss/syscalls.c projects/bectl/usr.bin/truss/truss.h projects/bectl/usr.bin/wc/wc.1 projects/bectl/usr.bin/wc/wc.c projects/bectl/usr.sbin/apmd/Makefile projects/bectl/usr.sbin/autofs/Makefile projects/bectl/usr.sbin/bhyve/bhyverun.c projects/bectl/usr.sbin/blacklistd/Makefile projects/bectl/usr.sbin/camdd/camdd.c projects/bectl/usr.sbin/config/mkmakefile.c projects/bectl/usr.sbin/cxgbetool/cxgbetool.8 projects/bectl/usr.sbin/cxgbetool/cxgbetool.c projects/bectl/usr.sbin/daemon/daemon.8 projects/bectl/usr.sbin/efibootmgr/efibootmgr.8 projects/bectl/usr.sbin/efibootmgr/efibootmgr.c projects/bectl/usr.sbin/freebsd-update/Makefile projects/bectl/usr.sbin/freebsd-update/freebsd-update.sh projects/bectl/usr.sbin/fstyp/Makefile projects/bectl/usr.sbin/jail/jail.8 projects/bectl/usr.sbin/makefs/ffs.c projects/bectl/usr.sbin/makefs/ffs/buf.c projects/bectl/usr.sbin/makefs/ffs/buf.h projects/bectl/usr.sbin/makefs/ffs/ffs_alloc.c projects/bectl/usr.sbin/makefs/ffs/ffs_balloc.c projects/bectl/usr.sbin/makefs/msdos.c projects/bectl/usr.sbin/makefs/msdos/msdosfs_denode.c projects/bectl/usr.sbin/makefs/msdos/msdosfs_vfsops.c projects/bectl/usr.sbin/makefs/msdos/msdosfs_vnops.c projects/bectl/usr.sbin/mergemaster/mergemaster.8 projects/bectl/usr.sbin/mergemaster/mergemaster.sh projects/bectl/usr.sbin/newsyslog/Makefile projects/bectl/usr.sbin/newsyslog/newsyslog.c projects/bectl/usr.sbin/newsyslog/tests/legacy_test.sh projects/bectl/usr.sbin/nfsd/Makefile projects/bectl/usr.sbin/nfsd/nfsd.8 projects/bectl/usr.sbin/nfsd/nfsd.c projects/bectl/usr.sbin/nfsd/pnfs.4 projects/bectl/usr.sbin/nscd/Makefile projects/bectl/usr.sbin/pciconf/pciconf.8 projects/bectl/usr.sbin/pciconf/pciconf.c projects/bectl/usr.sbin/pkg/Makefile projects/bectl/usr.sbin/pnfsdscopymr/pnfsdscopymr.c projects/bectl/usr.sbin/portsnap/portsnap/Makefile projects/bectl/usr.sbin/pw/pw_vpw.c projects/bectl/usr.sbin/route6d/route6d.c projects/bectl/usr.sbin/tzsetup/tzsetup.c projects/bectl/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8 Directory Properties: projects/bectl/ (props changed) projects/bectl/cddl/ (props changed) projects/bectl/cddl/contrib/opensolaris/ (props changed) projects/bectl/cddl/contrib/opensolaris/cmd/zdb/ (props changed) projects/bectl/cddl/contrib/opensolaris/cmd/zfs/ (props changed) projects/bectl/cddl/contrib/opensolaris/lib/libzfs/ (props changed) projects/bectl/contrib/elftoolchain/ (props changed) projects/bectl/contrib/file/ (props changed) projects/bectl/contrib/libarchive/ (props changed) projects/bectl/contrib/llvm/ (props changed) projects/bectl/contrib/llvm/tools/lld/ (props changed) projects/bectl/contrib/mdocml/ (props changed) projects/bectl/contrib/netbsd-tests/ (props changed) projects/bectl/contrib/pf/ (props changed) projects/bectl/contrib/tnftp/ (props changed) projects/bectl/sys/cddl/contrib/opensolaris/ (props changed) projects/bectl/sys/contrib/ck/ (props changed) projects/bectl/sys/contrib/ipfilter/ (props changed) Modified: projects/bectl/Makefile.inc1 ============================================================================== --- projects/bectl/Makefile.inc1 Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/Makefile.inc1 Sat Aug 11 04:26:29 2018 (r337608) @@ -830,6 +830,13 @@ IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh .else IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} .endif + +# When generating install media, do not allow user and group information from +# the build host to affect the contents of the distribution. +.if make(distributeworld) +DB_FROM_SRC= yes +.endif + .if defined(DB_FROM_SRC) INSTALLFLAGS+= -N ${.CURDIR}/etc MTREEFLAGS+= -N ${.CURDIR}/etc @@ -1936,13 +1943,17 @@ update: .PHONY _elftoolchain_libs= lib/libelf lib/libdwarf .endif +# libnv and libl are both requirements for config(8), which is an unconditional +# bootstrap-tool. +_config_deps= lib/libnv usr.bin/lex/lib + legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false .endif -.for _tool in tools/build ${_elftoolchain_libs} lib/libnv +.for _tool in tools/build ${_elftoolchain_libs} ${_config_deps} ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ Modified: projects/bectl/Makefile.libcompat ============================================================================== --- projects/bectl/Makefile.libcompat Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/Makefile.libcompat Sat Aug 11 04:26:29 2018 (r337608) @@ -126,10 +126,11 @@ LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOM MAKEOBJDIRPREFIX= \ MK_MAN=no MK_HTML=no LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \ - MK_TOOLCHAIN=no ${IMAKE_INSTALL} \ + ${IMAKE_INSTALL} \ -DLIBRARIES_ONLY -_LC_LIBDIRS.yes= lib gnu/lib +_LC_LIBDIRS.yes= lib +_LC_LIBDIRS.yes+= gnu/lib _LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib _LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib Modified: projects/bectl/ObsoleteFiles.inc ============================================================================== --- projects/bectl/ObsoleteFiles.inc Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/ObsoleteFiles.inc Sat Aug 11 04:26:29 2018 (r337608) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180725: Cleanup old libcasper.so.0 +OLD_LIBS+=lib/libcasper.so.0 # 20180722: indent(1) option renamed, test files follow OLD_FILES+=usr/bin/indent/tests/nsac.0 OLD_FILES+=usr/bin/indent/tests/nsac.0.pro @@ -588,8 +590,6 @@ OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt # 20171104: libcap_random should be in /lib not in /usr/lib OLD_LIBS+=usr/lib/libcap_random.so.0 # 20171104: Casper can work only as shared library -OLD_FILES+=usr/lib/libcasper.a -OLD_FILES+=usr/lib/libcasper_p.a OLD_FILES+=usr/lib/libcap_dns.a OLD_FILES+=usr/lib/libcap_dns_p.a OLD_FILES+=usr/lib/libcap_grp.a @@ -600,6 +600,20 @@ OLD_FILES+=usr/lib/libcap_random.a OLD_FILES+=usr/lib/libcap_random_p.a OLD_FILES+=usr/lib/libcap_sysctl.a OLD_FILES+=usr/lib/libcap_sysctl_p.a +OLD_FILES+=usr/lib/libcasper.a +OLD_FILES+=usr/lib/libcasper_p.a +OLD_FILES+=usr/lib32/libcap_dns.a +OLD_FILES+=usr/lib32/libcap_dns_p.a +OLD_FILES+=usr/lib32/libcap_grp.a +OLD_FILES+=usr/lib32/libcap_grp_p.a +OLD_FILES+=usr/lib32/libcap_pwd.a +OLD_FILES+=usr/lib32/libcap_pwd_p.a +OLD_FILES+=usr/lib32/libcap_random.a +OLD_FILES+=usr/lib32/libcap_random_p.a +OLD_FILES+=usr/lib32/libcap_sysctl.a +OLD_FILES+=usr/lib32/libcap_sysctl_p.a +OLD_FILES+=usr/lib32/libcasper.a +OLD_FILES+=usr/lib32/libcasper_p.a # 20171031: Removal of adding_user man page OLD_FILES+=usr/share/man/man7/adding_user.7.gz # 20171031: Disconnected libpathconv tests @@ -620,6 +634,8 @@ OLD_FILES+=usr/share/man/man9/mbp_sync.9.gz # 20171010: Remove libstand OLD_FILES+=usr/lib/libstand.a OLD_FILES+=usr/lib/libstand_p.a +OLD_FILES+=usr/lib32/libstand.a +OLD_FILES+=usr/lib32/libstand_p.a OLD_FILES+=usr/include/stand.h OLD_FILES+=usr/share/man/man3/libstand.3.gz # 20171003: remove RCMDS @@ -1372,6 +1388,10 @@ OLD_FILES+=usr/lib/libifc.a OLD_FILES+=usr/lib/libifc_p.a OLD_FILES+=usr/lib/libifconfig.a OLD_FILES+=usr/lib/libifconfig_p.a +OLD_FILES+=usr/lib32/libifc.a +OLD_FILES+=usr/lib32/libifc_p.a +OLD_FILES+=usr/lib32/libifconfig.a +OLD_FILES+=usr/lib32/libifconfig_p.a # 20170529: mount.conf(8) -> mount.conf(5) OLD_FILES+=usr/share/man/man8/mount.conf.8.gz # 20170525: remove misleading template Modified: projects/bectl/UPDATING ============================================================================== --- projects/bectl/UPDATING Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/UPDATING Sat Aug 11 04:26:29 2018 (r337608) @@ -1,4 +1,4 @@ -Updating Information for FreeBSD current users. + Updating Information for FreeBSD current users. This file is maintained and copyrighted by M. Warner Losh . See end of file for further details. For commonly done items, please see the @@ -31,6 +31,29 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180808: + The default pager for most commands has been changed to "less". To + restore the old behavior, set PAGER="more" and MANPAGER="more -s" in + your environment. + +20180731: + The jedec_ts(4) driver has been removed. A superset of its functionality + is available in the jedec_dimm(4) driver, and the manpage for that + driver includes migration instructions. If you have "device jedec_ts" + in your kernel configuration file, it must be removed. + +20180730: + amd64/GENERIC now has EFI runtime services, EFIRT, enabled by default. + This should have no effect if the kernel is booted via BIOS/legacy boot. + EFIRT may be disabled via a loader tunable, efi.rt.disabled, if a system + has a buggy firmware that prevents a successful boot due to use of + runtime services. + +20180727: + Atmel AT91RM9200 and AT91SAM9, Cavium CNS 11xx and XScale + support has been removed from the tree. These ports were + obsolete and/or known to be broken for many years. + 20180723: loader.efi has been augmented to participate more fully in the UEFI boot manager protocol. loader.efi will now look at the @@ -40,13 +63,24 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 20180720: zfsloader's functionality has now been folded into loader. - zfsloader is no longer necesasary once you've updated your + zfsloader is no longer necessary once you've updated your boot blocks. For a transition period, we will install a hardlink for zfsloader to loader to allow a smooth transition until the boot blocks can be updated (hard link because old zfs boot blocks don't understand symlinks). 20180719: + ARM64 now have efifb support, if you want to have serial console + on your arm64 board when an screen is connected and the bootloader + setup a frambuffer for us to use, just add : + boot_serial=YES + boot_multicons=YES + in /boot/loader.conf + For Raspberry Pi 3 (RPI) users, this is needed even if you don't have + an screen connected as the firmware will setup a framebuffer are that + u-boot will expose as an EFI framebuffer. + +20180719: New uid:gid added, ntpd:ntpd (123:123). Be sure to run mergemaster or take steps to update /etc/passwd before doing installworld on existing systems. Also, rc.d/ntpd now starts ntpd(8) as user ntpd @@ -164,7 +198,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: Support for FDDI networks has been removed. If you have device fddi or device fpa in your kernel config file they must be removed. - + 20180406: In addition to supporting RFC 3164 formatted messages, the syslogd(8) service is now capable of parsing RFC 5424 formatted Modified: projects/bectl/bin/date/date.1 ============================================================================== --- projects/bectl/bin/date/date.1 Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/date/date.1 Sat Aug 11 04:26:29 2018 (r337608) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 1, 2018 +.Dd August 4, 2018 .Dt DATE 1 .Os .Sh NAME @@ -64,6 +64,13 @@ .Nm .Op Fl d Ar dst .Op Fl t Ar minutes_west +.Nm +.Op Fl jnu +.Op Fl I Ns Op Ar FMT +.Op Fl f Ar input_fmt +.Op Fl r Ar ... +.Op Fl v Ar ... +.Op Ar new_date .Sh DESCRIPTION When invoked without arguments, the .Nm @@ -113,6 +120,33 @@ provided rather than using the default format. Parsing is done using .Xr strptime 3 . +.It Fl I Ns Op Ar FMT +Use +.St -iso8601 +output format. +.Ar FMT +may be omitted, in which case the default is +.Sq date . +Valid +.Ar FMT +values are +.Sq date , +.Sq hours , +.Sq minutes , +and +.Sq seconds . +The date and time is formatted to the specified precision. +When +.Ar FMT +is +.Sq hours +(or the more precise +.Sq minutes +or +.Sq seconds ) , +the +.St -iso8601 +format includes the timezone. .It Fl j Do not try to set the date. This allows you to use the @@ -401,6 +435,14 @@ sets the time to .Li "2:32 PM" , without modifying the date. .Pp +The command +.Pp +.Dl "TZ=America/Los_Angeles date -Iseconds -r 1533415339" +.Pp +will display +.Pp +.Dl "2018-08-04T13:42:19-07:00" +.Pp Finally the command: .Pp .Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`date`"" ""+%s""" @@ -425,6 +467,19 @@ between and .Xr timed 8 fails. +.Pp +It is invalid to combine the +.Fl I +flag with either +.Fl R +or an output format +.Dq ( + Ns ... ) +operand. +If this occurs, +.Nm +prints: +.Ql multiple output formats specified +and exits with an error status. .Sh SEE ALSO .Xr locale 1 , .Xr gettimeofday 2 , @@ -443,12 +498,22 @@ The utility is expected to be compatible with .St -p1003.2 . The -.Fl d , f , j , n , r , t , +.Fl d , f , I , j , n , r , t , and .Fl v options are all extensions to the standard. +.Pp +The format selected by the +.Fl I +flag is compatible with +.St -iso8601 . .Sh HISTORY A .Nm command appeared in .At v1 . +.Pp +The +.Fl I +flag was added in +.Fx 12.0 . Modified: projects/bectl/bin/date/date.c ============================================================================== --- projects/bectl/bin/date/date.c Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/date/date.c Sat Aug 11 04:26:29 2018 (r337608) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -68,10 +69,25 @@ __FBSDID("$FreeBSD$"); static time_t tval; int retval; -static void setthetime(const char *, const char *, int, int); static void badformat(void); +static void iso8601_usage(const char *); +static void multipleformats(void); +static void printdate(const char *); +static void printisodate(struct tm *); +static void setthetime(const char *, const char *, int, int); static void usage(void); +static const struct iso8601_fmt { + const char *refname; + const char *format_string; +} iso8601_fmts[] = { + { "date", "%Y-%m-%d" }, + { "hours", "T%H" }, + { "minutes", ":%M" }, + { "seconds", ":%S" }, +}; +static const struct iso8601_fmt *iso8601_selected; + static const char *rfc2822_format = "%a, %d %b %Y %T %z"; int @@ -79,7 +95,7 @@ main(int argc, char *argv[]) { struct timezone tz; int ch, rflag; - int jflag, nflag, Rflag; + bool Iflag, jflag, nflag, Rflag; const char *format; char buf[1024]; char *endptr, *fmt; @@ -89,15 +105,16 @@ main(int argc, char *argv[]) const struct vary *badv; struct tm *lt; struct stat sb; + size_t i; v = NULL; fmt = NULL; (void) setlocale(LC_TIME, ""); tz.tz_dsttime = tz.tz_minuteswest = 0; rflag = 0; - jflag = nflag = Rflag = 0; + Iflag = jflag = nflag = Rflag = 0; set_timezone = 0; - while ((ch = getopt(argc, argv, "d:f:jnRr:t:uv:")) != -1) + while ((ch = getopt(argc, argv, "d:f:I::jnRr:t:uv:")) != -1) switch((char)ch) { case 'd': /* daylight savings time */ tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0; @@ -108,6 +125,22 @@ main(int argc, char *argv[]) case 'f': fmt = optarg; break; + case 'I': + if (Rflag) + multipleformats(); + Iflag = 1; + if (optarg == NULL) { + iso8601_selected = iso8601_fmts; + break; + } + for (i = 0; i < nitems(iso8601_fmts); i++) + if (strcmp(optarg, iso8601_fmts[i].refname) == 0) + break; + if (i == nitems(iso8601_fmts)) + iso8601_usage(optarg); + + iso8601_selected = &iso8601_fmts[i]; + break; case 'j': jflag = 1; /* don't set time */ break; @@ -115,6 +148,8 @@ main(int argc, char *argv[]) nflag = 1; break; case 'R': /* RFC 2822 datetime format */ + if (Iflag) + multipleformats(); Rflag = 1; break; case 'r': /* user specified seconds */ @@ -163,6 +198,8 @@ main(int argc, char *argv[]) /* allow the operands in any order */ if (*argv && **argv == '+') { + if (Iflag) + multipleformats(); format = *argv + 1; ++argv; } @@ -173,8 +210,11 @@ main(int argc, char *argv[]) } else if (fmt != NULL) usage(); - if (*argv && **argv == '+') + if (*argv && **argv == '+') { + if (Iflag) + multipleformats(); format = *argv + 1; + } lt = localtime(&tval); if (lt == NULL) @@ -188,6 +228,9 @@ main(int argc, char *argv[]) } vary_destroy(v); + if (Iflag) + printisodate(lt); + if (format == rfc2822_format) /* * When using RFC 2822 datetime format, don't honor the @@ -196,12 +239,40 @@ main(int argc, char *argv[]) setlocale(LC_TIME, "C"); (void)strftime(buf, sizeof(buf), format, lt); + printdate(buf); +} + +static void +printdate(const char *buf) +{ (void)printf("%s\n", buf); if (fflush(stdout)) err(1, "stdout"); exit(retval); } +static void +printisodate(struct tm *lt) +{ + const struct iso8601_fmt *it; + char fmtbuf[32], buf[32], tzbuf[8]; + + fmtbuf[0] = 0; + for (it = iso8601_fmts; it <= iso8601_selected; it++) + strlcat(fmtbuf, it->format_string, sizeof(fmtbuf)); + + (void)strftime(buf, sizeof(buf), fmtbuf, lt); + + if (iso8601_selected > iso8601_fmts) { + (void)strftime(tzbuf, sizeof(tzbuf), "%z", lt); + memmove(&tzbuf[4], &tzbuf[3], 3); + tzbuf[3] = ':'; + strlcat(buf, tzbuf, sizeof(buf)); + } + + printdate(buf); +} + #define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0')) static void @@ -327,12 +398,27 @@ badformat(void) } static void +iso8601_usage(const char *badarg) +{ + errx(1, "invalid argument '%s' for -I", badarg); +} + +static void +multipleformats(void) +{ + errx(1, "multiple output formats specified"); +} + +static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", - "usage: date [-jnRu] [-d dst] [-r seconds] [-t west] " - "[-v[+|-]val[ymwdHMS]] ... ", + (void)fprintf(stderr, "%s\n%s\n%s\n", + "usage: date [-jnRu] [-d dst] [-r seconds|file] [-t west] " + "[-v[+|-]val[ymwdHMS]]", " " - "[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]"); + "[-I[date | hours | minutes | seconds]]", + " " + "[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]" + ); exit(1); } Modified: projects/bectl/bin/date/tests/format_string_test.sh ============================================================================== --- projects/bectl/bin/date/tests/format_string_test.sh Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/date/tests/format_string_test.sh Sat Aug 11 04:26:29 2018 (r337608) @@ -48,6 +48,55 @@ ${desc}_test_body() { atf_add_test_case ${desc}_test } +iso8601_check() +{ + local arg flags exp_output_1 exp_output_2 + + arg="${1}" + flags="${2}" + exp_output_1="${3}" + exp_output_2="${4}" + + atf_check -o "inline:${exp_output_1}\n" \ + date $flags -r ${TEST1} "-I${arg}" + atf_check -o "inline:${exp_output_2}\n" \ + date $flags -r ${TEST2} "-I${arg}" +} + +iso8601_string_test() +{ + local desc arg exp_output_1 exp_output_2 flags + + desc="${1}" + arg="${2}" + flags="${3}" + exp_output_1="${4}" + exp_output_2="${5}" + + atf_test_case iso8601_${desc}_test + eval " +iso8601_${desc}_test_body() { + iso8601_check '${arg}' '${flags}' '${exp_output_1}' '${exp_output_2}' +}" + atf_add_test_case iso8601_${desc}_test + + if [ -z "$flags" ]; then + atf_test_case iso8601_${desc}_parity + eval " +iso8601_${desc}_parity_body() { + local exp1 exp2 + + atf_require_prog gdate + + exp1=\"\$(gdate --date '@${TEST1}' '-I${arg}')\" + exp2=\"\$(gdate --date '@${TEST2}' '-I${arg}')\" + + iso8601_check '${arg}' '' \"\${exp1}\" \"\${exp2}\" +}" + atf_add_test_case iso8601_${desc}_parity + fi +} + atf_init_test_cases() { format_string_test A A Saturday Monday @@ -89,4 +138,12 @@ atf_init_test_cases() format_string_test z z +0000 +0000 format_string_test percent % % % format_string_test plus + "Sat Feb 7 07:04:03 UTC 1970" "Mon Nov 12 21:20:00 UTC 2001" + + iso8601_string_test default "" "" "1970-02-07" "2001-11-12" + iso8601_string_test date date "" "1970-02-07" "2001-11-12" + iso8601_string_test hours hours "" "1970-02-07T07+00:00" "2001-11-12T21+00:00" + iso8601_string_test minutes minutes "" "1970-02-07T07:04+00:00" "2001-11-12T21:20+00:00" + iso8601_string_test seconds seconds "" "1970-02-07T07:04:03+00:00" "2001-11-12T21:20:00+00:00" + # BSD date(1) does not support fractional seconds at this time. + #iso8601_string_test ns ns "" "1970-02-07T07:04:03,000000000+00:00" "2001-11-12T21:20:00,000000000+00:00" } Modified: projects/bectl/bin/dd/args.c ============================================================================== --- projects/bectl/bin/dd/args.c Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/dd/args.c Sat Aug 11 04:26:29 2018 (r337608) @@ -306,6 +306,8 @@ f_status(char *arg) ddflags |= C_NOINFO; else if (strcmp(arg, "noxfer") == 0) ddflags |= C_NOXFER; + else if (strcmp(arg, "progress") == 0) + ddflags |= C_PROGRESS; else errx(1, "unknown status %s", arg); } Modified: projects/bectl/bin/dd/dd.1 ============================================================================== --- projects/bectl/bin/dd/dd.1 Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/dd/dd.1 Sat Aug 11 04:26:29 2018 (r337608) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd April 2, 2017 +.Dd August 8, 2018 .Dt DD 1 .Os .Sh NAME @@ -164,12 +164,14 @@ bytes per second. Where .Cm value is one of the symbols from the following list. -.Bl -tag -width "noxfer" +.Bl -tag -width "progress" .It Cm noxfer Do not print the transfer statistics as the last line of status output. .It Cm none Do not print the status output. Error messages are shown; informational messages are not. +.It Cm progress +Print basic transfer statistics once per second. .El .It Cm conv Ns = Ns Ar value Ns Op , Ns Ar value ... Where Modified: projects/bectl/bin/dd/dd.c ============================================================================== --- projects/bectl/bin/dd/dd.c Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/dd/dd.c Sat Aug 11 04:26:29 2018 (r337608) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -89,6 +90,7 @@ const u_char *ctab; /* conversion table */ char fill_char; /* Character to fill with if defined */ size_t speed = 0; /* maximum speed, in bytes per second */ volatile sig_atomic_t need_summary; +volatile sig_atomic_t need_progress; int main(int argc __unused, char *argv[]) @@ -102,6 +104,7 @@ main(int argc __unused, char *argv[]) err(1, "unable to enter capability mode"); (void)signal(SIGINFO, siginfo_handler); + (void)signal(SIGALRM, sigalrm_handler); (void)signal(SIGINT, terminate); atexit(summary); @@ -281,6 +284,14 @@ setup(void) ctab = casetab; } + if ((ddflags & C_PROGRESS)) { + struct itimerval timer = { + .it_interval = { .tv_sec = 1, .tv_usec = 0 }, + .it_value = { .tv_sec = 1, .tv_usec = 0 }, + }; + setitimer(ITIMER_REAL, &timer, NULL); + } + if (clock_gettime(CLOCK_MONOTONIC, &st.start)) err(1, "clock_gettime"); } @@ -460,6 +471,9 @@ dd_in(void) (*cfunc)(); if (need_summary) { summary(); + } + if (need_progress) { + progress(); } } } Modified: projects/bectl/bin/dd/dd.h ============================================================================== --- projects/bectl/bin/dd/dd.h Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/dd/dd.h Sat Aug 11 04:26:29 2018 (r337608) @@ -100,5 +100,6 @@ typedef struct { #define C_STATUS 0x08000000 #define C_NOXFER 0x10000000 #define C_NOINFO 0x20000000 +#define C_PROGRESS 0x40000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: projects/bectl/bin/dd/extern.h ============================================================================== --- projects/bectl/bin/dd/extern.h Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/dd/extern.h Sat Aug 11 04:26:29 2018 (r337608) @@ -46,7 +46,9 @@ void pos_in(void); void pos_out(void); double secs_elapsed(void); void summary(void); +void progress(void); void siginfo_handler(int); +void sigalrm_handler(int); void terminate(int); void unblock(void); void unblock_close(void); @@ -66,3 +68,4 @@ extern const u_char a2ibm_32V[], a2ibm_POSIX[]; extern u_char casetab[]; extern char fill_char; extern volatile sig_atomic_t need_summary; +extern volatile sig_atomic_t need_progress; Modified: projects/bectl/bin/dd/misc.c ============================================================================== --- projects/bectl/bin/dd/misc.c Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/dd/misc.c Sat Aug 11 04:26:29 2018 (r337608) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include "dd.h" #include "extern.h" +static int need_newline; + double secs_elapsed(void) { @@ -83,6 +85,9 @@ summary(void) if (ddflags & C_NOINFO) return; + if (need_newline && !need_summary) + fprintf(stderr, "\n"); + secs = secs_elapsed(); (void)fprintf(stderr, @@ -102,12 +107,42 @@ summary(void) need_summary = 0; } +void +progress(void) +{ + double secs; + static int lastlen; + int len; + + secs = secs_elapsed(); + len = fprintf(stderr, + "\r%ju bytes transferred in %.0f secs (%.0f bytes/sec)", + st.bytes, secs, st.bytes / secs); + + if (len > 0) { + if (len < lastlen) + (void)fprintf(stderr, "%*s", len - lastlen, ""); + lastlen = len; + } + + need_newline = 1; + need_progress = 0; +} + /* ARGSUSED */ void siginfo_handler(int signo __unused) { need_summary = 1; +} + +/* ARGSUSED */ +void +sigalrm_handler(int signo __unused) +{ + + need_progress = 1; } /* ARGSUSED */ Modified: projects/bectl/bin/ls/ls.1 ============================================================================== --- projects/bectl/bin/ls/ls.1 Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/ls/ls.1 Sat Aug 11 04:26:29 2018 (r337608) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd January 17, 2018 +.Dd August 8, 2018 .Dt LS 1 .Os .Sh NAME @@ -132,6 +132,8 @@ after each that is a Enable colorized output. This option is equivalent to defining .Ev CLICOLOR +or +.Ev COLORTERM in the environment. (See below.) This functionality can be compiled out by removing the definition of @@ -628,6 +630,10 @@ The variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use. +.It Ev COLORTERM +See description for +.Ev CLICOLOR +above. .It Ev COLUMNS If this variable contains a string representing a decimal integer, it is used as the @@ -652,7 +658,9 @@ for more information. .It Ev LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with -.Ev CLICOLOR . +.Ev CLICOLOR +or +.Ev COLORTERM . This string is a concatenation of pairs of the format .Ar f Ns Ar b , where @@ -759,6 +767,8 @@ option for more details. .It Ev TERM The .Ev CLICOLOR +and +.Ev COLORTERM functionality depends on a terminal type with color capabilities. .It Ev TZ The timezone to use when displaying dates. Modified: projects/bectl/bin/ls/ls.c ============================================================================== --- projects/bectl/bin/ls/ls.c Sat Aug 11 04:23:03 2018 (r337607) +++ projects/bectl/bin/ls/ls.c Sat Aug 11 04:26:29 2018 (r337608) @@ -368,7 +368,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if (getenv("CLICOLOR") && + if ((getenv("CLICOLOR") || getenv("COLORTERM")) && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { Copied: projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh (from r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh Sat Aug 11 04:26:29 2018 (r337608, copy of r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh) @@ -0,0 +1,125 @@ +#!/usr/bin/env ksh +# +# 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 http://www.opensolaris.org/os/licensing. +# 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) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test {ip,udplite}:::{send,receive} of IPv4 UDP-Lite to a local address. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. No physical network interface is plumbed and up. +# 3. No other hosts on this subnet are reachable and listening on rpcbind. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test sends a UDP-Lite message using perl and checks that at least the +# following counts were traced: +# +# 1 x ip:::send (UDPLite sent to UDP-Lite port 33434) +# 1 x udplite:::send (UDPLite sent to UDP-Lite port 33434) +# 1 x ip:::receive (UDP-Lite received) +# 1 x udplite:::receive (UDP-Lite received) +# +# A udplite:::receive event is expected even if the received UDP-Lite packet +# elicits an ICMP PORT_UNREACHABLE message since there is no UDP-Lite +# socket for receiving the packet. +# + +if (( $# != 1 )); then + print -u2 "expected one argument: " + exit 2 +fi + +dtrace=$1 +local=127.0.0.1 +port=33434 +DIR=/var/tmp/dtest.$$ + +mkdir $DIR +cd $DIR + +cat > test.pl <<-EOPERL + use IO::Socket; + my \$s = IO::Socket::INET->new( + Type => SOCK_DGRAM, + Proto => "udplite", + PeerAddr => "$local", + PeerPort => $port); + die "Could not create UDP-Lite socket $local port $port" unless \$s; + send \$s, "Hello", 0; + close \$s; + sleep(2); +EOPERL + +$dtrace -c 'perl test.pl' -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_UDPLITE/ +{ + ipsend++; +} + +udplite:::send +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + udplitesend++; +} + +ip:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local" && + args[4]->ipv4_protocol == IPPROTO_UDPLITE/ +{ + ipreceive++; +} + +udplite:::receive +/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ +{ + udplitereceive++; +} + +END +{ + printf("Minimum UDP-Lite events seen\n\n"); + printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no"); + printf("udplite:::send - %s\n", udplitesend >= 1 ? "yes" : "no"); + printf("udplite:::receive - %s\n", udplitereceive >= 1 ? "yes" : "no"); +} +EODTRACE + +status=$? + +cd / +/bin/rm -rf $DIR + +exit $status Copied: projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh.out (from r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh.out Sat Aug 11 04:26:29 2018 (r337608, copy of r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh.out) @@ -0,0 +1,7 @@ +Minimum UDP-Lite events seen + +ip:::send - yes +ip:::receive - yes +udplite:::send - yes +udplite:::receive - yes + Copied: projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh (from r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/bectl/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh Sat Aug 11 04:26:29 2018 (r337608, copy of r337606, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh) @@ -0,0 +1,113 @@ +#!/usr/bin/env ksh93 +# +# 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 http://www.opensolaris.org/os/licensing. +# 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) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# + +# +# Test {udplite,ip}:::{send,receive} of IPv4 UDP-Lite to a remote host. +# +# This may fail due to: +# +# 1. A change to the ip stack breaking expected probe behavior, +# which is the reason we are testing. +# 2. No physical network interface is plumbed and up. +# 3. No other hosts on this subnet are reachable and listening on rpcbind. +# 4. An unlikely race causes the unlocked global send/receive +# variables to be corrupted. +# +# This test sends a UDP-Lite message using perl and checks that at least the +# following counts were traced: +# +# 1 x ip:::send (UDP-Lite sent to UDP-Lite port 33434) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Sat Aug 11 09:32:22 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D760F1064A87 for ; Sat, 11 Aug 2018 09:32:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CBC9736FF; Sat, 11 Aug 2018 09:32:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F2EA15506; Sat, 11 Aug 2018 09:32:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B9WLeb001850; Sat, 11 Aug 2018 09:32:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B9WL6h001849; Sat, 11 Aug 2018 09:32:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808110932.w7B9WL6h001849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 09:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337613 - projects/clang700-import X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang700-import X-SVN-Commit-Revision: 337613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 09:32:22 -0000 Author: dim Date: Sat Aug 11 09:32:20 2018 New Revision: 337613 URL: https://svnweb.freebsd.org/changeset/base/337613 Log: Update ObsoleteFiles.inc for 6.0.1 -> 7.0.0 upgrade. Modified: projects/clang700-import/ObsoleteFiles.inc Modified: projects/clang700-import/ObsoleteFiles.inc ============================================================================== --- projects/clang700-import/ObsoleteFiles.inc Sat Aug 11 08:34:24 2018 (r337612) +++ projects/clang700-import/ObsoleteFiles.inc Sat Aug 11 09:32:20 2018 (r337613) @@ -38,6 +38,142 @@ # xargs -n1 | sort | uniq -d; # done +# 2018mmdd: new clang import which bumps version from 6.0.1 to 7.0.0. +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/esan_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/6.0.1/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/6.0.1/include/sanitizer +OLD_FILES+=usr/lib/clang/6.0.1/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/6.0.1/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/6.0.1/include/adxintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/altivec.h +OLD_FILES+=usr/lib/clang/6.0.1/include/ammintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/arm64intr.h +OLD_FILES+=usr/lib/clang/6.0.1/include/arm_acle.h +OLD_FILES+=usr/lib/clang/6.0.1/include/arm_neon.h +OLD_FILES+=usr/lib/clang/6.0.1/include/armintr.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/avxintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/cetintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/cpuid.h +OLD_FILES+=usr/lib/clang/6.0.1/include/emmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/htmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/immintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/6.0.1/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/6.0.1/include/mmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/module.modulemap +OLD_FILES+=usr/lib/clang/6.0.1/include/msa.h +OLD_FILES+=usr/lib/clang/6.0.1/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/opencl-c.h +OLD_FILES+=usr/lib/clang/6.0.1/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/s390intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/shaintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/smmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/vadefs.h +OLD_FILES+=usr/lib/clang/6.0.1/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/vecintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/x86intrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/xopintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/6.0.1/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/6.0.1/include +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/6.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/6.0.1/lib/freebsd +OLD_DIRS+=usr/lib/clang/6.0.1/lib +OLD_DIRS+=usr/lib/clang/6.0.1 # 20180725: Cleanup old libcasper.so.0 OLD_LIBS+=lib/libcasper.so.0 # 20180722: indent(1) option renamed, test files follow From owner-svn-src-projects@freebsd.org Sat Aug 11 10:49:47 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C4361066C88 for ; Sat, 11 Aug 2018 10:49:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0730576200; Sat, 11 Aug 2018 10:49:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8A6916199; Sat, 11 Aug 2018 10:49:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BAnkMt038066; Sat, 11 Aug 2018 10:49:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BAniH9038052; Sat, 11 Aug 2018 10:49:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111049.w7BAniH9038052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 10:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337616 - in projects/clang700-import: cddl/usr.sbin/dwatch/libexec contrib/pf/pflogd sbin/ifconfig sbin/mount_cd9660 sys/amd64/amd64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang700-import: cddl/usr.sbin/dwatch/libexec contrib/pf/pflogd sbin/ifconfig sbin/mount_cd9660 sys/amd64/amd64 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/... X-SVN-Commit-Revision: 337616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 10:49:47 -0000 Author: dim Date: Sat Aug 11 10:49:43 2018 New Revision: 337616 URL: https://svnweb.freebsd.org/changeset/base/337616 Log: Merge ^/head r336870 through r337615. Added: projects/clang700-import/cddl/usr.sbin/dwatch/libexec/systop - copied unchanged from r337615, head/cddl/usr.sbin/dwatch/libexec/systop Modified: projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile projects/clang700-import/cddl/usr.sbin/dwatch/libexec/vop_readdir projects/clang700-import/contrib/pf/pflogd/pflogd.8 projects/clang700-import/sbin/ifconfig/ifieee80211.c projects/clang700-import/sbin/mount_cd9660/mount_cd9660.8 projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c projects/clang700-import/sys/dev/cxgbe/adapter.h projects/clang700-import/sys/dev/cxgbe/t4_main.c projects/clang700-import/sys/dev/cxgbe/t4_netmap.c projects/clang700-import/sys/dev/cxgbe/t4_sge.c projects/clang700-import/usr.bin/stat/stat.c Directory Properties: projects/clang700-import/ (props changed) projects/clang700-import/cddl/ (props changed) projects/clang700-import/contrib/pf/ (props changed) projects/clang700-import/sys/amd64/amd64/efirt_machdep.c (props changed) projects/clang700-import/sys/cddl/contrib/opensolaris/ (props changed) projects/clang700-import/sys/dev/efidev/efirt.c (props changed) Modified: projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 10:49:43 2018 (r337616) @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-established LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused Copied: projects/clang700-import/cddl/usr.sbin/dwatch/libexec/systop (from r337615, head/cddl/usr.sbin/dwatch/libexec/systop) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang700-import/cddl/usr.sbin/dwatch/libexec/systop Sat Aug 11 10:49:43 2018 (r337616, copy of r337615, head/cddl/usr.sbin/dwatch/libexec/systop) @@ -0,0 +1,84 @@ +# -*- tab-width: 4 -*- ;; Emacs +# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM +############################################################ IDENT(1) +# +# $Title: dwatch(8) profile for top-like syscall $ +# $Copyright: 2014-2018 Devin Teske. All rights reserved. $ +# $FreeBSD$ +# +############################################################ DESCRIPTION +# +# Every 3 seconds update the screen with syscall consumers. +# +############################################################ PRAGMAS + +# Optional: You can override the default pragmas (shown below) + +DTRACE_PRAGMA=" + option quiet + option aggsortrev +" # END-QUOTE + +############################################################ PROBE + +: ${PROBE:=profile:::tick-3s} + +############################################################ ACTIONS + +exec 9< /dev/null ) +rows="${size%% *}" +cols="${size#* }" + +exec 9<fi_mount != 0/ /* probe ID $(( $ID + $MA this->path = strjoin(this->path, strjoin(this->name = (this->d_name != 0 ? this->d_name : ""), this->name != "" ? "/" : "")); +} EOF ACTIONS=$( cat <&9 ) ID=$(( $ID + $MAX_DEPTH + 5 )) Modified: projects/clang700-import/contrib/pf/pflogd/pflogd.8 ============================================================================== --- projects/clang700-import/contrib/pf/pflogd/pflogd.8 Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/contrib/pf/pflogd/pflogd.8 Sat Aug 11 10:49:43 2018 (r337616) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22 2008 +.Dd August 11, 2018 .Dt PFLOGD 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Nm pflogd .Bk -words -.Op Fl Dx +.Op Fl \&Dx .Op Fl d Ar delay .Op Fl f Ar filename .Op Fl i Ar interface Modified: projects/clang700-import/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/clang700-import/sbin/ifconfig/ifieee80211.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sbin/ifconfig/ifieee80211.c Sat Aug 11 10:49:43 2018 (r337616) @@ -3496,7 +3496,7 @@ list_scan(int s) uint8_t buf[24*1024]; char ssid[IEEE80211_NWID_LEN+1]; const uint8_t *cp; - int len, ssidmax, idlen; + int len, idlen; if (get80211len(s, IEEE80211_IOC_SCAN_RESULTS, buf, sizeof(buf), &len) < 0) errx(1, "unable to get scan results"); @@ -3505,9 +3505,8 @@ list_scan(int s) getchaninfo(s); - ssidmax = verbose ? IEEE80211_NWID_LEN : 32; printf("%-*.*s %-17.17s %4s %4s %-7s %3s %4s\n" - , ssidmax, ssidmax, "SSID/MESH ID" + , IEEE80211_NWID_LEN, IEEE80211_NWID_LEN, "SSID/MESH ID" , "BSSID" , "CHAN" , "RATE" @@ -3530,8 +3529,8 @@ list_scan(int s) idlen = sr->isr_ssid_len; } printf("%-*.*s %s %3d %3dM %4d:%-4d %4d %-4.4s" - , ssidmax - , copy_essid(ssid, ssidmax, idp, idlen) + , IEE80211_NWID_LEN + , copy_essid(ssid, IEE80211_NWID_LEN, idp, idlen) , ssid , ether_ntoa((const struct ether_addr *) sr->isr_bssid) , ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags) Modified: projects/clang700-import/sbin/mount_cd9660/mount_cd9660.8 ============================================================================== --- projects/clang700-import/sbin/mount_cd9660/mount_cd9660.8 Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sbin/mount_cd9660/mount_cd9660.8 Sat Aug 11 10:49:43 2018 (r337616) @@ -32,7 +32,7 @@ .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd August 11, 2018 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -140,6 +140,7 @@ The following command can be used to mount a Kodak Pho .Xr unmount 2 , .Xr cd9660 5 , .Xr fstab 5 , +.Xr mdconfig 8 , .Xr mount 8 .Sh HISTORY The Modified: projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Aug 11 10:49:43 2018 (r337616) @@ -4371,18 +4371,14 @@ spa_add_l2cache(spa_t *spa, nvlist_t *config) } static void -spa_add_feature_stats(spa_t *spa, nvlist_t *config) +spa_feature_stats_from_disk(spa_t *spa, nvlist_t *features) { - nvlist_t *features; zap_cursor_t zc; zap_attribute_t za; - ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER)); - VERIFY(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP) == 0); - /* We may be unable to read features if pool is suspended. */ if (spa_suspended(spa)) - goto out; + return; if (spa->spa_feat_for_read_obj != 0) { for (zap_cursor_init(&zc, spa->spa_meta_objset, @@ -4391,7 +4387,7 @@ spa_add_feature_stats(spa_t *spa, nvlist_t *config) zap_cursor_advance(&zc)) { ASSERT(za.za_integer_length == sizeof (uint64_t) && za.za_num_integers == 1); - VERIFY3U(0, ==, nvlist_add_uint64(features, za.za_name, + VERIFY0(nvlist_add_uint64(features, za.za_name, za.za_first_integer)); } zap_cursor_fini(&zc); @@ -4404,16 +4400,62 @@ spa_add_feature_stats(spa_t *spa, nvlist_t *config) zap_cursor_advance(&zc)) { ASSERT(za.za_integer_length == sizeof (uint64_t) && za.za_num_integers == 1); - VERIFY3U(0, ==, nvlist_add_uint64(features, za.za_name, + VERIFY0(nvlist_add_uint64(features, za.za_name, za.za_first_integer)); } zap_cursor_fini(&zc); } +} -out: - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, - features) == 0); - nvlist_free(features); +static void +spa_feature_stats_from_cache(spa_t *spa, nvlist_t *features) +{ + int i; + + for (i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t feature = spa_feature_table[i]; + uint64_t refcount; + + if (feature_get_refcount(spa, &feature, &refcount) != 0) + continue; + + VERIFY0(nvlist_add_uint64(features, feature.fi_guid, refcount)); + } +} + +/* + * Store a list of pool features and their reference counts in the + * config. + * + * The first time this is called on a spa, allocate a new nvlist, fetch + * the pool features and reference counts from disk, then save the list + * in the spa. In subsequent calls on the same spa use the saved nvlist + * and refresh its values from the cached reference counts. This + * ensures we don't block here on I/O on a suspended pool so 'zpool + * clear' can resume the pool. + */ +static void +spa_add_feature_stats(spa_t *spa, nvlist_t *config) +{ + nvlist_t *features; + + ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER)); + + mutex_enter(&spa->spa_feat_stats_lock); + features = spa->spa_feat_stats; + + if (features != NULL) { + spa_feature_stats_from_cache(spa, features); + } else { + VERIFY0(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP)); + spa->spa_feat_stats = features; + spa_feature_stats_from_disk(spa, features); + } + + VERIFY0(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, + features)); + + mutex_exit(&spa->spa_feat_stats_lock); } int Modified: projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Sat Aug 11 10:49:43 2018 (r337616) @@ -708,6 +708,7 @@ spa_add(const char *name, nvlist_t *config, const char mutex_init(&spa->spa_scrub_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_suspend_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_vdev_top_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&spa->spa_feat_stats_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&spa->spa_async_cv, NULL, CV_DEFAULT, NULL); cv_init(&spa->spa_evicting_os_cv, NULL, CV_DEFAULT, NULL); @@ -881,6 +882,7 @@ spa_remove(spa_t *spa) nvlist_free(spa->spa_label_features); nvlist_free(spa->spa_load_info); + nvlist_free(spa->spa_feat_stats); spa_config_set(spa, NULL); #ifdef illumos @@ -922,6 +924,7 @@ spa_remove(spa_t *spa) mutex_destroy(&spa->spa_scrub_lock); mutex_destroy(&spa->spa_suspend_lock); mutex_destroy(&spa->spa_vdev_top_lock); + mutex_destroy(&spa->spa_feat_stats_lock); kmem_free(spa, sizeof (spa_t)); } Modified: projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Sat Aug 11 10:49:43 2018 (r337616) @@ -360,6 +360,8 @@ struct spa { uint64_t spa_feat_for_read_obj; /* required to read from pool */ uint64_t spa_feat_desc_obj; /* Feature descriptions */ uint64_t spa_feat_enabled_txg_obj; /* Feature enabled txg */ + kmutex_t spa_feat_stats_lock; /* protects spa_feat_stats */ + nvlist_t *spa_feat_stats; /* Cache of enabled features */ /* cache feature refcounts */ uint64_t spa_feat_refcount_cache[SPA_FEATURES]; #ifdef illumos Modified: projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Sat Aug 11 10:49:43 2018 (r337616) @@ -220,7 +220,7 @@ spa_features_check(spa_t *spa, boolean_t for_write, * * Note: well-designed features will not need to use this; they should * use spa_feature_is_enabled() and spa_feature_is_active() instead. - * However, this is non-static for zdb and zhack. + * However, this is non-static for zdb, zhack, and spa_add_feature_stats(). */ int feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res) Modified: projects/clang700-import/sys/dev/cxgbe/adapter.h ============================================================================== --- projects/clang700-import/sys/dev/cxgbe/adapter.h Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/dev/cxgbe/adapter.h Sat Aug 11 10:49:43 2018 (r337616) @@ -670,6 +670,7 @@ struct sge_wrq { #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) struct sge_nm_rxq { + volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ struct vi_info *vi; struct iq_desc *iq_desc; @@ -797,7 +798,6 @@ struct adapter { struct irq { struct resource *res; int rid; - volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ void *tag; struct sge_rxq *rxq; struct sge_nm_rxq *nm_rxq; @@ -1186,9 +1186,10 @@ void release_tid(struct adapter *, int, struct sge_wrq #ifdef DEV_NETMAP /* t4_netmap.c */ +struct sge_nm_rxq; void cxgbe_nm_attach(struct vi_info *); void cxgbe_nm_detach(struct vi_info *); -void t4_nm_intr(void *); +void service_nm_rxq(struct sge_nm_rxq *); #endif /* t4_sge.c */ @@ -1207,7 +1208,10 @@ int t4_setup_vi_queues(struct vi_info *); int t4_teardown_vi_queues(struct vi_info *); void t4_intr_all(void *); void t4_intr(void *); +#ifdef DEV_NETMAP +void t4_nm_intr(void *); void t4_vi_intr(void *); +#endif void t4_intr_err(void *); void t4_intr_evt(void *); void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); Modified: projects/clang700-import/sys/dev/cxgbe/t4_main.c ============================================================================== --- projects/clang700-import/sys/dev/cxgbe/t4_main.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/dev/cxgbe/t4_main.c Sat Aug 11 10:49:43 2018 (r337616) @@ -684,8 +684,8 @@ struct { #ifdef TCP_OFFLOAD /* - * service_iq() has an iq and needs the fl. Offset of fl from the iq should be - * exactly the same for both rxq and ofld_rxq. + * service_iq_fl() has an iq and needs the fl. Offset of fl from the iq should + * be exactly the same for both rxq and ofld_rxq. */ CTASSERT(offsetof(struct sge_ofld_rxq, iq) == offsetof(struct sge_rxq, iq)); CTASSERT(offsetof(struct sge_ofld_rxq, fl) == offsetof(struct sge_rxq, fl)); @@ -4819,9 +4819,26 @@ t4_setup_intr_handlers(struct adapter *sc) #ifdef DEV_NETMAP if (q < vi->nnmrxq) irq->nm_rxq = nm_rxq++; + + if (irq->nm_rxq != NULL && + irq->rxq == NULL) { + /* Netmap rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_nm_intr, irq->nm_rxq, s); + } + if (irq->nm_rxq != NULL && + irq->rxq != NULL) { + /* NIC and Netmap rx */ + rc = t4_alloc_irq(sc, irq, rid, + t4_vi_intr, irq, s); + } #endif - rc = t4_alloc_irq(sc, irq, rid, - t4_vi_intr, irq, s); + if (irq->rxq != NULL && + irq->nm_rxq == NULL) { + /* NIC rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_intr, irq->rxq, s); + } if (rc != 0) return (rc); #ifdef RSS Modified: projects/clang700-import/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- projects/clang700-import/sys/dev/cxgbe/t4_netmap.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/dev/cxgbe/t4_netmap.c Sat Aug 11 10:49:43 2018 (r337616) @@ -358,8 +358,6 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi nm_set_native_flags(na); for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_on(kring) || nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID) @@ -387,7 +385,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); - atomic_cmpset_int(&irq->nm_state, NM_OFF, NM_ON); + atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); } for_each_nm_txq(vi, i, nm_txq) { @@ -459,14 +457,12 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v free_nm_txq_hwq(vi, nm_txq); } for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_off(kring) || nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID) continue; - while (!atomic_cmpset_int(&irq->nm_state, NM_ON, NM_OFF)) + while (!atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_OFF)) pause("nmst", 1); free_nm_rxq_hwq(vi, nm_rxq); @@ -955,9 +951,8 @@ handle_nm_sge_egr_update(struct adapter *sc, struct if } void -t4_nm_intr(void *arg) +service_nm_rxq(struct sge_nm_rxq *nm_rxq) { - struct sge_nm_rxq *nm_rxq = arg; struct vi_info *vi = nm_rxq->vi; struct adapter *sc = vi->pi->adapter; struct ifnet *ifp = vi->ifp; Modified: projects/clang700-import/sys/dev/cxgbe/t4_sge.c ============================================================================== --- projects/clang700-import/sys/dev/cxgbe/t4_sge.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/sys/dev/cxgbe/t4_sge.c Sat Aug 11 10:49:43 2018 (r337616) @@ -204,6 +204,7 @@ struct sgl { }; static int service_iq(struct sge_iq *, int); +static int service_iq_fl(struct sge_iq *, int); static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); @@ -1333,8 +1334,12 @@ t4_teardown_vi_queues(struct vi_info *vi) } /* - * Deals with errors and the firmware event queue. All data rx queues forward - * their interrupt to the firmware event queue. + * Interrupt handler when the driver is using only 1 interrupt. This is a very + * unusual scenario. + * + * a) Deals with errors, if any. + * b) Services firmware event queue, which is taking interrupts for all other + * queues. */ void t4_intr_all(void *arg) @@ -1342,14 +1347,16 @@ t4_intr_all(void *arg) struct adapter *sc = arg; struct sge_iq *fwq = &sc->sge.fwq; + MPASS(sc->intr_count == 1); + t4_intr_err(arg); - if (atomic_cmpset_int(&fwq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(fwq, 0); - atomic_cmpset_int(&fwq->state, IQS_BUSY, IQS_IDLE); - } + t4_intr_evt(fwq); } -/* Deals with error interrupts */ +/* + * Interrupt handler for errors (installed directly when multiple interrupts are + * being used, or called by t4_intr_all). + */ void t4_intr_err(void *arg) { @@ -1359,6 +1366,10 @@ t4_intr_err(void *arg) t4_slow_intr_handler(sc); } +/* + * Interrupt handler for iq-only queues. The firmware event queue is the only + * such queue right now. + */ void t4_intr_evt(void *arg) { @@ -1370,90 +1381,74 @@ t4_intr_evt(void *arg) } } +/* + * Interrupt handler for iq+fl queues. + */ void t4_intr(void *arg) { struct sge_iq *iq = arg; if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(iq, 0); + service_iq_fl(iq, 0); atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } +#ifdef DEV_NETMAP +/* + * Interrupt handler for netmap rx queues. + */ void -t4_vi_intr(void *arg) +t4_nm_intr(void *arg) { - struct irq *irq = arg; + struct sge_nm_rxq *nm_rxq = arg; -#ifdef DEV_NETMAP - if (atomic_cmpset_int(&irq->nm_state, NM_ON, NM_BUSY)) { - t4_nm_intr(irq->nm_rxq); - atomic_cmpset_int(&irq->nm_state, NM_BUSY, NM_ON); + if (atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_BUSY)) { + service_nm_rxq(nm_rxq); + atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); } -#endif - if (irq->rxq != NULL) - t4_intr(irq->rxq); } -static inline int -sort_before_lro(struct lro_ctrl *lro) +/* + * Interrupt handler for vectors shared between NIC and netmap rx queues. + */ +void +t4_vi_intr(void *arg) { + struct irq *irq = arg; - return (lro->lro_mbuf_max != 0); + MPASS(irq->nm_rxq != NULL); + t4_nm_intr(irq->nm_rxq); + + MPASS(irq->rxq != NULL); + t4_intr(irq->rxq); } +#endif /* - * Deals with anything and everything on the given ingress queue. + * Deals with interrupts on an iq-only (no freelist) queue. */ static int service_iq(struct sge_iq *iq, int budget) { struct sge_iq *q; - struct sge_rxq *rxq = iq_to_rxq(iq); /* Use iff iq is part of rxq */ - struct sge_fl *fl; /* Use iff IQ_HAS_FL */ struct adapter *sc = iq->adapter; struct iq_desc *d = &iq->desc[iq->cidx]; int ndescs = 0, limit; - int rsp_type, refill; + int rsp_type; uint32_t lq; - uint16_t fl_hw_cidx; - struct mbuf *m0; STAILQ_HEAD(, sge_iq) iql = STAILQ_HEAD_INITIALIZER(iql); -#if defined(INET) || defined(INET6) - const struct timeval lro_timeout = {0, sc->lro_timeout}; - struct lro_ctrl *lro = &rxq->lro; -#endif KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + KASSERT((iq->flags & IQ_HAS_FL) == 0, + ("%s: called for iq %p with fl (iq->flags 0x%x)", __func__, iq, + iq->flags)); + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); + MPASS((iq->flags & IQ_LRO_ENABLED) == 0); limit = budget ? budget : iq->qsize / 16; - if (iq->flags & IQ_HAS_FL) { - fl = &rxq->fl; - fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ - } else { - fl = NULL; - fl_hw_cidx = 0; /* to silence gcc warning */ - } - -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_ADJ_CREDIT) { - MPASS(sort_before_lro(lro)); - iq->flags &= ~IQ_ADJ_CREDIT; - if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { - tcp_lro_flush_all(lro); - t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | - V_INGRESSQID((u32)iq->cntxt_id) | - V_SEINTARM(iq->intr_params)); - return (0); - } - ndescs = 1; - } -#else - MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); -#endif - /* * We always come back and check the descriptor ring for new indirect * interrupts and other responses after running a single handler. @@ -1463,74 +1458,40 @@ service_iq(struct sge_iq *iq, int budget) rmb(); - refill = 0; - m0 = NULL; rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); lq = be32toh(d->rsp.pldbuflen_qid); switch (rsp_type) { case X_RSPD_TYPE_FLBUF: + panic("%s: data for an iq (%p) with no freelist", + __func__, iq); - KASSERT(iq->flags & IQ_HAS_FL, - ("%s: data for an iq (%p) with no freelist", - __func__, iq)); + /* NOTREACHED */ - m0 = get_fl_payload(sc, fl, lq); - if (__predict_false(m0 == NULL)) - goto process_iql; - refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; -#ifdef T4_PKT_TIMESTAMP - /* - * 60 bit timestamp for the payload is - * *(uint64_t *)m0->m_pktdat. Note that it is - * in the leading free-space in the mbuf. The - * kernel can clobber it during a pullup, - * m_copymdata, etc. You need to make sure that - * the mbuf reaches you unmolested if you care - * about the timestamp. - */ - *(uint64_t *)m0->m_pktdat = - be64toh(ctrl->u.last_flit) & - 0xfffffffffffffff; -#endif - - /* fall through */ - case X_RSPD_TYPE_CPL: KASSERT(d->rss.opcode < NUM_CPL_CMDS, ("%s: bad opcode %02x.", __func__, d->rss.opcode)); - t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, NULL); break; case X_RSPD_TYPE_INTR: - /* - * Interrupts should be forwarded only to queues - * that are not forwarding their interrupts. - * This means service_iq can recurse but only 1 - * level deep. - */ - KASSERT(budget == 0, - ("%s: budget %u, rsp_type %u", __func__, - budget, rsp_type)); - - /* * There are 1K interrupt-capable queues (qids 0 * through 1023). A response type indicating a * forwarded interrupt with a qid >= 1K is an * iWARP async notification. */ - if (lq >= 1024) { - t4_an_handler(iq, &d->rsp); - break; - } + if (__predict_true(lq >= 1024)) { + t4_an_handler(iq, &d->rsp); + break; + } q = sc->sge.iqmap[lq - sc->sge.iq_start - sc->sge.iq_base]; if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { - if (service_iq(q, q->qsize / 16) == 0) { + if (service_iq_fl(q, q->qsize / 16) == 0) { atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); } else { @@ -1563,33 +1524,12 @@ service_iq(struct sge_iq *iq, int budget) V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); ndescs = 0; -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_LRO_ENABLED && - !sort_before_lro(lro) && - sc->lro_timeout != 0) { - tcp_lro_flush_inactive(lro, - &lro_timeout); - } -#endif - if (budget) { - if (iq->flags & IQ_HAS_FL) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - } return (EINPROGRESS); } } - if (refill) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - fl_hw_cidx = fl->hw_cidx; - } } -process_iql: if (STAILQ_EMPTY(&iql)) break; @@ -1599,13 +1539,168 @@ process_iql: */ q = STAILQ_FIRST(&iql); STAILQ_REMOVE_HEAD(&iql, link); - if (service_iq(q, q->qsize / 8) == 0) + if (service_iq_fl(q, q->qsize / 8) == 0) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); else STAILQ_INSERT_TAIL(&iql, q, link); } + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); + + return (0); +} + +static inline int +sort_before_lro(struct lro_ctrl *lro) +{ + + return (lro->lro_mbuf_max != 0); +} + +/* + * Deals with interrupts on an iq+fl queue. + */ +static int +service_iq_fl(struct sge_iq *iq, int budget) +{ + struct sge_rxq *rxq = iq_to_rxq(iq); + struct sge_fl *fl; + struct adapter *sc = iq->adapter; + struct iq_desc *d = &iq->desc[iq->cidx]; + int ndescs = 0, limit; + int rsp_type, refill, starved; + uint32_t lq; + uint16_t fl_hw_cidx; + struct mbuf *m0; #if defined(INET) || defined(INET6) + const struct timeval lro_timeout = {0, sc->lro_timeout}; + struct lro_ctrl *lro = &rxq->lro; +#endif + + KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + MPASS(iq->flags & IQ_HAS_FL); + + limit = budget ? budget : iq->qsize / 16; + fl = &rxq->fl; + fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_ADJ_CREDIT) { + MPASS(sort_before_lro(lro)); + iq->flags &= ~IQ_ADJ_CREDIT; + if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { + tcp_lro_flush_all(lro); + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | + V_INGRESSQID((u32)iq->cntxt_id) | + V_SEINTARM(iq->intr_params)); + return (0); + } + ndescs = 1; + } +#else + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); +#endif + + while ((d->rsp.u.type_gen & F_RSPD_GEN) == iq->gen) { + + rmb(); + + refill = 0; + m0 = NULL; + rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); + lq = be32toh(d->rsp.pldbuflen_qid); + + switch (rsp_type) { + case X_RSPD_TYPE_FLBUF: + + m0 = get_fl_payload(sc, fl, lq); + if (__predict_false(m0 == NULL)) + goto out; + refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; +#ifdef T4_PKT_TIMESTAMP + /* + * 60 bit timestamp for the payload is + * *(uint64_t *)m0->m_pktdat. Note that it is + * in the leading free-space in the mbuf. The + * kernel can clobber it during a pullup, + * m_copymdata, etc. You need to make sure that + * the mbuf reaches you unmolested if you care + * about the timestamp. + */ + *(uint64_t *)m0->m_pktdat = + be64toh(ctrl->u.last_flit) & 0xfffffffffffffff; +#endif + + /* fall through */ + + case X_RSPD_TYPE_CPL: + KASSERT(d->rss.opcode < NUM_CPL_CMDS, + ("%s: bad opcode %02x.", __func__, d->rss.opcode)); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + break; + + case X_RSPD_TYPE_INTR: + + /* + * There are 1K interrupt-capable queues (qids 0 + * through 1023). A response type indicating a + * forwarded interrupt with a qid >= 1K is an + * iWARP async notification. That is the only + * acceptable indirect interrupt on this queue. + */ + if (__predict_false(lq < 1024)) { + panic("%s: indirect interrupt on iq_fl %p " + "with qid %u", __func__, iq, lq); + } + + t4_an_handler(iq, &d->rsp); + break; + + default: + KASSERT(0, ("%s: illegal response type %d on iq %p", + __func__, rsp_type, iq)); + log(LOG_ERR, "%s: illegal response type %d on iq %p", + device_get_nameunit(sc->dev), rsp_type, iq); + break; + } + + d++; + if (__predict_false(++iq->cidx == iq->sidx)) { + iq->cidx = 0; + iq->gen ^= F_RSPD_GEN; + d = &iq->desc[0]; + } + if (__predict_false(++ndescs == limit)) { + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID(iq->cntxt_id) | + V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); + ndescs = 0; + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_LRO_ENABLED && + !sort_before_lro(lro) && + sc->lro_timeout != 0) { + tcp_lro_flush_inactive(lro, &lro_timeout); + } +#endif + if (budget) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + + return (EINPROGRESS); + } + } + if (refill) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + fl_hw_cidx = fl->hw_cidx; + } + } +out: +#if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { if (ndescs > 0 && lro->lro_mbuf_count > 8) { MPASS(sort_before_lro(lro)); @@ -1621,15 +1716,11 @@ process_iql: t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); - if (iq->flags & IQ_HAS_FL) { - int starved; - - FL_LOCK(fl); - starved = refill_fl(sc, fl, 64); - FL_UNLOCK(fl); - if (__predict_false(starved != 0)) - add_fl_to_sfl(sc, fl); - } + FL_LOCK(fl); + starved = refill_fl(sc, fl, 64); + FL_UNLOCK(fl); + if (__predict_false(starved != 0)) + add_fl_to_sfl(sc, fl); return (0); } Modified: projects/clang700-import/usr.bin/stat/stat.c ============================================================================== --- projects/clang700-import/usr.bin/stat/stat.c Sat Aug 11 10:42:12 2018 (r337615) +++ projects/clang700-import/usr.bin/stat/stat.c Sat Aug 11 10:49:43 2018 (r337616) @@ -619,8 +619,6 @@ format1(const struct stat *st, char *stmp, lfmt[24], tmp[20]; const char *sdata; char smode[12], sid[12], path[PATH_MAX + 4]; - struct passwd *pw; - struct group *gr; const struct timespec *tsp; struct timespec ts; struct tm *tm; @@ -717,9 +715,8 @@ format1(const struct stat *st, case SHOW_st_uid: small = (sizeof(st->st_uid) == 4); data = st->st_uid; - if ((pw = getpwuid(st->st_uid)) != NULL) - sdata = pw->pw_name; - else { + sdata = user_from_uid(st->st_uid, 1); + if (sdata == NULL) { snprintf(sid, sizeof(sid), "(%ld)", (long)st->st_uid); sdata = sid; } @@ -731,9 +728,8 @@ format1(const struct stat *st, case SHOW_st_gid: small = (sizeof(st->st_gid) == 4); data = st->st_gid; - if ((gr = getgrgid(st->st_gid)) != NULL) - sdata = gr->gr_name; - else { + sdata = group_from_gid(st->st_gid, 1); + if (sdata == NULL) { snprintf(sid, sizeof(sid), "(%ld)", (long)st->st_gid); sdata = sid; } From owner-svn-src-projects@freebsd.org Sat Aug 11 11:28:52 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7B691067FDB for ; Sat, 11 Aug 2018 11:28:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74CB3779E2; Sat, 11 Aug 2018 11:28:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53FB5168D1; Sat, 11 Aug 2018 11:28:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BBSqaT058777; Sat, 11 Aug 2018 11:28:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BBSpXM058775; Sat, 11 Aug 2018 11:28:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111128.w7BBSpXM058775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 11:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337619 - in projects/clang700-import: sbin/ifconfig usr.bin/printf X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang700-import: sbin/ifconfig usr.bin/printf X-SVN-Commit-Revision: 337619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 11:28:52 -0000 Author: dim Date: Sat Aug 11 11:28:51 2018 New Revision: 337619 URL: https://svnweb.freebsd.org/changeset/base/337619 Log: Merge ^/head r336870 through r337618. Modified: projects/clang700-import/sbin/ifconfig/ifieee80211.c projects/clang700-import/usr.bin/printf/printf.c Directory Properties: projects/clang700-import/ (props changed) Modified: projects/clang700-import/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/clang700-import/sbin/ifconfig/ifieee80211.c Sat Aug 11 11:13:34 2018 (r337618) +++ projects/clang700-import/sbin/ifconfig/ifieee80211.c Sat Aug 11 11:28:51 2018 (r337619) @@ -3529,8 +3529,8 @@ list_scan(int s) idlen = sr->isr_ssid_len; } printf("%-*.*s %s %3d %3dM %4d:%-4d %4d %-4.4s" - , IEE80211_NWID_LEN - , copy_essid(ssid, IEE80211_NWID_LEN, idp, idlen) + , IEEE80211_NWID_LEN + , copy_essid(ssid, IEEE80211_NWID_LEN, idp, idlen) , ssid , ether_ntoa((const struct ether_addr *) sr->isr_bssid) , ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags) Modified: projects/clang700-import/usr.bin/printf/printf.c ============================================================================== --- projects/clang700-import/usr.bin/printf/printf.c Sat Aug 11 11:13:34 2018 (r337618) +++ projects/clang700-import/usr.bin/printf/printf.c Sat Aug 11 11:28:51 2018 (r337619) @@ -388,7 +388,7 @@ printf_doformat(char *fmt, int *rval) free(p); if (getout) - exit(*rval); + return (end_fmt); break; } case 'c': { From owner-svn-src-projects@freebsd.org Sat Aug 11 16:40:09 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6FE910734A7 for ; Sat, 11 Aug 2018 16:40:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A00E88411; Sat, 11 Aug 2018 16:40:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C1A419C63; Sat, 11 Aug 2018 16:40:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGe8o2025669; Sat, 11 Aug 2018 16:40:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGe4cn025647; Sat, 11 Aug 2018 16:40:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111640.w7BGe4cn025647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 16:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337645 - in projects/clang700-import: contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/lib/MC/MCParser contrib/llvm/lib/Target/AMDGPU contrib/llvm/lib/Targe... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang700-import: contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/lib/MC/MCParser contrib/llvm/lib/Target/AMDGPU contrib/llvm/lib/Target/NVPTX contrib/llvm/lib/... X-SVN-Commit-Revision: 337645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:40:09 -0000 Author: dim Date: Sat Aug 11 16:40:03 2018 New Revision: 337645 URL: https://svnweb.freebsd.org/changeset/base/337645 Log: Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branch r339355, resolve conflicts, and bump version numbers. Modified: projects/clang700-import/contrib/llvm/lib/Analysis/InstructionSimplify.cpp projects/clang700-import/contrib/llvm/lib/Analysis/ValueTracking.cpp projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp projects/clang700-import/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPU.td projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUFeatures.td projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.h projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/VOP3Instructions.td projects/clang700-import/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp projects/clang700-import/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/Headers/unwind.h projects/clang700-import/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp projects/clang700-import/contrib/llvm/tools/lld/COFF/InputFiles.cpp projects/clang700-import/contrib/llvm/tools/lld/COFF/InputFiles.h projects/clang700-import/contrib/llvm/tools/lld/ELF/LinkerScript.cpp projects/clang700-import/contrib/llvm/tools/lld/ELF/Writer.cpp projects/clang700-import/contrib/llvm/tools/lldb/include/lldb/Utility/VMRange.h projects/clang700-import/contrib/llvm/tools/lldb/source/Utility/VMRange.cpp projects/clang700-import/lib/clang/freebsd_cc_version.h projects/clang700-import/lib/clang/include/clang/Basic/Version.inc projects/clang700-import/lib/clang/include/lld/Common/Version.inc Directory Properties: projects/clang700-import/contrib/compiler-rt/ (props changed) projects/clang700-import/contrib/libc++/ (props changed) projects/clang700-import/contrib/llvm/ (props changed) projects/clang700-import/contrib/llvm/tools/clang/ (props changed) projects/clang700-import/contrib/llvm/tools/lld/ (props changed) projects/clang700-import/contrib/llvm/tools/lldb/ (props changed) Modified: projects/clang700-import/contrib/llvm/lib/Analysis/InstructionSimplify.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Analysis/InstructionSimplify.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Analysis/InstructionSimplify.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -1863,6 +1863,40 @@ static Value *SimplifyAndInst(Value *Op0, Value *Op1, MaxRecurse)) return V; + // Assuming the effective width of Y is not larger than A, i.e. all bits + // from X and Y are disjoint in (X << A) | Y, + // if the mask of this AND op covers all bits of X or Y, while it covers + // no bits from the other, we can bypass this AND op. E.g., + // ((X << A) | Y) & Mask -> Y, + // if Mask = ((1 << effective_width_of(Y)) - 1) + // ((X << A) | Y) & Mask -> X << A, + // if Mask = ((1 << effective_width_of(X)) - 1) << A + // SimplifyDemandedBits in InstCombine can optimize the general case. + // This pattern aims to help other passes for a common case. + Value *Y, *XShifted; + if (match(Op1, m_APInt(Mask)) && + match(Op0, m_c_Or(m_CombineAnd(m_NUWShl(m_Value(X), m_APInt(ShAmt)), + m_Value(XShifted)), + m_Value(Y)))) { + const unsigned ShftCnt = ShAmt->getZExtValue(); + const KnownBits YKnown = computeKnownBits(Y, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); + const unsigned Width = Op0->getType()->getScalarSizeInBits(); + const unsigned EffWidthY = Width - YKnown.countMinLeadingZeros(); + if (EffWidthY <= ShftCnt) { + const KnownBits XKnown = computeKnownBits(X, Q.DL, 0, Q.AC, Q.CxtI, + Q.DT); + const unsigned EffWidthX = Width - XKnown.countMinLeadingZeros(); + const APInt EffBitsY = APInt::getLowBitsSet(Width, EffWidthY); + const APInt EffBitsX = APInt::getLowBitsSet(Width, EffWidthX) << ShftCnt; + // If the mask is extracting all bits from X or Y as is, we can skip + // this AND op. + if (EffBitsY.isSubsetOf(*Mask) && !EffBitsX.intersects(*Mask)) + return Y; + if (EffBitsX.isSubsetOf(*Mask) && !EffBitsY.intersects(*Mask)) + return XShifted; + } + } + return nullptr; } Modified: projects/clang700-import/contrib/llvm/lib/Analysis/ValueTracking.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Analysis/ValueTracking.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Analysis/ValueTracking.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -2817,10 +2817,13 @@ static bool cannotBeOrderedLessThanZeroImpl(const Valu default: break; case Intrinsic::maxnum: - return cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, SignBitOnly, - Depth + 1) || - cannotBeOrderedLessThanZeroImpl(I->getOperand(1), TLI, SignBitOnly, - Depth + 1); + return (isKnownNeverNaN(I->getOperand(0)) && + cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, + SignBitOnly, Depth + 1)) || + (isKnownNeverNaN(I->getOperand(1)) && + cannotBeOrderedLessThanZeroImpl(I->getOperand(1), TLI, + SignBitOnly, Depth + 1)); + case Intrinsic::minnum: return cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, SignBitOnly, Depth + 1) && Modified: projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -1489,24 +1489,20 @@ SDValue SelectionDAGLegalize::ExpandFCOPYSIGN(SDNode * // Get the signbit at the right position for MagAsInt. int ShiftAmount = SignAsInt.SignBit - MagAsInt.SignBit; + EVT ShiftVT = IntVT; + if (SignBit.getValueSizeInBits() < ClearedSign.getValueSizeInBits()) { + SignBit = DAG.getNode(ISD::ZERO_EXTEND, DL, MagVT, SignBit); + ShiftVT = MagVT; + } + if (ShiftAmount > 0) { + SDValue ShiftCnst = DAG.getConstant(ShiftAmount, DL, ShiftVT); + SignBit = DAG.getNode(ISD::SRL, DL, ShiftVT, SignBit, ShiftCnst); + } else if (ShiftAmount < 0) { + SDValue ShiftCnst = DAG.getConstant(-ShiftAmount, DL, ShiftVT); + SignBit = DAG.getNode(ISD::SHL, DL, ShiftVT, SignBit, ShiftCnst); + } if (SignBit.getValueSizeInBits() > ClearedSign.getValueSizeInBits()) { - if (ShiftAmount > 0) { - SDValue ShiftCnst = DAG.getConstant(ShiftAmount, DL, IntVT); - SignBit = DAG.getNode(ISD::SRL, DL, IntVT, SignBit, ShiftCnst); - } else if (ShiftAmount < 0) { - SDValue ShiftCnst = DAG.getConstant(-ShiftAmount, DL, IntVT); - SignBit = DAG.getNode(ISD::SHL, DL, IntVT, SignBit, ShiftCnst); - } SignBit = DAG.getNode(ISD::TRUNCATE, DL, MagVT, SignBit); - } else if (SignBit.getValueSizeInBits() < ClearedSign.getValueSizeInBits()) { - SignBit = DAG.getNode(ISD::ZERO_EXTEND, DL, MagVT, SignBit); - if (ShiftAmount > 0) { - SDValue ShiftCnst = DAG.getConstant(ShiftAmount, DL, MagVT); - SignBit = DAG.getNode(ISD::SRL, DL, MagVT, SignBit, ShiftCnst); - } else if (ShiftAmount < 0) { - SDValue ShiftCnst = DAG.getConstant(-ShiftAmount, DL, MagVT); - SignBit = DAG.getNode(ISD::SHL, DL, MagVT, SignBit, ShiftCnst); - } } // Store the part with the modified sign and convert back to float. Modified: projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -3641,26 +3641,43 @@ SDValue DAGTypeLegalizer::WidenVecOp_STORE(SDNode *N) } SDValue DAGTypeLegalizer::WidenVecOp_MSTORE(SDNode *N, unsigned OpNo) { - assert(OpNo == 3 && "Can widen only data operand of mstore"); + assert((OpNo == 2 || OpNo == 3) && + "Can widen only data or mask operand of mstore"); MaskedStoreSDNode *MST = cast(N); SDValue Mask = MST->getMask(); EVT MaskVT = Mask.getValueType(); SDValue StVal = MST->getValue(); - // Widen the value - SDValue WideVal = GetWidenedVector(StVal); SDLoc dl(N); - // The mask should be widened as well. - EVT WideVT = WideVal.getValueType(); - EVT WideMaskVT = EVT::getVectorVT(*DAG.getContext(), - MaskVT.getVectorElementType(), - WideVT.getVectorNumElements()); - Mask = ModifyToType(Mask, WideMaskVT, true); + if (OpNo == 3) { + // Widen the value + StVal = GetWidenedVector(StVal); + // The mask should be widened as well. + EVT WideVT = StVal.getValueType(); + EVT WideMaskVT = EVT::getVectorVT(*DAG.getContext(), + MaskVT.getVectorElementType(), + WideVT.getVectorNumElements()); + Mask = ModifyToType(Mask, WideMaskVT, true); + } else { + EVT WideMaskVT = TLI.getTypeToTransformTo(*DAG.getContext(), MaskVT); + Mask = ModifyToType(Mask, WideMaskVT, true); + + EVT ValueVT = StVal.getValueType(); + if (getTypeAction(ValueVT) == TargetLowering::TypeWidenVector) + StVal = GetWidenedVector(StVal); + else { + EVT WideVT = EVT::getVectorVT(*DAG.getContext(), + ValueVT.getVectorElementType(), + WideMaskVT.getVectorNumElements()); + StVal = ModifyToType(StVal, WideVT); + } + } + assert(Mask.getValueType().getVectorNumElements() == - WideVal.getValueType().getVectorNumElements() && + StVal.getValueType().getVectorNumElements() && "Mask and data vectors should have the same number of elements"); - return DAG.getMaskedStore(MST->getChain(), dl, WideVal, MST->getBasePtr(), + return DAG.getMaskedStore(MST->getChain(), dl, StVal, MST->getBasePtr(), Mask, MST->getMemoryVT(), MST->getMemOperand(), false, MST->isCompressingStore()); } Modified: projects/clang700-import/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -481,34 +481,6 @@ static bool hasPrefix(StringRef SectionName, StringRef return SectionName.startswith(Prefix) || SectionName == Prefix.drop_back(); } -// Return a set of section flags based on the section name that can then -// be augmented later, otherwise return 0 if we don't have any reasonable -// defaults. -static unsigned defaultSectionFlags(StringRef SectionName) { - - if (hasPrefix(SectionName, ".rodata.cst")) - return ELF::SHF_ALLOC | ELF::SHF_MERGE; - - if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1") - return ELF::SHF_ALLOC; - - if (SectionName == ".fini" || SectionName == ".init" || - hasPrefix(SectionName, ".text.")) - return ELF::SHF_ALLOC | ELF::SHF_EXECINSTR; - - if (hasPrefix(SectionName, ".data.") || SectionName == ".data1" || - hasPrefix(SectionName, ".bss.") || - hasPrefix(SectionName, ".init_array.") || - hasPrefix(SectionName, ".fini_array.") || - hasPrefix(SectionName, ".preinit_array.")) - return ELF::SHF_ALLOC | ELF::SHF_WRITE; - - if (hasPrefix(SectionName, ".tdata.") || hasPrefix(SectionName, ".tbss.")) - return ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_TLS; - - return 0; -} - bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) { StringRef SectionName; @@ -518,13 +490,27 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, StringRef TypeName; int64_t Size = 0; StringRef GroupName; + unsigned Flags = 0; const MCExpr *Subsection = nullptr; bool UseLastGroup = false; MCSymbolELF *Associated = nullptr; int64_t UniqueID = ~0; - // Set the default section flags first in case no others are given. - unsigned Flags = defaultSectionFlags(SectionName); + // Set the defaults first. + if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1") + Flags |= ELF::SHF_ALLOC; + else if (SectionName == ".fini" || SectionName == ".init" || + hasPrefix(SectionName, ".text.")) + Flags |= ELF::SHF_ALLOC | ELF::SHF_EXECINSTR; + else if (hasPrefix(SectionName, ".data.") || SectionName == ".data1" || + hasPrefix(SectionName, ".bss.") || + hasPrefix(SectionName, ".init_array.") || + hasPrefix(SectionName, ".fini_array.") || + hasPrefix(SectionName, ".preinit_array.")) + Flags |= ELF::SHF_ALLOC | ELF::SHF_WRITE; + else if (hasPrefix(SectionName, ".tdata.") || + hasPrefix(SectionName, ".tbss.")) + Flags |= ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_TLS; if (getLexer().is(AsmToken::Comma)) { Lex(); @@ -552,12 +538,6 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, if (extraFlags == -1U) return TokError("unknown flag"); - - // If we found additional section flags on a known section then give a - // warning. - if (Flags && Flags != extraFlags) - Warning(loc, "setting incorrect section attributes for " + SectionName); - Flags |= extraFlags; bool Mergeable = Flags & ELF::SHF_MERGE; Modified: projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPU.td ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPU.td Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPU.td Sat Aug 11 16:40:03 2018 (r337645) @@ -267,15 +267,6 @@ def FeatureD16PreservesUnusedBits : SubtargetFeature< // Subtarget Features (options and debugging) //===------------------------------------------------------------===// -// Some instructions do not support denormals despite this flag. Using -// fp32 denormals also causes instructions to run at the double -// precision rate for the device. -def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals", - "FP32Denormals", - "true", - "Enable single precision denormal handling" ->; - // Denormal handling for fp64 and fp16 is controlled by the same // config register when fp16 supported. // TODO: Do we need a separate f16 setting when not legal? Modified: projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUFeatures.td ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUFeatures.td Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUFeatures.td Sat Aug 11 16:40:03 2018 (r337645) @@ -19,6 +19,15 @@ def FeatureFMA : SubtargetFeature<"fmaf", "Enable single precision FMA (not as fast as mul+add, but fused)" >; +// Some instructions do not support denormals despite this flag. Using +// fp32 denormals also causes instructions to run at the double +// precision rate for the device. +def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals", + "FP32Denormals", + "true", + "Enable single precision denormal handling" +>; + class SubtargetFeatureLocalMemorySize : SubtargetFeature< "localmemorysize"#Value, "LocalMemorySize", Modified: projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -903,7 +903,7 @@ SDValue R600TargetLowering::LowerImplicitParameter(Sel unsigned DwordOffset) const { unsigned ByteOffset = DwordOffset * 4; PointerType * PtrType = PointerType::get(VT.getTypeForEVT(*DAG.getContext()), - AMDGPUASI.CONSTANT_BUFFER_0); + AMDGPUASI.PARAM_I_ADDRESS); // We shouldn't be using an offset wider than 16-bits for implicit parameters. assert(isInt<16>(ByteOffset)); @@ -1457,33 +1457,17 @@ SDValue R600TargetLowering::LowerLOAD(SDValue Op, Sele return scalarizeVectorLoad(LoadNode, DAG); } + // This is still used for explicit load from addrspace(8) int ConstantBlock = ConstantAddressBlock(LoadNode->getAddressSpace()); if (ConstantBlock > -1 && ((LoadNode->getExtensionType() == ISD::NON_EXTLOAD) || (LoadNode->getExtensionType() == ISD::ZEXTLOAD))) { SDValue Result; - if (isa(LoadNode->getMemOperand()->getValue()) || - isa(LoadNode->getMemOperand()->getValue()) || + if (isa(LoadNode->getMemOperand()->getValue()) || isa(Ptr)) { - SDValue Slots[4]; - for (unsigned i = 0; i < 4; i++) { - // We want Const position encoded with the following formula : - // (((512 + (kc_bank << 12) + const_index) << 2) + chan) - // const_index is Ptr computed by llvm using an alignment of 16. - // Thus we add (((512 + (kc_bank << 12)) + chan ) * 4 here and - // then div by 4 at the ISel step - SDValue NewPtr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr, - DAG.getConstant(4 * i + ConstantBlock * 16, DL, MVT::i32)); - Slots[i] = DAG.getNode(AMDGPUISD::CONST_ADDRESS, DL, MVT::i32, NewPtr); - } - EVT NewVT = MVT::v4i32; - unsigned NumElements = 4; - if (VT.isVector()) { - NewVT = VT; - NumElements = VT.getVectorNumElements(); - } - Result = DAG.getBuildVector(NewVT, DL, makeArrayRef(Slots, NumElements)); + return constBufferLoad(LoadNode, LoadNode->getAddressSpace(), DAG); } else { + //TODO: Does this even work? // non-constant ptr can't be folded, keeps it as a v4f32 load Result = DAG.getNode(AMDGPUISD::CONST_ADDRESS, DL, MVT::v4i32, DAG.getNode(ISD::SRL, DL, MVT::i32, Ptr, @@ -1622,7 +1606,7 @@ SDValue R600TargetLowering::LowerFormalArguments( } PointerType *PtrTy = PointerType::get(VT.getTypeForEVT(*DAG.getContext()), - AMDGPUASI.CONSTANT_BUFFER_0); + AMDGPUASI.PARAM_I_ADDRESS); // i64 isn't a legal type, so the register type used ends up as i32, which // isn't expected here. It attempts to create this sextload, but it ends up @@ -1646,17 +1630,17 @@ SDValue R600TargetLowering::LowerFormalArguments( unsigned ValBase = ArgLocs[In.getOrigArgIndex()].getLocMemOffset(); unsigned PartOffset = VA.getLocMemOffset(); + unsigned Alignment = MinAlign(VT.getStoreSize(), PartOffset); MachinePointerInfo PtrInfo(UndefValue::get(PtrTy), PartOffset - ValBase); SDValue Arg = DAG.getLoad( ISD::UNINDEXED, Ext, VT, DL, Chain, DAG.getConstant(PartOffset, DL, MVT::i32), DAG.getUNDEF(MVT::i32), PtrInfo, - MemVT, /* Alignment = */ 4, MachineMemOperand::MONonTemporal | + MemVT, Alignment, MachineMemOperand::MONonTemporal | MachineMemOperand::MODereferenceable | MachineMemOperand::MOInvariant); - // 4 is the preferred alignment for the CONSTANT memory space. InVals.push_back(Arg); } return Chain; @@ -1804,6 +1788,52 @@ SDValue R600TargetLowering::OptimizeSwizzle(SDValue Bu return BuildVector; } +SDValue R600TargetLowering::constBufferLoad(LoadSDNode *LoadNode, int Block, + SelectionDAG &DAG) const { + SDLoc DL(LoadNode); + EVT VT = LoadNode->getValueType(0); + SDValue Chain = LoadNode->getChain(); + SDValue Ptr = LoadNode->getBasePtr(); + assert (isa(Ptr)); + + //TODO: Support smaller loads + if (LoadNode->getMemoryVT().getScalarType() != MVT::i32 || !ISD::isNON_EXTLoad(LoadNode)) + return SDValue(); + + if (LoadNode->getAlignment() < 4) + return SDValue(); + + int ConstantBlock = ConstantAddressBlock(Block); + + SDValue Slots[4]; + for (unsigned i = 0; i < 4; i++) { + // We want Const position encoded with the following formula : + // (((512 + (kc_bank << 12) + const_index) << 2) + chan) + // const_index is Ptr computed by llvm using an alignment of 16. + // Thus we add (((512 + (kc_bank << 12)) + chan ) * 4 here and + // then div by 4 at the ISel step + SDValue NewPtr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr, + DAG.getConstant(4 * i + ConstantBlock * 16, DL, MVT::i32)); + Slots[i] = DAG.getNode(AMDGPUISD::CONST_ADDRESS, DL, MVT::i32, NewPtr); + } + EVT NewVT = MVT::v4i32; + unsigned NumElements = 4; + if (VT.isVector()) { + NewVT = VT; + NumElements = VT.getVectorNumElements(); + } + SDValue Result = DAG.getBuildVector(NewVT, DL, makeArrayRef(Slots, NumElements)); + if (!VT.isVector()) { + Result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, MVT::i32, Result, + DAG.getConstant(0, DL, MVT::i32)); + } + SDValue MergedValues[2] = { + Result, + Chain + }; + return DAG.getMergeValues(MergedValues, DL); +} + //===----------------------------------------------------------------------===// // Custom DAG Optimizations //===----------------------------------------------------------------------===// @@ -2022,6 +2052,16 @@ SDValue R600TargetLowering::PerformDAGCombine(SDNode * NewArgs[1] = OptimizeSwizzle(N->getOperand(1), &NewArgs[2], DAG, DL); return DAG.getNode(AMDGPUISD::TEXTURE_FETCH, DL, N->getVTList(), NewArgs); } + + case ISD::LOAD: { + LoadSDNode *LoadNode = cast(N); + SDValue Ptr = LoadNode->getBasePtr(); + if (LoadNode->getAddressSpace() == AMDGPUAS::PARAM_I_ADDRESS && + isa(Ptr)) + return constBufferLoad(LoadNode, AMDGPUAS::CONSTANT_BUFFER_0, DAG); + break; + } + default: break; } Modified: projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.h ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.h Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/R600ISelLowering.h Sat Aug 11 16:40:03 2018 (r337645) @@ -98,9 +98,11 @@ class R600TargetLowering final : public AMDGPUTargetLo bool isHWTrueValue(SDValue Op) const; bool isHWFalseValue(SDValue Op) const; - bool FoldOperand(SDNode *ParentNode, unsigned SrcIdx, SDValue &Src, - SDValue &Neg, SDValue &Abs, SDValue &Sel, SDValue &Imm, - SelectionDAG &DAG) const; + bool FoldOperand(SDNode *ParentNode, unsigned SrcIdx, SDValue &Src, + SDValue &Neg, SDValue &Abs, SDValue &Sel, SDValue &Imm, + SelectionDAG &DAG) const; + SDValue constBufferLoad(LoadSDNode *LoadNode, int Block, + SelectionDAG &DAG) const; SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const override; }; Modified: projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/VOP3Instructions.td ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/VOP3Instructions.td Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Target/AMDGPU/VOP3Instructions.td Sat Aug 11 16:40:03 2018 (r337645) @@ -461,17 +461,6 @@ def : GCNPat < (inst i16:$src0, i16:$src1, i16:$src2, (i1 0)) >; -def : GCNPat< - (i32 (op3 (op2 (op1 i16:$src0, i16:$src1), i16:$src2))), - (inst i16:$src0, i16:$src1, i16:$src2, (i1 0)) ->; - -def : GCNPat< - (i64 (op3 (op2 (op1 i16:$src0, i16:$src1), i16:$src2))), - (REG_SEQUENCE VReg_64, - (inst i16:$src0, i16:$src1, i16:$src2, (i1 0)), sub0, - (V_MOV_B32_e32 (i32 0)), sub1) ->; } defm: Ternary_i16_Pats; Modified: projects/clang700-import/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -16,6 +16,7 @@ #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/Instructions.h" +#include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" @@ -81,10 +82,12 @@ void NVPTXDAGToDAGISel::Select(SDNode *N) { switch (N->getOpcode()) { case ISD::LOAD: + case ISD::ATOMIC_LOAD: if (tryLoad(N)) return; break; case ISD::STORE: + case ISD::ATOMIC_STORE: if (tryStore(N)) return; break; @@ -834,17 +837,27 @@ static Optional pickOpcodeForVT( bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) { SDLoc dl(N); - LoadSDNode *LD = cast(N); + MemSDNode *LD = cast(N); + assert(LD->readMem() && "Expected load"); + LoadSDNode *PlainLoad = dyn_cast(N); EVT LoadedVT = LD->getMemoryVT(); SDNode *NVPTXLD = nullptr; // do not support pre/post inc/dec - if (LD->isIndexed()) + if (PlainLoad && PlainLoad->isIndexed()) return false; if (!LoadedVT.isSimple()) return false; + AtomicOrdering Ordering = LD->getOrdering(); + // In order to lower atomic loads with stronger guarantees we would need to + // use load.acquire or insert fences. However these features were only added + // with PTX ISA 6.0 / sm_70. + // TODO: Check if we can actually use the new instructions and implement them. + if (isStrongerThanMonotonic(Ordering)) + return false; + // Address Space Setting unsigned int CodeAddrSpace = getCodeAddrSpace(LD); if (canLowerToLDG(LD, *Subtarget, CodeAddrSpace, MF)) { @@ -855,8 +868,9 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) { CurDAG->getDataLayout().getPointerSizeInBits(LD->getAddressSpace()); // Volatile Setting - // - .volatile is only availalble for .global and .shared - bool isVolatile = LD->isVolatile(); + // - .volatile is only available for .global and .shared + // - .volatile has the same memory synchronization semantics as .relaxed.sys + bool isVolatile = LD->isVolatile() || Ordering == AtomicOrdering::Monotonic; if (CodeAddrSpace != NVPTX::PTXLdStInstCode::GLOBAL && CodeAddrSpace != NVPTX::PTXLdStInstCode::SHARED && CodeAddrSpace != NVPTX::PTXLdStInstCode::GENERIC) @@ -882,7 +896,7 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) { fromTypeWidth = 32; } - if ((LD->getExtensionType() == ISD::SEXTLOAD)) + if (PlainLoad && (PlainLoad->getExtensionType() == ISD::SEXTLOAD)) fromType = NVPTX::PTXLdStInstCode::Signed; else if (ScalarVT.isFloatingPoint()) // f16 uses .b16 as its storage type. @@ -1691,25 +1705,38 @@ bool NVPTXDAGToDAGISel::tryLDGLDU(SDNode *N) { bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { SDLoc dl(N); - StoreSDNode *ST = cast(N); + MemSDNode *ST = cast(N); + assert(ST->writeMem() && "Expected store"); + StoreSDNode *PlainStore = dyn_cast(N); + AtomicSDNode *AtomicStore = dyn_cast(N); + assert((PlainStore || AtomicStore) && "Expected store"); EVT StoreVT = ST->getMemoryVT(); SDNode *NVPTXST = nullptr; // do not support pre/post inc/dec - if (ST->isIndexed()) + if (PlainStore && PlainStore->isIndexed()) return false; if (!StoreVT.isSimple()) return false; + AtomicOrdering Ordering = ST->getOrdering(); + // In order to lower atomic loads with stronger guarantees we would need to + // use store.release or insert fences. However these features were only added + // with PTX ISA 6.0 / sm_70. + // TODO: Check if we can actually use the new instructions and implement them. + if (isStrongerThanMonotonic(Ordering)) + return false; + // Address Space Setting unsigned int CodeAddrSpace = getCodeAddrSpace(ST); unsigned int PointerSize = CurDAG->getDataLayout().getPointerSizeInBits(ST->getAddressSpace()); // Volatile Setting - // - .volatile is only availalble for .global and .shared - bool isVolatile = ST->isVolatile(); + // - .volatile is only available for .global and .shared + // - .volatile has the same memory synchronization semantics as .relaxed.sys + bool isVolatile = ST->isVolatile() || Ordering == AtomicOrdering::Monotonic; if (CodeAddrSpace != NVPTX::PTXLdStInstCode::GLOBAL && CodeAddrSpace != NVPTX::PTXLdStInstCode::SHARED && CodeAddrSpace != NVPTX::PTXLdStInstCode::GENERIC) @@ -1739,41 +1766,53 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { toType = NVPTX::PTXLdStInstCode::Unsigned; // Create the machine instruction DAG - SDValue Chain = N->getOperand(0); - SDValue N1 = N->getOperand(1); - SDValue N2 = N->getOperand(2); + SDValue Chain = ST->getChain(); + SDValue Value = PlainStore ? PlainStore->getValue() : AtomicStore->getVal(); + SDValue BasePtr = ST->getBasePtr(); SDValue Addr; SDValue Offset, Base; Optional Opcode; - MVT::SimpleValueType SourceVT = N1.getNode()->getSimpleValueType(0).SimpleTy; + MVT::SimpleValueType SourceVT = + Value.getNode()->getSimpleValueType(0).SimpleTy; - if (SelectDirectAddr(N2, Addr)) { + if (SelectDirectAddr(BasePtr, Addr)) { Opcode = pickOpcodeForVT(SourceVT, NVPTX::ST_i8_avar, NVPTX::ST_i16_avar, NVPTX::ST_i32_avar, NVPTX::ST_i64_avar, NVPTX::ST_f16_avar, NVPTX::ST_f16x2_avar, NVPTX::ST_f32_avar, NVPTX::ST_f64_avar); if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), Addr, - Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + Addr, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); - } else if (PointerSize == 64 ? SelectADDRsi64(N2.getNode(), N2, Base, Offset) - : SelectADDRsi(N2.getNode(), N2, Base, Offset)) { + } else if (PointerSize == 64 + ? SelectADDRsi64(BasePtr.getNode(), BasePtr, Base, Offset) + : SelectADDRsi(BasePtr.getNode(), BasePtr, Base, Offset)) { Opcode = pickOpcodeForVT(SourceVT, NVPTX::ST_i8_asi, NVPTX::ST_i16_asi, NVPTX::ST_i32_asi, NVPTX::ST_i64_asi, NVPTX::ST_f16_asi, NVPTX::ST_f16x2_asi, NVPTX::ST_f32_asi, NVPTX::ST_f64_asi); if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), Base, - Offset, Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + Base, + Offset, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); - } else if (PointerSize == 64 ? SelectADDRri64(N2.getNode(), N2, Base, Offset) - : SelectADDRri(N2.getNode(), N2, Base, Offset)) { + } else if (PointerSize == 64 + ? SelectADDRri64(BasePtr.getNode(), BasePtr, Base, Offset) + : SelectADDRri(BasePtr.getNode(), BasePtr, Base, Offset)) { if (PointerSize == 64) Opcode = pickOpcodeForVT( SourceVT, NVPTX::ST_i8_ari_64, NVPTX::ST_i16_ari_64, @@ -1787,10 +1826,15 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), Base, - Offset, Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + Base, + Offset, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); } else { if (PointerSize == 64) @@ -1806,10 +1850,14 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { NVPTX::ST_f32_areg, NVPTX::ST_f64_areg); if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), N2, - Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + BasePtr, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); } Modified: projects/clang700-import/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -47,21 +47,17 @@ STATISTIC(ChecksUnable, "Bounds checks unable to add") using BuilderTy = IRBuilder; -/// Adds run-time bounds checks to memory accessing instructions. +/// Gets the conditions under which memory accessing instructions will overflow. /// /// \p Ptr is the pointer that will be read/written, and \p InstVal is either /// the result from the load or the value being stored. It is used to determine /// the size of memory block that is touched. /// -/// \p GetTrapBB is a callable that returns the trap BB to use on failure. -/// -/// Returns true if any change was made to the IR, false otherwise. -template -static bool instrumentMemAccess(Value *Ptr, Value *InstVal, - const DataLayout &DL, TargetLibraryInfo &TLI, - ObjectSizeOffsetEvaluator &ObjSizeEval, - BuilderTy &IRB, GetTrapBBT GetTrapBB, - ScalarEvolution &SE) { +/// Returns the condition under which the access will overflow. +static Value *getBoundsCheckCond(Value *Ptr, Value *InstVal, + const DataLayout &DL, TargetLibraryInfo &TLI, + ObjectSizeOffsetEvaluator &ObjSizeEval, + BuilderTy &IRB, ScalarEvolution &SE) { uint64_t NeededSize = DL.getTypeStoreSize(InstVal->getType()); LLVM_DEBUG(dbgs() << "Instrument " << *Ptr << " for " << Twine(NeededSize) << " bytes\n"); @@ -70,7 +66,7 @@ static bool instrumentMemAccess(Value *Ptr, Value *Ins if (!ObjSizeEval.bothKnown(SizeOffset)) { ++ChecksUnable; - return false; + return nullptr; } Value *Size = SizeOffset.first; @@ -107,13 +103,23 @@ static bool instrumentMemAccess(Value *Ptr, Value *Ins Or = IRB.CreateOr(Cmp1, Or); } + return Or; +} + +/// Adds run-time bounds checks to memory accessing instructions. +/// +/// \p Or is the condition that should guard the trap. +/// +/// \p GetTrapBB is a callable that returns the trap BB to use on failure. +template +static void insertBoundsCheck(Value *Or, BuilderTy IRB, GetTrapBBT GetTrapBB) { // check if the comparison is always false ConstantInt *C = dyn_cast_or_null(Or); if (C) { ++ChecksSkipped; // If non-zero, nothing to do. if (!C->getZExtValue()) - return true; + return; } ++ChecksAdded; @@ -127,12 +133,11 @@ static bool instrumentMemAccess(Value *Ptr, Value *Ins // FIXME: We should really handle this differently to bypass the splitting // the block. BranchInst::Create(GetTrapBB(IRB), OldBB); - return true; + return; } // Create the conditional branch. BranchInst::Create(GetTrapBB(IRB), Cont, Or, OldBB); - return true; } static bool addBoundsChecking(Function &F, TargetLibraryInfo &TLI, @@ -143,11 +148,25 @@ static bool addBoundsChecking(Function &F, TargetLibra // check HANDLE_MEMORY_INST in include/llvm/Instruction.def for memory // touching instructions - std::vector WorkList; + SmallVector, 4> TrapInfo; for (Instruction &I : instructions(F)) { - if (isa(I) || isa(I) || isa(I) || - isa(I)) - WorkList.push_back(&I); + Value *Or = nullptr; + BuilderTy IRB(I.getParent(), BasicBlock::iterator(&I), TargetFolder(DL)); + if (LoadInst *LI = dyn_cast(&I)) { + Or = getBoundsCheckCond(LI->getPointerOperand(), LI, DL, TLI, + ObjSizeEval, IRB, SE); + } else if (StoreInst *SI = dyn_cast(&I)) { + Or = getBoundsCheckCond(SI->getPointerOperand(), SI->getValueOperand(), + DL, TLI, ObjSizeEval, IRB, SE); + } else if (AtomicCmpXchgInst *AI = dyn_cast(&I)) { + Or = getBoundsCheckCond(AI->getPointerOperand(), AI->getCompareOperand(), + DL, TLI, ObjSizeEval, IRB, SE); + } else if (AtomicRMWInst *AI = dyn_cast(&I)) { + Or = getBoundsCheckCond(AI->getPointerOperand(), AI->getValOperand(), DL, + TLI, ObjSizeEval, IRB, SE); + } + if (Or) + TrapInfo.push_back(std::make_pair(&I, Or)); } // Create a trapping basic block on demand using a callback. Depending on @@ -176,29 +195,14 @@ static bool addBoundsChecking(Function &F, TargetLibra return TrapBB; }; - bool MadeChange = false; - for (Instruction *Inst : WorkList) { + // Add the checks. + for (const auto &Entry : TrapInfo) { + Instruction *Inst = Entry.first; BuilderTy IRB(Inst->getParent(), BasicBlock::iterator(Inst), TargetFolder(DL)); - if (LoadInst *LI = dyn_cast(Inst)) { - MadeChange |= instrumentMemAccess(LI->getPointerOperand(), LI, DL, TLI, - ObjSizeEval, IRB, GetTrapBB, SE); - } else if (StoreInst *SI = dyn_cast(Inst)) { - MadeChange |= - instrumentMemAccess(SI->getPointerOperand(), SI->getValueOperand(), - DL, TLI, ObjSizeEval, IRB, GetTrapBB, SE); - } else if (AtomicCmpXchgInst *AI = dyn_cast(Inst)) { - MadeChange |= - instrumentMemAccess(AI->getPointerOperand(), AI->getCompareOperand(), - DL, TLI, ObjSizeEval, IRB, GetTrapBB, SE); - } else if (AtomicRMWInst *AI = dyn_cast(Inst)) { - MadeChange |= - instrumentMemAccess(AI->getPointerOperand(), AI->getValOperand(), DL, - TLI, ObjSizeEval, IRB, GetTrapBB, SE); - } else { - llvm_unreachable("unknown Instruction type"); - } + insertBoundsCheck(Entry.second, IRB, GetTrapBB); } - return MadeChange; + + return !TrapInfo.empty(); } PreservedAnalyses BoundsCheckingPass::run(Function &F, FunctionAnalysisManager &AM) { Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -1213,9 +1213,13 @@ static llvm::Constant *buildGlobalBlock(CodeGenModule auto fields = builder.beginStruct(); bool IsOpenCL = CGM.getLangOpts().OpenCL; + bool IsWindows = CGM.getTarget().getTriple().isOSWindows(); if (!IsOpenCL) { // isa - fields.add(CGM.getNSConcreteGlobalBlock()); + if (IsWindows) + fields.addNullPointer(CGM.Int8PtrPtrTy); + else + fields.add(CGM.getNSConcreteGlobalBlock()); // __flags BlockFlags flags = BLOCK_IS_GLOBAL | BLOCK_HAS_SIGNATURE; @@ -1250,7 +1254,27 @@ static llvm::Constant *buildGlobalBlock(CodeGenModule llvm::Constant *literal = fields.finishAndCreateGlobal( "__block_literal_global", blockInfo.BlockAlign, - /*constant*/ true, llvm::GlobalVariable::InternalLinkage, AddrSpace); + /*constant*/ !IsWindows, llvm::GlobalVariable::InternalLinkage, AddrSpace); + + // Windows does not allow globals to be initialised to point to globals in + // different DLLs. Any such variables must run code to initialise them. + if (IsWindows) { + auto *Init = llvm::Function::Create(llvm::FunctionType::get(CGM.VoidTy, + {}), llvm::GlobalValue::InternalLinkage, ".block_isa_init", + &CGM.getModule()); + llvm::IRBuilder<> b(llvm::BasicBlock::Create(CGM.getLLVMContext(), "entry", + Init)); + b.CreateAlignedStore(CGM.getNSConcreteGlobalBlock(), + b.CreateStructGEP(literal, 0), CGM.getPointerAlign().getQuantity()); + b.CreateRetVoid(); + // We can't use the normal LLVM global initialisation array, because we + // need to specify that this runs early in library initialisation. + auto *InitVar = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), + /*isConstant*/true, llvm::GlobalValue::InternalLinkage, + Init, ".block_isa_init_ptr"); + InitVar->setSection(".CRT$XCLa"); + CGM.addUsedGlobal(InitVar); + } // Return a constant of the appropriately-casted type. llvm::Type *RequiredType = Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -3812,40 +3812,10 @@ llvm::GlobalVariable *CGObjCGNU::ObjCIvarOffsetVariabl // is. This allows code compiled with non-fragile ivars to work correctly // when linked against code which isn't (most of the time). llvm::GlobalVariable *IvarOffsetPointer = TheModule.getNamedGlobal(Name); - if (!IvarOffsetPointer) { - // This will cause a run-time crash if we accidentally use it. A value of - // 0 would seem more sensible, but will silently overwrite the isa pointer - // causing a great deal of confusion. - uint64_t Offset = -1; - // We can't call ComputeIvarBaseOffset() here if we have the - // implementation, because it will create an invalid ASTRecordLayout object - // that we are then stuck with forever, so we only initialize the ivar - // offset variable with a guess if we only have the interface. The - // initializer will be reset later anyway, when we are generating the class - // description. - if (!CGM.getContext().getObjCImplementation( - const_cast(ID))) - Offset = ComputeIvarBaseOffset(CGM, ID, Ivar); - - llvm::ConstantInt *OffsetGuess = llvm::ConstantInt::get(Int32Ty, Offset, - /*isSigned*/true); - // Don't emit the guess in non-PIC code because the linker will not be able - // to replace it with the real version for a library. In non-PIC code you - // must compile with the fragile ABI if you want to use ivars from a - // GCC-compiled class. - if (CGM.getLangOpts().PICLevel) { - llvm::GlobalVariable *IvarOffsetGV = new llvm::GlobalVariable(TheModule, - Int32Ty, false, - llvm::GlobalValue::PrivateLinkage, OffsetGuess, Name+".guess"); - IvarOffsetPointer = new llvm::GlobalVariable(TheModule, - IvarOffsetGV->getType(), false, llvm::GlobalValue::LinkOnceAnyLinkage, - IvarOffsetGV, Name); - } else { - IvarOffsetPointer = new llvm::GlobalVariable(TheModule, - llvm::Type::getInt32PtrTy(VMContext), false, - llvm::GlobalValue::ExternalLinkage, nullptr, Name); - } - } + if (!IvarOffsetPointer) + IvarOffsetPointer = new llvm::GlobalVariable(TheModule, + llvm::Type::getInt32PtrTy(VMContext), false, + llvm::GlobalValue::ExternalLinkage, nullptr, Name); return IvarOffsetPointer; } Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -127,6 +127,7 @@ namespace clang { CodeGenOpts, C, CoverageInfo)), LinkModules(std::move(LinkModules)) { FrontendTimesIsEnabled = TimePasses; + llvm::TimePassesIsEnabled = TimePasses; } llvm::Module *getModule() const { return Gen->GetModule(); } std::unique_ptr takeModule() { Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/Headers/unwind.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/lib/Headers/unwind.h Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/tools/clang/lib/Headers/unwind.h Sat Aug 11 16:40:03 2018 (r337645) @@ -154,8 +154,12 @@ struct _Unwind_Control_Block { struct _Unwind_Exception { _Unwind_Exception_Class exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; +#if !defined (__USING_SJLJ_EXCEPTIONS__) && defined (__SEH__) + _Unwind_Word private_[6]; +#else _Unwind_Word private_1; _Unwind_Word private_2; +#endif /* The Itanium ABI requires that _Unwind_Exception objects are "double-word * aligned". GCC has interpreted this to mean "use the maximum useful * alignment for the target"; so do we. */ Modified: projects/clang700-import/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -113,9 +113,15 @@ ParsedType Sema::getConstructorName(IdentifierInfo &II break; } } - if (!InjectedClassName && CurClass->isInvalidDecl()) + if (!InjectedClassName) { + if (!CurClass->isInvalidDecl()) { + // FIXME: RequireCompleteDeclContext doesn't check dependent contexts + // properly. Work around it here for now. + Diag(SS.getLastQualifierNameLoc(), + diag::err_incomplete_nested_name_spec) << CurClass << SS.getRange(); + } return ParsedType(); - assert(InjectedClassName && "couldn't find injected class name"); + } QualType T = Context.getTypeDeclType(InjectedClassName); DiagnoseUseOfDecl(InjectedClassName, NameLoc); Modified: projects/clang700-import/contrib/llvm/tools/lld/COFF/InputFiles.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/tools/lld/COFF/InputFiles.cpp Sat Aug 11 16:37:55 2018 (r337644) +++ projects/clang700-import/contrib/llvm/tools/lld/COFF/InputFiles.cpp Sat Aug 11 16:40:03 2018 (r337645) @@ -205,8 +205,14 @@ SectionChunk *ObjFile::readSection(uint32_t SectionNum void ObjFile::readAssociativeDefinition( COFFSymbolRef Sym, const coff_aux_section_definition *Def) { - SectionChunk *Parent = SparseChunks[Def->getNumber(Sym.isBigObj())]; + readAssociativeDefinition(Sym, Def, Def->getNumber(Sym.isBigObj())); +} +void ObjFile::readAssociativeDefinition(COFFSymbolRef Sym, + const coff_aux_section_definition *Def, + uint32_t ParentSection) { + SectionChunk *Parent = SparseChunks[ParentSection]; + // If the parent is pending, it probably means that its section definition // appears after us in the symbol table. Leave the associated section as // pending; we will handle it during the second pass in initializeSymbols(). @@ -225,6 +231,35 @@ void ObjFile::readAssociativeDefinition( } } +void ObjFile::recordPrevailingSymbolForMingw( + COFFSymbolRef Sym, DenseMap &PrevailingSectionMap) { + // For comdat symbols in executable sections, where this is the copy + // of the section chunk we actually include instead of discarding it, + // add the symbol to a map to allow using it for implicitly + // associating .[px]data$ sections to it. + int32_t SectionNumber = Sym.getSectionNumber(); + SectionChunk *SC = SparseChunks[SectionNumber]; + if (SC && SC->getOutputCharacteristics() & IMAGE_SCN_MEM_EXECUTE) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Sat Aug 11 16:41:11 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75ABA1073510 for ; Sat, 11 Aug 2018 16:41:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 232D58867B; Sat, 11 Aug 2018 16:41:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 042C119DA1; Sat, 11 Aug 2018 16:41:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGfBrP028930; Sat, 11 Aug 2018 16:41:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGf8Z0028914; Sat, 11 Aug 2018 16:41:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111641.w7BGf8Z0028914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 16:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337647 - in projects/clang700-import: cddl/usr.sbin/dwatch/libexec etc etc/cron.d sbin/ddb sbin/pfctl sbin/restore sbin/sysctl share/man/man4 share/man/man5 share/man/man7 sys/netpfil/... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang700-import: cddl/usr.sbin/dwatch/libexec etc etc/cron.d sbin/ddb sbin/pfctl sbin/restore sbin/sysctl share/man/man4 share/man/man5 share/man/man7 sys/netpfil/pf usr.bin/at usr.sbin/au... X-SVN-Commit-Revision: 337647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:41:12 -0000 Author: dim Date: Sat Aug 11 16:41:08 2018 New Revision: 337647 URL: https://svnweb.freebsd.org/changeset/base/337647 Log: Merge ^/head r337619 through r337645. Added: projects/clang700-import/sbin/ddb/ddb.conf - copied unchanged from r337645, head/sbin/ddb/ddb.conf projects/clang700-import/sbin/pfctl/pf.os - copied unchanged from r337645, head/sbin/pfctl/pf.os projects/clang700-import/sbin/sysctl/sysctl.conf - copied unchanged from r337645, head/sbin/sysctl/sysctl.conf projects/clang700-import/usr.bin/at/atrun - copied unchanged from r337645, head/usr.bin/at/atrun projects/clang700-import/usr.sbin/bsnmpd/bsnmpd/snmpd.config - copied unchanged from r337645, head/usr.sbin/bsnmpd/bsnmpd/snmpd.config Deleted: projects/clang700-import/etc/cron.d/ projects/clang700-import/etc/ddb.conf projects/clang700-import/etc/pf.os projects/clang700-import/etc/snmpd.config projects/clang700-import/etc/sysctl.conf Modified: projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile projects/clang700-import/etc/Makefile projects/clang700-import/sbin/ddb/Makefile projects/clang700-import/sbin/pfctl/Makefile projects/clang700-import/sbin/restore/tape.c projects/clang700-import/sbin/sysctl/Makefile projects/clang700-import/share/man/man4/snd_envy24ht.4 projects/clang700-import/share/man/man5/make.conf.5 projects/clang700-import/share/man/man7/build.7 projects/clang700-import/sys/netpfil/pf/pf_if.c projects/clang700-import/usr.bin/at/Makefile projects/clang700-import/usr.bin/at/at.man projects/clang700-import/usr.sbin/auditd/Makefile projects/clang700-import/usr.sbin/bsdinstall/scripts/keymap projects/clang700-import/usr.sbin/bsnmpd/bsnmpd/Makefile Directory Properties: projects/clang700-import/ (props changed) projects/clang700-import/cddl/ (props changed) Modified: projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 16:41:08 2018 (r337647) @@ -12,6 +12,7 @@ FILES= chmod \ rw \ sched \ sendrecv \ + systop \ tcp \ udp \ udplite \ @@ -62,7 +63,6 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto -LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-established LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused Modified: projects/clang700-import/etc/Makefile ============================================================================== --- projects/clang700-import/etc/Makefile Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/etc/Makefile Sat Aug 11 16:41:08 2018 (r337647) @@ -15,7 +15,6 @@ SUBDIR+=sendmail BIN1= crontab \ devd.conf \ devfs.conf \ - ddb.conf \ dhclient.conf \ disktab \ fbtab \ @@ -42,7 +41,6 @@ BIN1= crontab \ remote \ rpc \ services \ - sysctl.conf \ syslog.conf \ termcap.small @@ -56,14 +54,6 @@ BIN1+= etc.${MACHINE_CPUARCH}/ttys .error etc.MACHINE/ttys missing .endif -OPENBSMDIR= ${SRCTOP}/contrib/openbsm -BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \ - ${OPENBSMDIR}/etc/audit_event -BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \ - ${OPENBSMDIR}/etc/audit_user -BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn -BSM_ETC_DIR= ${DESTDIR}/etc/security - # NB: keep these sorted by MK_* knobs .if ${MK_AMD} != "no" @@ -103,10 +93,6 @@ SSH= ${SRCTOP}/crypto/openssh/ssh_config \ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf .endif -.if ${MK_PF} != "no" -BIN1+= pf.os -.endif - .if ${MK_SENDMAIL} != "no" BIN1+= rc.sendmail .endif @@ -168,11 +154,6 @@ distribution: ${DESTDIR}/etc/services; .endif -.if ${MK_BSNMP} != "no" - cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - snmpd.config ${DESTDIR}/etc; -.endif .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif @@ -189,7 +170,6 @@ distribution: .if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install .endif - ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install @@ -203,12 +183,6 @@ distribution: ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \ - ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR} - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \ - ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR} - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ - ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ Modified: projects/clang700-import/sbin/ddb/Makefile ============================================================================== --- projects/clang700-import/sbin/ddb/Makefile Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/sbin/ddb/Makefile Sat Aug 11 16:41:08 2018 (r337647) @@ -1,5 +1,6 @@ # $FreeBSD$ +CONFS= ddb.conf PACKAGE=runtime PROG= ddb SRCS= ddb.c ddb_capture.c ddb_script.c Copied: projects/clang700-import/sbin/ddb/ddb.conf (from r337645, head/sbin/ddb/ddb.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang700-import/sbin/ddb/ddb.conf Sat Aug 11 16:41:08 2018 (r337647, copy of r337645, head/sbin/ddb/ddb.conf) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# +# This file is read when going to multi-user and its contents piped thru +# ``ddb'' to define debugging scripts. +# +# see ``man 4 ddb'' and ``man 8 ddb'' for details. +# + +script lockinfo=show locks; show alllocks; show lockedvnods + +# kdb.enter.panic panic(9) was called. +script kdb.enter.panic=textdump set; capture on; run lockinfo; show pcpu; bt; ps; alltrace; capture off; call doadump; reset + +# kdb.enter.witness witness(4) detected a locking error. +script kdb.enter.witness=run lockinfo Modified: projects/clang700-import/sbin/pfctl/Makefile ============================================================================== --- projects/clang700-import/sbin/pfctl/Makefile Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/sbin/pfctl/Makefile Sat Aug 11 16:41:08 2018 (r337647) @@ -6,6 +6,7 @@ .PATH: ${SRCTOP}/sys/netpfil/pf PACKAGE=pf +CONFS= pf.os PROG= pfctl MAN= pfctl.8 Copied: projects/clang700-import/sbin/pfctl/pf.os (from r337645, head/sbin/pfctl/pf.os) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang700-import/sbin/pfctl/pf.os Sat Aug 11 16:41:08 2018 (r337647, copy of r337645, head/sbin/pfctl/pf.os) @@ -0,0 +1,709 @@ +# $FreeBSD$ +# $OpenBSD: pf.os,v 1.27 2016/09/03 17:08:57 sthen Exp $ +# passive OS fingerprinting +# ------------------------- +# +# SYN signatures. Those signatures work for SYN packets only (duh!). +# +# (C) Copyright 2000-2003 by Michal Zalewski +# (C) Copyright 2003 by Mike Frantzen +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# +# This fingerprint database is adapted from Michal Zalewski's p0f passive +# operating system package. The last database sync was from a Nov 3 2003 +# p0f.fp. +# +# +# Each line in this file specifies a single fingerprint. Please read the +# information below carefully before attempting to append any signatures +# reported as UNKNOWN to this file to avoid mistakes. +# +# We use the following set metrics for fingerprinting: +# +# - Window size (WSS) - a highly OS dependent setting used for TCP/IP +# performance control (max. amount of data to be sent without ACK). +# Some systems use a fixed value for initial packets. On other +# systems, it is a multiple of MSS or MTU (MSS+40). In some rare +# cases, the value is just arbitrary. +# +# NEW SIGNATURE: if p0f reported a special value of 'Snn', the number +# appears to be a multiple of MSS (MSS*nn); a special value of 'Tnn' +# means it is a multiple of MTU ((MSS+40)*nn). Unless you notice the +# value of nn is not fixed (unlikely), just copy the Snn or Tnn token +# literally. If you know this device has a simple stack and a fixed +# MTU, you can however multiply S value by MSS, or T value by MSS+40, +# and put it instead of Snn or Tnn. +# +# If WSS otherwise looks like a fixed value (for example a multiple +# of two), or if you can confirm the value is fixed, please quote +# it literally. If there's no apparent pattern in WSS chosen, you +# should consider wildcarding this value. +# +# - Overall packet size - a function of all IP and TCP options and bugs. +# +# NEW SIGNATURE: Copy this value literally. +# +# - Initial TTL - We check the actual TTL of a received packet. It can't +# be higher than the initial TTL, and also shouldn't be dramatically +# lower (maximum distance is defined as 40 hops). +# +# NEW SIGNATURE: *Never* copy TTL from a p0f-reported signature literally. +# You need to determine the initial TTL. The best way to do it is to +# check the documentation for a remote system, or check its settings. +# A fairly good method is to simply round the observed TTL up to +# 32, 64, 128, or 255, but it should be noted that some obscure devices +# might not use round TTLs (in particular, some shoddy appliances use +# "original" initial TTL settings). If not sure, you can see how many +# hops you're away from the remote party with traceroute or mtr. +# +# - Don't fragment flag (DF) - some modern OSes set this to implement PMTU +# discovery. Others do not bother. +# +# NEW SIGNATURE: Copy this value literally. +# +# - Maximum segment size (MSS) - this setting is usually link-dependent. P0f +# uses it to determine link type of the remote host. +# +# NEW SIGNATURE: Always wildcard this value, except for rare cases when +# you have an appliance with a fixed value, know the system supports only +# a very limited number of network interface types, or know the system +# is using a value it pulled out of nowhere. Specific unique MSS +# can be used to tell Google crawlbots from the rest of the population. +# +# - Window scaling (WSCALE) - this feature is used to scale WSS. +# It extends the size of a TCP/IP window to 32 bits. Some modern +# systems implement this feature. +# +# NEW SIGNATURE: Observe several signatures. Initial WSCALE is often set +# to zero or other low value. There's usually no need to wildcard this +# parameter. +# +# - Timestamp - some systems that implement timestamps set them to +# zero in the initial SYN. This case is detected and handled appropriately. +# +# - Selective ACK permitted - a flag set by systems that implement +# selective ACK functionality. +# +# - The sequence of TCP all options (MSS, window scaling, selective ACK +# permitted, timestamp, NOP). Other than the options previously +# discussed, p0f also checks for timestamp option (a silly +# extension to broadcast your uptime ;-), NOP options (used for +# header padding) and sackOK option (selective ACK feature). +# +# NEW SIGNATURE: Copy the sequence literally. +# +# To wildcard any value (except for initial TTL or TCP options), replace +# it with '*'. You can also use a modulo operator to match any values +# that divide by nnn - '%nnn'. +# +# Fingerprint entry format: +# +# wwww:ttt:D:ss:OOO...:OS:Version:Subtype:Details +# +# wwww - window size (can be *, %nnn, Snn or Tnn). The special values +# "S" and "T" which are a multiple of MSS or a multiple of MTU +# respectively. +# ttt - initial TTL +# D - don't fragment bit (0 - not set, 1 - set) +# ss - overall SYN packet size +# OOO - option value and order specification (see below) +# OS - OS genre (Linux, Solaris, Windows) +# Version - OS Version (2.0.27 on x86, etc) +# Subtype - OS subtype or patchlevel (SP3, lo0) +# details - Generic OS details +# +# If OS genre starts with '*', p0f will not show distance, link type +# and timestamp data. It is useful for userland TCP/IP stacks of +# network scanners and so on, where many settings are randomized or +# bogus. +# +# If OS genre starts with @, it denotes an approximate hit for a group +# of operating systems (signature reporting still enabled in this case). +# Use this feature at the end of this file to catch cases for which +# you don't have a precise match, but can tell it's Windows or FreeBSD +# or whatnot by looking at, say, flag layout alone. +# +# Option block description is a list of comma or space separated +# options in the order they appear in the packet: +# +# N - NOP option +# Wnnn - window scaling option, value nnn (or * or %nnn) +# Mnnn - maximum segment size option, value nnn (or * or %nnn) +# S - selective ACK OK +# T - timestamp +# T0 - timestamp with a zero value +# +# To denote no TCP options, use a single '.'. +# +# Please report any additions to this file, or any inaccuracies or +# problems spotted, to the maintainers: lcamtuf@coredump.cx, +# frantzen@openbsd.org and bugs@openbsd.org with a tcpdump packet +# capture of the relevant SYN packet(s) +# +# A test and submission page is available at +# http://lcamtuf.coredump.cx/p0f-help/ +# +# +# WARNING WARNING WARNING +# ----------------------- +# +# Do not add a system X as OS Y just because NMAP says so. It is often +# the case that X is a NAT firewall. While nmap is talking to the +# device itself, p0f is fingerprinting the guy behind the firewall +# instead. +# +# When in doubt, use common sense, don't add something that looks like +# a completely different system as Linux or FreeBSD or LinkSys router. +# Check DNS name, establish a connection to the remote host and look +# at SYN+ACK - does it look similar? +# +# Some users tweak their TCP/IP settings - enable or disable RFC1323 +# functionality, enable or disable timestamps or selective ACK, +# disable PMTU discovery, change MTU and so on. Always compare a new rule +# to other fingerprints for this system, and verify the system isn't +# "customized" before adding it. It is OK to add signature variants +# caused by a commonly used software (personal firewalls, security +# packages, etc), but it makes no sense to try to add every single +# possible /proc/sys/net/ipv4 tweak on Linux or so. +# +# KEEP IN MIND: Some packet firewalls configured to normalize outgoing +# traffic (OpenBSD pf with "scrub" enabled, for example) will, well, +# normalize packets. Signatures will not correspond to the originating +# system (and probably not quite to the firewall either). +# +# NOTE: Try to keep this file in some reasonable order, from most to +# least likely systems. This will speed up operation. Also keep most +# generic and broad rules near the end. +# + +########################## +# Standard OS signatures # +########################## + +# ----------------- AIX --------------------- + +# AIX is first because its signatures are close to NetBSD, MacOS X and +# Linux 2.0, but it uses a fairly rare MSSes, at least sometimes... +# This is a shoddy hack, though. + +45046:64:0:44:M*: AIX:4.3::AIX 4.3 +16384:64:0:44:M512: AIX:4.3:2-3:AIX 4.3.2 and earlier + +16384:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +16384:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +32768:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +32768:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +65535:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +65535:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +65535:64:0:64:M*,N,W1,N,N,T,N,N,S: AIX:5.3:ML1:AIX 5.3 ML1 + +# ----------------- Linux ------------------- + +# S1:64:0:44:M*:A: Linux:1.2::Linux 1.2.x (XXX quirks support) +512:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x +16384:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x + +# Endian snafu! Nelson says "ha-ha": +2:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x (MkLinux) on Mac +64:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x (MkLinux) on Mac + + +S4:64:1:60:M1360,S,T,N,W0: Linux:google::Linux (Google crawlbot) + +S2:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4 (big boy) +S3:64:1:60:M*,S,T,N,W0: Linux:2.4:.18-21:Linux 2.4.18 and newer +S4:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4/2.6 <= 2.6.7 +S4:64:1:60:M*,S,T,N,W0: Linux:2.6:.1-7:Linux 2.4/2.6 <= 2.6.7 + +S4:64:1:60:M*,S,T,N,W5: Linux:2.6::Linux 2.6 (newer, 1) +S4:64:1:60:M*,S,T,N,W6: Linux:2.6::Linux 2.6 (newer, 2) +S4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 3) +T4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 4) + +S10:64:1:60:M*,S,T,N,W4: Linux:3.0::Linux 3.0 + +S3:64:1:60:M*,S,T,N,W1: Linux:2.5::Linux 2.5 (sometimes 2.4) +S4:64:1:60:M*,S,T,N,W1: Linux:2.5-2.6::Linux 2.5/2.6 +S3:64:1:60:M*,S,T,N,W2: Linux:2.5::Linux 2.5 (sometimes 2.4) +S4:64:1:60:M*,S,T,N,W2: Linux:2.5::Linux 2.5 (sometimes 2.4) + +S20:64:1:60:M*,S,T,N,W0: Linux:2.2:20-25:Linux 2.2.20 and newer +S22:64:1:60:M*,S,T,N,W0: Linux:2.2::Linux 2.2 +S11:64:1:60:M*,S,T,N,W0: Linux:2.2::Linux 2.2 + +# Popular cluster config scripts disable timestamps and +# selective ACK: +S4:64:1:48:M1460,N,W0: Linux:2.4:cluster:Linux 2.4 in cluster + +# This needs to be investigated. On some systems, WSS +# is selected as a multiple of MTU instead of MSS. I got +# many submissions for this for many late versions of 2.4: +T4:64:1:60:M1412,S,T,N,W0: Linux:2.4::Linux 2.4 (late, uncommon) + +# This happens only over loopback, but let's make folks happy: +32767:64:1:60:M16396,S,T,N,W0: Linux:2.4:lo0:Linux 2.4 (local) +S8:64:1:60:M3884,S,T,N,W0: Linux:2.2:lo0:Linux 2.2 (local) + +# Opera visitors: +16384:64:1:60:M*,S,T,N,W0: Linux:2.2:Opera:Linux 2.2 (Opera?) +32767:64:1:60:M*,S,T,N,W0: Linux:2.4:Opera:Linux 2.4 (Opera?) + +# Some fairly common mods: +S4:64:1:52:M*,N,N,S,N,W0: Linux:2.4:ts:Linux 2.4 w/o timestamps +S22:64:1:52:M*,N,N,S,N,W0: Linux:2.2:ts:Linux 2.2 w/o timestamps + + +# ----------------- FreeBSD ----------------- + +16384:64:1:44:M*: FreeBSD:2.0-2.2::FreeBSD 2.0-4.2 +16384:64:1:44:M*: FreeBSD:3.0-3.5::FreeBSD 2.0-4.2 +16384:64:1:44:M*: FreeBSD:4.0-4.2::FreeBSD 2.0-4.2 +16384:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.4::FreeBSD 4.4 + +1024:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.4::FreeBSD 4.4 + +57344:64:1:44:M*: FreeBSD:4.6-4.8:noRFC1323:FreeBSD 4.6-4.8 (no RFC1323) +57344:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.6-4.9::FreeBSD 4.6-4.9 + +32768:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.8-4.11::FreeBSD 4.8-5.1 (or MacOS X) +32768:64:1:60:M*,N,W0,N,N,T: FreeBSD:5.0-5.1::FreeBSD 4.8-5.1 (or MacOS X) +65535:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.8-4.11::FreeBSD 4.8-5.2 (or MacOS X) +65535:64:1:60:M*,N,W0,N,N,T: FreeBSD:5.0-5.2::FreeBSD 4.8-5.2 (or MacOS X) +65535:64:1:60:M*,N,W1,N,N,T: FreeBSD:4.7-4.11::FreeBSD 4.7-5.2 +65535:64:1:60:M*,N,W1,N,N,T: FreeBSD:5.0-5.2::FreeBSD 4.7-5.2 + +# XXX need quirks support +# 65535:64:1:60:M*,N,W0,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (1) +# 65535:64:1:60:M*,N,W1,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (2) +# 65535:64:1:60:M*,N,W2,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (3) +# 65535:64:1:44:M*:Z:FreeBSD:5.2::FreeBSD 5.2 (no RFC1323) + +# 16384:64:1:60:M*,N,N,N,N,N,N,T:FreeBSD:4.4:noTS:FreeBSD 4.4 (w/o timestamps) + +# ----------------- NetBSD ------------------ + +16384:64:0:60:M*,N,W0,N,N,T: NetBSD:1.3::NetBSD 1.3 +65535:64:0:60:M*,N,W0,N,N,T0: NetBSD:1.6:opera:NetBSD 1.6 (Opera) +16384:64:0:60:M*,N,W0,N,N,T0: NetBSD:1.6::NetBSD 1.6 +16384:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6:df:NetBSD 1.6 (DF) +65535:64:1:60:M*,N,W1,N,N,T0: NetBSD:1.6::NetBSD 1.6W-current (DF) +65535:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6::NetBSD 1.6X (DF) +32768:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6:randomization:NetBSD 1.6ZH-current (w/ ip_id randomization) + +# ----------------- OpenBSD ----------------- + +16384:64:0:60:M*,N,W0,N,N,T: OpenBSD:2.6::NetBSD 1.3 (or OpenBSD 2.6) +16384:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8::OpenBSD 3.0-4.8 +16384:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8:no-df:OpenBSD 3.0-4.8 (scrub no-df) +57344:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0::OpenBSD 3.3-4.0 +57344:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0:no-df:OpenBSD 3.3-4.0 (scrub no-df) + +65535:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0:opera:OpenBSD 3.0-4.0 (Opera) + +16384:64:1:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9::OpenBSD 4.9 +16384:64:0:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9:no-df:OpenBSD 4.9 (scrub no-df) + +16384:64:1:64:M*,N,N,S,N,W6,N,N,T: OpenBSD:6.1::OpenBSD 6.1 +16384:64:0:64:M*,N,N,S,N,W6,N,N,T: OpenBSD:6.1:no-df:OpenBSD 6.1 (scrub no-df) + +# ----------------- DragonFly BSD ----------------- + +57344:64:1:60:M*,N,W0,N,N,T: DragonFly:1.0:A:DragonFly 1.0A +57344:64:0:64:M*,N,W0,N,N,S,N,N,T: DragonFly:1.2-1.12::DragonFly 1.2-1.12 +5840:64:1:60:M*,S,T,N,W4: DragonFly:2.0-2.1::DragonFly 2.0-2.1 +57344:64:0:64:M*,N,W0,N,N,S,N,N,T: DragonFly:2.2-2.3::DragonFly 2.2-2.3 +57344:64:0:64:M*,N,W5,N,N,S,N,N,T: DragonFly:2.4-2.7::DragonFly 2.4-2.7 + +# ----------------- Solaris ----------------- + +S17:64:1:64:N,W3,N,N,T0,N,N,S,M*: Solaris:8:RFC1323:Solaris 8 RFC1323 +S17:64:1:48:N,N,S,M*: Solaris:8::Solaris 8 +S17:255:1:44:M*: Solaris:2.5-2.7::Solaris 2.5 to 7 + +S6:255:1:44:M*: Solaris:2.6-2.7::Solaris 2.6 to 7 +S23:255:1:44:M*: Solaris:2.5:1:Solaris 2.5.1 +S34:64:1:48:M*,N,N,S: Solaris:2.9::Solaris 9 +S44:255:1:44:M*: Solaris:2.7::Solaris 7 + +4096:64:0:44:M1460: SunOS:4.1::SunOS 4.1.x + +S34:64:1:52:M*,N,W0,N,N,S: Solaris:10:beta:Solaris 10 (beta) +32850:64:1:64:M*,N,N,T,N,W1,N,N,S: Solaris:10::Solaris 10 1203 + +# ----------------- IRIX -------------------- + +49152:64:0:44:M*: IRIX:6.4::IRIX 6.4 +61440:64:0:44:M*: IRIX:6.2-6.5::IRIX 6.2-6.5 +49152:64:0:52:M*,N,W2,N,N,S: IRIX:6.5:RFC1323:IRIX 6.5 (RFC1323) +49152:64:0:52:M*,N,W3,N,N,S: IRIX:6.5:RFC1323:IRIX 6.5 (RFC1323) + +61440:64:0:48:M*,N,N,S: IRIX:6.5:12-21:IRIX 6.5.12 - 6.5.21 +49152:64:0:48:M*,N,N,S: IRIX:6.5:15-21:IRIX 6.5.15 - 6.5.21 + +49152:60:0:64:M*,N,W2,N,N,T,N,N,S: IRIX:6.5:IP27:IRIX 6.5 IP27 + + +# ----------------- Tru64 ------------------- + +32768:64:1:48:M*,N,W0: Tru64:4.0::Tru64 4.0 (or OS/2 Warp 4) +32768:64:0:48:M*,N,W0: Tru64:5.0::Tru64 5.0 +8192:64:0:44:M1460: Tru64:5.1:noRFC1323:Tru64 6.1 (no RFC1323) (or QNX 6) +61440:64:0:48:M*,N,W0: Tru64:5.1a:JP4:Tru64 v5.1a JP4 (or OpenVMS 7.x on Compaq 5.x stack) + +# ----------------- OpenVMS ----------------- + +6144:64:1:60:M*,N,W0,N,N,T: OpenVMS:7.2::OpenVMS 7.2 (Multinet 4.4 stack) + +# ----------------- MacOS ------------------- + +# XXX Need EOL tcp opt support +# S2:255:1:48:M*,W0,E:.:MacOS:8.6 classic + +# XXX some of these use EOL too +16616:255:1:48:M*,W0: MacOS:7.3-7.6:OTTCP:MacOS 7.3-8.6 (OTTCP) +16616:255:1:48:M*,W0: MacOS:8.0-8.6:OTTCP:MacOS 7.3-8.6 (OTTCP) +16616:255:1:48:M*,N,N,N: MacOS:8.1-8.6:OTTCP:MacOS 8.1-8.6 (OTTCP) +32768:255:1:48:M*,W0,N: MacOS:9.0-9.2::MacOS 9.0-9.2 +65535:255:1:48:M*,N,N,N,N: MacOS:9.1::MacOS 9.1 (OT 2.7.4) + + +# ----------------- Windows ----------------- + +# Windows TCP/IP stack is a mess. For most recent XP, 2000 and +# even 98, the patchlevel, not the actual OS version, is more +# relevant to the signature. They share the same code, so it would +# seem. Luckily for us, almost all Windows 9x boxes have an +# awkward MSS of 536, which I use to tell one from another +# in most difficult cases. + +8192:32:1:44:M*: Windows:3.11::Windows 3.11 (Tucows) +S44:64:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:95::Windows 95 +8192:128:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:95:b:Windows 95b + +# There were so many tweaking tools and so many stack versions for +# Windows 98 it is no longer possible to tell them from each other +# without some very serious research. Until then, there's an insane +# number of signatures, for your amusement: + +S44:32:1:48:M*,N,N,S: Windows:98:lowTTL:Windows 98 (low TTL) +8192:32:1:48:M*,N,N,S: Windows:98:lowTTL:Windows 98 (low TTL) +%8192:64:1:48:M536,N,N,S: Windows:98::Windows 98 +%8192:128:1:48:M536,N,N,S: Windows:98::Windows 98 +S4:64:1:48:M*,N,N,S: Windows:98::Windows 98 +S6:64:1:48:M*,N,N,S: Windows:98::Windows 98 +S12:64:1:48:M*,N,N,S: Windows:98::Windows 98 +T30:64:1:64:M1460,N,W0,N,N,T0,N,N,S: Windows:98::Windows 98 +32767:64:1:48:M*,N,N,S: Windows:98::Windows 98 +37300:64:1:48:M*,N,N,S: Windows:98::Windows 98 +46080:64:1:52:M*,N,W3,N,N,S: Windows:98:RFC1323:Windows 98 (RFC1323) +65535:64:1:44:M*: Windows:98:noSack:Windows 98 (no sack) +S16:128:1:48:M*,N,N,S: Windows:98::Windows 98 +S16:128:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:98::Windows 98 +S26:128:1:48:M*,N,N,S: Windows:98::Windows 98 +T30:128:1:48:M*,N,N,S: Windows:98::Windows 98 +32767:128:1:52:M*,N,W0,N,N,S: Windows:98::Windows 98 +60352:128:1:48:M*,N,N,S: Windows:98::Windows 98 +60352:128:1:64:M*,N,W2,N,N,T0,N,N,S: Windows:98::Windows 98 + +# What's with 1414 on NT? +T31:128:1:44:M1414: Windows:NT:4.0:Windows NT 4.0 SP6a +64512:128:1:44:M1414: Windows:NT:4.0:Windows NT 4.0 SP6a +8192:128:1:44:M*: Windows:NT:4.0:Windows NT 4.0 (older) + +# Windows XP and 2000. Most of the signatures that were +# either dubious or non-specific (no service pack data) +# were deleted and replaced with generics at the end. + +65535:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4, XP SP1 +65535:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP4, XP SP1 +%8192:128:1:48:M*,N,N,S: Windows:2000:SP2+:Windows 2000 SP2, XP SP1 (seldom 98 4.10.2222) +%8192:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP2, XP SP1 (seldom 98 4.10.2222) +S20:128:1:48:M*,N,N,S: Windows:2000::Windows 2000/XP SP3 +S20:128:1:48:M*,N,N,S: Windows:XP:SP3:Windows 2000/XP SP3 +S45:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4, XP SP 1 +S45:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP4, XP SP 1 +40320:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4 + +S6:128:1:48:M*,N,N,S: Windows:2000:SP2:Windows XP, 2000 SP2+ +S6:128:1:48:M*,N,N,S: Windows:XP::Windows XP, 2000 SP2+ +S12:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows XP SP1 +S44:128:1:48:M*,N,N,S: Windows:2000:SP3:Windows Pro SP1, 2000 SP3 +S44:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows Pro SP1, 2000 SP3 +64512:128:1:48:M*,N,N,S: Windows:2000:SP3:Windows SP1, 2000 SP3 +64512:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP3 +32767:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows SP1, 2000 SP4 +32767:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP4 + +8192:128:1:52:M*,N,W2,N,N,S: Windows:Vista::Windows Vista/7 + +# Odds, ends, mods: + +S52:128:1:48:M1260,N,N,S: Windows:2000:cisco:Windows XP/2000 via Cisco +S52:128:1:48:M1260,N,N,S: Windows:XP:cisco:Windows XP/2000 via Cisco +65520:128:1:48:M*,N,N,S: Windows:XP::Windows XP bare-bone +16384:128:1:52:M536,N,W0,N,N,S: Windows:2000:ZoneAlarm:Windows 2000 w/ZoneAlarm? +2048:255:0:40:.: Windows:.NET::Windows .NET Enterprise Server + +44620:64:0:48:M*,N,N,S: Windows:ME::Windows ME no SP (?) +S6:255:1:48:M536,N,N,S: Windows:95:winsock2:Windows 95 winsock 2 +32768:32:1:52:M1460,N,W0,N,N,S: Windows:2003:AS:Windows 2003 AS + + +# No need to be more specific, it passes: +# *:128:1:48:M*,N,N,S:U:-Windows:XP/2000 while downloading (leak!) XXX quirk +# there is an equiv similar generic sig w/o the quirk + +# ----------------- HP/UX ------------------- + +32768:64:1:44:M*: HP-UX:B.10.20::HP-UX B.10.20 +32768:64:0:48:M*,W0,N: HP-UX:11.0::HP-UX 11.0 +32768:64:1:48:M*,W0,N: HP-UX:11.10::HP-UX 11.0 or 11.11 +32768:64:1:48:M*,W0,N: HP-UX:11.11::HP-UX 11.0 or 11.11 + +# Whoa. Hardcore WSS. +0:64:0:48:M*,W0,N: HP-UX:B.11.00:A:HP-UX B.11.00 A (RFC1323) + +# ----------------- RiscOS ------------------ + +# We don't yet support the ?12 TCP option +#16384:64:1:68:M1460,N,W0,N,N,T,N,N,?12: RISCOS:3.70-4.36::RISC OS 3.70-4.36 +12288:32:0:44:M536: RISC OS:3.70:4.10:RISC OS 3.70 inet 4.10 + +# XXX quirk +# 4096:64:1:56:M1460,N,N,T:T: RISC OS:3.70:freenet:RISC OS 3.70 freenet 2.00 + + + +# ----------------- BSD/OS ------------------ + +# Once again, power of two WSS is also shared by MacOS X with DF set +8192:64:1:60:M1460,N,W0,N,N,T: BSD/OS:3.1::BSD/OS 3.1-4.3 (or MacOS X 10.2 w/DF) +8192:64:1:60:M1460,N,W0,N,N,T: BSD/OS:4.0-4.3::BSD/OS 3.1-4.3 (or MacOS X 10.2) + + +# ---------------- NewtonOS ----------------- + +4096:64:0:44:M1420: NewtonOS:2.1::NewtonOS 2.1 + +# ---------------- NeXTSTEP ----------------- + +S4:64:0:44:M1024: NeXTSTEP:3.3::NeXTSTEP 3.3 +S8:64:0:44:M512: NeXTSTEP:3.3::NeXTSTEP 3.3 + +# ------------------ BeOS ------------------- + +1024:255:0:48:M*,N,W0: BeOS:5.0-5.1::BeOS 5.0-5.1 +12288:255:0:44:M1402: BeOS:5.0::BeOS 5.0.x + +# ------------------ OS/400 ----------------- + +8192:64:1:60:M1440,N,W0,N,N,T: OS/400:VR4::OS/400 VR4/R5 +8192:64:1:60:M1440,N,W0,N,N,T: OS/400:VR5::OS/400 VR4/R5 +4096:64:1:60:M1440,N,W0,N,N,T: OS/400:V4R5:CF67032:OS/400 V4R5 + CF67032 + +# XXX quirk +# 28672:64:0:44:M1460:A:OS/390:? + +# ------------------ ULTRIX ----------------- + +16384:64:0:40:.: ULTRIX:4.5::ULTRIX 4.5 + +# ------------------- QNX ------------------- + +S16:64:0:44:M512: QNX:::QNX demodisk + +# ------------------ Novell ----------------- + +16384:128:1:44:M1460: Novell:NetWare:5.0:Novel Netware 5.0 +6144:128:1:44:M1460: Novell:IntranetWare:4.11:Novell IntranetWare 4.11 +6144:128:1:44:M1368: Novell:BorderManager::Novell BorderManager ? + +6144:128:1:52:M*,W0,N,S,N,N: Novell:Netware:6:Novell Netware 6 SP3 + + +# ----------------- SCO ------------------ +S3:64:1:60:M1460,N,W0,N,N,T: SCO:UnixWare:7.1:SCO UnixWare 7.1 +S17:64:1:60:M1380,N,W0,N,N,T: SCO:UnixWare:7.1:SCO UnixWare 7.1.3 MP3 +S23:64:1:44:M1380: SCO:OpenServer:5.0:SCO OpenServer 5.0 + +# ------------------- DOS ------------------- + +2048:255:0:44:M536: DOS:WATTCP:1.05:DOS Arachne via WATTCP/1.05 +T2:255:0:44:M984: DOS:WATTCP:1.05Arachne:Arachne via WATTCP/1.05 (eepro) + +# ------------------ OS/2 ------------------- + +S56:64:0:44:M512: OS/2:4::OS/2 4 +28672:64:0:44:M1460: OS/2:4::OS/2 Warp 4.0 + +# ----------------- TOPS-20 ----------------- + +# Another hardcore MSS, one of the ACK leakers hunted down. +# XXX QUIRK 0:64:0:44:M1460:A:TOPS-20:version 7 +0:64:0:44:M1460: TOPS-20:7::TOPS-20 version 7 + +# ----------------- FreeMiNT ---------------- + +S44:255:0:44:M536: FreeMiNT:1:16A:FreeMiNT 1 patch 16A (Atari) + +# ------------------ AMIGA ------------------ + +# XXX TCP option 12 +# S32:64:1:56:M*,N,N,S,N,N,?12:.:AMIGA:3.9 BB2 with Miami stack + +# ------------------ Plan9 ------------------ + +65535:255:0:48:M1460,W0,N: Plan9:4::Plan9 edition 4 + +# ----------------- AMIGAOS ----------------- + +16384:64:1:48:M1560,N,N,S: AMIGAOS:3.9::AMIGAOS 3.9 BB2 MiamiDX + +########################################### +# Appliance / embedded / other signatures # +########################################### + +# ---------- Firewalls / routers ------------ + +S12:64:1:44:M1460: @Checkpoint:::Checkpoint (unknown 1) +S12:64:1:48:N,N,S,M1460: @Checkpoint:::Checkpoint (unknown 2) +4096:32:0:44:M1460: ExtremeWare:4.x::ExtremeWare 4.x + +# XXX TCP option 12 +# S32:64:0:68:M512,N,W0,N,N,T,N,N,?12:.:Nokia:IPSO w/Checkpoint NG FP3 +# S16:64:0:68:M1024,N,W0,N,N,T,N,N,?12:.:Nokia:IPSO 3.7 build 026 + +S4:64:1:60:W0,N,S,T,M1460: FortiNet:FortiGate:50:FortiNet FortiGate 50 + +8192:64:1:44:M1460: Eagle:::Eagle Secure Gateway + +S52:128:1:48:M1260,N,N,N,N: LinkSys:WRV54G::LinkSys WRV54G VPN router + + + +# ------- Switches and other stuff ---------- + +4128:255:0:44:M*: Cisco:::Cisco Catalyst 3500, 7500 etc +S8:255:0:44:M*: Cisco:12008::Cisco 12008 +60352:128:1:64:M1460,N,W2,N,N,T,N,N,S: Alteon:ACEswitch::Alteon ACEswitch +64512:128:1:44:M1370: Nortel:Contivity Client::Nortel Conectivity Client + + +# ---------- Caches and whatnots ------------ + +S4:64:1:52:M1460,N,N,S,N,W0: AOL:web cache::AOL web cache + +32850:64:1:64:N,W1,N,N,T,N,N,S,M*: NetApp:5.x::NetApp Data OnTap 5.x +16384:64:1:64:M1460,N,N,S,N,W0,N: NetApp:5.3:1:NetApp 5.3.1 +65535:64:0:64:M1460,N,N,S,N,W*,N,N,T: NetApp:5.3-5.5::NetApp 5.3-5.5 +65535:64:0:60:M1460,N,W0,N,N,T: NetApp:CacheFlow::NetApp CacheFlow +8192:64:1:64:M1460,N,N,S,N,W0,N,N,T: NetApp:5.2:1:NetApp NetCache 5.2.1 +20480:64:1:64:M1460,N,N,S,N,W0,N,N,T: NetApp:4.1::NetApp NetCache4.1 + +65535:64:0:60:M1460,N,W0,N,N,T: CacheFlow:4.1::CacheFlow CacheOS 4.1 +8192:64:0:60:M1380,N,N,N,N,N,N,T: CacheFlow:1.1::CacheFlow CacheOS 1.1 + +S4:64:0:48:M1460,N,N,S: Cisco:Content Engine::Cisco Content Engine + +27085:128:0:40:.: Dell:PowerApp cache::Dell PowerApp (Linux-based) + +65535:255:1:48:N,W1,M1460: Inktomi:crawler::Inktomi crawler +S1:255:1:60:M1460,S,T,N,W0: LookSmart:ZyBorg::LookSmart ZyBorg + +16384:255:0:40:.: Proxyblocker:::Proxyblocker (what's this?) + +65535:255:0:48:M*,N,N,S: Redline:::Redline T|X 2200 + +32696:128:0:40:M1460: Spirent:Avalanche::Spirent Web Avalanche HTTP benchmarking engine + +# ----------- Embedded systems -------------- + +S9:255:0:44:M536: PalmOS:Tungsten:C:PalmOS Tungsten C +S5:255:0:44:M536: PalmOS:3::PalmOS 3/4 +S5:255:0:44:M536: PalmOS:4::PalmOS 3/4 +S4:255:0:44:M536: PalmOS:3:5:PalmOS 3.5 +2948:255:0:44:M536: PalmOS:3:5:PalmOS 3.5.3 (Handera) +S29:255:0:44:M536: PalmOS:5::PalmOS 5.0 +16384:255:0:44:M1398: PalmOS:5.2:Clie:PalmOS 5.2 (Clie) +S14:255:0:44:M1350: PalmOS:5.2:Treo:PalmOS 5.2.1 (Treo) + +S23:64:1:64:N,W1,N,N,T,N,N,S,M1460: SymbianOS:7::SymbianOS 7 + +8192:255:0:44:M1460: SymbianOS:6048::Symbian OS 6048 (Nokia 7650?) +8192:255:0:44:M536: SymbianOS:9210::Symbian OS (Nokia 9210?) +S22:64:1:56:M1460,T,S: SymbianOS:P800::Symbian OS ? (SE P800?) +S36:64:1:56:M1360,T,S: SymbianOS:6600::Symbian OS 60xx (Nokia 6600?) + + +# Perhaps S4? +5840:64:1:60:M1452,S,T,N,W1: Zaurus:3.10::Zaurus 3.10 + +32768:128:1:64:M1460,N,W0,N,N,T0,N,N,S: PocketPC:2002::PocketPC 2002 + +S1:255:0:44:M346: Contiki:1.1:rc0:Contiki 1.1-rc0 + +4096:128:0:44:M1460: Sega:Dreamcast:3.0:Sega Dreamcast Dreamkey 3.0 +T5:64:0:44:M536: Sega:Dreamcast:HKT-3020:Sega Dreamcast HKT-3020 (browser disc 51027) +S22:64:1:44:M1460: Sony:PS2::Sony Playstation 2 (SOCOM?) + +S12:64:0:44:M1452: AXIS:5600:v5.64:AXIS Printer Server 5600 v5.64 + +3100:32:1:44:M1460: Windows:CE:2.0:Windows CE 2.0 + +#################### +# Fancy signatures # +#################### + +1024:64:0:40:.: *NMAP:syn scan:1:NMAP syn scan (1) +2048:64:0:40:.: *NMAP:syn scan:2:NMAP syn scan (2) +3072:64:0:40:.: *NMAP:syn scan:3:NMAP syn scan (3) +4096:64:0:40:.: *NMAP:syn scan:4:NMAP syn scan (4) + +# Requires quirks support +# 1024:64:0:40:.:A:*NMAP:TCP sweep probe (1) +# 2048:64:0:40:.:A:*NMAP:TCP sweep probe (2) +# 3072:64:0:40:.:A:*NMAP:TCP sweep probe (3) +# 4096:64:0:40:.:A:*NMAP:TCP sweep probe (4) + +1024:64:0:60:W10,N,M265,T: *NMAP:OS:1:NMAP OS detection probe (1) +2048:64:0:60:W10,N,M265,T: *NMAP:OS:2:NMAP OS detection probe (2) +3072:64:0:60:W10,N,M265,T: *NMAP:OS:3:NMAP OS detection probe (3) +4096:64:0:60:W10,N,M265,T: *NMAP:OS:4:NMAP OS detection probe (4) + +32767:64:0:40:.: *NAST:::NASTsyn scan + +# Requires quirks support +# 12345:255:0:40:.:A:-p0f:sendsyn utility + + +##################################### +# Generic signatures - just in case # +##################################### + +#*:64:1:60:M*,N,W*,N,N,T: @FreeBSD:4.0-4.9::FreeBSD 4.x/5.x +#*:64:1:60:M*,N,W*,N,N,T: @FreeBSD:5.0-5.1::FreeBSD 4.x/5.x + +*:128:1:52:M*,N,W0,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W0,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W*,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W*,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:64:M*,N,W0,N,N,T0,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323) +*:128:1:64:M*,N,W0,N,N,T0,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323) +*:128:1:64:M*,N,W*,N,N,T0,N,N,S: @Windows:XP:RFC1323:Windows XP (RFC1323, w+) +*:128:1:48:M536,N,N,S: @Windows:98::Windows 98 +*:128:1:48:M*,N,N,S: @Windows:XP::Windows XP/2000 +*:128:1:48:M*,N,N,S: @Windows:2000::Windows XP/2000 + + Modified: projects/clang700-import/sbin/restore/tape.c ============================================================================== --- projects/clang700-import/sbin/restore/tape.c Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/sbin/restore/tape.c Sat Aug 11 16:41:08 2018 (r337647) @@ -1314,8 +1314,8 @@ gethead(struct s_spcl *buf) return (FAIL); } if (swabl(buf->c_magic) != FS_UFS2_MAGIC && - buf->c_magic != NFS_MAGIC) { - if (buf->c_magic == OFS_MAGIC) { + swabl(buf->c_magic) != NFS_MAGIC) { + if (swabl(buf->c_magic) == OFS_MAGIC) { fprintf(stderr, "Format of dump tape is too old. Must use\n"); fprintf(stderr, Modified: projects/clang700-import/sbin/sysctl/Makefile ============================================================================== --- projects/clang700-import/sbin/sysctl/Makefile Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/sbin/sysctl/Makefile Sat Aug 11 16:41:08 2018 (r337647) @@ -2,6 +2,7 @@ # $FreeBSD$ PACKAGE=runtime +CONFS= sysctl.conf PROG= sysctl WARNS?= 3 MAN= sysctl.8 Copied: projects/clang700-import/sbin/sysctl/sysctl.conf (from r337645, head/sbin/sysctl/sysctl.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang700-import/sbin/sysctl/sysctl.conf Sat Aug 11 16:41:08 2018 (r337647, copy of r337645, head/sbin/sysctl/sysctl.conf) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# +# This file is read when going to multi-user and its contents piped thru +# ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details. +# + +# Uncomment this to prevent users from seeing information about processes that +# are being run under another UID. +#security.bsd.see_other_uids=0 Modified: projects/clang700-import/share/man/man4/snd_envy24ht.4 ============================================================================== --- projects/clang700-import/share/man/man4/snd_envy24ht.4 Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/share/man/man4/snd_envy24ht.4 Sat Aug 11 16:41:08 2018 (r337647) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2014 +.Dd August 11, 2018 .Dt SND_ENVY24HT 4 .Os .Sh NAME @@ -68,6 +68,8 @@ Audiotrak Prodigy 7.1 XT Audiotrak Prodigy HD2 .It ESI Juli@ +.It +ESI Juli@ XTe .It M-Audio Audiophile 192 .It Modified: projects/clang700-import/share/man/man5/make.conf.5 ============================================================================== --- projects/clang700-import/share/man/man5/make.conf.5 Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/share/man/man5/make.conf.5 Sat Aug 11 16:41:08 2018 (r337647) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2018 +.Dd August 11, 2018 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -234,12 +234,13 @@ Set this to not update the ports tree during .Pq Vt bool Set this to use .Xr svn 1 +or +.Xr svnlite 1 to update your .Pa src tree with .Dq Li "make update" . -Note that since a subversion client is not included in the base system, -you will need to set +Note that you can set .Va SVN to the full path of a .Xr svn 1 Modified: projects/clang700-import/share/man/man7/build.7 ============================================================================== --- projects/clang700-import/share/man/man7/build.7 Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/share/man/man7/build.7 Sat Aug 11 16:41:08 2018 (r337647) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2017 +.Dd August 11, 2018 .Dt BUILD 7 .Os .Sh NAME @@ -42,6 +42,8 @@ and These directories may be initially empty or non-existent until updated with .Xr svn 1 or +.Xr svnlite 1 +or .Xr portsnap 8 . Directory .Pa /usr/src @@ -789,6 +791,7 @@ make TARGET_ARCH=armv6 DESTDIR=/clients/arm64 installw .Xr install 1 , .Xr make 1 , .Xr svn 1 , +.Xr svnlite 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr arch 7 , Modified: projects/clang700-import/sys/netpfil/pf/pf_if.c ============================================================================== --- projects/clang700-import/sys/netpfil/pf/pf_if.c Sat Aug 11 16:41:07 2018 (r337646) +++ projects/clang700-import/sys/netpfil/pf/pf_if.c Sat Aug 11 16:41:08 2018 (r337647) @@ -297,12 +297,17 @@ pfi_kif_match(struct pfi_kif *rule_kif, struct pfi_kif if (rule_kif == NULL || rule_kif == packet_kif) return (1); - if (rule_kif->pfik_group != NULL) - /* XXXGL: locking? */ + if (rule_kif->pfik_group != NULL) { + IF_ADDR_RLOCK(packet_kif->pfik_ifp); CK_STAILQ_FOREACH(p, &packet_kif->pfik_ifp->if_groups, ifgl_next) - if (p->ifgl_group == rule_kif->pfik_group) + if (p->ifgl_group == rule_kif->pfik_group) { + IF_ADDR_RUNLOCK(packet_kif->pfik_ifp); return (1); + } + IF_ADDR_RUNLOCK(packet_kif->pfik_ifp); + } + return (0); } @@ -735,6 +740,7 @@ pfi_get_ifaces(const char *name, struct pfi_kif *buf, static int pfi_skip_if(const char *filter, struct pfi_kif *p) { + struct ifg_list *i; int n; if (filter == NULL || !*filter) @@ -745,10 +751,19 @@ pfi_skip_if(const char *filter, struct pfi_kif *p) if (n < 1 || n >= IFNAMSIZ) return (1); /* sanity check */ if (filter[n-1] >= '0' && filter[n-1] <= '9') - return (1); /* only do exact match in that case */ - if (strncmp(p->pfik_name, filter, n)) - return (1); /* prefix doesn't match */ - return (p->pfik_name[n] < '0' || p->pfik_name[n] > '9'); + return (1); /* group names may not end in a digit */ + if (p->pfik_ifp != NULL) { + IF_ADDR_RLOCK(p->pfik_ifp); + CK_STAILQ_FOREACH(i, &p->pfik_ifp->if_groups, ifgl_next) { + if (!strncmp(i->ifgl_group->ifg_group, filter, + IFNAMSIZ)) { + IF_ADDR_RUNLOCK(p->pfik_ifp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Sat Aug 11 20:08:26 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C79B810786A1 for ; Sat, 11 Aug 2018 20:08:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9958F6B4; Sat, 11 Aug 2018 20:08:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F8441BEC3; Sat, 11 Aug 2018 20:08:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BK8QMj034335; Sat, 11 Aug 2018 20:08:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BK8QGh034334; Sat, 11 Aug 2018 20:08:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808112008.w7BK8QGh034334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 20:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337654 - projects/clang700-import/contrib/libc++/include X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang700-import/contrib/libc++/include X-SVN-Commit-Revision: 337654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 20:08:26 -0000 Author: dim Date: Sat Aug 11 20:08:25 2018 New Revision: 337654 URL: https://svnweb.freebsd.org/changeset/base/337654 Log: Undo r337593 (commenting out of timespec_get in libc++'s header), now that r337576 added that function. PR: 230400 Modified: projects/clang700-import/contrib/libc++/include/ctime Modified: projects/clang700-import/contrib/libc++/include/ctime ============================================================================== --- projects/clang700-import/contrib/libc++/include/ctime Sat Aug 11 19:45:04 2018 (r337653) +++ projects/clang700-import/contrib/libc++/include/ctime Sat Aug 11 20:08:25 2018 (r337654) @@ -74,7 +74,7 @@ using ::localtime; #endif using ::strftime; #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES) -//using ::timespec_get; +using ::timespec_get; #endif _LIBCPP_END_NAMESPACE_STD From owner-svn-src-projects@freebsd.org Sat Aug 11 20:32:51 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08EEC1078E1B for ; Sat, 11 Aug 2018 20:32:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0E8890455; Sat, 11 Aug 2018 20:32:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 924E11C399; Sat, 11 Aug 2018 20:32:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BKWo9c049884; Sat, 11 Aug 2018 20:32:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BKWonc049883; Sat, 11 Aug 2018 20:32:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808112032.w7BKWonc049883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 20:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337655 - projects/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl X-SVN-Commit-Revision: 337655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 20:32:51 -0000 Author: kevans Date: Sat Aug 11 20:32:50 2018 New Revision: 337655 URL: https://svnweb.freebsd.org/changeset/base/337655 Log: Add libzfs to prebuild_libs, libbe dependency on libzfs Modified: projects/bectl/Makefile.inc1 Modified: projects/bectl/Makefile.inc1 ============================================================================== --- projects/bectl/Makefile.inc1 Sat Aug 11 20:08:25 2018 (r337654) +++ projects/bectl/Makefile.inc1 Sat Aug 11 20:32:50 2018 (r337655) @@ -2524,7 +2524,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ ${_cddl_lib_libuutil} \ ${_cddl_lib_libavl} \ - ${_cddl_lib_libzfs_core} \ + ${_cddl_lib_libzfs_core} ${_cddl_lib_libzfs} \ ${_cddl_lib_libctf} \ lib/libufs \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ @@ -2597,7 +2597,9 @@ _cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libuutil= cddl/lib/libuutil .if ${MK_ZFS} != "no" _cddl_lib_libzfs_core= cddl/lib/libzfs_core +_cddl_lib_libzfs= cddl/lib/libzfs cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L +cddl/lib/libbe__L: cddl/lib/libzfs__L .endif _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib From owner-svn-src-projects@freebsd.org Sat Aug 11 20:47:36 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9B921079303 for ; Sat, 11 Aug 2018 20:47:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E60690C22; Sat, 11 Aug 2018 20:47:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F0391C557; Sat, 11 Aug 2018 20:47:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BKlaVw055128; Sat, 11 Aug 2018 20:47:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BKlaVP055127; Sat, 11 Aug 2018 20:47:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808112047.w7BKlaVP055127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 20:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337657 - projects/bectl/sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: projects/bectl/sbin/bectl X-SVN-Commit-Revision: 337657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 20:47:36 -0000 Author: kevans Date: Sat Aug 11 20:47:35 2018 New Revision: 337657 URL: https://svnweb.freebsd.org/changeset/base/337657 Log: bectl(8): Add missing include path Modified: projects/bectl/sbin/bectl/Makefile Modified: projects/bectl/sbin/bectl/Makefile ============================================================================== --- projects/bectl/sbin/bectl/Makefile Sat Aug 11 20:41:42 2018 (r337656) +++ projects/bectl/sbin/bectl/Makefile Sat Aug 11 20:47:35 2018 (r337657) @@ -12,6 +12,7 @@ LIBADD+= util CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -DNEED_SOLARIS_BOOLEAN From owner-svn-src-projects@freebsd.org Sat Aug 11 22:45:40 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CDB107BD99 for ; Sat, 11 Aug 2018 22:45:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F0FA942F1; Sat, 11 Aug 2018 22:45:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C2021D91A; Sat, 11 Aug 2018 22:45:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BMjeLj016205; Sat, 11 Aug 2018 22:45:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BMjdYo016203; Sat, 11 Aug 2018 22:45:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808112245.w7BMjdYo016203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 22:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r337662 - in projects/bectl: . cddl/lib/libbe sbin/bectl X-SVN-Group: projects X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in projects/bectl: . cddl/lib/libbe sbin/bectl X-SVN-Commit-Revision: 337662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 22:45:40 -0000 Author: kevans Date: Sat Aug 11 22:45:39 2018 New Revision: 337662 URL: https://svnweb.freebsd.org/changeset/base/337662 Log: libbe(3)/bectl(8): More SYSROOT/GCC build fixes - Missing include path - Fully specify libzfs's dependencies (except for deps pulled in by other deps) in Makefile.inc1 - Drop WARNS back down to 2 for libbe(3). I do this with much hesitation, but the libzfs headers are apparently a hot warning-filled mess as far as GCC 4.2 is concerned. Modified: projects/bectl/Makefile.inc1 projects/bectl/cddl/lib/libbe/Makefile projects/bectl/sbin/bectl/Makefile Modified: projects/bectl/Makefile.inc1 ============================================================================== --- projects/bectl/Makefile.inc1 Sat Aug 11 22:11:12 2018 (r337661) +++ projects/bectl/Makefile.inc1 Sat Aug 11 22:45:39 2018 (r337662) @@ -2598,7 +2598,13 @@ _cddl_lib_libuutil= cddl/lib/libuutil .if ${MK_ZFS} != "no" _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib_libzfs= cddl/lib/libzfs + cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L + +cddl/lib/libzfs__L: cddl/lib/libzfs_core__L lib/msun__L lib/libutil__L +cddl/lib/libzfs__L: lib/libthr__L lib/libmd__L lib/libz__L cddl/lib/libumem__L +cddl/lib/libzfs__L: cddl/lib/libuutil__L cddl/lib/libavl__L lib/libgeom__L + cddl/lib/libbe__L: cddl/lib/libzfs__L .endif _cddl_lib_libctf= cddl/lib/libctf Modified: projects/bectl/cddl/lib/libbe/Makefile ============================================================================== --- projects/bectl/cddl/lib/libbe/Makefile Sat Aug 11 22:11:12 2018 (r337661) +++ projects/bectl/cddl/lib/libbe/Makefile Sat Aug 11 22:45:39 2018 (r337662) @@ -11,6 +11,8 @@ SRCS= be.c be_access.c be_error.c be_info.c INCS= be.h MAN= libbe.3 +WARNS?= 2 + LIBADD+= zfs LIBADD+= nvpair Modified: projects/bectl/sbin/bectl/Makefile ============================================================================== --- projects/bectl/sbin/bectl/Makefile Sat Aug 11 22:11:12 2018 (r337661) +++ projects/bectl/sbin/bectl/Makefile Sat Aug 11 22:45:39 2018 (r337662) @@ -13,6 +13,7 @@ LIBADD+= util CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair CFLAGS+= -DNEED_SOLARIS_BOOLEAN