wg: Write rc(8) script to easily manage wg(4) interfaces This "wg" rc(8) script is somewhat similar to the "wg-quick" tool on Linux/FreeBSD. It can be used to quickly start/stop the wg(4) interfaces according to the wg.conf(5) configuration files in the "/etc/wireguard" directory. The syntax of wg.conf(5) configuration file is very similar to that of "wg-quick" but with necessary changes and minor additions. See wg.conf(5) for details. On the one hand, the new "wg_enable" and "wg_interfaces" variables in "/etc/rc.conf" can be used to auto-configure the wg(4) interfaces during the system startup. See rc.conf(5) for more details. On the other hand, this "wg" script can be manually called from the command-line to start/stop the wg(4) interfaces. Thanks to swildner for reviewing the man page.
world - Add /etc/rc.local.d to rcorder startup and shutdown ops * System now rcorders across both /etc/rc.d and /etc/rc.local.d during startup and shutdown. * Allows the sysadmin to put control scripts in /etc/rc.local.d formatted similarly to how they are in /etc/rc.d Submitted-by: Stephen Welker <stephen.welker@nemostar.com.au>
kernel: Remove ndis(4) and associated tools and stuff. ndis(4) was a wrapper to allow running binary Windows network drivers that conformed to the Network Driver Interface Specification, i.e. NDIS. It only ever supported drivers from the days of Windows XP and Windows Server 2003 (i.e. NDIS 5.1). And even if one was actually able to extract the .sys and .inf files from the driver package and successfully convert them to a building module, which both were adventures in itself, it could be any result when trying to run it, depending on the card and driver, from resonably working to not working, even crashing. But it did work for some cards, so it had some limited merit in its time. NetBSD removed it in 2018, FreeBSD in January 2021, so let's follow suit now.
calendar(1): Rewrite to support Chinese & Julian calendars I wanted to use Chinese calendar in the calendar(1) utility, so I started working on it. The Chinese calendar is a lunisolar calendar and requires calculations of Sun and Moon positions. Along the way of implementing the Chinese calendar support, more and more parts of the old code has been replaced. Now, the new calendar(1) code base has been mostly rewritten to be more extensible to support multiple calendars. Although only the Gregorian (the default), Chinese and Julian calendars are currently supported, more calendars now becomes much easier to add. Highlights: * Support Chinese calendar * Support Julian calendar * More accurate Sun and Moon calculations * More extensible * More calendar files/entries and more accurate information * Better code base Major Changes: * If no user's calendar file, default to '/etc/calendar/default' * Search calendar files in '/etc/calendar', which allows to override the calendar file in '/usr/share/calendar' in a system-wide way * Add '-s' option to show information of Chinese/Julian calendar or Sun/Moon * Add '-H' option to specify the calendar home directory * Add '-L' option to specify the location, which should be set to get accurate Sun/Moon information * Add '-T' option to specify the current time for Sun/Moon calculations * Much Improved calendar file parser * More clean man page * More helpful error messages * Some bug fixes and various cleanups The new calendar algorithms are implemented by referring to this great book: Calendrical Calculations: The Ultimate Edition (4th Edition) by Edward M. Reingold and Nachum Dershowitz. Cambridge University Press, 2018. ISBN: 9781107057623 More information about the development history of this calendar(1) utility can be found in my GitHub repository: https://github.com/liweitianux/ccalendar
initrd: Detach from the world and build on the fly Why --- Currently, the files for initrd image creation are built and installed at /usr/share/initrd by "buildworld" and "installworld", respectively, and then mkinitrd(8) simply packs them to create the initrd.img.gz. For normal users, the shipped /usr/share/initrd and mkinitrd(8) don't make much sense, since they don't need to modify the initrd contents and create a modified initrd image. From a developer's perspective, the required steps (buildworld, installworld and mkinitrd) to create and test a new initrd image can be annoying. How --- Detach the build and installation of the initrd contents from the world. Build the (rescue/initrd) tools on-the-fly when creating the initrd image. As per ftigeot's suggestion, these statically linked tools can be useful when dealing with a broken system, so install them under /rescue to be more intuitive and easier to use (similar to FreeBSD and maybe other BSDs). What ---- * Move "share/initrd" to be top-level, and detach it from world. + Update the patch in bsd.crunchgen.mk accordingly. + Add Makefile.inc to simplify subdir's makefiles. + Rewrite the Makefile with targets: - rescue: build and install the rescue tools into /rescue. - initrd: further packs the etc and rescue staffs to create the initrd image. * Move "sbin/mkinitrd/mkinitrd.sh" under the new "initrd" directory and adapt it to work with the "initrd" make target. Remove the other parts of mkinitrd(8). * Export the above "rescue" and "initrd" targets to be top-level. * Update nrelease framework to use the new "make initrd". * Update build.7 man page accordingly. * Print the message about updating the initrd image and 3rd-party packages after "make upgrade" instead of "make installworld". * Document this change in UPDATING. * Other small updates and style cleanups. TODO ---- * Add initrd.7 man page * Crunch more useful tools * Crunch bin/sbin/etc. into a bundle to save space (??) Reviewed-by: swildner Thanks-to: dillon, swildner, ftigeot
move private edit library to /lib/priv While here, fix private ssh and ldns. The .so and .a versions were not installed and this probably will break future builds for anyone that's built world in the last few hours. Also, all of these private libraries also need -L flags in addition to -rpath flags.
installer - use a more modern mount setup for UFS and HAMMER. * Rewrite a large chunk of the disklabeling and mount point code. UFS now gains a separate /boot partition, avoiding issues with the boot loader if the user desires to install a large UFS root on a drive. * Normalize the mount mechanics for both UFS and HAMMER. Instead of using PFSs on HAMMER, we create two large partitions by default: One is the root partition, the other is /build. The /build partition holds major elements of the system which would normally not have to be backed up: /var/tmp (from /build/var.tmp) /var/cache (from /build/var.cache) /var/crash (from /build/var.crash) /var/spool (from /build/var.spool) /var/log (from /build/var.log) /usr/obj (from /build/usr.obj) The root partition holds all remaining major directories, including the base /var. There are several reasons for this. Generally speaking, stuff in /home, /usr and most of the stuff in /var is critical to system operation and user happiness, and it makes little sense to separate it out from the root mount. We pick-out the less critical directories and place them on /build, using NULL mounts to mount them in their expected locations. * Users can easily make adjustments post-install without having to mess around with PFSs, and can make simple adjustments pre-install. * Drives smaller than around 40GB will not create a separate /build partition by default, but will still create a /build directory in the root partition and generate the same nullfs mounts. This makes it easier for the user to adjust to a larger configuration later on if desired. * This also improves crash recovery mechanics, increasing the chance that the root partition will be able to mount with minimal recovery work. * We now use a tmpfs filesystem for /tmp by default. /var/tmp is mounted from storage. Again, the user can change this easily post-install. * Calculate better values for swap, root, and /build, based on the size of the slice being installed to. The /build directory will cap-out at around 20GB leaving. Swap will be made smaller if the root partition seems to small, and so forth. Some swap is always configured. Swap is a very useful thing to have, even if you have tons of memory, because there will always be a certain number of always-idle pages from idle services laying around. * Remove /dev from sources.conf, it is no longer appropriate to try to cpdup /dev. Fixes a cpdup error. * UFS root can now be encrypted (it couldn't before), because the UFS install now splits out a separate /boot partition. * Tested w/non-crypto UFS and HAMMER install, crypto UFS and HAMMER install, and with small and large drives.
devd(8): Sync with FreeBSD and turn it on by default. Most important of all, it cares about knowing which USB modules support which device/vendor IDs and it will load the associated module upon USB device plugging if it is not already loaded or in the kernel config. Taken-from: FreeBSD
Sync ndis(4) and tools with FreeBSD and hook it all back into the build. It supports NDIS 5.x drivers, that means Windows XP and Server 2003. The latter is an educated guess by me. No testing has actually been done using Windows Server 2003 drivers. It is tested on i386 with the following PCI adapters: * D-Link DWL-G520+ (Texas Instruments ACX111 chip), aka acx(4). * Linksys WMP600N (Ralink RT2860 chip). * Planex GW-DS54GR (Realtek RTL8185 chip) which was kindly donated by sephe. Thanks to Max Herrgard <herrgard@gmail.com> for testing it on x86_64 with a CNet CWP-854 (Ralink RT2561T chip), aka ral(4). Note that this port has the following caveats: * PCI adapters need hw.ioapic_enable=0 in /boot/loader.conf but worked great then. Without it, the box will completely freeze after a while. This has been observed on both my own testing box as well as on a different box by Max Herrgard. The cause is yet unknown. :-( * PC Card adapters are untested (they might just work). * USB adapters are not yet stable at all. Panics might ensue. Taken-from: FreeBSD