path: root/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* efivar: use bool for booleansWarner Losh2021-04-091-23/+22
| | | | | | | | | Rather than int flags we ++, use booleans for all command line args. No functional change intended. Reviewed by: markj@ Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D29621
* efivar: Attempt to fix setting/printing/deleting EFI vars with '-' in their nameWarner Losh2021-04-091-9/+18
| | | | | | | | | | | | Due to how we're parsing UUIDs, we were disallowing setting, printing or deleting any UEFI variable with a '-' in it when you attempted to do that operation with the exact name (wildcard reporting was unaffected). Fix the parser to loop over all the dashes in the name and only give up when all possible matches are exhausted. Reviewed by: markj@ Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D29620
* efivar: Add --quiet to not report errorsWarner Losh2021-04-092-17/+55
| | | | | | | | | Add -q/--quiet flag to the command line. With it, errors are not reported at all. Instead nothing is printed and the exit code is non-zero. Reviewed by: markj Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D29619
* lpd(8): Mention the author of a paper in the SEE ALSO sectionGordon Bergling2021-04-091-1/+3
| | | | | Obtained from: OpenBSD MFC after: 1 week
* config(8): Mention the authors of a paper in the SEE ALSO sectionGordon Bergling2021-04-091-1/+5
| | | | | Obtained from: OpenBSD MFC after: 1 week
* bhyve: fix regression in legacy virtio-9p config parsingRoman Bogorodskiy2021-04-081-1/+1
| | | | | | | | | | | Commit 621b5090487de9fed1b503769702a9a2a27cc7bb introduced a regression in legacy virtio-9p config parsing by not initializing *sharename to NULL. As a result, "sharename != NULL" check in the first iteration fails and bhyve exits with "virtio-9p: more than one share name given". Fix by adding NULL back. Approved by: grehan
* uefisign: handle empty sectionsEric van Gyzen2021-04-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | loader.efi has an empty set_Xfic section. Handle it correctly. ``` Sections: Idx Name Size VMA LMA File off Algn [...] 3 set_Xcom 00000168 00000000000d4000 00000000000d4000 000d0e00 2**2 CONTENTS, ALLOC, LOAD, DATA 4 set_Xfic 00000000 00000000000d4168 00000000000d4168 00000000 2**2 ALLOC, LOAD, DATA 5 .sdata 00000448 00000000000d5000 00000000000d5000 000d1000 2**2 CONTENTS, ALLOC, LOAD, DATA [...] ``` Reviewed by: trasz, dab Reported by: andy.y.liu@dell.com Tested by: andy.y.liu@dell.com MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D29606
* Introduce "soft" serseq variant.Alexander Motin2021-04-061-4/+5
| | | | | | | | | | With new ZFS prefetcher improvements it is no longer needed to fully serialize reads to reach decent prediction hit rate. Softer variant only creates small time window to reduce races instead of completely blocking following reads while previous is running. It much less hurts the performance in case of prediction miss. MFC after: 1 month
* Allocate extra inodes in makefs when leaving free space in UFS images.Nathan Whitehorn2021-04-064-3/+30
| | | | | | | | | | | | | | By default, makefs(8) has very few spare inodes in its output images, which is fine for static filesystems, but not so great for VM images where many more files will be added. Make makefs(8) use the same default settings as newfs(8) when creating images with free space -- there isn't much point to leaving free space on the image if you can't put files there. If no free space is requested, use current behavior of a minimal number of available inodes. Reviewed by: manu MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D29492
* uefisign: fix handling of errors from child procEric van Gyzen2021-04-061-1/+5
| | | | | | | | | | | | | | | | Close the unused pipe file descriptors so the parent will notice if the child exits prematurely. Previously, the parent would block forever on a read from the pipe. $ uefisign -c foo.cert -k foo.key -o loader.efi loader.efi.unsigned uefisign: section points inside the headers load: 0.06 cmd: uefisign 4502 [piperd] 7.25r 0.00u 0.00s 0% 5968k ... _sleep+0x1be pipe_read+0x3d6 kern_readv+0x8c sys_read+0x83 ... Reviewed by: trasz MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D29605
* pciconf: Use VM_MEMATTR_DEVICE on supported architecturesMarcin Wojtas2021-04-061-1/+5
| | | | | | | | | | | | | Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE when mapping device registers in kernel. Do the same in pciconf. On armada8k SoC all reads from BARs mapped with hitherto attribute (VM_MEMATTR_UNCACHEABLE) return 0xff's. Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: kib Obtained from: Semihalf Sponsored by: Marvell Differential revision: https://reviews.freebsd.org/D29603
* bsdinstall: remove ftp7.ua.freebsd.org mirrorPhilip Paeps2021-04-061-1/+0
| | | | | PR: 254779 Reported by: Dmytro <dima@dima.rv.ua>
* bsdconfig: remove ftp7.ua.freebsd.org mirrorPhilip Paeps2021-04-061-1/+0
| | | | | PR: 254779 Reported by: Dmytro <dima@dima.rv.ua>
* freebsd-update: improve mandoc db generationEd Maste2021-04-051-1/+2
| | | | | | | | | | | | | | | freebsd-update compares the dates on man pages with mandoc.db, and if any newer pages are found it regenerates mandoc.db. Previously, if mandoc.db did not already exist the check failed and freebsd-update then failed to create one. Now, check that mandoc.db exists before performing the check for newer pages. Reported by: bdrewery (in D10482) Reviewed by: gordon MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29575
* Tweak language involving ZFS installation; no content changes.Nathan Whitehorn2021-04-051-16/+24
* Add some general notes about scripted installations.Nathan Whitehorn2021-04-051-0/+13
* jail: fix jail(8) synposis and usage message to match reality.Jamie Gritton2021-04-042-3/+3
| | | | | | Reported by: yuri PR: 254741 MFC after: 5 days
* Remove kgmon(8)Konstantin Belousov2021-04-037-699/+0
| | | | | | | | | Follow-up to the removal of the mcov from kernel. Noted by: mckusick Reviewed by: mckusick Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D29563
* Fix typo in xhci nvlist node name, and also increment device counter.Peter Grehan2021-04-031-1/+2
| | | | | | | | | This allows the xhci tablet device to be recognized and a PCI device instantiated. Reviewed by: jhb Fixes: 621b5090487d Refactor configuration management in bhyve. MFC after: 3 months.
* config(8): remove support for -pKonstantin Belousov2021-04-027-47/+1
| | | | | | | | | and other equivalent ways to request mcount-based profiling, like 'profile N' in kernel config. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D29529
* netmap: several typo fixesVincenzo Maffione2021-04-021-4/+4
| | | | No functional changes intended.
* nfsd: silence rpcb_unset noise for NFSv4 only serversRick Macklem2021-04-011-7/+13
| | | | | | | | | | | | | | | | | | An NFSv4 only configuration does not register with rpcbind(). Without this patch a failure to rpcb_unset() is reported when the daemon is terminated for this case. This is harmless noise, but this patch avoids calling rpcb_unset() for the NFSv4 only case, avoiding the noise. When called with "-d", it still does the rpcb_unset(), assuming that the configuration might have been changed to NFSv4 only and unregistering with rpcbind() might still be needed. Reviewed by: freqlabs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29449
* traceroute6: Fix Capsicum rights for rcvsockMark Johnston2021-04-011-3/+6
| | | | | | | | | | | | | | | - Always use distinct sockets for send and recv - Limit rights on the recv socket For ICMP6 we were using the same socket for both send and receive, and we limited rights on the socket such that it's impossible to receive anything. PR: 254623 Diagnosed by: Zhenlei Huang <zlei.huang@gmail.com> Reviewed by: oshogbo MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29523
* usr.sbin/services_mkdb: plug memory leak when line was blank.Xin LI2021-03-301-2/+8
| | | | | | Reviewed by: bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29370
* bhyve: change vq_getchain to return iovecs in both directionsKa Ho Ng2021-03-308-83/+88
| | | | | | | | | | | | | | | The old prototype requires callers to inspect flags of each descriptors to get the starting position of host-writable iovecs. vq_getchain() is changed to return a virtio request with the number of host-readable iovecs and host-writable iovecs instead. Callers can avoid boilerplate code of getting the start offset of host-writable iovecs. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Reviewed by: afedorov Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D29433
* bhyve: Enable virtio-scsi legacy config parsing.John Baldwin2021-03-291-0/+1
| | | | | | | | | | | The previous commit added the handler to parse the command line options for virtio-scsi devices but forgot to set the correct function pointer to point to the handler. Reported by: vangyzen Reviewed by: vangyzen Fixes: 621b5090487de9fed1b503769702a9a2a27cc7bb Differential Revision: https://reviews.freebsd.org/D29438
* bsdinstall: Drop vestigial bsdinstall-esps cleanupRyan Moeller2021-03-262-15/+1
| | | | | | | | | This is not needed after 0b7472b3d8d2f1e90fade5236b44fd98d8e396c2. MFC after: 3 days Sponsored by: iXsystems, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D29325
* rpc.lockd: Unconditionally close fds as daemonCaleb St. John2021-03-261-1/+1
| | | | | | | | | | | | | | | When lockd is configured with a debug level of > 0 and foreground == 0, the process is daemonized with a truth noclose argument to daemon(). This doesn't seem to be the desired behavior because that prevents stdout and stderr from being closed, however, stdout and stderr aren't used anywhere else. Furthermore, the man pages state that with a higher debug level it will use the syslog facilities to do so. Submitted by: Caleb St. John Discussed with: rmacklem MFC after: 3 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29415
* Add a new mode to the scripted partition editor for variant disk names.Nathan Whitehorn2021-03-264-11/+27
| | | | | | | | | | | | | | If the disk parameter "DEFAULT" is set in place of an actual device name, or no disk is specified for the PARTITIONS parameter, the installer will follow the logic used in the automatic-partitioning mode, in which it will either provide a selection dialog for one of several disks if several are present or automatically select it if there is only one. This simplifies the creation of fully-automatic installation media for hardware or VMs with varying disk names. Suggested by: Egoitz Aurrekoetxea <egoitz@sarenet.es> MFC after: 3 weeks Relnotes: yes
* mpsutil.8: fix typos in the man pageAlan Somers2021-03-251-3/+3
| | | | | MFC after: 2 weeks Sponsored by: Axcient
* align nfsdumpstate column outputCaleb St. John2021-03-241-0/+3
| | | | | | | | | | | | | | | | | | | There are scenarios where an NFS client will mount an NFSv4 export without specifying a callback address. When running nfsdumpstate under this circumstance, the column output is shifted incorrectly which places the "ClientID" value underneath the "Clientaddr" column. This diff is a small cosmetic change that prints a blank in the "Clientaddr" column and ensures the data for the columns are aligned appropriately. Submitted by: Caleb St. John Reviewed by: sef (previous version) MFC after: 3 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D18958
* bhyve hostbridge: Rename "device" property to "devid".John Baldwin2021-03-242-4/+4
| | | | | | | | | | | "device" is already used as the generic PCI-level name of the device model to use (e.g. "hostbridge"). The result was that parsing "hostbridge" as an integer failed and the host bridge used a device ID of 0. The EFI ROM asserts that the device ID of the hostbridge is not 0, so booting with the current EFI ROM was failing during the ROM boot. Fixes: 621b5090487de9fed1b503769702a9a2a27cc7bb
* makefs: Ignore the "tags" keyword in mtree manifestsMark Johnston2021-03-231-1/+7
| | | | | | | | | | | An install using -DNO_ROOT emits mtree entries containing tags used by pkgbase. makefs(8) can safely ignore them, so do that rather than emitting a warning for each entry. Reviewed by: brooks, imp MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29384
* syslogd: Increase message size limitsDmitry Wagin2021-03-232-12/+27
| | | | | | | | | | | | | | | | | | | Add a -M option to control the maximum length of forwarded messages. syslogd(8) used to truncate forwarded messages to 1024 bytes, but after commit 1a874a126a54 ("Add RFC 5424 syslog message output to syslogd.") applies a more conservative limit of 480 bytes for IPv4 per RFC 5426 section 3.2. Restore the old default behaviour of truncating to 1024 bytes. RFC 5424 specifies no upper limit on the length of forwarded messages, while for RFC 3164 the limit is 1024 bytes. Increase MAXLINE to 8192 bytes to correspond to commit 672ef817a192. Replaced bootfile[] size for MAXPATHLEN used in getbootfile(3) as a returned value. Using (MAXLINE+1) as a size for bootfile[] is excessive. PR: 241937 MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27206
* Fix scripted installs on EFI systems after default mounting of the ESP.Nathan Whitehorn2021-03-232-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because the ESP mount point (/boot/efi) is in mtree, tar will attempt to extract a directory at that point post-mount when the system is installed. Normally, this is fine, since tar can happily set whatever properties it wants. For FAT32 file systems, however, like the ESP, tar will attempt to set mtime on the root directory, which FAT does not support, and tar will interpret this as a fatal error, breaking the install (see https://github.com/libarchive/libarchive/issues/1516). This issue would also break scripted installs on bare-metal POWER8, POWER9, and PS3 systems, as well as some ARM systems. This patch solves the problem in two ways: - If stdout is a TTY, use the distextract stage instead of tar, as in interactive installs. distextract solves this problem internally and provides a nicer UI to boot, but requires a TTY. - If stdout is not a TTY, use tar but, as a stopgap for 13.0, exclude boot/efi from tarball extraction and then add it by hand. This is a hack, and better solutions (as in the libarchive ticket above) will obsolete it, but it solves the most common case, leaving only unattended TTY-less installs on a few tier-2 platforms broken. In addition, fix a bug with fstab generation uncovered once the tar issue is fixed that umount(8) can depend on the ordering of lines in fstab in a way that mount(8) does not. The partition editor now writes out fstab in mount order, making sure umount (run at the end of scripted, but not interactive, installs) succeeds. PR: 254395 Reviewed by: gjb, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29380
* Bump documentation date after recent updates to bsdinstall.8.Nathan Whitehorn2021-03-221-1/+1
* Include examples of how to build script-install media.Nathan Whitehorn2021-03-221-0/+14
* Improve example install scripts, making them simpler and more robust.Nathan Whitehorn2021-03-221-3/+2
| | | | | | | | In particular: - There is no need to do anything with gpart (the installer does that for you). - There is no need to specify the network interface, since we have an option for defaults.
* rtsold: Fix validation of RDNSS optionsMark Johnston2021-03-211-6/+12
| | | | | | | | | | | | | | | The header specifies the size of the option in multiples of eight bytes. The option consists of an eight-byte header followed by one or more IPv6 addresses, so the option is invalid if the size is not equal to 1+2n for some n>0. Check this. The bug can cause random stack data to be formatted as an IPv6 address and passed to resolvconf(8), but a host able to trigger the bug may also specify arbitrary addresses this way. Reported by: Q C <cq674350529@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 3 days
* usr.sbin/services_mkdb: diff reduction against NetBSD.Xin LI2021-03-211-0/+1
| | | | MFC after: 1 month
* usr.sbin/uefisign: prevent specifying certificate, key or outputXin LI2021-03-211-5/+14
| | | | | | multiple times. MFC after: 1 month
* Clarify that scripted installations don't require specification of bootNathan Whitehorn2021-03-191-0/+4
| | | | | | partitions, as there seems to be widespread confusion on this point. MFC after: 1 day
* bhyve: support relocating fbuf and passthru data BARsD Scott Phillips2021-03-194-34/+125
| | | | | | | | | | | | | | | | | | | | | | | | | We want to allow the UEFI firmware to enumerate and assign addresses to PCI devices so we can boot from NVMe[1]. Address assignment of PCI BARs is properly handled by the PCI emulation code in general, but a few specific cases need additional support. fbuf and passthru map additional objects into the guest physical address space and so need to handle address updates. Here we add a callback to emulated PCI devices to inform them of a BAR configuration change. fbuf and passthru then watch for these BAR changes and relocate the frame buffer memory segment and passthru device mmio area respectively. We also add new VM_MUNMAP_MEMSEG and VM_UNMAP_PPTDEV_MMIO ioctls to vmm(4) to facilitate the unmapping needed for addres updates. [1]: https://github.com/freebsd/uefi-edk2/pull/9/ Originally by: scottph MFC After: 1 week Sponsored by: Intel Corporation Reviewed by: grehan Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D24066
* Refactor configuration management in bhyve.John Baldwin2021-03-1848-1071/+2593
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the existing ad-hoc configuration via various global variables with a small database of key-value pairs. The database supports heirarchical keys using a MIB-like syntax to name the path to a given key. Values are always stored as strings. The API used to manage configuation values does include wrappers to handling boolean values. Other values use non-string types require parsing by consumers. The configuration values are stored in a tree using nvlists. Leaf nodes hold string values. Configuration values are permitted to reference other configuration values using '%(name)'. This permits constructing template configurations. All existing command line arguments now set configuration values. For devices, the "-s" option parses its option argument to generate a list of key-value pairs for the given device. A new '-o' command line option permits setting an individual configuration variable. The key name is always given as a full path of dot-separated components. A new '-k' command line option parses a simple configuration file. This configuration file holds a flat list of 'key=value' lines where the 'key' is the full path of a configuration variable. Lines starting with a '#' are comments. In general, bhyve starts by parsing command line options in sequence and applying those settings to configuration values. Once this is complete, bhyve then begins initializing its state based on the configuration values. This means that subsequent configuration options or files may override or supplement previously given settings. A special 'config.dump' configuration value can be set to true to help debug configuration issues. When this value is set, bhyve will print out the configuration variables as a flat list of 'key=value' lines. Most command line argments map to a single configuration variable, e.g. '-w' sets the 'x86.strictmsr' value to false. A few command line arguments have less obvious effects: - Multiple '-p' options append their values (as a comma-seperated list) to "vcpu.N.cpuset" values (where N is a decimal vcpu number). - For '-s' options, a pci.<bus>.<slot>.<function> node is created. The first argument to '-s' (the device type) is used as the value of a "device" variable. Additional comma-separated arguments are then parsed into 'key=value' pairs and used to set additional variables under the device node. A PCI device emulation driver can provide its own hook to override the parsing of the additonal '-s' arguments after the device type. After the configuration phase as completed, the init_pci hook then walks the "pci.<bus>.<slot>.<func>" nodes. It uses the "device" value to find the device model to use. The device model's init routine is passed a reference to its nvlist node in the configuration tree which it can query for specific variables. The result is that a lot of the string parsing is removed from the device models and centralized. In addition, adding a new variable just requires teaching the model to look for the new variable. - For '-l' options, a similar model is used where the string is parsed into values that are later read during initialization. One key note here is that the serial ports use the commonly used lowercase names from existing documentation and examples (e.g. "lpc.com1") instead of the uppercase names previously used internally in bhyve. Reviewed by: grehan MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D26035
* inetd.conf: Wordsmith recommendationDaniel Ebdrup Jensen2021-03-181-1/+2
| | | | | Rather than recommend specific VTIs, it's better to give a general recommendation for where current and future suitable VTIs can be found.
* pkg: settle the uniq extension to .pkg instead of .bsdBaptiste Daroussin2021-03-161-1/+1
| | | | Requested by: many
* bhyve: virtio shares definitions between sys/dev/virtioKa Ho Ng2021-03-168-211/+98
| | | | | | | | | | | | Definitions inside usr.sbin/bhyve/virtio.h are thrown away. Definitions in sys/dev/virtio are used instead. This reduces code duplication. Sponsored by: The FreeBSD Foundation Reviewed by: grehan Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D29084
* pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txzBaptiste Daroussin2021-03-151-14/+29
| | | | | | | | | | | The package extension is going to be changed to .bsd to be among other things resilient to the change of compression format used and reduce the impact of all third party tool of that change. Ensure the bootstrap knows about it Reviewed by: manu Differential revision: https://reviews.freebsd.org/D29232
* wlandebug.8: remove Xref for missing manpagesFernando ApesteguĂ­a2021-03-151-4/+6
| | | | | | | | | | | | | | | | | | | | | Remove references for: athdebug(8), athstats(8) and wlanstats(8) Those are tools in the tools/ directory that are not built as part of the base system. According to the toolds/README file: "...these tools are not meant to be built as part of the standard system..." Even more, the tools/tools/README is not udpated and wlanstats does not even built on current: error: cast from 'struct sockaddr *' to 'const struct sockaddr_dl *' increases required alignment from 1 to 2 [-Werror,-Wcast-align] PR: 227174 Reported by: freebsd.org@alexandrews.me.uk Reviewed by: gbe@ adrian@ Approved by: gbe@ (mentor) adrian@ Differential Revision: https://reviews.freebsd.org/D29033
* autofs: best effort to maintain mounttab and mountdtabRobert Wing2021-03-124-1/+18
| | | | | | | | | | | | When an automounted filesystem is successfully unmounted, call rpc.umntall(8) with the -k flag. rpc.umntall(8) is used to clean up /var/db/mounttab on the client and /var/db/mountdtab on the server. This is only useful for NFSv3. PR: 251906 Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D27801