Date: Wed, 11 Apr 2018 15:04:31 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r332408 - in user/markj/netdump: bin/setfacl release/amd64 release/arm64 release/i386 release/powerpc sbin/camcontrol sbin/geom/class/eli sbin/ipfw share/man/man7 share/man/man9 share/m... Message-ID: <201804111504.w3BF4Vsw046666@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Wed Apr 11 15:04:31 2018 New Revision: 332408 URL: https://svnweb.freebsd.org/changeset/base/332408 Log: MFH at r332407. Added: user/markj/netdump/share/man/man9/OF_child.9 - copied unchanged from r332407, head/share/man/man9/OF_child.9 user/markj/netdump/share/man/man9/OF_device_from_xref.9 - copied unchanged from r332407, head/share/man/man9/OF_device_from_xref.9 user/markj/netdump/share/man/man9/OF_finddevice.9 - copied unchanged from r332407, head/share/man/man9/OF_finddevice.9 user/markj/netdump/share/man/man9/OF_getprop.9 - copied unchanged from r332407, head/share/man/man9/OF_getprop.9 user/markj/netdump/share/man/man9/OF_node_from_xref.9 - copied unchanged from r332407, head/share/man/man9/OF_node_from_xref.9 user/markj/netdump/share/man/man9/OF_package_to_path.9 - copied unchanged from r332407, head/share/man/man9/OF_package_to_path.9 user/markj/netdump/sys/arm64/qualcomm/ - copied from r332407, head/sys/arm64/qualcomm/ Deleted: user/markj/netdump/sys/dts/arm/armada-380.dtsi user/markj/netdump/sys/dts/arm/armada-385-db-ap.dts user/markj/netdump/sys/dts/arm/armada-385.dtsi user/markj/netdump/sys/dts/arm/armada-388-clearfog.dts user/markj/netdump/sys/dts/arm/armada-388-gp.dts user/markj/netdump/sys/dts/arm/armada-388.dtsi user/markj/netdump/sys/dts/arm/armada-38x-solidrun-microsom.dtsi user/markj/netdump/sys/dts/arm/armada-38x.dtsi Modified: user/markj/netdump/bin/setfacl/setfacl.1 user/markj/netdump/bin/setfacl/setfacl.c user/markj/netdump/bin/setfacl/setfacl.h user/markj/netdump/bin/setfacl/util.c user/markj/netdump/release/amd64/make-memstick.sh user/markj/netdump/release/amd64/mkisoimages.sh user/markj/netdump/release/arm64/RPI3.conf user/markj/netdump/release/arm64/make-memstick.sh user/markj/netdump/release/i386/make-memstick.sh user/markj/netdump/release/powerpc/make-memstick.sh user/markj/netdump/sbin/camcontrol/camcontrol.8 user/markj/netdump/sbin/geom/class/eli/geli.8 user/markj/netdump/sbin/geom/class/eli/geom_eli.c user/markj/netdump/sbin/ipfw/ipfw.8 user/markj/netdump/share/man/man7/development.7 user/markj/netdump/share/man/man9/Makefile user/markj/netdump/share/misc/committers-src.dot user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c user/markj/netdump/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c user/markj/netdump/sys/arm/annapurna/alpine/alpine_pci_msix.c user/markj/netdump/sys/arm/at91/at91_pinctrl.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_gpio.c user/markj/netdump/sys/arm/broadcom/bcm2835/bcm2835_pwm.c user/markj/netdump/sys/arm/freescale/imx/imx_iomux.c user/markj/netdump/sys/arm/mv/mv_common.c user/markj/netdump/sys/arm/mv/mvwin.h user/markj/netdump/sys/arm/nvidia/drm2/tegra_drm_subr.c user/markj/netdump/sys/arm/ti/ti_adc.c user/markj/netdump/sys/arm/ti/ti_pinmux.c user/markj/netdump/sys/arm64/conf/GENERIC user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/markj/netdump/sys/cddl/dev/dtrace/dtrace_cddl.h user/markj/netdump/sys/conf/files.arm64 user/markj/netdump/sys/dev/cesa/cesa.c user/markj/netdump/sys/dev/cesa/cesa.h user/markj/netdump/sys/dev/cpufreq/cpufreq_dt.c user/markj/netdump/sys/dev/dpaa/qman_fdt.c user/markj/netdump/sys/dev/etherswitch/e6000sw/e6000sw.c user/markj/netdump/sys/dev/extres/clk/clk.c user/markj/netdump/sys/dev/extres/phy/phy.c user/markj/netdump/sys/dev/extres/regulator/regulator.c user/markj/netdump/sys/dev/extres/syscon/syscon.c user/markj/netdump/sys/dev/fdt/fdt_clock.c user/markj/netdump/sys/dev/fdt/fdt_pinctrl.c user/markj/netdump/sys/dev/gpio/gpioregulator.c user/markj/netdump/sys/dev/gpio/ofw_gpiobus.c user/markj/netdump/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c user/markj/netdump/sys/dev/ofw/ofw_bus_subr.c user/markj/netdump/sys/dev/ofw/openfirm.c user/markj/netdump/sys/dev/ofw/openfirm.h user/markj/netdump/sys/dev/pci/pci_user.c user/markj/netdump/sys/dev/vnic/thunder_bgx_fdt.c user/markj/netdump/sys/geom/bde/g_bde.c user/markj/netdump/sys/geom/cache/g_cache.c user/markj/netdump/sys/geom/concat/g_concat.c user/markj/netdump/sys/geom/eli/g_eli.c user/markj/netdump/sys/geom/eli/g_eli_ctl.c user/markj/netdump/sys/geom/gate/g_gate.c user/markj/netdump/sys/geom/geom_bsd.c user/markj/netdump/sys/geom/geom_ccd.c user/markj/netdump/sys/geom/geom_fox.c user/markj/netdump/sys/geom/geom_map.c user/markj/netdump/sys/geom/geom_mbr.c user/markj/netdump/sys/geom/geom_redboot.c user/markj/netdump/sys/geom/geom_sunlabel.c user/markj/netdump/sys/geom/geom_vol_ffs.c user/markj/netdump/sys/geom/journal/g_journal_ufs.c user/markj/netdump/sys/geom/label/g_label.c user/markj/netdump/sys/geom/linux_lvm/g_linux_lvm.c user/markj/netdump/sys/geom/mirror/g_mirror.c user/markj/netdump/sys/geom/mountver/g_mountver.c user/markj/netdump/sys/geom/multipath/g_multipath.c user/markj/netdump/sys/geom/nop/g_nop.c user/markj/netdump/sys/geom/part/g_part_apm.c user/markj/netdump/sys/geom/part/g_part_bsd.c user/markj/netdump/sys/geom/part/g_part_bsd64.c user/markj/netdump/sys/geom/part/g_part_ebr.c user/markj/netdump/sys/geom/part/g_part_gpt.c user/markj/netdump/sys/geom/part/g_part_ldm.c user/markj/netdump/sys/geom/part/g_part_mbr.c user/markj/netdump/sys/geom/part/g_part_vtoc8.c user/markj/netdump/sys/geom/raid3/g_raid3.c user/markj/netdump/sys/geom/shsec/g_shsec.c user/markj/netdump/sys/geom/stripe/g_stripe.c user/markj/netdump/sys/geom/uzip/g_uzip.c user/markj/netdump/sys/geom/vinum/geom_vinum.c user/markj/netdump/sys/geom/virstor/g_virstor.c user/markj/netdump/sys/geom/zero/g_zero.c user/markj/netdump/sys/kern/kern_environment.c user/markj/netdump/sys/kern/kern_rwlock.c user/markj/netdump/sys/kern/kern_sx.c user/markj/netdump/sys/kern/subr_witness.c user/markj/netdump/sys/mips/ingenic/jz4780_pinctrl.c user/markj/netdump/sys/mips/mediatek/fdt_reset.c user/markj/netdump/sys/net/bpf.c user/markj/netdump/sys/net/bpfdesc.h user/markj/netdump/sys/net/iflib.c user/markj/netdump/sys/netinet/tcp_log_buf.c user/markj/netdump/sys/netinet/tcp_output.c user/markj/netdump/sys/netinet/tcp_subr.c user/markj/netdump/sys/netinet/tcp_var.h user/markj/netdump/sys/netpfil/ipfw/ip_fw_table.c user/markj/netdump/sys/netpfil/pf/pf.c user/markj/netdump/sys/netpfil/pf/pf_ioctl.c user/markj/netdump/sys/powerpc/booke/trap_subr.S user/markj/netdump/sys/powerpc/mpc85xx/lbc.c user/markj/netdump/sys/powerpc/powerpc/trap.c user/markj/netdump/tests/sys/acl/run user/markj/netdump/tests/sys/netpfil/Makefile user/markj/netdump/usr.bin/head/head.1 user/markj/netdump/usr.bin/head/head.c user/markj/netdump/usr.bin/systat/sctp.c user/markj/netdump/usr.bin/tail/tail.1 user/markj/netdump/usr.bin/tail/tail.c user/markj/netdump/usr.sbin/ctld/ctl.conf.5 Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/bin/setfacl/setfacl.1 ============================================================================== --- user/markj/netdump/bin/setfacl/setfacl.1 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/setfacl.1 Wed Apr 11 15:04:31 2018 (r332408) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2016 +.Dd April 10, 2018 .Dt SETFACL 1 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nd set ACL information .Sh SYNOPSIS .Nm +.Op Fl R Op Fl H | L | P .Op Fl bdhkn .Op Fl a Ar position entries .Op Fl m Ar entries @@ -79,18 +80,30 @@ entries of the current ACL. The operations apply to the default ACL entries instead of access ACL entries. Currently only directories may have -default ACL's. This option is not applicable to NFSv4 ACLs. +default ACL's. +This option is not applicable to NFSv4 ACLs. .It Fl h If the target of the operation is a symbolic link, perform the operation on the symbolic link itself, rather than following the link. +.It Fl H +If the +.Fl R +option is specified, symbolic links on the command line are followed +and hence unaffected by the command. +(Symbolic links encountered during tree traversal are not followed.) .It Fl k Delete any default ACL entries on the specified files. It is not considered an error if the specified files do not have any default ACL entries. An error will be reported if any of -the specified files cannot have a default entry (i.e.\& -non-directories). This option is not applicable to NFSv4 ACLs. +the specified files cannot have a default entry (i.e., +non-directories). +This option is not applicable to NFSv4 ACLs. +.It Fl L +If the +.Fl R +option is specified, all symbolic links are followed. .It Fl m Ar entries Modify the ACL on the specified file. New entries will be added, and existing entries will be modified @@ -116,6 +129,13 @@ the input is taken from stdin. Do not recalculate the permissions associated with the ACL mask entry. This option is not applicable to NFSv4 ACLs. +.It Fl P +If the +.Fl R +option is specified, no symbolic links are followed. +This is the default. +.It Fl R +Perform the action recursively on any specified directories. .It Fl x Ar entries | position If .Ar entries Modified: user/markj/netdump/bin/setfacl/setfacl.c ============================================================================== --- user/markj/netdump/bin/setfacl/setfacl.c Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/setfacl.c Wed Apr 11 15:04:31 2018 (r332408) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #include <err.h> #include <errno.h> +#include <fts.h> +#include <stdbool.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -59,41 +62,20 @@ struct sf_entry { }; static TAILQ_HEAD(, sf_entry) entrylist; -/* TAILQ entry for files */ -struct sf_file { - const char *filename; - TAILQ_ENTRY(sf_file) next; -}; -static TAILQ_HEAD(, sf_file) filelist; - uint have_mask; uint need_mask; uint have_stdin; uint n_flag; -static void add_filename(const char *filename); static void usage(void); static void -add_filename(const char *filename) -{ - struct sf_file *file; - - if (strlen(filename) > PATH_MAX - 1) { - warn("illegal filename"); - return; - } - file = zmalloc(sizeof(struct sf_file)); - file->filename = filename; - TAILQ_INSERT_TAIL(&filelist, file, next); -} - -static void usage(void) { - fprintf(stderr, "usage: setfacl [-bdhkn] [-a position entries] " - "[-m entries] [-M file] [-x entries] [-X file] [file ...]\n"); + fprintf(stderr, "usage: setfacl [-R [-H | -L | -P]] [-bdhkn] " + "[-a position entries] [-m entries] [-M file] " + "[-x entries] [-X file] [file ...]\n"); exit(1); } @@ -104,23 +86,32 @@ main(int argc, char *argv[]) acl_type_t acl_type; acl_entry_t unused_entry; char filename[PATH_MAX]; - int local_error, carried_error, ch, i, entry_number, ret; - int h_flag; - struct sf_file *file; + int local_error, carried_error, ch, entry_number, ret, fts_options; + bool h_flag, H_flag, L_flag, R_flag, follow_symlink; + size_t fl_count, i; + FTS *ftsp; + FTSENT *file; + char **files_list; struct sf_entry *entry; - const char *fn_dup; char *end; - struct stat sb; acl_type = ACL_TYPE_ACCESS; - carried_error = local_error = 0; - h_flag = have_mask = have_stdin = n_flag = need_mask = 0; + carried_error = local_error = fts_options = 0; + have_mask = have_stdin = n_flag = need_mask = 0; + h_flag = H_flag = L_flag = R_flag = false; TAILQ_INIT(&entrylist); - TAILQ_INIT(&filelist); - while ((ch = getopt(argc, argv, "M:X:a:bdhkm:nx:")) != -1) + while ((ch = getopt(argc, argv, "HLM:PRX:a:bdhkm:nx:")) != -1) switch(ch) { + case 'H': + H_flag = true; + L_flag = false; + break; + case 'L': + L_flag = true; + H_flag = false; + break; case 'M': entry = zmalloc(sizeof(struct sf_entry)); entry->acl = get_acl_from_file(optarg); @@ -129,6 +120,12 @@ main(int argc, char *argv[]) entry->op = OP_MERGE_ACL; TAILQ_INSERT_TAIL(&entrylist, entry, next); break; + case 'P': + H_flag = L_flag = false; + break; + case 'R': + R_flag = true; + break; case 'X': entry = zmalloc(sizeof(struct sf_entry)); entry->acl = get_acl_from_file(optarg); @@ -213,43 +210,93 @@ main(int argc, char *argv[]) err(1, "cannot have more than one stdin"); have_stdin = 1; bzero(&filename, sizeof(filename)); + i = 0; + /* Start with an array size sufficient for basic cases. */ + fl_count = 1024; + files_list = zmalloc(fl_count * sizeof(char *)); while (fgets(filename, (int)sizeof(filename), stdin)) { /* remove the \n */ filename[strlen(filename) - 1] = '\0'; - fn_dup = strdup(filename); - if (fn_dup == NULL) + files_list[i] = strdup(filename); + if (files_list[i] == NULL) err(1, "strdup() failed"); - add_filename(fn_dup); + /* Grow array if necessary. */ + if (++i == fl_count) { + fl_count <<= 1; + if (fl_count > SIZE_MAX / sizeof(char *)) + errx(1, "Too many input files"); + files_list = zrealloc(files_list, + fl_count * sizeof(char *)); + } } + + /* fts_open() requires the last array element to be NULL. */ + files_list[i] = NULL; } else - for (i = 0; i < argc; i++) - add_filename(argv[i]); + files_list = argv; - /* cycle through each file */ - TAILQ_FOREACH(file, &filelist, next) { - local_error = 0; + if (R_flag) { + if (h_flag) + errx(1, "the -R and -h options may not be " + "specified together."); + if (L_flag) { + fts_options = FTS_LOGICAL; + } else { + fts_options = FTS_PHYSICAL; - if (stat(file->filename, &sb) == -1) { - warn("%s: stat() failed", file->filename); - carried_error++; + if (H_flag) { + fts_options |= FTS_COMFOLLOW; + } + } + } else if (h_flag) { + fts_options = FTS_PHYSICAL; + } else { + fts_options = FTS_LOGICAL; + } + + /* Open all files. */ + if ((ftsp = fts_open(files_list, fts_options | FTS_NOSTAT, 0)) == NULL) + err(1, "fts_open"); + while ((file = fts_read(ftsp)) != NULL) { + switch (file->fts_info) { + case FTS_D: + /* Do not recurse if -R not specified. */ + if (!R_flag) + fts_set(ftsp, file, FTS_SKIP); + break; + case FTS_DP: + /* Skip the second visit to a directory. */ continue; + case FTS_DNR: + case FTS_ERR: + warnx("%s: %s", file->fts_path, + strerror(file->fts_errno)); + continue; + default: + break; } - if (acl_type == ACL_TYPE_DEFAULT && S_ISDIR(sb.st_mode) == 0) { - warnx("%s: default ACL may only be set on a directory", - file->filename); + if (acl_type == ACL_TYPE_DEFAULT && file->fts_info != FTS_D) { + warnx("%s: default ACL may only be set on " + "a directory", file->fts_path); carried_error++; continue; } - if (h_flag) - ret = lpathconf(file->filename, _PC_ACL_NFS4); + local_error = 0; + + follow_symlink = ((fts_options & FTS_LOGICAL) || + ((fts_options & FTS_COMFOLLOW) && + file->fts_level == FTS_ROOTLEVEL)); + + if (follow_symlink) + ret = pathconf(file->fts_accpath, _PC_ACL_NFS4); else - ret = pathconf(file->filename, _PC_ACL_NFS4); + ret = lpathconf(file->fts_accpath, _PC_ACL_NFS4); if (ret > 0) { if (acl_type == ACL_TYPE_DEFAULT) { warnx("%s: there are no default entries " - "in NFSv4 ACLs", file->filename); + "in NFSv4 ACLs", file->fts_path); carried_error++; continue; } @@ -259,20 +306,20 @@ main(int argc, char *argv[]) acl_type = ACL_TYPE_ACCESS; } else if (ret < 0 && errno != EINVAL) { warn("%s: pathconf(..., _PC_ACL_NFS4) failed", - file->filename); + file->fts_path); } - if (h_flag) - acl = acl_get_link_np(file->filename, acl_type); + if (follow_symlink) + acl = acl_get_file(file->fts_accpath, acl_type); else - acl = acl_get_file(file->filename, acl_type); + acl = acl_get_link_np(file->fts_accpath, acl_type); if (acl == NULL) { - if (h_flag) - warn("%s: acl_get_link_np() failed", - file->filename); - else + if (follow_symlink) warn("%s: acl_get_file() failed", - file->filename); + file->fts_path); + else + warn("%s: acl_get_link_np() failed", + file->fts_path); carried_error++; continue; } @@ -285,11 +332,12 @@ main(int argc, char *argv[]) switch(entry->op) { case OP_ADD_ACL: local_error += add_acl(entry->acl, - entry->entry_number, &acl, file->filename); + entry->entry_number, + &acl, file->fts_path); break; case OP_MERGE_ACL: local_error += merge_acl(entry->acl, &acl, - file->filename); + file->fts_path); need_mask = 1; break; case OP_REMOVE_EXT: @@ -301,37 +349,37 @@ main(int argc, char *argv[]) acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { local_error += remove_default(&acl, - file->filename); + file->fts_path); break; } - remove_ext(&acl, file->filename); + remove_ext(&acl, file->fts_path); need_mask = 0; break; case OP_REMOVE_DEF: if (acl_type == ACL_TYPE_NFS4) { warnx("%s: there are no default entries in NFSv4 ACLs; " - "cannot remove", file->filename); + "cannot remove", file->fts_path); local_error++; break; } - if (acl_delete_def_file(file->filename) == -1) { + if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", - file->filename); + file->fts_path); local_error++; } if (acl_type == ACL_TYPE_DEFAULT) local_error += remove_default(&acl, - file->filename); + file->fts_path); need_mask = 0; break; case OP_REMOVE_ACL: local_error += remove_acl(entry->acl, &acl, - file->filename); + file->fts_path); need_mask = 1; break; case OP_REMOVE_BY_NUMBER: local_error += remove_by_number(entry->entry_number, - &acl, file->filename); + &acl, file->fts_path); need_mask = 1; break; } @@ -343,9 +391,9 @@ main(int argc, char *argv[]) */ if (acl_type == ACL_TYPE_DEFAULT && acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { - if (acl_delete_def_file(file->filename) == -1) { + if (acl_delete_def_file(file->fts_accpath) == -1) { warn("%s: acl_delete_def_file() failed", - file->filename); + file->fts_path); carried_error++; } continue; @@ -358,22 +406,22 @@ main(int argc, char *argv[]) } if (acl_type != ACL_TYPE_NFS4 && need_mask && - set_acl_mask(&acl, file->filename) == -1) { - warnx("%s: failed to set ACL mask", file->filename); + set_acl_mask(&acl, file->fts_path) == -1) { + warnx("%s: failed to set ACL mask", file->fts_path); carried_error++; - } else if (h_flag) { - if (acl_set_link_np(file->filename, acl_type, + } else if (follow_symlink) { + if (acl_set_file(file->fts_accpath, acl_type, acl) == -1) { carried_error++; - warn("%s: acl_set_link_np() failed", - file->filename); + warn("%s: acl_set_file() failed", + file->fts_path); } } else { - if (acl_set_file(file->filename, acl_type, + if (acl_set_link_np(file->fts_accpath, acl_type, acl) == -1) { carried_error++; - warn("%s: acl_set_file() failed", - file->filename); + warn("%s: acl_set_link_np() failed", + file->fts_path); } } Modified: user/markj/netdump/bin/setfacl/setfacl.h ============================================================================== --- user/markj/netdump/bin/setfacl/setfacl.h Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/setfacl.h Wed Apr 11 15:04:31 2018 (r332408) @@ -47,6 +47,7 @@ void remove_ext(acl_t *prev_acl, const char *filenam int set_acl_mask(acl_t *prev_acl, const char *filename); /* util.c */ void *zmalloc(size_t size); +void *zrealloc(void *ptr, size_t size); const char *brand_name(int brand); int branding_mismatch(int brand1, int brand2); Modified: user/markj/netdump/bin/setfacl/util.c ============================================================================== --- user/markj/netdump/bin/setfacl/util.c Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/bin/setfacl/util.c Wed Apr 11 15:04:31 2018 (r332408) @@ -44,6 +44,17 @@ zmalloc(size_t size) return (ptr); } +void * +zrealloc(void *ptr, size_t size) +{ + void *newptr; + + newptr = realloc(ptr, size); + if (newptr == NULL) + err(1, "realloc() failed"); + return (newptr); +} + const char * brand_name(int brand) { Modified: user/markj/netdump/release/amd64/make-memstick.sh ============================================================================== --- user/markj/netdump/release/amd64/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/amd64/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -36,6 +36,12 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} +mkimg -s gpt \ + -b ${1}/boot/pmbr \ + -p efi:=${1}/boot/boot1.efifat \ + -p freebsd-boot:=${1}/boot/gptboot \ + -p freebsd-ufs:=${2}.part \ + -p freebsd-swap::1M \ + -o ${2} rm ${2}.part Modified: user/markj/netdump/release/amd64/mkisoimages.sh ============================================================================== --- user/markj/netdump/release/amd64/mkisoimages.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/amd64/mkisoimages.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -38,7 +38,7 @@ if [ "$1" = "-b" ]; then umount efi rmdir efi mdconfig -d -u $device - bootable="-o bootimage=efi;efiboot.img -o no-emul-boot $bootable" + bootable="-o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi $bootable" shift else Modified: user/markj/netdump/release/arm64/RPI3.conf ============================================================================== --- user/markj/netdump/release/arm64/RPI3.conf Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/arm64/RPI3.conf Wed Apr 11 15:04:31 2018 (r332408) @@ -22,9 +22,10 @@ export BOARDNAME="RPI3" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3" - UBOOT_FILES="LICENCE.broadcom README armstub8.bin bootcode.bin config.txt \ - fixup.dat fixup_cd.dat fixup_x.dat start.elf start_cd.elf \ - start_x.elf u-boot.bin" + UBOOT_FILES="README u-boot.bin" + DTB_FILES="armstub8.bin bootcode.bin config.txt fixup_cd.dat \ + fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ + start_cd.elf start_db.elf start_x.elf start.elf ${DTB}" FATMOUNT="${DESTDIR%${KERNEL}}fat" UFSMOUNT="${DESTDIR%${KERNEL}}ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" @@ -34,7 +35,10 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done - chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${DTB} ${FATMOUNT}/${DTB} + for _DF in ${DTB_FILES}; do + chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \ + ${FATMOUNT}/${_DF} + done chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays for _OL in ${OVERLAYS}; do chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \ Modified: user/markj/netdump/release/arm64/make-memstick.sh ============================================================================== --- user/markj/netdump/release/arm64/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/arm64/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -36,6 +36,9 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2} +mkimg -s gpt \ + -p efi:=${1}/boot/boot1.efifat \ + -p freebsd:=${2}.part \ + -o ${2} rm ${2}.part Modified: user/markj/netdump/release/i386/make-memstick.sh ============================================================================== --- user/markj/netdump/release/i386/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/i386/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -36,6 +36,11 @@ makefs -B little -o label=FreeBSD_Install -o version=2 rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} +mkimg -s gpt \ + -b ${1}/boot/pmbr \ + -p freebsd-boot:=${1}/boot/gptboot \ + -p freebsd-ufs:=${2}.part \ + -p freebsd-swap::1M \ + -o ${2} rm ${2}.part Modified: user/markj/netdump/release/powerpc/make-memstick.sh ============================================================================== --- user/markj/netdump/release/powerpc/make-memstick.sh Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/release/powerpc/make-memstick.sh Wed Apr 11 15:04:31 2018 (r332408) @@ -41,7 +41,10 @@ makefs -B big -o version=2 ${tempfile} ${1} rm ${1}/etc/fstab rm ${1}/etc/rc.conf.local -mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} +mkimg -s apm \ + -p freebsd-boot:=${1}/boot/boot1.hfs \ + -p freebsd-ufs/FreeBSD_Install:=${tempfile} \ + -o ${2} rm -f ${tempfile} Modified: user/markj/netdump/sbin/camcontrol/camcontrol.8 ============================================================================== --- user/markj/netdump/sbin/camcontrol/camcontrol.8 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/camcontrol/camcontrol.8 Wed Apr 11 15:04:31 2018 (r332408) @@ -561,7 +561,7 @@ the blocksize. Note that this command only displays the information, it does not update the kernel data structures. Use the -.Nm +.Nm reprobe subcommand to do that. .It Ic start Send the SCSI Start/Stop Unit (0x1B) command to the given device with the @@ -1593,7 +1593,7 @@ If the device is a .Tn SCSI device and it provides a recommended timeout for the WRITE BUFFER command (see the -.Nm +.Nm opcodes subcommand), that timeout will be used for the firmware download. The drive-recommended timeout value may be overridden on the command line with the @@ -1644,12 +1644,12 @@ will currently attempt a firmware download to any .Tn ATA or .Tn SATA -device, since the standard +device, since the standard .Tn ATA DOWNLOAD MICROCODE command may work. Firmware downloads to .Tn ATA -and +and .Tn SATA devices are supported for devices connected to standard @@ -1658,7 +1658,7 @@ and .Tn SATA controllers, and devices connected to SAS controllers with -.Tn SCSI +.Tn SCSI to .Tn ATA translation capability. @@ -1667,7 +1667,7 @@ In the latter case, uses the .Tn SCSI .Tn ATA -PASS-THROUGH command to send the +PASS-THROUGH command to send the .Tn ATA DOWNLOAD MICROCODE command to the drive. Some @@ -1991,9 +1991,9 @@ For instance, .Tn LTO tapes have MAM. Either the -.Fl r +.Fl r option or the -.Fl w +.Fl w option must be specified. .Bl -tag -width 14n .It Fl r Ar action @@ -2022,7 +2022,7 @@ This option is not yet implemented. .It Fl a Ar num Specify the attribute number to display. This option only works with the attr_values, attr_list and supp_attr -arguments to +arguments to .Fl r . .It Fl c Display cached attributes. @@ -2038,7 +2038,7 @@ Specify the output format for the attribute values (at comma separated list of options. The default output is currently set to field_all,nonascii_trim,text_raw. Once this code is ported to FreeBSD 10, any text fields will be converted -from their codeset to the user's native codeset with +from their codeset to the user's native codeset with .Xr iconv 3 . .Pp The text options are mutually exclusive; if you specify more than one, you @@ -2146,7 +2146,7 @@ action. This requests that the device report Nominal and Recommended timeout values for the given command or commands. The timeout values are in seconds. -The timeout descriptor also includes a command-specific +The timeout descriptor also includes a command-specific .El .It Ic zone Manage @@ -2287,8 +2287,8 @@ The summary and column headings are printed, fields ar and the fields themselves may contain spaces. .It summary Just print the summary: the number of zones, the maximum LBA (LBA of the -last logical block on the drive), and the value of the -.Dq same +last logical block on the drive), and the value of the +.Dq same field. The .Dq same @@ -2319,7 +2319,7 @@ to translation layer (SAT). It may be helpful to read the ATA Command Set - 4 (ACS-4) description of the Extended Power Conditions feature set, available at t13.org, to -understand the details of this particular +understand the details of this particular .Nm subcommand. .Bl -tag -width 6n @@ -2365,7 +2365,7 @@ Idle and Standby mode supported by the drive. .Bl -tag -width 8n .It Fl e Enable the power condition. -One of +One of .Fl e or .Fl d @@ -2395,7 +2395,7 @@ Enable or disable a particular power condition. .Bl -tag -width 7n .It Fl e Enable the power condition. -One of +One of .Fl e or .Fl d @@ -2485,7 +2485,7 @@ time, but override the system time zone and use UTC in .It Fl s Set the device's timestamp. Either the .Fl f -and +and .Fl T options or the .Fl U @@ -2494,7 +2494,7 @@ option must be specified. .It Fl f Ar format Specify the strptime format string, as documented in strptime(3). The time must also be specified with the -.Fl T +.Fl T option. .It Fl T Ar time Provide the time in the format specified with the @@ -2790,7 +2790,7 @@ camcontrol epc da4 -c goto -p Standby_z -H Tell drive .Pa da4 to go to the Standby_z power state (which is -the drive's lowest power state) and hold in that state until it is +the drive's lowest power state) and hold in that state until it is explicitly released by another .Cm goto command. @@ -2802,14 +2802,14 @@ camcontrol epc da2 -c status -P Report only the power state of drive .Pa da2 . -Some drives will power up in response to the commands sent by the +Some drives will power up in response to the commands sent by the .Pa status subcommand, and the .Fl P option causes .Nm to only send the -.Tn ATA +.Tn ATA CHECK POWER MODE command, which should not trigger a change in the drive's power state. .Pp @@ -2829,7 +2829,7 @@ camcontrol timestamp sa0 -s -f "%a, %d %b %Y %T %z" \e Set the timestamp of drive .Pa sa0 using a -.Xr strptime 3 +.Xr strptime 3 format string followed by a time string that was created using this format string. .Sh SEE ALSO Modified: user/markj/netdump/sbin/geom/class/eli/geli.8 ============================================================================== --- user/markj/netdump/sbin/geom/class/eli/geli.8 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/geom/class/eli/geli.8 Wed Apr 11 15:04:31 2018 (r332408) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2017 +.Dd April 10, 2018 .Dt GELI 8 .Os .Sh NAME @@ -67,7 +67,7 @@ utility: .Cm init .Nm .Cm attach -.Op Fl dprv +.Op Fl dnprv .Op Fl j Ar passfile .Op Fl k Ar keyfile .Ar prov @@ -420,6 +420,9 @@ For more information see the description of the option for the .Cm init subcommand. +.It Fl n +Do a dry-run decryption. +This is useful to verify passphrase and keyfile without decrypting the device. .It Fl p Do not use a passphrase as a component of the User Key. Cannot be combined with the Modified: user/markj/netdump/sbin/geom/class/eli/geom_eli.c ============================================================================== --- user/markj/netdump/sbin/geom/class/eli/geom_eli.c Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/geom/class/eli/geom_eli.c Wed Apr 11 15:04:31 2018 (r332408) @@ -148,11 +148,12 @@ struct g_command class_commands[] = { { 'd', "detach", NULL, G_TYPE_BOOL }, { 'j', "passfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, { 'k', "keyfile", G_VAL_OPTIONAL, G_TYPE_STRING | G_TYPE_MULTI }, + { 'n', "dryrun", NULL, G_TYPE_BOOL }, { 'p', "nopassphrase", NULL, G_TYPE_BOOL }, { 'r', "readonly", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-dprv] [-j passfile] [-k keyfile] prov" + "[-dnprv] [-j passfile] [-k keyfile] prov" }, { "detach", 0, NULL, { Modified: user/markj/netdump/sbin/ipfw/ipfw.8 ============================================================================== --- user/markj/netdump/sbin/ipfw/ipfw.8 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/sbin/ipfw/ipfw.8 Wed Apr 11 15:04:31 2018 (r332408) @@ -2233,7 +2233,7 @@ of the firewall and quickly (and atomically) switch be By default, tables from set 0 are referenced when adding rule with table opcodes regardless of rule set. This behavior can be changed by setting -.Va net.inet.ip.fw.tables_set +.Va net.inet.ip.fw.tables_sets variable to 1. Rule's set will then be used for table references. .Pp Modified: user/markj/netdump/share/man/man7/development.7 ============================================================================== --- user/markj/netdump/share/man/man7/development.7 Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/share/man/man7/development.7 Wed Apr 11 15:04:31 2018 (r332408) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2018 +.Dd April 10, 2018 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -75,6 +75,11 @@ Build instructions can be found in .Xr build 7 and .Xr release 7 . +Kernel APIs are usually documented, use +.Cm apropos -s 9 '' +for a list. +Regression test suite is described in +.Xr tests 7 . For coding conventions, see .Xr style 9 . .Pp Modified: user/markj/netdump/share/man/man9/Makefile ============================================================================== --- user/markj/netdump/share/man/man9/Makefile Wed Apr 11 14:38:56 2018 (r332407) +++ user/markj/netdump/share/man/man9/Makefile Wed Apr 11 15:04:31 2018 (r332408) @@ -208,6 +208,12 @@ MAN= accept_filter.9 \ namei.9 \ netisr.9 \ nv.9 \ + OF_child.9 \ + OF_device_from_xref.9 \ + OF_finddevice.9 \ + OF_getprop.9 \ + OF_node_from_xref.9 \ + OF_package_to_path.9 \ ofw_bus_is_compatible.9 \ ofw_bus_status_okay.9 \ osd.9 \ @@ -1527,6 +1533,21 @@ MLINKS+=nv.9 libnv.9 \ nv.9 nvlist_take_string_array.9 \ nv.9 nvlist_unpack.9 \ nv.9 nvlist_xfer.9 +MLINKS+=OF_child.9 OF_parent.9 \ + OF_child.9 OF_peer.9 +MLINKS+=OF_device_from_xref.9 OF_device_register_xref.9 \ + OF_device_from_xref.9 OF_xref_from_device.9 +MLINKS+=OF_getprop.9 OF_getencprop.9 \ + OF_getprop.9 OF_getencprop_alloc.9 \ + OF_getprop.9 OF_getprop_alloc.9 \ + OF_getprop.9 OF_getproplen.9 \ + OF_getprop.9 OF_hasprop.9 \ + OF_getprop.9 OF_nextprop.9 \ + OF_getprop.9 OF_prop_free.9 \ + OF_getprop.9 OF_searchencprop.9 \ + OF_getprop.9 OF_searchprop.9 \ + OF_getprop.9 OF_setprop.9 +MLINKS+=OF_node_from_xref.9 OF_xref_from_node.9 MLINKS+=ofw_bus_is_compatible.9 ofw_bus_is_compatible_strict.9 \ ofw_bus_is_compatible.9 ofw_bus_node_is_compatible.9 \ ofw_bus_is_compatible.9 ofw_bus_search_compatible.9 Copied: user/markj/netdump/share/man/man9/OF_child.9 (from r332407, head/share/man/man9/OF_child.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/share/man/man9/OF_child.9 Wed Apr 11 15:04:31 2018 (r332408, copy of r332407, head/share/man/man9/OF_child.9) @@ -0,0 +1,76 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko <gonzo@FreeBSD.org> +.\" +.\" All rights reserved. +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS 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$ +.\" +.Dd April 9, 2018 +.Dt OF_CHILD 9 +.Os +.Sh NAME +.Nm OF_child , +.Nm OF_parent , +.Nm OF_peer +.Nd navigate device tree +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft phandle_t +.Fn OF_child "phandle_t node" +.Ft phandle_t +.Fn OF_parent "phandle_t node" +.Ft phandle_t +.Fn OF_peer "phandle_t node" +.Sh DESCRIPTION +.Pp +.Fn OF_child +returns the phandle value of the first child of the +.Fa node . +Zero is returned if there are no child nodes. +.Pp +.Fn OF_parent +returns the phandle for the parent of the +.Fa node . +Zero is returned if +.Fa node +is the root node. +.Pp +.Fn OF_peer +returns the phandle value of the next sibling of the +.Fa node . +Zero is returned if there is no sibling node. +.Sh EXAMPLES +.Bd -literal +phandle_t node, child; + ... +for (child = OF_child(node); child != 0; child = OF_peer(child) { + ... +} +.Ed +.Sh SEE ALSO +.Xr OF_finddevice 9 +.Sh AUTHORS +.An -nosplit +This manual page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . Copied: user/markj/netdump/share/man/man9/OF_device_from_xref.9 (from r332407, head/share/man/man9/OF_device_from_xref.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/share/man/man9/OF_device_from_xref.9 Wed Apr 11 15:04:31 2018 (r332408, copy of r332407, head/share/man/man9/OF_device_from_xref.9) @@ -0,0 +1,91 @@ +.\" +.\" Copyright (c) 2018 Oleksandr Tymoshenko <gonzo@FreeBSD.org> +.\" +.\" All rights reserved. +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS 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$ +.\" +.Dd April 9, 2018 +.Dt OF_DEVICE_FROM_XREF 9 +.Os +.Sh NAME +.Nm OF_device_from_xref , +.Nm OF_xref_from_device, +.Nm OF_device_register_xref +.Nd "manage mappings between xrefs and devices" +.Sh SYNOPSIS +.In dev/ofw/ofw_bus.h +.In dev/ofw/ofw_bus_subr.h +.Ft int +.Fn OF_device_register_xref "phandle_t xref" "device_t dev" +.Ft device_t +.Fn OF_device_from_xref "phandle_t xref" +.Ft phandle_t +.Fn OF_xref_from_device "device_t dev" +.Sh DESCRIPTION +.Pp +When a device tree node references another node, the driver may +need to get a device_t instance associated with the referenced node. +For instance, an Ethernet driver accessing a PHY device. +To make this possible, the kernel maintains a table that +maps effective handles to device_t instances. +.Pp +.Fn OF_device_register_xref +adds a map entry from the effective phandle +.Fa xref +to device +.Fa dev . +If a mapping entry for +.Fa xref +already exists, it is replaced with the new one. +The function always returns 0. +.Pp +.Fn OF_device_from_xref +returns a device_t instance associated with the effective phandle +.Fa xref . *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804111504.w3BF4Vsw046666>