Index: head/UPDATING =================================================================== --- head/UPDATING (revision 348184) +++ head/UPDATING (revision 348185) @@ -1,2061 +1,2055 @@ 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 COMMON ITEMS: section later in the file. These instructions assume that you basically know what you are doing. If not, then please consult the FreeBSD handbook: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: FreeBSD 13.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of system primitives, and encourage loud failure through extra sanity checking and fail stop semantics. They also substantially impact system performance. If you want to do performance measurement, benchmarking, and optimization, you'll want to turn them off. This includes various WITNESS- related kernel options, INVARIANTS, malloc debugging flags in userland, and various verbose features in the kernel. Many developers choose to disable these features on build machines to maximize performance. (To completely disable malloc debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20190517: - For users of mergemaster, after recent changes to locations of - master.passwd and group in the source tree mergemaster needs to be - updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster - and run `make install'. - 20190513: User-wired pages now have their own counter, vm.stats.vm.v_user_wire_count. The vm.max_wired sysctl was renamed to vm.max_user_wired and changed from an unsigned int to an unsigned long. bhyve VMs wired with the -S are now subject to the user wiring limit; the vm.max_user_wired sysctl may need to be tuned to avoid running into the limit. 20190507: The IPSEC option has been removed from GENERIC. Users requiring ipsec(4) must now load the ipsec(4) kernel module. 20190507: The tap(4) driver has been folded into tun(4), and the module has been renamed to tuntap. You should update any kld_load="if_tap" or kld_load="if_tun" entries in /etc/rc.conf, if_tap_load="YES" or if_tun_load="YES" entries in /boot/loader.conf to load the if_tuntap module instead, and "device tap" or "device tun" entries in kernel config files to select the tuntap device instead. 20190418: The following knobs have been added related to tradeoffs between safe use of the random device and availability in the absence of entropy: kern.random.initial_seeding.bypass_before_seeding: tunable; set non-zero to bypass the random device prior to seeding, or zero to block random requests until the random device is initially seeded. For now, set to 1 (unsafe) by default to restore pre-r346250 boot availability properties. kern.random.initial_seeding.read_random_bypassed_before_seeding: read-only diagnostic sysctl that is set when bypass is enabled and read_random(9) is bypassed, to enable programmatic handling of this initial condition, if desired. kern.random.initial_seeding.arc4random_bypassed_before_seeding: Similar to the above, but for for arc4random(9) initial seeding. kern.random.initial_seeding.disable_bypass_warnings: tunable; set non-zero to disable warnings in dmesg when the same conditions are met as for the diagnostic sysctls above. Defaults to zero, i.e., produce warnings in dmesg when the conditions are met. 20190416: The loadable random module KPI has changed; the random_infra_init() routine now requires a 3rd function pointer for a bool (*)(void) method that returns true if the random device is seeded (and therefore unblocked). 20190404: r345895 reverts r320698. This implies that an nfsuserd(8) daemon built from head sources between r320757 (July 6, 2017) and r338192 (Aug. 22, 2018) will not work unless the "-use-udpsock" is added to the command line. nfsuserd daemons built from head sources that are post-r338192 are not affected and should continue to work. 20190320: The fuse(4) module has been renamed to fusefs(4) for consistency with other filesystems. You should update any kld_load="fuse" entries in /etc/rc.conf, fuse_load="YES" entries in /boot/loader.conf, and "options FUSE" entries in kernel config files. 20190304: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 8.0.0. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20190226: geom_uzip(4) depends on the new module xz. If geom_uzip is statically compiled into your custom kernel, add 'device xz' statement to the kernel config. 20190219: drm and drm2 have been removed from the tree. Please see https://wiki.freebsd.org/Graphics for the latest information on migrating to the drm ports. 20190131: Iflib is no longer unconditionally compiled into the kernel. Drivers using iflib and statically compiled into the kernel, now require the 'device iflib' config option. For the same drivers loaded as modules on kernels not having 'device iflib', the iflib.ko module is loaded automatically. 20190125: The IEEE80211_AMPDU_AGE and AH_SUPPORT_AR5416 kernel configuration options no longer exist since r343219 and r343427 respectively; nothing uses them, so they should be just removed from custom kernel config files. 20181230: r342635 changes the way efibootmgr(8) works by requiring users to add the -b (bootnum) parameter for commands where the bootnum was previously specified with each option. For example 'efibootmgr -B 0001' is now 'efibootmgr -B -b 0001'. 20181220: r342286 modifies the NFSv4 server so that it obeys vfs.nfsd.nfs_privport in the same as it is applied to NFSv2 and 3. This implies that NFSv4 servers that have vfs.nfsd.nfs_privport set will only allow mounts from clients using a reserved port#. Since both the FreeBSD and Linux NFSv4 clients use reserved port#s by default, this should not affect most NFSv4 mounts. 20181219: The XLP config has been removed. We can't support 64-bit atomics in this kernel because it is running in 32-bit mode. XLP users must transition to running a 64-bit kernel (XLP64 or XLPN32). The mips GXEMUL support has been removed from FreeBSD. MALTA* + qemu is the preferred emulator today and we don't need two different ones. The old sibyte / swarm / Broadcom BCM1250 support has been removed from the mips port. 20181211: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 7.0.1. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20181211: Remove the timed and netdate programs from the base tree. Setting the time with these daemons has been obsolete for over a decade. 20181126: On amd64, arm64 and armv7 (architectures that install LLVM's ld.lld linker as /usr/bin/ld) GNU ld is no longer installed as ld.bfd, as it produces broken binaries when ifuncs are in use. Users needing GNU ld should install the binutils port or package. 20181123: The BSD crtbegin and crtend code has been enabled by default. It has had extensive testing on amd64, arm64, and i386. It can be disabled by building a world with -DWITHOUT_BSD_CRTBEGIN. 20181115: The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue) has been converted to a port (misc/ctm) and will be removed from FreeBSD-13. It is available as a package (ctm) for all supported FreeBSD versions. 20181110: The default newsyslog.conf(5) file has been changed to only include files in /etc/newsyslog.conf.d/ and /usr/local/etc/newsyslog.conf.d/ if the filenames end in '.conf' and do not begin with a '.'. You should check the configuration files in these two directories match this naming convention. You can verify which configuration files are being included using the command: $ newsyslog -Nrv 20181015: Ports for the DRM modules have been simplified. Now, amd64 users should just install the drm-kmod port. All others should install drm-legacy-kmod. Graphics hardware that's newer than about 2010 usually works with drm-kmod. For hardware older than 2013, however, some users will need to use drm-legacy-kmod if drm-kmod doesn't work for them. Hardware older than 2008 usually only works in drm-legacy-kmod. The graphics team can only commit to hardware made since 2013 due to the complexity of the market and difficulty to test all the older cards effectively. If you have hardware supported by drm-kmod, you are strongly encouraged to use that as you will get better support. Other than KPI chasing, drm-legacy-kmod will not be updated. As outlined elsewhere, the drm and drm2 modules will be eliminated from the src base soon (with a limited exception for arm). Please update to the package asap and report any issues to x11@freebsd.org. Generally, anybody using the drm*-kmod packages should add WITHOUT_DRM_MODULE=t and WITHOUT_DRM2_MODULE=t to avoid nasty cross-threading surprises, especially with automatic driver loading from X11 startup. These will become the defaults in 13-current shortly. 20181012: The ixlv(4) driver has been renamed to iavf(4). As a consequence, custom kernel and module loading configuration files must be updated accordingly. Moreover, interfaces previous presented as ixlvN to the system are now exposed as iavfN and network configuration files must be adjusted as necessary. 20181009: OpenSSL has been updated to version 1.1.1. This update included additional various API changes throughout the base system. It is important to rebuild third-party software after upgrading. The value of __FreeBSD_version has been bumped accordingly. 20181006: The legacy DRM modules and drivers have now been added to the loader's module blacklist, in favor of loading them with kld_list in rc.conf(5). The module blacklist may be overridden with the loader.conf(5) 'module_blacklist' variable, but loading them via rc.conf(5) is strongly encouraged. 20181002: The cam(4) based nda(4) driver will be used over nvd(4) by default on powerpc64. You may set 'options NVME_USE_NVD=1' in your kernel conf or loader tunable 'hw.nvme.use_nvd=1' if you wish to use the existing driver. Make sure to edit /boot/etc/kboot.conf and fstab to use the nda device name. 20180913: Reproducible build mode is now on by default, in preparation for FreeBSD 12.0. This eliminates build metadata such as the user, host, and time from the kernel (and uname), unless the working tree corresponds to a modified checkout from a version control system. The previous behavior can be obtained by setting the /etc/src.conf knob WITHOUT_REPRODUCIBLE_BUILD. 20180826: The Yarrow CSPRNG has been removed from the kernel as it has not been supported by its designers since at least 2003. Fortuna has been the default since FreeBSD-11. 20180822: devctl freeze/thaw have gone into the tree, the rc scripts have been updated to use them and devmatch has been changed. You should update kernel, userland and rc scripts all at the same time. 20180818: The default interpreter has been switched from 4th to Lua. LOADER_DEFAULT_INTERP, documented in build(7), will override the default interpreter. If you have custom FORTH code you will need to set LOADER_DEFAULT_INTERP=4th (valid values are 4th, lua or simp) in src.conf for the build. This will create default hard links between loader and loader_4th instead of loader and loader_lua, the new default. If you are using UEFI it will create the proper hard link to loader.efi. bhyve uses userboot.so. It remains 4th-only until some issues are solved regarding coexisting with multiple versions of FreeBSD are resolved. 20180815: ls(1) now respects the COLORTERM environment variable used in other systems and software to indicate that a colored terminal is both supported and desired. If ls(1) is suddenly emitting colors, they may be disabled again by either removing the unwanted COLORTERM from your environment, or using `ls --color=never`. The ls(1) specific CLICOLOR may not be observed in a future release. 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 BootXXXX environment variable to determine if a specific kernel or root partition was specified. XXXX is derived from BootCurrent. efibootmgr(8) manages these standard UEFI variables. 20180720: zfsloader's functionality has now been folded into loader. 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 frame buffer 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 frame buffer are that u-boot will expose as an EFI frame buffer. 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. Do not skip the "mergemaster -Fp" step before installworld, as described in the update procedures near the bottom of this document. Also, rc.d/ntpd now starts ntpd(8) as user ntpd if the new mac_ntpd(4) policy is available, unless ntpd_flags or the ntp config file contain options that change file/dir locations. When such options (e.g., "statsdir" or "crypto") are used, ntpd can still be run as non-root by setting ntpd_user=ntpd in rc.conf, after taking steps to ensure that all required files/dirs are accessible by the ntpd user. 20180717: Big endian arm support has been removed. 20180711: The static environment setup in kernel configs is no longer mutually exclusive with the loader(8) environment by default. In order to restore the previous default behavior of disabling the loader(8) environment if a static environment is present, you must specify loader_env.disabled=1 in the static environment. 20180705: The ABI of syscalls used by management tools like sockstat and netstat has been broken to allow 32-bit binaries to work on 64-bit kernels without modification. These programs will need to match the kernel in order to function. External programs may require minor modifications to accommodate a change of type in structures from pointers to 64-bit virtual addresses. 20180702: On i386 and amd64 atomics are now inlined. Out of tree modules using atomics will need to be rebuilt. 20180701: The '%I' format in the kern.corefile sysctl limits the number of core files that a process can generate to the number stored in the debug.ncores sysctl. The '%I' format is replaced by the single digit index. Previously, if all indexes were taken the kernel would overwrite only a core file with the highest index in a filename. Currently the system will create a new core file if there is a free index or if all slots are taken it will overwrite the oldest one. 20180630: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 6.0.1. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20180628: r335753 introduced a new quoting method. However, etc/devd/devmatch.conf needed to be changed to work with it. This change was made with r335763 and requires a mergemaster / etcupdate / etc to update the installed file. 20180612: r334930 changed the interface between the NFS modules, so they all need to be rebuilt. r335018 did a __FreeBSD_version bump for this. 20180530: As of r334391 lld is the default amd64 system linker; it is installed as /usr/bin/ld. Kernel build workarounds (see 20180510 entry) are no longer necessary. 20180530: The kernel / userland interface for devinfo changed, so you'll need a new kernel and userland as a pair for it to work (rebuilding lib/libdevinfo is all that's required). devinfo and devmatch will not work, but everything else will when there's a mismatch. 20180523: The on-disk format for hwpmc callchain records has changed to include threadid corresponding to a given record. This changes the field offsets and thus requires that libpmcstat be rebuilt before using a kernel later than r334108. 20180517: The vxge(4) driver has been removed. This driver was introduced into HEAD one week before the Exar left the Ethernet market and is not known to be used. If you have device vxge in your kernel config file it must be removed. 20180510: The amd64 kernel now requires a ld that supports ifunc to produce a working kernel, either lld or a newer binutils. lld is built by default on amd64, and the 'buildkernel' target uses it automatically. However, it is not the default linker, so building the kernel the traditional way requires LD=ld.lld on the command line (or LD=/usr/local/bin/ld for binutils port/package). lld will soon be default, and this requirement will go away. NOTE: As of r334391 lld is the default system linker on amd64, and no workaround is necessary. 20180508: The nxge(4) driver has been removed. This driver was for PCI-X 10g cards made by s2io/Neterion. The company was acquired by Exar and no longer sells or supports Ethernet products. If you have device nxge in your kernel config file it must be removed. 20180504: The tz database (tzdb) has been updated to 2018e. This version more correctly models time stamps in time zones with negative DST such as Europe/Dublin (from 1971 on), Europe/Prague (1946/7), and Africa/Windhoek (1994/2017). This does not affect the UT offsets, only time zone abbreviations and the tm_isdst flag. 20180502: The ixgb(4) driver has been removed. This driver was for an early and uncommon legacy PCI 10GbE for a single ASIC, Intel 82597EX. Intel quickly shifted to the long lived ixgbe family. If you have device ixgb in your kernel config file it must be removed. 20180501: The lmc(4) driver has been removed. This was a WAN interface card that was already reportedly rare in 2003, and had an ambiguous license. If you have device lmc in your kernel config file it must be removed. 20180413: Support for Arcnet networks has been removed. If you have device arcnet or device cm in your kernel config file they must be removed. 20180411: 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 log messages. The main benefit of using RFC 5424 is that clients may now send log messages with timestamps containing year numbers, microseconds and time zone offsets. Similarly, the syslog(3) C library function has been altered to send RFC 5424 formatted messages to the local system logging daemon. On systems using syslogd(8), this change should have no negative impact, as long as syslogd(8) and the C library are updated at the same time. On systems using a different system logging daemon, it may be necessary to make configuration adjustments, depending on the software used. When using syslog-ng, add the 'syslog-protocol' flag to local input sources to enable parsing of RFC 5424 formatted messages: source src { unix-dgram("/var/run/log" flags(syslog-protocol)); } When using rsyslog, disable the 'SysSock.UseSpecialParser' option of the 'imuxsock' module to let messages be processed by the regular RFC 3164/5424 parsing pipeline: module(load="imuxsock" SysSock.UseSpecialParser="off") Do note that these changes only affect communication between local applications and syslogd(8). The format that syslogd(8) uses to store messages on disk or forward messages to other systems remains unchanged. syslogd(8) still uses RFC 3164 for these purposes. Options to customize this behaviour will be added in the future. Utilities that process log files stored in /var/log are thus expected to continue to function as before. __FreeBSD_version has been incremented to 1200061 to denote this change. 20180328: Support for token ring networks has been removed. If you have "device token" in your kernel config you should remove it. No device drivers supported token ring. 20180323: makefs was modified to be able to tag ISO9660 El Torito boot catalog entries as EFI instead of overloading the i386 tag as done previously. The amd64 mkisoimages.sh script used to build amd64 ISO images for release was updated to use this. This may mean that makefs must be updated before "make cdrom" can be run in the release directory. This should be as simple as: $ cd $SRCDIR/usr.sbin/makefs $ make depend all install 20180212: FreeBSD boot loader enhanced with Lua scripting. It's purely opt-in for now by building WITH_LOADER_LUA and WITHOUT_FORTH in /etc/src.conf. Co-existence for the transition period will come shortly. Booting is a complex environment and test coverage for Lua-enabled loaders has been thin, so it would be prudent to assume it might not work and make provisions for backup boot methods. 20180211: devmatch functionality has been turned on in devd. It will automatically load drivers for unattached devices. This may cause unexpected drivers to be loaded. Please report any problems to current@ and imp@freebsd.org. 20180114: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to 6.0.0. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20180110: LLVM's lld linker is now used as the FreeBSD/amd64 bootstrap linker. This means it is used to link the kernel and userland libraries and executables, but is not yet installed as /usr/bin/ld by default. To revert to ld.bfd as the bootstrap linker, in /etc/src.conf set WITHOUT_LLD_BOOTSTRAP=yes 20180110: On i386, pmtimer has been removed. Its functionality has been folded into apm. It was a no-op on ACPI in current for a while now (but was still needed on i386 in FreeBSD 11 and earlier). Users may need to remove it from kernel config files. 20180104: The use of RSS hash from the network card aka flowid has been disabled by default for lagg(4) as it's currently incompatible with the lacp and loadbalance protocols. This can be re-enabled by setting the following in loader.conf: net.link.lagg.default_use_flowid="1" 20180102: The SW_WATCHDOG option is no longer necessary to enable the hardclock-based software watchdog if no hardware watchdog is configured. As before, SW_WATCHDOG will cause the software watchdog to be enabled even if a hardware watchdog is configured. 20171215: r326887 fixes the issue described in the 20171214 UPDATING entry. r326888 flips the switch back to building GELI support always. 20171214: r362593 broke ZFS + GELI support for reasons unknown. However, it also broke ZFS support generally, so GELI has been turned off by default as the lesser evil in r326857. If you boot off ZFS and/or GELI, it might not be a good time to update. 20171125: PowerPC users must update loader(8) by rebuilding world before installing a new kernel, as the protocol connecting them has changed. Without the update, loader metadata will not be passed successfully to the kernel and users will have to enter their root partition at the kernel mountroot prompt to continue booting. Newer versions of loader can boot old kernels without issue. 20171110: The LOADER_FIREWIRE_SUPPORT build variable as been renamed to WITH/OUT_LOADER_FIREWIRE. LOADER_{NO_,}GELI_SUPPORT has been renamed to WITH/OUT_LOADER_GELI. 20171106: The naive and non-compliant support of posix_fallocate(2) in ZFS has been removed as of r325320. The system call now returns EINVAL when used on a ZFS file. Although the new behavior complies with the standard, some consumers are not prepared to cope with it. One known victim is lld prior to r325420. 20171102: Building in a FreeBSD src checkout will automatically create object directories now rather than store files in the current directory if 'make obj' was not ran. Calling 'make obj' is no longer necessary. This feature can be disabled by setting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf (not /etc/src.conf), or passing the option in the environment. 20171101: The default MAKEOBJDIR has changed from /usr/obj/ for native builds, and /usr/obj// for cross-builds, to a unified /usr/obj//. This behavior can be changed to the old format by setting WITHOUT_UNIFIED_OBJDIR=yes in /etc/src-env.conf, the environment, or with -DWITHOUT_UNIFIED_OBJDIR when building. The UNIFIED_OBJDIR option is a transitional feature that will be removed for 12.0 release; please migrate to the new format for any tools by looking up the OBJDIR used by 'make -V .OBJDIR' means rather than hardcoding paths. 20171028: The native-xtools target no longer installs the files by default to the OBJDIR. Use the native-xtools-install target with a DESTDIR to install to ${DESTDIR}/${NXTP} where NXTP defaults to /nxb-bin. 20171021: As part of the boot loader infrastructure cleanup, LOADER_*_SUPPORT options are changing from controlling the build if defined / undefined to controlling the build with explicit 'yes' or 'no' values. They will shift to WITH/WITHOUT options to match other options in the system. 20171010: libstand has turned into a private library for sys/boot use only. It is no longer supported as a public interface outside of sys/boot. 20171005: The arm port has split armv6 into armv6 and armv7. armv7 is now a valid TARGET_ARCH/MACHINE_ARCH setting. If you have an armv7 system and are running a kernel from before r324363, you will need to add MACHINE_ARCH=armv7 to 'make buildworld' to do a native build. 20171003: When building multiple kernels using KERNCONF, non-existent KERNCONF files will produce an error and buildkernel will fail. Previously missing KERNCONF files silently failed giving no indication as to why, only to subsequently discover during installkernel that the desired kernel was never built in the first place. 20170912: The default serial number format for CTL LUNs has changed. This will affect users who use /dev/diskid/* device nodes, or whose FibreChannel or iSCSI clients care about their LUNs' serial numbers. Users who require serial number stability should hardcode serial numbers in /etc/ctl.conf . 20170912: For 32-bit arm compiled for hard-float support, soft-floating point binaries now always get their shared libraries from LD_SOFT_LIBRARY_PATH (in the past, this was only used if /usr/libsoft also existed). Only users with a hard-float ld.so, but soft-float everything else should be affected. 20170826: The geli password typed at boot is now hidden. To restore the previous behavior, see geli(8) for configuration options. 20170825: Move PMTUD blackhole counters to TCPSTATS and remove them from bare sysctl values. Minor nit, but requires a rebuild of both world/kernel to complete. 20170814: "make check" behavior (made in ^/head@r295380) has been changed to execute from a limited sandbox, as opposed to executing from ${TESTSDIR}. Behavioral changes: - The "beforecheck" and "aftercheck" targets are now specified. - ${CHECKDIR} (added in commit noted above) has been removed. - Legacy behavior can be enabled by setting WITHOUT_MAKE_CHECK_USE_SANDBOX in src.conf(5) or the environment. If the limited sandbox mode is enabled, "make check" will execute "make distribution", then install, execute the tests, and clean up the sandbox if successful. The "make distribution" and "make install" targets are typically run as root to set appropriate permissions and ownership at installation time. The end-user should set "WITH_INSTALL_AS_USER" in src.conf(5) or the environment if executing "make check" with limited sandbox mode using an unprivileged user. 20170808: Since the switch to GPT disk labels, fsck for UFS/FFS has been unable to automatically find alternate superblocks. As of r322297, the information needed to find alternate superblocks has been moved to the end of the area reserved for the boot block. Filesystems created with a newfs of this vintage or later will create the recovery information. If you have a filesystem created prior to this change and wish to have a recovery block created for your filesystem, you can do so by running fsck in foreground mode (i.e., do not use the -p or -y options). As it starts, fsck will ask ``SAVE DATA TO FIND ALTERNATE SUPERBLOCKS'' to which you should answer yes. 20170728: As of r321665, an NFSv4 server configuration that services Kerberos mounts or clients that do not support the uid/gid in owner/owner_group string capability, must explicitly enable the nfsuserd daemon by adding nfsuserd_enable="YES" to the machine's /etc/rc.conf file. 20170722: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 5.0.0. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20170701: WITHOUT_RCMDS is now the default. Set WITH_RCMDS if you need the r-commands (rlogin, rsh, etc.) to be built with the base system. 20170625: The FreeBSD/powerpc platform now uses a 64-bit type for time_t. This is a very major ABI incompatible change, so users of FreeBSD/powerpc must be careful when performing source upgrades. It is best to run 'make installworld' from an alternate root system, either a live CD/memory stick, or a temporary root partition. Additionally, all ports must be recompiled. powerpc64 is largely unaffected, except in the case of 32-bit compatibility. All 32-bit binaries will be affected. 20170623: Forward compatibility for the "ino64" project have been committed. This will allow most new binaries to run on older kernels in a limited fashion. This prevents many of the common foot-shooting actions in the upgrade as well as the limited ability to roll back the kernel across the ino64 upgrade. Complicated use cases may not work properly, though enough simpler ones work to allow recovery in most situations. 20170620: Switch back to the BSDL dtc (Device Tree Compiler). Set WITH_GPL_DTC if you require the GPL compiler. 20170618: The internal ABI used for communication between the NFS kernel modules was changed by r320085, so __FreeBSD_version was bumped to ensure all the NFS related modules are updated together. 20170617: The ABI of struct event was changed by extending the data member to 64bit and adding ext fields. For upgrade, same precautions as for the entry 20170523 "ino64" must be followed. 20170531: The GNU roff toolchain has been removed from base. To render manpages which are not supported by mandoc(1), man(1) can fallback on GNU roff from ports (and recommends to install it). To render roff(7) documents, consider using GNU roff from ports or the heirloom doctools roff toolchain from ports via pkg install groff or via pkg install heirloom-doctools. 20170524: The ath(4) and ath_hal(4) modules now build piecemeal to allow for smaller runtime footprint builds. This is useful for embedded systems which only require one chipset support. If you load it as a module, make sure this is in /boot/loader.conf: if_ath_load="YES" This will load the HAL, all chip/RF backends and if_ath_pci. If you have if_ath_pci in /boot/loader.conf, ensure it is after if_ath or it will not load any HAL chipset support. If you want to selectively load things (eg on ye cheape ARM/MIPS platforms where RAM is at a premium) you should: * load ath_hal * load the chip modules in question * load ath_rate, ath_dfs * load ath_main * load if_ath_pci and/or if_ath_ahb depending upon your particular bus bind type - this is where probe/attach is done. For further comments/feedback, poke adrian@ . 20170523: The "ino64" 64-bit inode project has been committed, which extends a number of types to 64 bits. Upgrading in place requires care and adherence to the documented upgrade procedure. If using a custom kernel configuration ensure that the COMPAT_FREEBSD11 option is included (as during the upgrade the system will be running the ino64 kernel with the existing world). For the safest in-place upgrade begin by removing previous build artifacts via "rm -rf /usr/obj/*". Then, carefully follow the full procedure documented below under the heading "To rebuild everything and install it on the current system." Specifically, a reboot is required after installing the new kernel before installing world. While an installworld normally works by accident from multiuser after rebooting the proper kernel, there are many cases where this will fail across this upgrade and installworld from single user is required. 20170424: The NATM framework including the en(4), fatm(4), hatm(4), and patm(4) devices has been removed. Consumers should plan a migration before the end-of-life date for FreeBSD 11. 20170420: GNU diff has been replaced by a BSD licensed diff. Some features of GNU diff has not been implemented, if those are needed a newer version of GNU diff is available via the diffutils package under the gdiff name. 20170413: As of r316810 for ipfilter, keep frags is no longer assumed when keep state is specified in a rule. r316810 aligns ipfilter with documentation in man pages separating keep frags from keep state. This allows keep state to be specified without forcing keep frags and allows keep frags to be specified independently of keep state. To maintain previous behaviour, also specify keep frags with keep state (as documented in ipf.conf.5). 20170407: arm64 builds now use the base system LLD 4.0.0 linker by default, instead of requiring that the aarch64-binutils port or package be installed. To continue using aarch64-binutils, set CROSS_BINUTILS_PREFIX=/usr/local/aarch64-freebsd/bin . 20170405: The UDP optimization in entry 20160818 that added the sysctl net.inet.udp.require_l2_bcast has been reverted. L2 broadcast packets will no longer be treated as L3 broadcast packets. 20170331: Binds and sends to the loopback addresses, IPv6 and IPv4, will now use any explicitly assigned loopback address available in the jail instead of using the first assigned address of the jail. 20170329: The ctl.ko module no longer implements the iSCSI target frontend: cfiscsi.ko does instead. If building cfiscsi.ko as a kernel module, the module can be loaded via one of the following methods: - `cfiscsi_load="YES"` in loader.conf(5). - Add `cfiscsi` to `$kld_list` in rc.conf(5). - ctladm(8)/ctld(8), when compiled with iSCSI support (`WITH_ISCSI=yes` in src.conf(5)) Please see cfiscsi(4) for more details. 20170316: The mmcsd.ko module now additionally depends on geom_flashmap.ko. Also, mmc.ko and mmcsd.ko need to be a matching pair built from the same source (previously, the dependency of mmcsd.ko on mmc.ko was missing, but mmcsd.ko now will refuse to load if it is incompatible with mmc.ko). 20170315: The syntax of ipfw(8) named states was changed to avoid ambiguity. If you have used named states in the firewall rules, you need to modify them after installworld and before rebooting. Now named states must be prefixed with colon. 20170311: The old drm (sys/dev/drm/) drivers for i915 and radeon have been removed as the userland we provide cannot use them. The KMS version (sys/dev/drm2) supports the same hardware. 20170302: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 4.0.0. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20170221: The code that provides support for ZFS .zfs/ directory functionality has been reimplemented. It's not possible now to create a snapshot by mkdir under .zfs/snapshot/. That should be the only user visible change. 20170216: EISA bus support has been removed. The WITH_EISA option is no longer valid. 20170215: MCA bus support has been removed. 20170127: The WITH_LLD_AS_LD / WITHOUT_LLD_AS_LD build knobs have been renamed WITH_LLD_IS_LD / WITHOUT_LLD_IS_LD, for consistency with CLANG_IS_CC. 20170112: The EM_MULTIQUEUE kernel configuration option is deprecated now that the em(4) driver conforms to iflib specifications. 20170109: The igb(4), em(4) and lem(4) ethernet drivers are now implemented via IFLIB. If you have a custom kernel configuration that excludes em(4) but you use igb(4), you need to re-add em(4) to your custom configuration. 20161217: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.1. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20161124: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.0. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20161119: The layout of the pmap structure has changed for powerpc to put the pmap statistics at the front for all CPU variations. libkvm(3) and all tools that link against it need to be recompiled. 20161030: isl(4) and cyapa(4) drivers now require a new driver, chromebook_platform(4), to work properly on Chromebook-class hardware. On other types of hardware the drivers may need to be configured using device hints. Please see the corresponding manual pages for details. 20161017: The urtwn(4) driver was merged into rtwn(4) and now consists of rtwn(4) main module + rtwn_usb(4) and rtwn_pci(4) bus-specific parts. Also, firmware for RTL8188CE was renamed due to possible name conflict (rtwnrtl8192cU(B) -> rtwnrtl8192cE(B)) 20161015: GNU rcs has been removed from base. It is available as packages: - rcs: Latest GPLv3 GNU rcs version. - rcs57: Copy of the latest version of GNU rcs (GPLv2) before it was removed from base. 20161008: Use of the cc_cdg, cc_chd, cc_hd, or cc_vegas congestion control modules now requires that the kernel configuration contain the TCP_HHOOK option. (This option is included in the GENERIC kernel.) 20161003: The WITHOUT_ELFCOPY_AS_OBJCOPY src.conf(5) knob has been retired. ELF Tool Chain's elfcopy is always installed as /usr/bin/objcopy. 20160924: Relocatable object files with the extension of .So have been renamed to use an extension of .pico instead. The purpose of this change is to avoid a name clash with shared libraries on case-insensitive file systems. On those file systems, foo.So is the same file as foo.so. 20160918: GNU rcs has been turned off by default. It can (temporarily) be built again by adding WITH_RCS knob in src.conf. Otherwise, GNU rcs is available from packages: - rcs: Latest GPLv3 GNU rcs version. - rcs57: Copy of the latest version of GNU rcs (GPLv2) from base. 20160918: The backup_uses_rcs functionality has been removed from rc.subr. 20160908: The queue(3) debugging macro, QUEUE_MACRO_DEBUG, has been split into two separate components, QUEUE_MACRO_DEBUG_TRACE and QUEUE_MACRO_DEBUG_TRASH. Define both for the original QUEUE_MACRO_DEBUG behavior. 20160824: r304787 changed some ioctl interfaces between the iSCSI userspace programs and the kernel. ctladm, ctld, iscsictl, and iscsid must be rebuilt to work with new kernels. __FreeBSD_version has been bumped to 1200005. 20160818: The UDP receive code has been updated to only treat incoming UDP packets that were addressed to an L2 broadcast address as L3 broadcast packets. It is not expected that this will affect any standards-conforming UDP application. The new behaviour can be disabled by setting the sysctl net.inet.udp.require_l2_bcast to 0. 20160818: Remove the openbsd_poll system call. __FreeBSD_version has been bumped because of this. 20160708: The stable/11 branch has been created from head@r302406. 20160622: The libc stub for the pipe(2) system call has been replaced with a wrapper that calls the pipe2(2) system call and the pipe(2) system call is now only implemented by the kernels that include "options COMPAT_FREEBSD10" in their config file (this is the default). Users should ensure that this option is enabled in their kernel or upgrade userspace to r302092 before upgrading their kernel. 20160527: CAM will now strip leading spaces from SCSI disks' serial numbers. This will affect users who create UFS filesystems on SCSI disks using those disk's diskid device nodes. For example, if /etc/fstab previously contained a line like "/dev/diskid/DISK-%20%20%20%20%20%20%20ABCDEFG0123456", you should change it to "/dev/diskid/DISK-ABCDEFG0123456". Users of geom transforms like gmirror may also be affected. ZFS users should generally be fine. 20160523: The bitstring(3) API has been updated with new functionality and improved performance. But it is binary-incompatible with the old API. Objects built with the new headers may not be linked against objects built with the old headers. 20160520: The brk and sbrk functions have been removed from libc on arm64. Binutils from ports has been updated to not link to these functions and should be updated to the latest version before installing a new libc. 20160517: The armv6 port now defaults to hard float ABI. Limited support for running both hardfloat and soft float on the same system is available using the libraries installed with -DWITH_LIBSOFT. This has only been tested as an upgrade path for installworld and packages may fail or need manual intervention to run. New packages will be needed. To update an existing self-hosted armv6hf system, you must add TARGET_ARCH=armv6 on the make command line for both the build and the install steps. 20160510: Kernel modules compiled outside of a kernel build now default to installing to /boot/modules instead of /boot/kernel. Many kernel modules built this way (such as those in ports) already overrode KMODDIR explicitly to install into /boot/modules. However, manually building and installing a module from /sys/modules will now install to /boot/modules instead of /boot/kernel. 20160414: The CAM I/O scheduler has been committed to the kernel. There should be no user visible impact. This does enable NCQ Trim on ada SSDs. While the list of known rogues that claim support for this but actually corrupt data is believed to be complete, be on the lookout for data corruption. The known rogue list is believed to be complete: o Crucial MX100, M550 drives with MU01 firmware. o Micron M510 and M550 drives with MU01 firmware. o Micron M500 prior to MU07 firmware o Samsung 830, 840, and 850 all firmwares o FCCT M500 all firmwares Crucial has firmware http://www.crucial.com/usa/en/support-ssd-firmware with working NCQ TRIM. For Micron branded drives, see your sales rep for updated firmware. Black listed drives will work correctly because these drives work correctly so long as no NCQ TRIMs are sent to them. Given this list is the same as found in Linux, it's believed there are no other rogues in the market place. All other models from the above vendors work. To be safe, if you are at all concerned, you can quirk each of your drives to prevent NCQ from being sent by setting: kern.cam.ada.X.quirks="0x2" in loader.conf. If the drive requires the 4k sector quirk, set the quirks entry to 0x3. 20160330: The FAST_DEPEND build option has been removed and its functionality is now the one true way. The old mkdep(1) style of 'make depend' has been removed. See 20160311 for further details. 20160317: Resource range types have grown from unsigned long to uintmax_t. All drivers, and anything using libdevinfo, need to be recompiled. 20160311: WITH_FAST_DEPEND is now enabled by default for in-tree and out-of-tree builds. It no longer runs mkdep(1) during 'make depend', and the 'make depend' stage can safely be skipped now as it is auto ran when building 'make all' and will generate all SRCS and DPSRCS before building anything else. Dependencies are gathered at compile time with -MF flags kept in separate .depend files per object file. Users should run 'make cleandepend' once if using -DNO_CLEAN to clean out older stale .depend files. 20160306: On amd64, clang 3.8.0 can now insert sections of type AMD64_UNWIND into kernel modules. Therefore, if you load any kernel modules at boot time, please install the boot loaders after you install the kernel, but before rebooting, e.g.: make buildworld make buildkernel KERNCONF=YOUR_KERNEL_HERE make installkernel KERNCONF=YOUR_KERNEL_HERE make -C sys/boot install Then follow the usual steps, described in the General Notes section, below. 20160305: Clang, llvm, lldb and compiler-rt have been upgraded to 3.8.0. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20160301: The AIO subsystem is now a standard part of the kernel. The VFS_AIO kernel option and aio.ko kernel module have been removed. Due to stability concerns, asynchronous I/O requests are only permitted on sockets and raw disks by default. To enable asynchronous I/O requests on all file types, set the vfs.aio.enable_unsafe sysctl to a non-zero value. 20160226: The ELF object manipulation tool objcopy is now provided by the ELF Tool Chain project rather than by GNU binutils. It should be a drop-in replacement, with the addition of arm64 support. The (temporary) src.conf knob WITHOUT_ELFCOPY_AS_OBJCOPY knob may be set to obtain the GNU version if necessary. 20160129: Building ZFS pools on top of zvols is prohibited by default. That feature has never worked safely; it's always been prone to deadlocks. Using a zvol as the backing store for a VM guest's virtual disk will still work, even if the guest is using ZFS. Legacy behavior can be restored by setting vfs.zfs.vol.recursive=1. 20160119: The NONE and HPN patches has been removed from OpenSSH. They are still available in the security/openssh-portable port. 20160113: With the addition of ypldap(8), a new _ypldap user is now required during installworld. "mergemaster -p" can be used to add the user prior to installworld, as documented in the handbook. 20151216: The tftp loader (pxeboot) now uses the option root-path directive. As a consequence it no longer looks for a pxeboot.4th file on the tftp server. Instead it uses the regular /boot infrastructure as with the other loaders. 20151211: The code to start recording plug and play data into the modules has been committed. While the old tools will properly build a new kernel, a number of warnings about "unknown metadata record 4" will be produced for an older kldxref. To avoid such warnings, make sure to rebuild the kernel toolchain (or world). Make sure that you have r292078 or later when trying to build 292077 or later before rebuilding. 20151207: Debug data files are now built by default with 'make buildworld' and installed with 'make installworld'. This facilitates debugging but requires more disk space both during the build and for the installed world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes in src.conf(5). 20151130: r291527 changed the internal interface between the nfsd.ko and nfscommon.ko modules. As such, they must both be upgraded to-gether. __FreeBSD_version has been bumped because of this. 20151108: Add support for unicode collation strings leads to a change of order of files listed by ls(1) for example. To get back to the old behaviour, set LC_COLLATE environment variable to "C". Databases administrators will need to reindex their databases given collation results will be different. Due to a bug in install(1) it is recommended to remove the ancient locales before running make installworld. rm -rf /usr/share/locale/* 20151030: The OpenSSL has been upgraded to 1.0.2d. Any binaries requiring libcrypto.so.7 or libssl.so.7 must be recompiled. 20151020: Qlogic 24xx/25xx firmware images were updated from 5.5.0 to 7.3.0. Kernel modules isp_2400_multi and isp_2500_multi were removed and should be replaced with isp_2400 and isp_2500 modules respectively. 20151017: The build previously allowed using 'make -n' to not recurse into sub-directories while showing what commands would be executed, and 'make -n -n' to recursively show commands. Now 'make -n' will recurse and 'make -N' will not. 20151012: If you specify SENDMAIL_MC or SENDMAIL_CF in make.conf, mergemaster and etcupdate will now use this file. A custom sendmail.cf is now updated via this mechanism rather than via installworld. If you had excluded sendmail.cf in mergemaster.rc or etcupdate.conf, you may want to remove the exclusion or change it to "always install". /etc/mail/sendmail.cf is now managed the same way regardless of whether SENDMAIL_MC/SENDMAIL_CF is used. If you are not using SENDMAIL_MC/SENDMAIL_CF there should be no change in behavior. 20151011: Compatibility shims for legacy ATA device names have been removed. It includes ATA_STATIC_ID kernel option, kern.cam.ada.legacy_aliases and kern.geom.raid.legacy_aliases loader tunables, kern.devalias.* environment variables, /dev/ad* and /dev/ar* symbolic links. 20151006: Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.7.0. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using clang 3.5.0 or higher. 20150924: Kernel debug files have been moved to /usr/lib/debug/boot/kernel/, and renamed from .symbols to .debug. This reduces the size requirements on the boot partition or file system and provides consistency with userland debug files. When using the supported kernel installation method the /usr/lib/debug/boot/kernel directory will be renamed (to kernel.old) as is done with /boot/kernel. Developers wishing to maintain the historical behavior of installing debug files in /boot/kernel/ can set KERN_DEBUGDIR="" in src.conf(5). 20150827: The wireless drivers had undergone changes that remove the 'parent interface' from the ifconfig -l output. The rc.d network scripts used to check presence of a parent interface in the list, so old scripts would fail to start wireless networking. Thus, etcupdate(3) or mergemaster(8) run is required after kernel update, to update your rc.d scripts in /etc. 20150827: pf no longer supports 'scrub fragment crop' or 'scrub fragment drop-ovl' These configurations are now automatically interpreted as 'scrub fragment reassemble'. 20150817: Kernel-loadable modules for the random(4) device are back. To use them, the kernel must have device random options RANDOM_LOADABLE kldload(8) can then be used to load random_fortuna.ko or random_yarrow.ko. Please note that due to the indirect function calls that the loadable modules need to provide, the build-in variants will be slightly more efficient. The random(4) kernel option RANDOM_DUMMY has been retired due to unpopularity. It was not all that useful anyway. 20150813: The WITHOUT_ELFTOOLCHAIN_TOOLS src.conf(5) knob has been retired. Control over building the ELF Tool Chain tools is now provided by the WITHOUT_TOOLCHAIN knob. 20150810: The polarity of Pulse Per Second (PPS) capture events with the uart(4) driver has been corrected. Prior to this change the PPS "assert" event corresponded to the trailing edge of a positive PPS pulse and the "clear" event was the leading edge of the next pulse. As the width of a PPS pulse in a typical GPS receiver is on the order of 1 millisecond, most users will not notice any significant difference with this change. Anyone who has compensated for the historical polarity reversal by configuring a negative offset equal to the pulse width will need to remove that workaround. 20150809: The default group assigned to /dev/dri entries has been changed from 'wheel' to 'video' with the id of '44'. If you want to have access to the dri devices please add yourself to the video group with: # pw groupmod video -m $USER 20150806: The menu.rc and loader.rc files will now be replaced during upgrades. Please migrate local changes to menu.rc.local and loader.rc.local instead. 20150805: GNU Binutils versions of addr2line, c++filt, nm, readelf, size, strings and strip have been removed. The src.conf(5) knob WITHOUT_ELFTOOLCHAIN_TOOLS no longer provides the binutils tools. 20150728: As ZFS requires more kernel stack pages than is the default on some architectures e.g. i386, it now warns if KSTACK_PAGES is less than ZFS_MIN_KSTACK_PAGES (which is 4 at the time of writing). Please consider using 'options KSTACK_PAGES=X' where X is greater than or equal to ZFS_MIN_KSTACK_PAGES i.e. 4 in such configurations. 20150706: sendmail has been updated to 8.15.2. Starting with FreeBSD 11.0 and sendmail 8.15, sendmail uses uncompressed IPv6 addresses by default, i.e., they will not contain "::". For example, instead of ::1, it will be 0:0:0:0:0:0:0:1. This permits a zero subnet to have a more specific match, such as different map entries for IPv6:0:0 vs IPv6:0. This change requires that configuration data (including maps, files, classes, custom ruleset, etc.) must use the same format, so make certain such configuration data is upgrading. As a very simple check search for patterns like 'IPv6:[0-9a-fA-F:]*::' and 'IPv6::'. To return to the old behavior, set the m4 option confUSE_COMPRESSED_IPV6_ADDRESSES or the cf option UseCompressedIPv6Addresses. 20150630: The default kernel entropy-processing algorithm is now Fortuna, replacing Yarrow. Assuming you have 'device random' in your kernel config file, the configurations allow a kernel option to override this default. You may choose *ONE* of: options RANDOM_YARROW # Legacy /dev/random algorithm. options RANDOM_DUMMY # Blocking-only driver. If you have neither, you get Fortuna. For most people, read no further, Fortuna will give a /dev/random that works like it always used to, and the difference will be irrelevant. If you remove 'device random', you get *NO* kernel-processed entropy at all. This may be acceptable to folks building embedded systems, but has complications. Carry on reading, and it is assumed you know what you need. *PLEASE* read random(4) and random(9) if you are in the habit of tweaking kernel configs, and/or if you are a member of the embedded community, wanting specific and not-usual behaviour from your security subsystems. NOTE!! If you use RANDOM_DUMMY and/or have no 'device random', you will NOT have a functioning /dev/random, and many cryptographic features will not work, including SSH. You may also find strange behaviour from the random(3) set of library functions, in particular sranddev(3), srandomdev(3) and arc4random(3). The reason for this is that the KERN_ARND sysctl only returns entropy if it thinks it has some to share, and with RANDOM_DUMMY or no 'device random' this will never happen. 20150623: An additional fix for the issue described in the 20150614 sendmail entry below has been committed in revision 284717. 20150616: FreeBSD's old make (fmake) has been removed from the system. It is available as the devel/fmake port or via pkg install fmake. 20150615: The fix for the issue described in the 20150614 sendmail entry below has been committed in revision 284436. The work around described in that entry is no longer needed unless the default setting is overridden by a confDH_PARAMETERS configuration setting of '5' or pointing to a 512 bit DH parameter file. 20150614: ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support has been removed from atf.test.mk (included from bsd.test.mk). Please upgrade devel/atf and devel/kyua to version 0.20+ and adjust any calling code to work with Kyuafile and kyua. 20150614: The import of openssl to address the FreeBSD-SA-15:10.openssl security advisory includes a change which rejects handshakes with DH parameters below 768 bits. sendmail releases prior to 8.15.2 (not yet released), defaulted to a 512 bit DH parameter setting for client connections. To work around this interoperability, sendmail can be configured to use a 2048 bit DH parameter by: 1. Edit /etc/mail/`hostname`.mc 2. If a setting for confDH_PARAMETERS does not exist or exists and is set to a string beginning with '5', replace it with '2'. 3. If a setting for confDH_PARAMETERS exists and is set to a file path, create a new file with: openssl dhparam -out /path/to/file 2048 4. Rebuild the .cf file: cd /etc/mail/; make; make install 5. Restart sendmail: cd /etc/mail/; make restart A sendmail patch is coming, at which time this file will be updated. 20150604: Generation of legacy formatted entries have been disabled by default in pwd_mkdb(8), as all base system consumers of the legacy formatted entries were converted to use the new format by default when the new, machine independent format have been added and supported since FreeBSD 5.x. Please see the pwd_mkdb(8) manual page for further details. 20150525: Clang and llvm have been upgraded to 3.6.1 release. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using 3.5.0 or higher. 20150521: TI platform code switched to using vendor DTS files and this update may break existing systems running on Beaglebone, Beaglebone Black, and Pandaboard: - dtb files should be regenerated/reinstalled. Filenames are the same but content is different now - GPIO addressing was changed, now each GPIO bank (32 pins per bank) has its own /dev/gpiocX device, e.g. pin 121 on /dev/gpioc0 in old addressing scheme is now pin 25 on /dev/gpioc3. - Pandaboard: /etc/ttys should be updated, serial console device is now /dev/ttyu2, not /dev/ttyu0 20150501: soelim(1) from gnu/usr.bin/groff has been replaced by usr.bin/soelim. If you need the GNU extension from groff soelim(1), install groff from package: pkg install groff, or via ports: textproc/groff. 20150423: chmod, chflags, chown and chgrp now affect symlinks in -R mode as defined in symlink(7); previously symlinks were silently ignored. 20150415: The const qualifier has been removed from iconv(3) to comply with POSIX. The ports tree is aware of this from r384038 onwards. 20150416: Libraries specified by LIBADD in Makefiles must have a corresponding DPADD_ variable to ensure correct dependencies. This is now enforced in src.libnames.mk. 20150324: From legacy ata(4) driver was removed support for SATA controllers supported by more functional drivers ahci(4), siis(4) and mvs(4). Kernel modules ataahci and ataadaptec were removed completely, replaced by ahci and mvs modules respectively. 20150315: Clang, llvm and lldb have been upgraded to 3.6.0 release. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using 3.5.0 or higher. 20150307: The 32-bit PowerPC kernel has been changed to a position-independent executable. This can only be booted with a version of loader(8) newer than January 31, 2015, so make sure to update both world and kernel before rebooting. 20150217: If you are running a -CURRENT kernel since r273872 (Oct 30th, 2014), but before r278950, the RNG was not seeded properly. Immediately upgrade the kernel to r278950 or later and regenerate any keys (e.g. ssh keys or openssl keys) that were generated w/ a kernel from that range. This does not affect programs that directly used /dev/random or /dev/urandom. All userland uses of arc4random(3) are affected. 20150210: The autofs(4) ABI was changed in order to restore binary compatibility with 10.1-RELEASE. The automountd(8) daemon needs to be rebuilt to work with the new kernel. 20150131: The powerpc64 kernel has been changed to a position-independent executable. This can only be booted with a new version of loader(8), so make sure to update both world and kernel before rebooting. 20150118: Clang and llvm have been upgraded to 3.5.1 release. This is a bugfix only release, no new features have been added. Please see the 20141231 entry below for information about prerequisites and upgrading, if you are not already using 3.5.0. 20150107: ELF tools addr2line, elfcopy (strip), nm, size, and strings are now taken from the ELF Tool Chain project rather than GNU binutils. They should be drop-in replacements, with the addition of arm64 support. The WITHOUT_ELFTOOLCHAIN_TOOLS= knob may be used to obtain the binutils tools, if necessary. See 20150805 for updated information. 20150105: The default Unbound configuration now enables remote control using a local socket. Users who have already enabled the local_unbound service should regenerate their configuration by running "service local_unbound setup" as root. 20150102: The GNU texinfo and GNU info pages have been removed. To be able to view GNU info pages please install texinfo from ports. 20141231: Clang, llvm and lldb have been upgraded to 3.5.0 release. As of this release, a prerequisite for building clang, llvm and lldb is a C++11 capable compiler and C++11 standard library. This means that to be able to successfully build the cross-tools stage of buildworld, with clang as the bootstrap compiler, your system compiler or cross compiler should either be clang 3.3 or later, or gcc 4.8 or later, and your system C++ library should be libc++, or libdstdc++ from gcc 4.8 or later. On any standard FreeBSD 10.x or 11.x installation, where clang and libc++ are on by default (that is, on x86 or arm), this should work out of the box. On 9.x installations where clang is enabled by default, e.g. on x86 and powerpc, libc++ will not be enabled by default, so libc++ should be built (with clang) and installed first. If both clang and libc++ are missing, build clang first, then use it to build libc++. On 8.x and earlier installations, upgrade to 9.x first, and then follow the instructions for 9.x above. Sparc64 and mips users are unaffected, as they still use gcc 4.2.1 by default, and do not build clang. Many embedded systems are resource constrained, and will not be able to build clang in a reasonable time, or in some cases at all. In those cases, cross building bootable systems on amd64 is a workaround. This new version of clang introduces a number of new warnings, of which the following are most likely to appear: -Wabsolute-value This warns in two cases, for both C and C++: * When the code is trying to take the absolute value of an unsigned quantity, which is effectively a no-op, and almost never what was intended. The code should be fixed, if at all possible. If you are sure that the unsigned quantity can be safely cast to signed, without loss of information or undefined behavior, you can add an explicit cast, or disable the warning. * When the code is trying to take an absolute value, but the called abs() variant is for the wrong type, which can lead to truncation. If you want to disable the warning instead of fixing the code, please make sure that truncation will not occur, or it might lead to unwanted side-effects. -Wtautological-undefined-compare and -Wundefined-bool-conversion These warn when C++ code is trying to compare 'this' against NULL, while 'this' should never be NULL in well-defined C++ code. However, there is some legacy (pre C++11) code out there, which actively abuses this feature, which was less strictly defined in previous C++ versions. Squid and openjdk do this, for example. The warning can be turned off for C++98 and earlier, but compiling the code in C++11 mode might result in unexpected behavior; for example, the parts of the program that are unreachable could be optimized away. 20141222: The old NFS client and server (kernel options NFSCLIENT, NFSSERVER) kernel sources have been removed. The .h files remain, since some utilities include them. This will need to be fixed later. If "mount -t oldnfs ..." is attempted, it will fail. If the "-o" option on mountd(8), nfsd(8) or nfsstat(1) is used, the utilities will report errors. 20141121: The handling of LOCAL_LIB_DIRS has been altered to skip addition of directories to top level SUBDIR variable when their parent directory is included in LOCAL_DIRS. Users with build systems with such hierarchies and without SUBDIR entries in the parent directory Makefiles should add them or add the directories to LOCAL_DIRS. 20141109: faith(4) and faithd(8) have been removed from the base system. Faith has been obsolete for a very long time. 20141104: vt(4), the new console driver, is enabled by default. It brings support for Unicode and double-width characters, as well as support for UEFI and integration with the KMS kernel video drivers. You may need to update your console settings in /etc/rc.conf, most probably the keymap. During boot, /etc/rc.d/syscons will indicate what you need to do. vt(4) still has issues and lacks some features compared to syscons(4). See the wiki for up-to-date information: https://wiki.freebsd.org/Newcons If you want to keep using syscons(4), you can do so by adding the following line to /boot/loader.conf: kern.vty=sc 20141102: pjdfstest has been integrated into kyua as an opt-in test suite. Please see share/doc/pjdfstest/README for more details on how to execute it. 20141009: gperf has been removed from the base system for architectures that use clang. Ports that require gperf will obtain it from the devel/gperf port. 20140923: pjdfstest has been moved from tools/regression/pjdfstest to contrib/pjdfstest . 20140922: At svn r271982, The default linux compat kernel ABI has been adjusted to 2.6.18 in support of the linux-c6 compat ports infrastructure update. If you wish to continue using the linux-f10 compat ports, add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are encouraged to update their linux-compat packages to linux-c6 during their next update cycle. 20140729: The ofwfb driver, used to provide a graphics console on PowerPC when using vt(4), no longer allows mmap() of all physical memory. This will prevent Xorg on PowerPC with some ATI graphics cards from initializing properly unless x11-servers/xorg-server is updated to 1.12.4_8 or newer. 20140723: The xdev targets have been converted to using TARGET and TARGET_ARCH instead of XDEV and XDEV_ARCH. 20140719: The default unbound configuration has been modified to address issues with reverse lookups on networks that use private address ranges. If you use the local_unbound service, run "service local_unbound setup" as root to regenerate your configuration, then "service local_unbound reload" to load the new configuration. 20140709: The GNU texinfo and GNU info pages are not built and installed anymore, WITH_INFO knob has been added to allow to built and install them again. UPDATE: see 20150102 entry on texinfo's removal 20140708: The GNU readline library is now an INTERNALLIB - that is, it is statically linked into consumers (GDB and variants) in the base system, and the shared library is no longer installed. The devel/readline port is available for third party software that requires readline. 20140702: The Itanium architecture (ia64) has been removed from the list of known architectures. This is the first step in the removal of the architecture. 20140701: Commit r268115 has added NFSv4.1 server support, merged from projects/nfsv4.1-server. Since this includes changes to the internal interfaces between the NFS related modules, a full build of the kernel and modules will be necessary. __FreeBSD_version has been bumped. 20140629: The WITHOUT_VT_SUPPORT kernel config knob has been renamed WITHOUT_VT. (The other _SUPPORT knobs have a consistent meaning which differs from the behaviour controlled by this knob.) 20140619: Maximal length of the serial number in CTL was increased from 16 to 64 chars, that breaks ABI. All CTL-related tools, such as ctladm and ctld, need to be rebuilt to work with a new kernel. 20140606: The libatf-c and libatf-c++ major versions were downgraded to 0 and 1 respectively to match the upstream numbers. They were out of sync because, when they were originally added to FreeBSD, the upstream versions were not respected. These libraries are private and not yet built by default, so renumbering them should be a non-issue. However, unclean source trees will yield broken test programs once the operator executes "make delete-old-libs" after a "make installworld". Additionally, the atf-sh binary was made private by moving it into /usr/libexec/. Already-built shell test programs will keep the path to the old binary so they will break after "make delete-old" is run. If you are using WITH_TESTS=yes (not the default), wipe the object tree and rebuild from scratch to prevent spurious test failures. This is only needed once: the misnumbered libraries and misplaced binaries have been added to OptionalObsoleteFiles.inc so they will be removed during a clean upgrade. 20140512: Clang and llvm have been upgraded to 3.4.1 release. 20140508: We bogusly installed src.opts.mk in /usr/share/mk. This file should be removed to avoid issues in the future (and has been added to ObsoleteFiles.inc). 20140505: /etc/src.conf now affects only builds of the FreeBSD src tree. In the past, it affected all builds that used the bsd.*.mk files. The old behavior was a bug, but people may have relied upon it. To get this behavior back, you can .include /etc/src.conf from /etc/make.conf (which is still global and isn't changed). This also changes the behavior of incremental builds inside the tree of individual directories. Set MAKESYSPATH to ".../share/mk" to do that. Although this has survived make universe and some upgrade scenarios, other upgrade scenarios may have broken. At least one form of temporary breakage was fixed with MAKESYSPATH settings for buildworld as well... In cases where MAKESYSPATH isn't working with this setting, you'll need to set it to the full path to your tree. One side effect of all this cleaning up is that bsd.compiler.mk is no longer implicitly included by bsd.own.mk. If you wish to use COMPILER_TYPE, you must now explicitly include bsd.compiler.mk as well. 20140430: The lindev device has been removed since /dev/full has been made a standard device. __FreeBSD_version has been bumped. 20140424: The knob WITHOUT_VI was added to the base system, which controls building ex(1), vi(1), etc. Older releases of FreeBSD required ex(1) in order to reorder files share/termcap and didn't build ex(1) as a build tool, so building/installing with WITH_VI is highly advised for build hosts for older releases. This issue has been fixed in stable/9 and stable/10 in r277022 and r276991, respectively. 20140418: The YES_HESIOD knob has been removed. It has been obsolete for a decade. Please move to using WITH_HESIOD instead or your builds will silently lack HESIOD. 20140405: The uart(4) driver has been changed with respect to its handling of the low-level console. Previously the uart(4) driver prevented any process from changing the baudrate or the CLOCAL and HUPCL control flags. By removing the restrictions, operators can make changes to the serial console port without having to reboot. However, when getty(8) is started on the serial device that is associated with the low-level console, a misconfigured terminal line in /etc/ttys will now have a real impact. Before upgrading the kernel, make sure that /etc/ttys has the serial console device configured as 3wire without baudrate to preserve the previous behaviour. E.g: ttyu0 "/usr/libexec/getty 3wire" vt100 on secure 20140306: Support for libwrap (TCP wrappers) in rpcbind was disabled by default to improve performance. To re-enable it, if needed, run rpcbind with command line option -W. 20140226: Switched back to the GPL dtc compiler due to updates in the upstream dts files not being supported by the BSDL dtc compiler. You will need to rebuild your kernel toolchain to pick up the new compiler. Core dumps may result while building dtb files during a kernel build if you fail to do so. Set WITHOUT_GPL_DTC if you require the BSDL compiler. 20140216: Clang and llvm have been upgraded to 3.4 release. 20140216: The nve(4) driver has been removed. Please use the nfe(4) driver for NVIDIA nForce MCP Ethernet adapters instead. 20140212: An ABI incompatibility crept into the libc++ 3.4 import in r261283. This could cause certain C++ applications using shared libraries built against the previous version of libc++ to crash. The incompatibility has now been fixed, but any C++ applications or shared libraries built between r261283 and r261801 should be recompiled. 20140204: OpenSSH will now ignore errors caused by kernel lacking of Capsicum capability mode support. Please note that enabling the feature in kernel is still highly recommended. 20140131: OpenSSH is now built with sandbox support, and will use sandbox as the default privilege separation method. This requires Capsicum capability mode support in kernel. 20140128: The libelf and libdwarf libraries have been updated to newer versions from upstream. Shared library version numbers for these two libraries were bumped. Any ports or binaries requiring these two libraries should be recompiled. __FreeBSD_version is bumped to 1100006. 20140110: If a Makefile in a tests/ directory was auto-generating a Kyuafile instead of providing an explicit one, this would prevent such Makefile from providing its own Kyuafile in the future during NO_CLEAN builds. This has been fixed in the Makefiles but manual intervention is needed to clean an objdir if you use NO_CLEAN: # find /usr/obj -name Kyuafile | xargs rm -f 20131213: The behavior of gss_pseudo_random() for the krb5 mechanism has changed, for applications requesting a longer random string than produced by the underlying enctype's pseudo-random() function. In particular, the random string produced from a session key of enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will be different at the 17th octet and later, after this change. The counter used in the PRF+ construction is now encoded as a big-endian integer in accordance with RFC 4402. __FreeBSD_version is bumped to 1100004. 20131108: The WITHOUT_ATF build knob has been removed and its functionality has been subsumed into the more generic WITHOUT_TESTS. If you were using the former to disable the build of the ATF libraries, you should change your settings to use the latter. 20131025: The default version of mtree is nmtree which is obtained from NetBSD. The output is generally the same, but may vary slightly. If you found you need identical output adding "-F freebsd9" to the command line should do the trick. For the time being, the old mtree is available as fmtree. 20131014: libbsdyml has been renamed to libyaml and moved to /usr/lib/private. This will break ports-mgmt/pkg. Rebuild the port, or upgrade to pkg 1.1.4_8 and verify bsdyml not linked in, before running "make delete-old-libs": # make -C /usr/ports/ports-mgmt/pkg build deinstall install clean or # pkg install pkg; ldd /usr/local/sbin/pkg | grep bsdyml 20131010: The stable/10 branch has been created in subversion from head revision r256279. COMMON ITEMS: General Notes ------------- Avoid using make -j when upgrading. While generally safe, there are sometimes problems using -j to upgrade. If your upgrade fails with -j, please try again without -j. From time to time in the past there have been problems using -j with buildworld and/or installworld. This is especially true when upgrading between "distant" versions (eg one that cross a major release boundary or several minor releases, or when several months have passed on the -current branch). Sometimes, obscure build problems are the result of environment poisoning. This can happen because the make utility reads its environment when searching for values for global variables. To run your build attempts in an "environmental clean room", prefix all make commands with 'env -i '. See the env(1) manual page for more details. When upgrading from one major version to another it is generally best to upgrade to the latest code in the currently installed branch first, then do an upgrade to the new branch. This is the best-tested upgrade path, and has the highest probability of being successful. Please try this approach if you encounter problems with a major version upgrade. Since the stable 4.x branch point, one has generally been able to upgrade from anywhere in the most recent stable branch to head / current (or even the last couple of stable branches). See the top of this file when there's an exception. When upgrading a live system, having a root shell around before installing anything can help undo problems. Not having a root shell around can lead to problems if pam has changed too much from your starting point to allow continued authentication after the upgrade. This file should be read as a log of events. When a later event changes information of a prior event, the prior event should not be deleted. Instead, a pointer to the entry with the new information should be placed in the old entry. Readers of this file should also sanity check older entries before relying on them blindly. Authors of new entries should write them with this in mind. ZFS notes --------- When upgrading the boot ZFS pool to a new version, always follow these two steps: 1.) recompile and reinstall the ZFS boot loader and boot block (this is part of "make buildworld" and "make installworld") 2.) update the ZFS boot block on your boot drive The following example updates the ZFS boot block on the first partition (freebsd-boot) of a GPT partitioned drive ada0: "gpart bootcode -p /boot/gptzfsboot -i 1 ada0" Non-boot pools do not need these updates. To build a kernel ----------------- If you are updating from a prior version of FreeBSD (even one just a few days old), you should follow this procedure. It is the most failsafe as it uses a /usr/obj tree with a fresh mini-buildworld, make kernel-toolchain make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE To test a kernel once --------------------- If you just want to boot a kernel once (because you are not sure if it works, or if you want to boot a known bad kernel to provide debugging information) run make installkernel KERNCONF=YOUR_KERNEL_HERE KODIR=/boot/testkernel nextboot -k testkernel To rebuild everything and install it on the current system. ----------------------------------------------------------- # Note: sometimes if you are running current you gotta do more than # is listed here if you are upgrading from a really old current. make buildworld make buildkernel KERNCONF=YOUR_KERNEL_HERE make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] mergemaster -Fp [5] make installworld mergemaster -Fi [4] make delete-old [6] To cross-install current onto a separate partition -------------------------------------------------- # In this approach we use a separate partition to hold # current's root, 'usr', and 'var' directories. A partition # holding "/", "/usr" and "/var" should be about 2GB in # size. make buildworld make buildkernel KERNCONF=YOUR_KERNEL_HERE make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT} cp /etc/fstab ${CURRENT_ROOT}/etc/fstab # if newfs'd To upgrade in-place from stable to current ---------------------------------------------- make buildworld [9] make buildkernel KERNCONF=YOUR_KERNEL_HERE [8] make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] mergemaster -Fp [5] make installworld mergemaster -Fi [4] make delete-old [6] Make sure that you've read the UPDATING file to understand the tweaks to various things you need. At this point in the life cycle of current, things change often and you are on your own to cope. The defaults can also change, so please read ALL of the UPDATING entries. Also, if you are tracking -current, you must be subscribed to freebsd-current@freebsd.org. Make sure that before you update your sources that you have read and understood all the recent messages there. If in doubt, please track -stable which has much fewer pitfalls. [1] If you have third party modules, such as vmware, you should disable them at this point so they don't crash your system on reboot. [3] From the bootblocks, boot -s, and then do fsck -p mount -u / mount -a sh /etc/rc.d/zfs start # mount zfs filesystem, if needed cd src # full path to source adjkerntz -i # if CMOS is wall time Also, when doing a major release upgrade, it is required that you boot into single user mode to do the installworld. [4] Note: This step is non-optional. Failure to do this step can result in a significant reduction in the functionality of the system. Attempting to do it by hand is not recommended and those that pursue this avenue should read this file carefully, as well as the archives of freebsd-current and freebsd-hackers mailing lists for potential gotchas. The -U option is also useful to consider. See mergemaster(8) for more information. [5] Usually this step is a no-op. However, from time to time you may need to do this if you get unknown user in the following step. It never hurts to do it all the time. You may need to install a new mergemaster (cd src/usr.sbin/mergemaster && make install) after the buildworld before this step if you last updated from current before 20130425 or from -stable before 20130430. [6] This only deletes old files and directories. Old libraries can be deleted by "make delete-old-libs", but you have to make sure that no program is using those libraries anymore. [8] The new kernel must be able to run existing binaries used by an installworld. When upgrading across major versions, the new kernel's configuration must include the correct COMPAT_FREEBSD option for existing binaries (e.g. COMPAT_FREEBSD11 to run 11.x binaries). Failure to do so may leave you with a system that is hard to boot to recover. A GENERIC kernel will include suitable compatibility options to run binaries from older branches. Note that the ability to run binaries from unsupported branches is not guaranteed. Make sure that you merge any new devices from GENERIC since the last time you updated your kernel config file. Options also change over time, so you may need to adjust your custom kernels for these as well. [9] If CPUTYPE is defined in your /etc/make.conf, make sure to use the "?=" instead of the "=" assignment operator, so that buildworld can override the CPUTYPE if it needs to. MAKEOBJDIRPREFIX must be defined in an environment variable, and not on the command line, or in /etc/make.conf. buildworld will warn if it is improperly defined. FORMAT: This file contains a list, in reverse chronological order, of major breakages in tracking -current. It is not guaranteed to be a complete list of such breakages, and only contains entries since September 23, 2011. If you need to see UPDATING entries from before that date, you will need to fetch an UPDATING file from an older FreeBSD release. Copyright information: Copyright 1998-2009 M. Warner Losh. Redistribution, publication, translation and use, with or without modification, in full or in part, in any form or format of this document are permitted without further permission from the author. THIS DOCUMENT IS PROVIDED BY WARNER LOSH ``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 WARNER LOSH 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. Contact Warner Losh if you have any questions about your use of this document. $FreeBSD$ Index: head/etc/group =================================================================== --- head/etc/group (nonexistent) +++ head/etc/group (revision 348185) @@ -0,0 +1,36 @@ +# $FreeBSD$ +# +wheel:*:0:root +daemon:*:1: +kmem:*:2: +sys:*:3: +tty:*:4: +operator:*:5:root +mail:*:6: +bin:*:7: +news:*:8: +man:*:9: +games:*:13: +ftp:*:14: +staff:*:20: +sshd:*:22: +smmsp:*:25: +mailnull:*:26: +guest:*:31: +video:*:44: +bind:*:53: +unbound:*:59: +proxy:*:62: +authpf:*:63: +_pflogd:*:64: +_dhcp:*:65: +uucp:*:66: +dialer:*:68: +network:*:69: +audit:*:77: +www:*:80: +ntpd:*:123: +_ypldap:*:160: +hast:*:845: +nogroup:*:65533: +nobody:*:65534: Property changes on: head/etc/group ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/etc/master.passwd =================================================================== --- head/etc/master.passwd (nonexistent) +++ head/etc/master.passwd (revision 348185) @@ -0,0 +1,28 @@ +# $FreeBSD$ +# +root::0:0::0:0:Charlie &:/root:/bin/csh +toor:*:0:0::0:0:Bourne-again Superuser:/root: +daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin +operator:*:2:5::0:0:System &:/:/usr/sbin/nologin +bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin +tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin +kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin +news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin +man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin +smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin +mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin +bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin +unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin +proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin +_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin +uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico +pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin +auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin +www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin +ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin +_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin +hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin +nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin Property changes on: head/etc/master.passwd ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/etc/shells =================================================================== --- head/etc/shells (nonexistent) +++ head/etc/shells (revision 348185) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# +# List of acceptable shells for chpass(1). +# Ftpd will not allow users to connect who are not using +# one of these shells. + +/bin/sh +/bin/csh +/bin/tcsh Property changes on: head/etc/shells ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: head/lib/libc/gen/shells =================================================================== --- head/lib/libc/gen/shells (revision 348184) +++ head/lib/libc/gen/shells (nonexistent) @@ -1,9 +0,0 @@ -# $FreeBSD$ -# -# List of acceptable shells for chpass(1). -# Ftpd will not allow users to connect who are not using -# one of these shells. - -/bin/sh -/bin/csh -/bin/tcsh Property changes on: head/lib/libc/gen/shells ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libc/gen/master.passwd =================================================================== --- head/lib/libc/gen/master.passwd (revision 348184) +++ head/lib/libc/gen/master.passwd (nonexistent) @@ -1,28 +0,0 @@ -# $FreeBSD$ -# -root::0:0::0:0:Charlie &:/root:/bin/csh -toor:*:0:0::0:0:Bourne-again Superuser:/root: -daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin -operator:*:2:5::0:0:System &:/:/usr/sbin/nologin -bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin -tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin -kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin -games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin -news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin -man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin -sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin -smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin -mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin -bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin -unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin -proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin -_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin -_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin -uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico -pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin -auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin -www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin -ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin -_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin -hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin -nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin Property changes on: head/lib/libc/gen/master.passwd ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libc/gen/group =================================================================== --- head/lib/libc/gen/group (revision 348184) +++ head/lib/libc/gen/group (nonexistent) @@ -1,36 +0,0 @@ -# $FreeBSD$ -# -wheel:*:0:root -daemon:*:1: -kmem:*:2: -sys:*:3: -tty:*:4: -operator:*:5:root -mail:*:6: -bin:*:7: -news:*:8: -man:*:9: -games:*:13: -ftp:*:14: -staff:*:20: -sshd:*:22: -smmsp:*:25: -mailnull:*:26: -guest:*:31: -video:*:44: -bind:*:53: -unbound:*:59: -proxy:*:62: -authpf:*:63: -_pflogd:*:64: -_dhcp:*:65: -uucp:*:66: -dialer:*:68: -network:*:69: -audit:*:77: -www:*:80: -ntpd:*:123: -_ypldap:*:160: -hast:*:845: -nogroup:*:65533: -nobody:*:65534: Property changes on: head/lib/libc/gen/group ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libc/gen/Makefile.inc =================================================================== --- head/lib/libc/gen/Makefile.inc (revision 348184) +++ head/lib/libc/gen/Makefile.inc (revision 348185) @@ -1,559 +1,559 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 # $FreeBSD$ # machine-independent gen sources -.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen ${SRCTOP}/etc CONFS+= group master.passwd shells CONFSMODE_master.passwd= 600 SRCS+= __getosreldate.c \ __pthread_mutex_init_calloc_cb_stub.c \ __xuname.c \ _once_stub.c \ _pthread_stubs.c \ _rand48.c \ _spinlock_stub.c \ _thread_init.c \ alarm.c \ arc4random.c \ arc4random-compat.c \ arc4random_uniform.c \ assert.c \ auxv.c \ basename.c \ basename_compat.c \ cap_sandboxed.c \ check_utility_compat.c \ clock.c \ clock_getcpuclockid.c \ closedir.c \ confstr.c \ crypt.c \ ctermid.c \ daemon.c \ devname.c \ dirfd.c \ dirname.c \ dirname_compat.c \ disklabel.c \ dlfcn.c \ drand48.c \ dup3.c \ elf_utils.c \ erand48.c \ err.c \ errlst.c \ errno.c \ exec.c \ exect.c \ fdevname.c \ feature_present.c \ fmtcheck.c \ fmtmsg.c \ fnmatch.c \ fpclassify.c \ frexp.c \ fstab.c \ ftok.c \ fts.c \ ftw.c \ getbootfile.c \ getbsize.c \ getcap.c \ getcwd.c \ getdomainname.c \ getentropy.c \ getgrent.c \ getgrouplist.c \ gethostname.c \ getloadavg.c \ getlogin.c \ getmntinfo.c \ getnetgrent.c \ getosreldate.c \ getpagesize.c \ getpagesizes.c \ getpeereid.c \ getprogname.c \ getpwent.c \ getttyent.c \ getusershell.c \ getutxent.c \ getvfsbyname.c \ glob.c \ initgroups.c \ isatty.c \ isinf.c \ isnan.c \ jrand48.c \ lcong48.c \ libc_dlopen.c \ lockf.c \ lrand48.c \ mrand48.c \ nftw.c \ nice.c \ nlist.c \ nrand48.c \ opendir.c \ pause.c \ pmadvise.c \ popen.c \ posix_spawn.c \ psignal.c \ pututxline.c \ pw_scan.c \ raise.c \ readdir.c \ readpassphrase.c \ recvmmsg.c \ rewinddir.c \ scandir.c \ seed48.c \ seekdir.c \ semctl.c \ sendmmsg.c \ setdomainname.c \ sethostname.c \ setjmperr.c \ setmode.c \ setproctitle.c \ setprogname.c \ siginterrupt.c \ siglist.c \ signal.c \ sigsetops.c \ sleep.c \ srand48.c \ statvfs.c \ stringlist.c \ strtofflags.c \ sysconf.c \ sysctl.c \ sysctlbyname.c \ sysctlnametomib.c \ syslog.c \ telldir.c \ termios.c \ time.c \ times.c \ timespec_get.c \ timezone.c \ tls.c \ ttyname.c \ ttyslot.c \ ualarm.c \ ulimit.c \ uname.c \ usleep.c \ utime.c \ utxdb.c \ valloc.c \ wait.c \ wait3.c \ waitpid.c \ waitid.c \ wordexp.c .if ${MK_SYMVER} == yes SRCS+= devname-compat11.c \ fts-compat.c \ fts-compat11.c \ ftw-compat11.c \ getmntinfo-compat11.c \ glob-compat11.c \ nftw-compat11.c \ readdir-compat11.c \ scandir-compat11.c \ unvis-compat.c .endif CFLAGS.arc4random.c= -I${SRCTOP}/sys -I${SRCTOP}/sys/crypto/chacha20 .PATH: ${SRCTOP}/contrib/libc-pwcache SRCS+= pwcache.c pwcache.h .PATH: ${SRCTOP}/contrib/libc-vis CFLAGS+= -I${SRCTOP}/contrib/libc-vis SRCS+= unvis.c vis.c MISRCS+=modf.c CANCELPOINTS_SRCS=sem.c sem_new.c .for src in ${CANCELPOINTS_SRCS} SRCS+=cancelpoints_${src} CLEANFILES+=cancelpoints_${src} cancelpoints_${src}: ${LIBC_SRCTOP}/gen/${src} .NOMETA ln -sf ${.ALLSRC} ${.TARGET} .endfor SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map # machine-dependent gen sources .sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/gen/Makefile.inc" MAN+= alarm.3 \ arc4random.3 \ auxv.3 \ basename.3 \ cap_rights_get.3 \ cap_sandboxed.3 \ check_utility_compat.3 \ clock.3 \ clock_getcpuclockid.3 \ confstr.3 \ ctermid.3 \ daemon.3 \ devname.3 \ directory.3 \ dirname.3 \ dl_iterate_phdr.3 \ dladdr.3 \ dlinfo.3 \ dllockinit.3 \ dlopen.3 \ dup3.3 \ err.3 \ exec.3 \ feature_present.3 \ fmtcheck.3 \ fmtmsg.3 \ fnmatch.3 \ fpclassify.3 \ frexp.3 \ ftok.3 \ fts.3 \ ftw.3 \ getbootfile.3 \ getbsize.3 \ getcap.3 \ getcontext.3 \ getcwd.3 \ getdiskbyname.3 \ getdomainname.3 \ getentropy.3 \ getfsent.3 \ getgrent.3 \ getgrouplist.3 \ gethostname.3 \ getloadavg.3 \ getmntinfo.3 \ getnetgrent.3 \ getosreldate.3 \ getpagesize.3 \ getpagesizes.3 \ getpass.3 \ getpeereid.3 \ getprogname.3 \ getpwent.3 \ getttyent.3 \ getusershell.3 \ getutxent.3 \ getvfsbyname.3 \ glob.3 \ initgroups.3 \ isgreater.3 \ ldexp.3 \ lockf.3 \ makecontext.3 \ modf.3 \ nice.3 \ nlist.3 \ pause.3 \ popen.3 \ posix_spawn.3 \ posix_spawn_file_actions_addopen.3 \ posix_spawn_file_actions_init.3 \ posix_spawnattr_getflags.3 \ posix_spawnattr_getpgroup.3 \ posix_spawnattr_getschedparam.3 \ posix_spawnattr_getschedpolicy.3 \ posix_spawnattr_init.3 \ posix_spawnattr_getsigdefault.3 \ posix_spawnattr_getsigmask.3 \ psignal.3 \ pwcache.3 \ raise.3 \ rand48.3 \ readpassphrase.3 \ rfork_thread.3 \ scandir.3 \ sem_destroy.3 \ sem_getvalue.3 \ sem_init.3 \ sem_open.3 \ sem_post.3 \ sem_timedwait.3 \ sem_wait.3 \ setjmp.3 \ setmode.3 \ setproctitle.3 \ siginterrupt.3 \ signal.3 \ sigsetops.3 \ sleep.3 \ statvfs.3 \ stringlist.3 \ strtofflags.3 \ sysconf.3 \ sysctl.3 \ syslog.3 \ tcgetpgrp.3 \ tcgetsid.3 \ tcsendbreak.3 \ tcsetattr.3 \ tcsetpgrp.3 \ tcsetsid.3 \ time.3 \ times.3 \ timespec_get.3 \ timezone.3 \ ttyname.3 \ tzset.3 \ ualarm.3 \ ucontext.3 \ ulimit.3 \ uname.3 \ unvis.3 \ usleep.3 \ utime.3 \ valloc.3 \ vis.3 \ wordexp.3 MLINKS+=arc4random.3 arc4random_buf.3 \ arc4random.3 arc4random_uniform.3 MLINKS+=auxv.3 elf_aux_info.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 MLINKS+=devname.3 fdevname.3 MLINKS+=devname.3 fdevname_r.3 MLINKS+=directory.3 closedir.3 \ directory.3 dirfd.3 \ directory.3 fdclosedir.3 \ directory.3 fdopendir.3 \ directory.3 opendir.3 \ directory.3 readdir.3 \ directory.3 readdir_r.3 \ directory.3 rewinddir.3 \ directory.3 seekdir.3 \ directory.3 telldir.3 MLINKS+=dlopen.3 fdlopen.3 \ dlopen.3 dlclose.3 \ dlopen.3 dlerror.3 \ dlopen.3 dlfunc.3 \ dlopen.3 dlsym.3 \ dlopen.3 dlvsym.3 MLINKS+=err.3 err_set_exit.3 \ err.3 err_set_file.3 \ err.3 errc.3 \ err.3 errx.3 \ err.3 verr.3 \ err.3 verrc.3 \ err.3 verrx.3 \ err.3 vwarn.3 \ err.3 vwarnc.3 \ err.3 vwarnx.3 \ err.3 warnc.3 \ err.3 warn.3 \ err.3 warnx.3 MLINKS+=exec.3 execl.3 \ exec.3 execle.3 \ exec.3 execlp.3 \ exec.3 exect.3 \ exec.3 execv.3 \ exec.3 execvP.3 \ exec.3 execvp.3 MLINKS+=fpclassify.3 finite.3 \ fpclassify.3 finitef.3 \ fpclassify.3 isfinite.3 \ fpclassify.3 isinf.3 \ fpclassify.3 isnan.3 \ fpclassify.3 isnormal.3 MLINKS+=frexp.3 frexpf.3 \ frexp.3 frexpl.3 MLINKS+=fts.3 fts_children.3 \ fts.3 fts_close.3 \ fts.3 fts_open.3 \ fts.3 fts_read.3 \ fts.3 fts_set.3 \ fts.3 fts_set_clientptr.3 \ fts.3 fts_get_clientptr.3 \ fts.3 fts_get_stream.3 MLINKS+=ftw.3 nftw.3 MLINKS+=getcap.3 cgetcap.3 \ getcap.3 cgetclose.3 \ getcap.3 cgetent.3 \ getcap.3 cgetfirst.3 \ getcap.3 cgetmatch.3 \ getcap.3 cgetnext.3 \ getcap.3 cgetnum.3 \ getcap.3 cgetset.3 \ getcap.3 cgetstr.3 \ getcap.3 cgetustr.3 MLINKS+=getcwd.3 getwd.3 MLINKS+=getcontext.3 getcontextx.3 MLINKS+=getcontext.3 setcontext.3 MLINKS+=getdomainname.3 setdomainname.3 MLINKS+=getfsent.3 endfsent.3 \ getfsent.3 getfsfile.3 \ getfsent.3 getfsspec.3 \ getfsent.3 getfstype.3 \ getfsent.3 setfsent.3 \ getfsent.3 setfstab.3 \ getfsent.3 getfstab.3 MLINKS+=getgrent.3 endgrent.3 \ getgrent.3 getgrgid.3 \ getgrent.3 getgrnam.3 \ getgrent.3 setgrent.3 \ getgrent.3 setgroupent.3 \ getgrent.3 getgrent_r.3 \ getgrent.3 getgrnam_r.3 \ getgrent.3 getgrgid_r.3 MLINKS+=gethostname.3 sethostname.3 MLINKS+=getnetgrent.3 endnetgrent.3 \ getnetgrent.3 getnetgrent_r.3 \ getnetgrent.3 innetgr.3 \ getnetgrent.3 setnetgrent.3 MLINKS+=getprogname.3 setprogname.3 MLINKS+=getpwent.3 endpwent.3 \ getpwent.3 getpwnam.3 \ getpwent.3 getpwuid.3 \ getpwent.3 setpassent.3 \ getpwent.3 setpwent.3 \ getpwent.3 setpwfile.3 \ getpwent.3 getpwent_r.3 \ getpwent.3 getpwnam_r.3 \ getpwent.3 getpwuid_r.3 MLINKS+=getttyent.3 endttyent.3 \ getttyent.3 getttynam.3 \ getttyent.3 isdialuptty.3 \ getttyent.3 isnettty.3 \ getttyent.3 setttyent.3 MLINKS+=getusershell.3 endusershell.3 \ getusershell.3 setusershell.3 MLINKS+=getutxent.3 endutxent.3 \ getutxent.3 getutxid.3 \ getutxent.3 getutxline.3 \ getutxent.3 getutxuser.3 \ getutxent.3 pututxline.3 \ getutxent.3 setutxdb.3 \ getutxent.3 setutxent.3 \ getutxent.3 utmpx.3 MLINKS+=glob.3 globfree.3 MLINKS+=isgreater.3 isgreaterequal.3 \ isgreater.3 isless.3 \ isgreater.3 islessequal.3 \ isgreater.3 islessgreater.3 \ isgreater.3 isunordered.3 MLINKS+=ldexp.3 ldexpf.3 \ ldexp.3 ldexpl.3 MLINKS+=makecontext.3 swapcontext.3 MLINKS+=modf.3 modff.3 \ modf.3 modfl.3 MLINKS+=popen.3 pclose.3 MLINKS+=posix_spawn.3 posix_spawnp.3 \ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_addclose.3 \ posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_adddup2.3 \ posix_spawn_file_actions_init.3 posix_spawn_file_actions_destroy.3 \ posix_spawnattr_getflags.3 posix_spawnattr_setflags.3 \ posix_spawnattr_getpgroup.3 posix_spawnattr_setpgroup.3 \ posix_spawnattr_getschedparam.3 posix_spawnattr_setschedparam.3 \ posix_spawnattr_getschedpolicy.3 posix_spawnattr_setschedpolicy.3 \ posix_spawnattr_getsigdefault.3 posix_spawnattr_setsigdefault.3 \ posix_spawnattr_getsigmask.3 posix_spawnattr_setsigmask.3 \ posix_spawnattr_init.3 posix_spawnattr_destroy.3 MLINKS+=psignal.3 strsignal.3 \ psignal.3 sys_siglist.3 \ psignal.3 sys_signame.3 MLINKS+=pwcache.3 group_from_gid.3 \ pwcache.3 user_from_uid.3 MLINKS+=rand48.3 _rand48.3 \ rand48.3 drand48.3 \ rand48.3 erand48.3 \ rand48.3 jrand48.3 \ rand48.3 lcong48.3 \ rand48.3 lrand48.3 \ rand48.3 mrand48.3 \ rand48.3 nrand48.3 \ rand48.3 seed48.3 \ rand48.3 srand48.3 MLINKS+=recv.2 recvmmsg.2 MLINKS+=scandir.3 alphasort.3 MLINKS+=sem_open.3 sem_close.3 \ sem_open.3 sem_unlink.3 MLINKS+=sem_wait.3 sem_trywait.3 MLINKS+=sem_timedwait.3 sem_clockwait_np.3 MLINKS+=send.2 sendmmsg.2 MLINKS+=setjmp.3 _longjmp.3 \ setjmp.3 _setjmp.3 \ setjmp.3 longjmp.3 \ setjmp.3 longjmperr.3 \ setjmp.3 longjmperror.3 \ setjmp.3 siglongjmp.3 \ setjmp.3 sigsetjmp.3 MLINKS+=setmode.3 getmode.3 MLINKS+=setproctitle.3 setproctitle_fast.3 MLINKS+=sigsetops.3 sigaddset.3 \ sigsetops.3 sigdelset.3 \ sigsetops.3 sigemptyset.3 \ sigsetops.3 sigfillset.3 \ sigsetops.3 sigismember.3 MLINKS+=statvfs.3 fstatvfs.3 MLINKS+=stringlist.3 sl_add.3 \ stringlist.3 sl_find.3 \ stringlist.3 sl_free.3 \ stringlist.3 sl_init.3 MLINKS+=strtofflags.3 fflagstostr.3 MLINKS+=sysctl.3 sysctlbyname.3 \ sysctl.3 sysctlnametomib.3 MLINKS+=syslog.3 closelog.3 \ syslog.3 openlog.3 \ syslog.3 setlogmask.3 \ syslog.3 vsyslog.3 MLINKS+=tcsendbreak.3 tcdrain.3 \ tcsendbreak.3 tcflow.3 \ tcsendbreak.3 tcflush.3 MLINKS+=tcsetattr.3 cfgetispeed.3 \ tcsetattr.3 cfgetospeed.3 \ tcsetattr.3 cfmakeraw.3 \ tcsetattr.3 cfmakesane.3 \ tcsetattr.3 cfsetispeed.3 \ tcsetattr.3 cfsetospeed.3 \ tcsetattr.3 cfsetspeed.3 \ tcsetattr.3 tcgetattr.3 MLINKS+=ttyname.3 isatty.3 \ ttyname.3 ttyname_r.3 MLINKS+=tzset.3 tzsetwall.3 MLINKS+=unvis.3 strunvis.3 \ unvis.3 strunvisx.3 MLINKS+=vis.3 nvis.3 \ vis.3 snvis.3 \ vis.3 strenvisx.3 \ vis.3 strnunvis.3 \ vis.3 strnunvisx.3 \ vis.3 strnvis.3 \ vis.3 strnvisx.3 \ vis.3 strsenvisx.3 \ vis.3 strsnvis.3 \ vis.3 strsnvisx.3 \ vis.3 strsvis.3 \ vis.3 strsvisx.3 \ vis.3 strvis.3 \ vis.3 strvisx.3 \ vis.3 svis.3 MLINKS+=wordexp.3 wordfree.3 afterinstallconfig: .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd .if defined(NO_ROOT) && defined(METALOG) ( \ echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ ) | cat -l >> ${METALOG} .endif Index: head/usr.sbin/etcupdate/etcupdate.sh =================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh (revision 348184) +++ head/usr.sbin/etcupdate/etcupdate.sh (revision 348185) @@ -1,1803 +1,1801 @@ #!/bin/sh # # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # # Copyright (c) 2010-2013 Hudson River Trading LLC # Written by: John H. Baldwin # 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 AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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$ # This is a tool to manage updating files that are not updated as part # of 'make installworld' such as files in /etc. Unlike other tools, # this one is specifically tailored to assisting with mass upgrades. # To that end it does not require user intervention while running. # # Theory of operation: # # The most reliable way to update changes to files that have local # modifications is to perform a three-way merge between the original # unmodified file, the new version of the file, and the modified file. # This requires having all three versions of the file available when # performing an update. # # To that end, etcupdate uses a strategy where the current unmodified # tree is kept in WORKDIR/current and the previous unmodified tree is # kept in WORKDIR/old. When performing a merge, a new tree is built # if needed and then the changes are merged into DESTDIR. Any files # with unresolved conflicts after the merge are left in a tree rooted # at WORKDIR/conflicts. # # To provide extra flexibility, etcupdate can also build tarballs of # root trees that can later be used. It can also use a tarball as the # source of a new tree instead of building it from /usr/src. # Global settings. These can be adjusted by config files and in some # cases by command line options. # TODO: # - automatable conflict resolution # - a 'revert' command to make a file "stock" usage() { cat < etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile] etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] etcupdate status [-d workdir] [-D destdir] EOF exit 1 } # Used to write a message prepended with '>>>' to the logfile. log() { echo ">>>" "$@" >&3 } # Used for assertion conditions that should never happen. panic() { echo "PANIC:" "$@" exit 10 } # Used to write a warning message. These are saved to the WARNINGS # file with " " prepended. warn() { echo -n " " >> $WARNINGS echo "$@" >> $WARNINGS } # Output a horizontal rule using the passed-in character. Matches the # length used for Index lines in CVS and SVN diffs. # # $1 - character rule() { jot -b "$1" -s "" 67 } # Output a text description of a specified file's type. # # $1 - file pathname. file_type() { stat -f "%HT" $1 | tr "[:upper:]" "[:lower:]" } # Returns true (0) if a file exists # # $1 - file pathname. exists() { [ -e $1 -o -L $1 ] } # Returns true (0) if a file should be ignored, false otherwise. # # $1 - file pathname ignore() { local pattern - set -o noglob for pattern in $IGNORE_FILES; do set +o noglob case $1 in $pattern) return 0 ;; esac set -o noglob done # Ignore /.cshrc and /.profile if they are hardlinked to the # same file in /root. This ensures we only compare those # files once in that case. case $1 in /.cshrc|/.profile) if [ ${DESTDIR}$1 -ef ${DESTDIR}/root$1 ]; then return 0 fi ;; *) ;; esac return 1 } # Returns true (0) if the new version of a file should always be # installed rather than attempting to do a merge. # # $1 - file pathname always_install() { local pattern - set -o noglob for pattern in $ALWAYS_INSTALL; do set +o noglob case $1 in $pattern) return 0 ;; esac set -o noglob done return 1 } # Build a new tree # # $1 - directory to store new tree in build_tree() { local destdir dir file make make="make $MAKE_OPTIONS -DNO_FILEMON" log "Building tree at $1 with $make" mkdir -p $1/usr/obj >&3 2>&1 destdir=`realpath $1` if [ -n "$preworld" ]; then # Build a limited tree that only contains files that are # crucial to installworld. for file in $PREWORLD_FILES; do name=$(basename $file) mkdir -p $1/etc >&3 2>&1 || return 1 cp -p $SRCDIR/$file $1/etc/$name || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc && MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc && MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \ >&3 2>&1 || return 1 else (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1 fi chflags -R noschg $1 >&3 2>&1 || return 1 rm -rf $1/usr/obj >&3 2>&1 || return 1 # Purge auto-generated files. Only the source files need to # be updated after which these files are regenerated. rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \ return 1 # Remove empty files. These just clutter the output of 'diff'. find $1 -type f -size 0 -delete >&3 2>&1 || return 1 # Trim empty directories. find -d $1 -type d -empty -delete >&3 2>&1 || return 1 return 0 } # Generate a new NEWTREE tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a # source tree. extract_tree() { local files # If we have a tarball, extract that into the new directory. if [ -n "$tarball" ]; then files= if [ -n "$preworld" ]; then files="$PREWORLD_FILES" fi if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \ >&3 2>&1; then echo "Failed to extract new tree." remove_tree $NEWTREE exit 1 fi else if ! build_tree $NEWTREE; then echo "Failed to build new tree." remove_tree $NEWTREE exit 1 fi fi } # Forcefully remove a tree. Returns true (0) if the operation succeeds. # # $1 - path to tree remove_tree() { rm -rf $1 >&3 2>&1 if [ -e $1 ]; then chflags -R noschg $1 >&3 2>&1 rm -rf $1 >&3 2>&1 fi [ ! -e $1 ] } # Return values for compare() COMPARE_EQUAL=0 COMPARE_ONLYFIRST=1 COMPARE_ONLYSECOND=2 COMPARE_DIFFTYPE=3 COMPARE_DIFFLINKS=4 COMPARE_DIFFFILES=5 # Compare two files/directories/symlinks. Note that this does not # recurse into subdirectories. Instead, if two nodes are both # directories, they are assumed to be equivalent. # # Returns true (0) if the nodes are identical. If only one of the two # nodes are present, return one of the COMPARE_ONLY* constants. If # the nodes are different, return one of the COMPARE_DIFF* constants # to indicate the type of difference. # # $1 - first node # $2 - second node compare() { local first second # If the first node doesn't exist, then check for the second # node. Note that -e will fail for a symbolic link that # points to a missing target. if ! exists $1; then if exists $2; then return $COMPARE_ONLYSECOND else return $COMPARE_EQUAL fi elif ! exists $2; then return $COMPARE_ONLYFIRST fi # If the two nodes are different file types fail. first=`stat -f "%Hp" $1` second=`stat -f "%Hp" $2` if [ "$first" != "$second" ]; then return $COMPARE_DIFFTYPE fi # If both are symlinks, compare the link values. if [ -L $1 ]; then first=`readlink $1` second=`readlink $2` if [ "$first" = "$second" ]; then return $COMPARE_EQUAL else return $COMPARE_DIFFLINKS fi fi # If both are files, compare the file contents. if [ -f $1 ]; then if cmp -s $1 $2; then return $COMPARE_EQUAL else return $COMPARE_DIFFFILES fi fi # As long as the two nodes are the same type of file, consider # them equivalent. return $COMPARE_EQUAL } # Returns true (0) if the only difference between two regular files is a # change in the FreeBSD ID string. # # $1 - path of first file # $2 - path of second file fbsdid_only() { diff -qI '\$FreeBSD.*\$' $1 $2 >/dev/null 2>&1 } # This is a wrapper around compare that will return COMPARE_EQUAL if # the only difference between two regular files is a change in the # FreeBSD ID string. It only makes this adjustment if the -F flag has # been specified. # # $1 - first node # $2 - second node compare_fbsdid() { local cmp compare $1 $2 cmp=$? if [ -n "$FREEBSD_ID" -a "$cmp" -eq $COMPARE_DIFFFILES ] && \ fbsdid_only $1 $2; then return $COMPARE_EQUAL fi return $cmp } # Returns true (0) if a directory is empty. # # $1 - pathname of the directory to check empty_dir() { local contents contents=`ls -A $1` [ -z "$contents" ] } # Returns true (0) if one directories contents are a subset of the # other. This will recurse to handle subdirectories and compares # individual files in the trees. Its purpose is to quiet spurious # directory warnings for dryrun invocations. # # $1 - first directory (sub) # $2 - second directory (super) dir_subset() { local contents file if ! [ -d $1 -a -d $2 ]; then return 1 fi # Ignore files that are present in the second directory but not # in the first. contents=`ls -A $1` for file in $contents; do if ! compare $1/$file $2/$file; then return 1 fi if [ -d $1/$file ]; then if ! dir_subset $1/$file $2/$file; then return 1 fi fi done return 0 } # Returns true (0) if a directory in the destination tree is empty. # If this is a dryrun, then this returns true as long as the contents # of the directory are a subset of the contents in the old tree # (meaning that the directory would be empty in a non-dryrun when this # was invoked) to quiet spurious warnings. # # $1 - pathname of the directory to check relative to DESTDIR. empty_destdir() { if [ -n "$dryrun" ]; then dir_subset $DESTDIR/$1 $OLDTREE/$1 return fi empty_dir $DESTDIR/$1 } # Output a diff of two directory entries with the same relative name # in different trees. Note that as with compare(), this does not # recurse into subdirectories. If the nodes are identical, nothing is # output. # # $1 - first tree # $2 - second tree # $3 - node name # $4 - label for first tree # $5 - label for second tree diffnode() { local first second file old new diffargs if [ -n "$FREEBSD_ID" ]; then diffargs="-I \\\$FreeBSD.*\\\$" else diffargs="" fi compare_fbsdid $1/$3 $2/$3 case $? in $COMPARE_EQUAL) ;; $COMPARE_ONLYFIRST) echo echo "Removed: $3" echo ;; $COMPARE_ONLYSECOND) echo echo "Added: $3" echo ;; $COMPARE_DIFFTYPE) first=`file_type $1/$3` second=`file_type $2/$3` echo echo "Node changed from a $first to a $second: $3" echo ;; $COMPARE_DIFFLINKS) first=`readlink $1/$file` second=`readlink $2/$file` echo echo "Link changed: $file" rule "=" echo "-$first" echo "+$second" echo ;; $COMPARE_DIFFFILES) echo "Index: $3" rule "=" diff -u $diffargs -L "$3 ($4)" $1/$3 -L "$3 ($5)" $2/$3 ;; esac } # Run one-off commands after an update has completed. These commands # are not tied to a specific file, so they cannot be handled by # post_install_file(). post_update() { local args # None of these commands should be run for a pre-world update. if [ -n "$preworld" ]; then return fi # If /etc/localtime exists and is not a symlink and /var/db/zoneinfo # exists, run tzsetup -r to refresh /etc/localtime. if [ -f ${DESTDIR}/etc/localtime -a \ ! -L ${DESTDIR}/etc/localtime ]; then if [ -f ${DESTDIR}/var/db/zoneinfo ]; then if [ -n "${DESTDIR}" ]; then args="-C ${DESTDIR}" else args="" fi log "tzsetup -r ${args}" if [ -z "$dryrun" ]; then tzsetup -r ${args} >&3 2>&1 fi else warn "Needs update: /etc/localtime (required" \ "manual update via tzsetup(8))" fi fi } # Create missing parent directories of a node in a target tree # preserving the owner, group, and permissions from a specified # template tree. # # $1 - template tree # $2 - target tree # $3 - pathname of the node (relative to both trees) install_dirs() { local args dir dir=`dirname $3` # Nothing to do if the parent directory exists. This also # catches the degenerate cases when the path is just a simple # filename. if [ -d ${2}$dir ]; then return 0 fi # If non-directory file exists with the desired directory # name, then fail. if exists ${2}$dir; then # If this is a dryrun and we are installing the # directory in the DESTDIR and the file in the DESTDIR # matches the file in the old tree, then fake success # to quiet spurious warnings. if [ -n "$dryrun" -a "$2" = "$DESTDIR" ]; then if compare $OLDTREE/$dir $DESTDIR/$dir; then return 0 fi fi args=`file_type ${2}$dir` warn "Directory mismatch: ${2}$dir ($args)" return 1 fi # Ensure the parent directory of the directory is present # first. if ! install_dirs $1 "$2" $dir; then return 1 fi # Format attributes from template directory as install(1) # arguments. args=`stat -f "-o %Su -g %Sg -m %0Mp%0Lp" $1/$dir` log "install -d $args ${2}$dir" if [ -z "$dryrun" ]; then install -d $args ${2}$dir >&3 2>&1 fi return 0 } # Perform post-install fixups for a file. This largely consists of # regenerating any files that depend on the newly installed file. # # $1 - pathname of the updated file (relative to DESTDIR) post_install_file() { case $1 in /etc/mail/aliases) # Grr, newaliases only works for an empty DESTDIR. if [ -z "$DESTDIR" ]; then log "newaliases" if [ -z "$dryrun" ]; then newaliases >&3 2>&1 fi else NEWALIAS_WARN=yes fi ;; /etc/login.conf) log "cap_mkdb ${DESTDIR}$1" if [ -z "$dryrun" ]; then cap_mkdb ${DESTDIR}$1 >&3 2>&1 fi ;; /etc/master.passwd) log "pwd_mkdb -p -d $DESTDIR/etc ${DESTDIR}$1" if [ -z "$dryrun" ]; then pwd_mkdb -p -d $DESTDIR/etc ${DESTDIR}$1 \ >&3 2>&1 fi ;; /etc/motd) # /etc/rc.d/motd hardcodes the /etc/motd path. # Don't warn about non-empty DESTDIR's since this # change is only cosmetic anyway. if [ -z "$DESTDIR" ]; then log "sh /etc/rc.d/motd start" if [ -z "$dryrun" ]; then sh /etc/rc.d/motd start >&3 2>&1 fi fi ;; /etc/services) log "services_mkdb -q -o $DESTDIR/var/db/services.db" \ "${DESTDIR}$1" if [ -z "$dryrun" ]; then services_mkdb -q -o $DESTDIR/var/db/services.db \ ${DESTDIR}$1 >&3 2>&1 fi ;; esac } # Install the "new" version of a file. Returns true if it succeeds # and false otherwise. # # $1 - pathname of the file to install (relative to DESTDIR) install_new() { if ! install_dirs $NEWTREE "$DESTDIR" $1; then return 1 fi log "cp -Rp ${NEWTREE}$1 ${DESTDIR}$1" if [ -z "$dryrun" ]; then cp -Rp ${NEWTREE}$1 ${DESTDIR}$1 >&3 2>&1 fi post_install_file $1 return 0 } # Install the "resolved" version of a file. Returns true if it succeeds # and false otherwise. # # $1 - pathname of the file to install (relative to DESTDIR) install_resolved() { # This should always be present since the file is already # there (it caused a conflict). However, it doesn't hurt to # just be safe. if ! install_dirs $NEWTREE "$DESTDIR" $1; then return 1 fi log "cp -Rp ${CONFLICTS}$1 ${DESTDIR}$1" cp -Rp ${CONFLICTS}$1 ${DESTDIR}$1 >&3 2>&1 post_install_file $1 return 0 } # Generate a conflict file when a "new" file conflicts with an # existing file in DESTDIR. # # $1 - pathname of the file that conflicts (relative to DESTDIR) new_conflict() { if [ -n "$dryrun" ]; then return fi install_dirs $NEWTREE $CONFLICTS $1 diff --changed-group-format='<<<<<<< (local) %<======= %>>>>>>>> (stock) ' $DESTDIR/$1 $NEWTREE/$1 > $CONFLICTS/$1 } # Remove the "old" version of a file. # # $1 - pathname of the old file to remove (relative to DESTDIR) remove_old() { log "rm -f ${DESTDIR}$1" if [ -z "$dryrun" ]; then rm -f ${DESTDIR}$1 >&3 2>&1 fi echo " D $1" } # Update a file that has no local modifications. # # $1 - pathname of the file to update (relative to DESTDIR) update_unmodified() { local new old # If the old file is a directory, then remove it with rmdir # (this should only happen if the file has changed its type # from a directory to a non-directory). If the directory # isn't empty, then fail. This will be reported as a warning # later. if [ -d $DESTDIR/$1 ]; then if empty_destdir $1; then log "rmdir ${DESTDIR}$1" if [ -z "$dryrun" ]; then rmdir ${DESTDIR}$1 >&3 2>&1 fi else return 1 fi # If both the old and new files are regular files, leave the # existing file. This avoids breaking hard links for /.cshrc # and /.profile. Otherwise, explicitly remove the old file. elif ! [ -f ${DESTDIR}$1 -a -f ${NEWTREE}$1 ]; then log "rm -f ${DESTDIR}$1" if [ -z "$dryrun" ]; then rm -f ${DESTDIR}$1 >&3 2>&1 fi fi # If the new file is a directory, note that the old file has # been removed, but don't do anything else for now. The # directory will be installed if needed when new files within # that directory are installed. if [ -d $NEWTREE/$1 ]; then if empty_dir $NEWTREE/$1; then echo " D $file" else echo " U $file" fi elif install_new $1; then echo " U $file" fi return 0 } # Update the FreeBSD ID string in a locally modified file to match the # FreeBSD ID string from the "new" version of the file. # # $1 - pathname of the file to update (relative to DESTDIR) update_freebsdid() { local new dest file # If the FreeBSD ID string is removed from the local file, # there is nothing to do. In this case, treat the file as # updated. Otherwise, if either file has more than one # FreeBSD ID string, just punt and let the user handle the # conflict manually. new=`grep -c '\$FreeBSD.*\$' ${NEWTREE}$1` dest=`grep -c '\$FreeBSD.*\$' ${DESTDIR}$1` if [ "$dest" -eq 0 ]; then return 0 fi if [ "$dest" -ne 1 -o "$dest" -ne 1 ]; then return 1 fi # If the FreeBSD ID string in the new file matches the FreeBSD ID # string in the local file, there is nothing to do. new=`grep '\$FreeBSD.*\$' ${NEWTREE}$1` dest=`grep '\$FreeBSD.*\$' ${DESTDIR}$1` if [ "$new" = "$dest" ]; then return 0 fi # Build the new file in three passes. First, copy all the # lines preceding the FreeBSD ID string from the local version # of the file. Second, append the FreeBSD ID string line from # the new version. Finally, append all the lines after the # FreeBSD ID string from the local version of the file. file=`mktemp $WORKDIR/etcupdate-XXXXXXX` awk '/\$FreeBSD.*\$/ { exit } { print }' ${DESTDIR}$1 >> $file awk '/\$FreeBSD.*\$/ { print }' ${NEWTREE}$1 >> $file awk '/\$FreeBSD.*\$/ { ok = 1; next } { if (ok) print }' \ ${DESTDIR}$1 >> $file # As an extra sanity check, fail the attempt if the updated # version of the file has any differences aside from the # FreeBSD ID string. if ! fbsdid_only ${DESTDIR}$1 $file; then rm -f $file return 1 fi log "cp $file ${DESTDIR}$1" if [ -z "$dryrun" ]; then cp $file ${DESTDIR}$1 >&3 2>&1 fi rm -f $file post_install_file $1 echo " M $1" return 0 } # Attempt to update a file that has local modifications. This routine # only handles regular files. If the 3-way merge succeeds without # conflicts, the updated file is installed. If the merge fails, the # merged version with conflict markers is left in the CONFLICTS tree. # # $1 - pathname of the file to merge (relative to DESTDIR) merge_file() { local res # Try the merge to see if there is a conflict. diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > /dev/null 2>&3 res=$? case $res in 0) # No conflicts, so just redo the merge to the # real file. log "diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1" if [ -z "$dryrun" ]; then temp=$(mktemp -t etcupdate) diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > ${temp} # Use "cat >" to preserve metadata. cat ${temp} > ${DESTDIR}$1 rm -f ${temp} fi post_install_file $1 echo " M $1" ;; 1) # Conflicts, save a version with conflict markers in # the conflicts directory. if [ -z "$dryrun" ]; then install_dirs $NEWTREE $CONFLICTS $1 log "diff3 -m -A ${DESTDIR}$1 ${CONFLICTS}$1" diff3 -m -A -L "yours" -L "original" -L "new" \ ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > \ ${CONFLICTS}$1 fi echo " C $1" ;; *) panic "merge failed with status $res" ;; esac } # Returns true if a file contains conflict markers from a merge conflict. # # $1 - pathname of the file to resolve (relative to DESTDIR) has_conflicts() { egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1 } # Attempt to resolve a conflict. The user is prompted to choose an # action for each conflict. If the user edits the file, they are # prompted again for an action. The process is very similar to # resolving conflicts after an update or merge with Perforce or # Subversion. The prompts are modelled on a subset of the available # commands for resolving conflicts with Subversion. # # $1 - pathname of the file to resolve (relative to DESTDIR) resolve_conflict() { local command junk echo "Resolving conflict in '$1':" edit= while true; do # Only display the resolved command if the file # doesn't contain any conflicts. echo -n "Select: (p) postpone, (df) diff-full, (e) edit," if ! has_conflicts $1; then echo -n " (r) resolved," fi echo echo -n " (h) help for more options: " read command case $command in df) diff -u ${DESTDIR}$1 ${CONFLICTS}$1 ;; e) $EDITOR ${CONFLICTS}$1 ;; h) cat </dev/null 2>&1 fi echo " D $dir" else warn "Non-empty directory remains: $dir" fi fi } # Handle a file that exists in both the old and new trees. If the # file has not changed in the old and new trees, there is nothing to # do. If the file in the destination directory matches the new file, # there is nothing to do. If the file in the destination directory # matches the old file, then the new file should be installed. # Everything else becomes some sort of conflict with more detailed # handling. # # $1 - pathname of the file (relative to DESTDIR) handle_modified_file() { local cmp dest file new newdestcmp old file=$1 if ignore $file; then log "IGNORE: modified file $file" return fi compare $OLDTREE/$file $NEWTREE/$file cmp=$? if [ $cmp -eq $COMPARE_EQUAL ]; then return fi if [ $cmp -eq $COMPARE_ONLYFIRST -o $cmp -eq $COMPARE_ONLYSECOND ]; then panic "Changed file now missing" fi compare $NEWTREE/$file $DESTDIR/$file newdestcmp=$? if [ $newdestcmp -eq $COMPARE_EQUAL ]; then return fi # If the only change in the new file versus the destination # file is a change in the FreeBSD ID string and -F is # specified, just install the new file. if [ -n "$FREEBSD_ID" -a $newdestcmp -eq $COMPARE_DIFFFILES ] && \ fbsdid_only $NEWTREE/$file $DESTDIR/$file; then if update_unmodified $file; then return else panic "Updating FreeBSD ID string failed" fi fi # If the local file is the same as the old file, install the # new file. If -F is specified and the only local change is # in the FreeBSD ID string, then install the new file as well. if compare_fbsdid $OLDTREE/$file $DESTDIR/$file; then if update_unmodified $file; then return fi fi # If the file was removed from the dest tree, just whine. if [ $newdestcmp -eq $COMPARE_ONLYFIRST ]; then # If the removed file matches an ALWAYS_INSTALL glob, # then just install the new version of the file. if always_install $file; then log "ALWAYS: adding $file" if ! [ -d $NEWTREE/$file ]; then if install_new $file; then echo " A $file" fi fi return fi # If the only change in the new file versus the old # file is a change in the FreeBSD ID string and -F is # specified, don't warn. if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \ fbsdid_only $OLDTREE/$file $NEWTREE/$file; then return fi case $cmp in $COMPARE_DIFFTYPE) old=`file_type $OLDTREE/$file` new=`file_type $NEWTREE/$file` warn "Remove mismatch: $file ($old became $new)" ;; $COMPARE_DIFFLINKS) old=`readlink $OLDTREE/$file` new=`readlink $NEWTREE/$file` warn \ "Removed link changed: $file (\"$old\" became \"$new\")" ;; $COMPARE_DIFFFILES) warn "Removed file changed: $file" ;; esac return fi # Treat the file as unmodified and force install of the new # file if it matches an ALWAYS_INSTALL glob. If the update # attempt fails, then fall through to the normal case so a # warning is generated. if always_install $file; then log "ALWAYS: updating $file" if update_unmodified $file; then return fi fi # If the only change in the new file versus the old file is a # change in the FreeBSD ID string and -F is specified, just # update the FreeBSD ID string in the local file. if [ -n "$FREEBSD_ID" -a $cmp -eq $COMPARE_DIFFFILES ] && \ fbsdid_only $OLDTREE/$file $NEWTREE/$file; then if update_freebsdid $file; then continue fi fi # If the file changed types between the old and new trees but # the files in the new and dest tree are both of the same # type, treat it like an added file just comparing the new and # dest files. if [ $cmp -eq $COMPARE_DIFFTYPE ]; then case $newdestcmp in $COMPARE_DIFFLINKS) new=`readlink $NEWTREE/$file` dest=`readlink $DESTDIR/$file` warn \ "New link conflict: $file (\"$new\" vs \"$dest\")" return ;; $COMPARE_DIFFFILES) new_conflict $file echo " C $file" return ;; esac else # If the file has not changed types between the old # and new trees, but it is a different type in # DESTDIR, then just warn. if [ $newdestcmp -eq $COMPARE_DIFFTYPE ]; then new=`file_type $NEWTREE/$file` dest=`file_type $DESTDIR/$file` warn "Modified mismatch: $file ($new vs $dest)" return fi fi case $cmp in $COMPARE_DIFFTYPE) old=`file_type $OLDTREE/$file` new=`file_type $NEWTREE/$file` dest=`file_type $DESTDIR/$file` warn "Modified $dest changed: $file ($old became $new)" ;; $COMPARE_DIFFLINKS) old=`readlink $OLDTREE/$file` new=`readlink $NEWTREE/$file` warn \ "Modified link changed: $file (\"$old\" became \"$new\")" ;; $COMPARE_DIFFFILES) merge_file $file ;; esac } # Handle a file that has been added in the new tree. If the file does # not exist in DESTDIR, simply copy the file into DESTDIR. If the # file exists in the DESTDIR and is identical to the new version, do # nothing. Otherwise, generate a diff of the two versions of the file # and mark it as a conflict. # # $1 - pathname of the file (relative to DESTDIR) handle_added_file() { local cmp dest file new file=$1 if ignore $file; then log "IGNORE: added file $file" return fi compare $DESTDIR/$file $NEWTREE/$file cmp=$? case $cmp in $COMPARE_EQUAL) return ;; $COMPARE_ONLYFIRST) panic "Added file now missing" ;; $COMPARE_ONLYSECOND) # Ignore new directories. They will be # created as needed when non-directory nodes # are installed. if ! [ -d $NEWTREE/$file ]; then if install_new $file; then echo " A $file" fi fi return ;; esac # Treat the file as unmodified and force install of the new # file if it matches an ALWAYS_INSTALL glob. If the update # attempt fails, then fall through to the normal case so a # warning is generated. if always_install $file; then log "ALWAYS: updating $file" if update_unmodified $file; then return fi fi case $cmp in $COMPARE_DIFFTYPE) new=`file_type $NEWTREE/$file` dest=`file_type $DESTDIR/$file` warn "New file mismatch: $file ($new vs $dest)" ;; $COMPARE_DIFFLINKS) new=`readlink $NEWTREE/$file` dest=`readlink $DESTDIR/$file` warn "New link conflict: $file (\"$new\" vs \"$dest\")" ;; $COMPARE_DIFFFILES) # If the only change in the new file versus # the destination file is a change in the # FreeBSD ID string and -F is specified, just # install the new file. if [ -n "$FREEBSD_ID" ] && \ fbsdid_only $NEWTREE/$file $DESTDIR/$file; then if update_unmodified $file; then return else panic \ "Updating FreeBSD ID string failed" fi fi new_conflict $file echo " C $file" ;; esac } # Main routines for each command # Build a new tree and save it in a tarball. build_cmd() { local dir if [ $# -ne 1 ]; then echo "Missing required tarball." echo usage fi log "build command: $1" # Create a temporary directory to hold the tree dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create temporary directory." exit 1 fi if ! build_tree $dir; then echo "Failed to build tree." remove_tree $dir exit 1 fi if ! tar cfj $1 -C $dir . >&3 2>&1; then echo "Failed to create tarball." remove_tree $dir exit 1 fi remove_tree $dir } # Output a diff comparing the tree at DESTDIR to the current # unmodified tree. Note that this diff does not include files that # are present in DESTDIR but not in the unmodified tree. diff_cmd() { local file if [ $# -ne 0 ]; then usage fi # Requires an unmodified tree to diff against. if ! [ -d $NEWTREE ]; then echo "Reference tree to diff against unavailable." exit 1 fi # Unfortunately, diff alone does not quite provide the right # level of options that we want, so improvise. for file in `(cd $NEWTREE; find .) | sed -e 's/^\.//'`; do if ignore $file; then continue fi diffnode $NEWTREE "$DESTDIR" $file "stock" "local" done } # Just extract a new tree into NEWTREE either by building a tree or # extracting a tarball. This can be used to bootstrap updates by # initializing the current "stock" tree to match the currently # installed system. # # Unlike 'update', this command does not rotate or preserve an # existing NEWTREE, it just replaces any existing tree. extract_cmd() { if [ $# -ne 0 ]; then usage fi log "extract command: tarball=$tarball" if [ -d $NEWTREE ]; then if ! remove_tree $NEWTREE; then echo "Unable to remove current tree." exit 1 fi fi extract_tree } # Resolve conflicts left from an earlier merge. resolve_cmd() { local conflicts if [ $# -ne 0 ]; then usage fi if ! [ -d $CONFLICTS ]; then return fi if ! [ -d $NEWTREE ]; then echo "The current tree is not present to resolve conflicts." exit 1 fi conflicts=`(cd $CONFLICTS; find . ! -type d) | sed -e 's/^\.//'` for file in $conflicts; do resolve_conflict $file done if [ -n "$NEWALIAS_WARN" ]; then warn "Needs update: /etc/mail/aliases.db" \ "(requires manual update via newaliases(1))" echo echo "Warnings:" echo " Needs update: /etc/mail/aliases.db" \ "(requires manual update via newaliases(1))" fi } # Report a summary of the previous merge. Specifically, list any # remaining conflicts followed by any warnings from the previous # update. status_cmd() { if [ $# -ne 0 ]; then usage fi if [ -d $CONFLICTS ]; then (cd $CONFLICTS; find . ! -type d) | sed -e 's/^\./ C /' fi if [ -s $WARNINGS ]; then echo "Warnings:" cat $WARNINGS fi } # Perform an actual merge. The new tree can either already exist (if # rerunning a merge), be extracted from a tarball, or generated from a # source tree. update_cmd() { local dir if [ $# -ne 0 ]; then usage fi log "update command: rerun=$rerun tarball=$tarball preworld=$preworld" if [ `id -u` -ne 0 ]; then echo "Must be root to update a tree." exit 1 fi # Enforce a sane umask umask 022 # XXX: Should existing conflicts be ignored and removed during # a rerun? # Trim the conflicts tree. Whine if there is anything left. if [ -e $CONFLICTS ]; then find -d $CONFLICTS -type d -empty -delete >&3 2>&1 rmdir $CONFLICTS >&3 2>&1 fi if [ -d $CONFLICTS ]; then echo "Conflicts remain from previous update, aborting." exit 1 fi if [ -z "$rerun" ]; then # For a dryrun that is not a rerun, do not rotate the existing # stock tree. Instead, extract a tree to a temporary directory # and use that for the comparison. if [ -n "$dryrun" ]; then dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` if [ $? -ne 0 ]; then echo "Unable to create temporary directory." exit 1 fi # A pre-world dryrun has already set OLDTREE to # point to the current stock tree. if [ -z "$preworld" ]; then OLDTREE=$NEWTREE fi NEWTREE=$dir # For a pre-world update, blow away any pre-existing # NEWTREE. elif [ -n "$preworld" ]; then if ! remove_tree $NEWTREE; then echo "Unable to remove pre-world tree." exit 1 fi # Rotate the existing stock tree to the old tree. elif [ -d $NEWTREE ]; then # First, delete the previous old tree if it exists. if ! remove_tree $OLDTREE; then echo "Unable to remove old tree." exit 1 fi # Move the current stock tree. if ! mv $NEWTREE $OLDTREE >&3 2>&1; then echo "Unable to rename current stock tree." exit 1 fi fi if ! [ -d $OLDTREE ]; then cat < $WORKDIR/old.files (cd $NEWTREE; find .) | sed -e 's/^\.//' | sort > $WORKDIR/new.files # Split the files up into three groups using comm. comm -23 $WORKDIR/old.files $WORKDIR/new.files > $WORKDIR/removed.files comm -13 $WORKDIR/old.files $WORKDIR/new.files > $WORKDIR/added.files comm -12 $WORKDIR/old.files $WORKDIR/new.files > $WORKDIR/both.files # Initialize conflicts and warnings handling. rm -f $WARNINGS mkdir -p $CONFLICTS # Ignore removed files for the pre-world case. A pre-world # update uses a stripped-down tree. if [ -n "$preworld" ]; then > $WORKDIR/removed.files fi # The order for the following sections is important. In the # odd case that a directory is converted into a file, the # existing subfiles need to be removed if possible before the # file is converted. Similarly, in the case that a file is # converted into a directory, the file needs to be converted # into a directory if possible before the new files are added. # First, handle removed files. for file in `cat $WORKDIR/removed.files`; do handle_removed_file $file done # For the directory pass, reverse sort the list to effect a # depth-first traversal. This is needed to ensure that if a # directory with subdirectories is removed, the entire # directory is removed if there are no local modifications. for file in `sort -r $WORKDIR/removed.files`; do handle_removed_directory $file done # Second, handle files that exist in both the old and new # trees. for file in `cat $WORKDIR/both.files`; do handle_modified_file $file done # Finally, handle newly added files. for file in `cat $WORKDIR/added.files`; do handle_added_file $file done if [ -n "$NEWALIAS_WARN" ]; then warn "Needs update: /etc/mail/aliases.db" \ "(requires manual update via newaliases(1))" fi # Run any special one-off commands after an update has completed. post_update if [ -s $WARNINGS ]; then echo "Warnings:" cat $WARNINGS fi if [ -n "$dir" ]; then if [ -z "$dryrun" -o -n "$rerun" ]; then panic "Should not have a temporary directory" fi remove_tree $dir fi } # Determine which command we are executing. A command may be # specified as the first word. If one is not specified then 'update' # is assumed as the default command. command="update" if [ $# -gt 0 ]; then case "$1" in build|diff|extract|status|resolve) command="$1" shift ;; -*) # If first arg is an option, assume the # default command. ;; *) usage ;; esac fi # Set default variable values. # The path to the source tree used to build trees. SRCDIR=/usr/src # The destination directory where the modified files live. DESTDIR= # Ignore changes in the FreeBSD ID string. FREEBSD_ID= # Files that should always have the new version of the file installed. ALWAYS_INSTALL= # Files to ignore and never update during a merge. IGNORE_FILES= # Flags to pass to 'make' when building a tree. MAKE_OPTIONS= # Include a config file if it exists. Note that command line options # override any settings in the config file. More details are in the # manual, but in general the following variables can be set: # - ALWAYS_INSTALL # - DESTDIR # - EDITOR # - FREEBSD_ID # - IGNORE_FILES # - LOGFILE # - MAKE_OPTIONS # - SRCDIR # - WORKDIR if [ -r /etc/etcupdate.conf ]; then . /etc/etcupdate.conf fi # Parse command line options tarball= rerun= always= dryrun= ignore= nobuild= preworld= while getopts "d:nprs:t:A:BD:FI:L:M:" option; do case "$option" in d) WORKDIR=$OPTARG ;; n) dryrun=YES ;; p) preworld=YES ;; r) rerun=YES ;; s) SRCDIR=$OPTARG ;; t) tarball=$OPTARG ;; A) # To allow this option to be specified # multiple times, accumulate command-line # specified patterns in an 'always' variable # and use that to overwrite ALWAYS_INSTALL # after parsing all options. Need to be # careful here with globbing expansion. set -o noglob always="$always $OPTARG" set +o noglob ;; B) nobuild=YES ;; D) DESTDIR=$OPTARG ;; F) FREEBSD_ID=YES ;; I) # To allow this option to be specified # multiple times, accumulate command-line # specified patterns in an 'ignore' variable # and use that to overwrite IGNORE_FILES after # parsing all options. Need to be careful # here with globbing expansion. set -o noglob ignore="$ignore $OPTARG" set +o noglob ;; L) LOGFILE=$OPTARG ;; M) MAKE_OPTIONS="$OPTARG" ;; *) echo usage ;; esac done shift $((OPTIND - 1)) # Allow -A command line options to override ALWAYS_INSTALL set from # the config file. set -o noglob if [ -n "$always" ]; then ALWAYS_INSTALL="$always" fi # Allow -I command line options to override IGNORE_FILES set from the # config file. if [ -n "$ignore" ]; then IGNORE_FILES="$ignore" fi set +o noglob # Where the "old" and "new" trees are stored. WORKDIR=${WORKDIR:-$DESTDIR/var/db/etcupdate} # Log file for verbose output from program that are run. The log file # is opened on fd '3'. LOGFILE=${LOGFILE:-$WORKDIR/log} # The path of the "old" tree OLDTREE=$WORKDIR/old # The path of the "new" tree NEWTREE=$WORKDIR/current # The path of the "conflicts" tree where files with merge conflicts are saved. CONFLICTS=$WORKDIR/conflicts # The path of the "warnings" file that accumulates warning notes from an update. WARNINGS=$WORKDIR/warnings # Use $EDITOR for resolving conflicts. If it is not set, default to vi. EDITOR=${EDITOR:-/usr/bin/vi} # Files that need to be updated before installworld. -PREWORLD_FILES="lib/libc/gen/master.passwd lib/libc/gen/group" -# If on an older tree, use it instead. Delete after 13.0. -[ -f ${SRCDIR}/etc/master.passwd ] && PREWORLD_FILES="etc/master.passwd etc/group" +PREWORLD_FILES="etc/master.passwd etc/group" # Handle command-specific argument processing such as complaining # about unsupported options. Since the configuration file is always # included, do not complain about extra command line arguments that # may have been set via the config file rather than the command line. case $command in update) if [ -n "$rerun" -a -n "$tarball" ]; then echo "Only one of -r or -t can be specified." echo usage fi if [ -n "$rerun" -a -n "$preworld" ]; then echo "Only one of -p or -r can be specified." echo usage fi ;; build|diff|status) if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \ -n "$preworld" ]; then usage fi ;; resolve) if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" ]; then usage fi ;; extract) if [ -n "$dryrun" -o -n "$rerun" -o -n "$preworld" ]; then usage fi ;; esac # Pre-world mode uses a different set of trees. It leaves the current # tree as-is so it is still present for a full etcupdate run after the # world install is complete. Instead, it installs a few critical files # into a separate tree. if [ -n "$preworld" ]; then OLDTREE=$NEWTREE NEWTREE=$WORKDIR/preworld fi # Open the log file. Don't truncate it if doing a minor operation so # that a minor operation doesn't lose log info from a major operation. if ! mkdir -p $WORKDIR 2>/dev/null; then echo "Failed to create work directory $WORKDIR" fi case $command in diff|resolve|status) exec 3>>$LOGFILE ;; *) exec 3>$LOGFILE ;; esac ${command}_cmd "$@" Index: head/usr.sbin/mergemaster/mergemaster.sh =================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh (revision 348184) +++ head/usr.sbin/mergemaster/mergemaster.sh (revision 348185) @@ -1,1438 +1,1435 @@ #!/bin/sh # mergemaster # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. # Copyright (c) 1998-2012 Douglas Barton, All rights reserved # Please see detailed copyright below # $FreeBSD$ PATH=/bin:/usr/bin:/usr/sbin display_usage () { VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` echo "mergemaster version ${VERSION_NUMBER}" echo 'Usage: mergemaster [-scrvhpCP] [-a|[-iFU]] [--run-updates=always|never]' echo ' [-m /path] [-t /path] [-d] [-u N] [-w N] [-A arch] [-D /path]' echo "Options:" echo " -s Strict comparison (diff every pair of files)" echo " -c Use context diff instead of unified diff" echo " -r Re-run on a previously cleaned directory (skip temproot creation)" echo " -v Be more verbose about the process, include additional checks" echo " -a Leave all files that differ to merge by hand" echo " -h Display more complete help" echo ' -i Automatically install files that do not exist in destination directory' echo ' -p Pre-buildworld mode, only compares crucial files' echo ' -F Install files that differ only by revision control Id ($FreeBSD)' echo ' -C Compare local rc.conf variables to the defaults' echo ' -P Preserve files that are overwritten' echo " -U Attempt to auto upgrade files that have not been user modified" echo ' ***DANGEROUS***' echo ' --run-updates= Specify always or never to run newalises, pwd_mkdb, etc.' echo '' echo " -m /path/directory Specify location of source to do the make in" echo " -t /path/directory Specify temp root directory" echo " -d Add date and time to directory name (e.g., /var/tmp/temproot.`date +%m%d.%H.%M`)" echo " -u N Specify a numeric umask" echo " -w N Specify a screen width in columns to sdiff" echo " -A architecture Alternative architecture name to pass to make" echo ' -D /path/directory Specify the destination directory to install files to' echo '' } display_help () { echo "* To specify a directory other than /var/tmp/temproot for the" echo " temporary root environment, use -t /path/to/temp/root" echo "* The -w option takes a number as an argument for the column width" echo " of the screen. The default is 80." echo '* The -a option causes mergemaster to run without prompting.' } # Loop allowing the user to use sdiff to merge files and display the merged # file. merge_loop () { case "${VERBOSE}" in '') ;; *) echo " *** Type h at the sdiff prompt (%) to get usage help" ;; esac echo '' MERGE_AGAIN=yes while [ "${MERGE_AGAIN}" = "yes" ]; do # Prime file.merged so we don't blat the owner/group id's cp -p "${COMPFILE}" "${COMPFILE}.merged" sdiff -o "${COMPFILE}.merged" --text --suppress-common-lines \ --width=${SCREEN_WIDTH:-80} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" INSTALL_MERGED=V while [ "${INSTALL_MERGED}" = "v" -o "${INSTALL_MERGED}" = "V" ]; do echo '' echo " Use 'i' to install merged file" echo " Use 'r' to re-do the merge" echo " Use 'v' to view the merged file" echo " Default is to leave the temporary file to deal with by hand" echo '' echo -n " *** How should I deal with the merged file? [Leave it for later] " read INSTALL_MERGED case "${INSTALL_MERGED}" in [iI]) mv "${COMPFILE}.merged" "${COMPFILE}" echo '' if mm_install "${COMPFILE}"; then echo " *** Merged version of ${COMPFILE} installed successfully" else echo " *** Problem installing ${COMPFILE}, it will remain to merge by hand later" fi unset MERGE_AGAIN ;; [rR]) rm "${COMPFILE}.merged" ;; [vV]) ${PAGER} "${COMPFILE}.merged" ;; '') echo " *** ${COMPFILE} will remain for your consideration" unset MERGE_AGAIN ;; *) echo "invalid choice: ${INSTALL_MERGED}" INSTALL_MERGED=V ;; esac done done } # Loop showing user differences between files, allow merge, skip or install # options diff_loop () { HANDLE_COMPFILE=v while [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" -o \ "${HANDLE_COMPFILE}" = "NOT V" ]; do if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then if [ -n "${AUTO_UPGRADE}" -a -n "${CHANGED}" ]; then case "${CHANGED}" in *:${DESTDIR}${COMPFILE#.}:*) ;; # File has been modified *) echo '' echo " *** ${COMPFILE} has not been user modified." echo '' if mm_install "${COMPFILE}"; then echo " *** ${COMPFILE} upgraded successfully" echo '' # Make the list print one file per line AUTO_UPGRADED_FILES="${AUTO_UPGRADED_FILES} ${DESTDIR}${COMPFILE#.} " else echo " *** Problem upgrading ${COMPFILE}, it will remain to merge by hand" fi return ;; esac fi if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then echo '' echo ' ====================================================================== ' echo '' ( echo " *** Displaying differences between ${COMPFILE} and installed version:" echo '' diff ${DIFF_FLAG} ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" ) | ${PAGER} echo '' fi else echo '' echo " *** There is no installed version of ${COMPFILE}" echo '' case "${AUTO_INSTALL}" in [Yy][Ee][Ss]) echo '' if mm_install "${COMPFILE}"; then echo " *** ${COMPFILE} installed successfully" echo '' # Make the list print one file per line AUTO_INSTALLED_FILES="${AUTO_INSTALLED_FILES} ${DESTDIR}${COMPFILE#.} " else echo " *** Problem installing ${COMPFILE}, it will remain to merge by hand" fi return ;; *) NO_INSTALLED=yes ;; esac fi echo " Use 'd' to delete the temporary ${COMPFILE}" echo " Use 'i' to install the temporary ${COMPFILE}" case "${NO_INSTALLED}" in '') echo " Use 'm' to merge the temporary and installed versions" echo " Use 'v' to view the diff results again" ;; esac echo '' echo " Default is to leave the temporary file to deal with by hand" echo '' echo -n "How should I deal with this? [Leave it for later] " read HANDLE_COMPFILE case "${HANDLE_COMPFILE}" in [dD]) rm "${COMPFILE}" echo '' echo " *** Deleting ${COMPFILE}" ;; [iI]) echo '' if mm_install "${COMPFILE}"; then echo " *** ${COMPFILE} installed successfully" else echo " *** Problem installing ${COMPFILE}, it will remain to merge by hand" fi ;; [mM]) case "${NO_INSTALLED}" in '') # interact with user to merge files merge_loop ;; *) echo '' echo " *** There is no installed version of ${COMPFILE}" echo '' HANDLE_COMPFILE="NOT V" ;; esac # End of "No installed version of file but user selected merge" test ;; [vV]) continue ;; '') echo '' echo " *** ${COMPFILE} will remain for your consideration" ;; *) # invalid choice, show menu again. echo "invalid choice: ${HANDLE_COMPFILE}" echo '' HANDLE_COMPFILE="NOT V" continue ;; esac # End of "How to handle files that are different" done unset NO_INSTALLED echo '' case "${VERBOSE}" in '') ;; *) sleep 3 ;; esac } press_to_continue () { local DISCARD echo -n ' *** Press the [Enter] or [Return] key to continue ' read DISCARD } # Set the default path for the temporary root environment # TEMPROOT='/var/tmp/temproot' # Read /etc/mergemaster.rc first so the one in $HOME can override # if [ -r /etc/mergemaster.rc ]; then . /etc/mergemaster.rc fi # Read .mergemasterrc before command line so CLI can override # if [ -r "$HOME/.mergemasterrc" ]; then . "$HOME/.mergemasterrc" fi for var in "$@" ; do case "$var" in --run-updates*) RUN_UPDATES=`echo ${var#--run-updates=} | tr [:upper:] [:lower:]` ;; *) newopts="$newopts $var" ;; esac done set -- $newopts unset var newopts # Check the command line options # while getopts ":ascrvhipCPm:t:du:w:D:A:FU" COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in A) ARCHSTRING='TARGET_ARCH='${OPTARG} ;; F) FREEBSD_ID=yes ;; U) AUTO_UPGRADE=yes ;; s) STRICT=yes unset DIFF_OPTIONS ;; c) DIFF_FLAG='-c' ;; r) RERUN=yes ;; v) case "${AUTO_RUN}" in '') VERBOSE=yes ;; esac ;; a) AUTO_RUN=yes unset VERBOSE ;; h) display_usage display_help exit 0 ;; i) AUTO_INSTALL=yes ;; C) COMP_CONFS=yes ;; P) PRESERVE_FILES=yes ;; p) PRE_WORLD=yes unset COMP_CONFS unset AUTO_RUN ;; m) SOURCEDIR=${OPTARG} ;; t) TEMPROOT=${OPTARG} ;; d) TEMPROOT=${TEMPROOT}.`date +%m%d.%H.%M` ;; u) NEW_UMASK=${OPTARG} ;; w) SCREEN_WIDTH=${OPTARG} ;; D) DESTDIR=${OPTARG} ;; *) display_usage exit 1 ;; esac done if [ -n "$AUTO_RUN" ]; then if [ -n "$FREEBSD_ID" -o -n "$AUTO_UPGRADE" -o -n "$AUTO_INSTALL" ]; then echo '' echo "*** You have included the -a option along with one or more options" echo ' that indicate that you wish mergemaster to actually make updates' echo ' (-F, -U, or -i), however these options are not compatible.' echo ' Please read mergemaster(8) for more information.' echo '' exit 1 fi fi # Assign the location of the mtree database # MTREEDB=${MTREEDB:-${DESTDIR}/var/db} MTREEFILE="${MTREEDB}/mergemaster.mtree" # Don't force the user to set this in the mergemaster rc file if [ -n "${PRESERVE_FILES}" -a -z "${PRESERVE_FILES_DIR}" ]; then PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` mkdir -p ${PRESERVE_FILES_DIR} fi # Check for the mtree database in DESTDIR case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) if [ ! -s "${MTREEFILE}" ]; then echo '' echo "*** Unable to find mtree database (${MTREEFILE})." echo " Skipping auto-upgrade on this run." echo " It will be created for the next run when this one is complete." echo '' case "${AUTO_RUN}" in '') press_to_continue ;; esac unset AUTO_UPGRADE fi ;; esac if [ -e "${DESTDIR}/etc/fstab" ]; then if grep -q nodev ${DESTDIR}/etc/fstab; then echo '' echo "*** You have the deprecated 'nodev' option in ${DESTDIR}/etc/fstab." echo " This can prevent the filesystem from being mounted on reboot." echo " Please update your fstab before continuing." echo " See fstab(5) for more information." echo '' exit 1 fi fi echo '' # If the user has a pager defined, make sure we can run it # case "${DONT_CHECK_PAGER}" in '') check_pager () { while ! type "${PAGER%% *}" >/dev/null; do echo " *** Your PAGER environment variable specifies '${PAGER}', but" echo " due to the limited PATH that I use for security reasons," echo " I cannot execute it. So, what would you like to do?" echo '' echo " Use 'e' to exit mergemaster and fix your PAGER variable" echo " Use 'l' to set PAGER to 'less' for this run" echo " Use 'm' to use plain old 'more' as your PAGER for this run" echo '' echo " or you may type an absolute path to PAGER for this run" echo '' echo " Default is to use 'less' " echo '' echo -n "What should I do? [Use 'less'] " read FIXPAGER case "${FIXPAGER}" in [eE]) exit 0 ;; [lL]|'') PAGER=less ;; [mM]) PAGER=more ;; /*) PAGER="$FIXPAGER" ;; *) echo '' echo "invalid choice: ${FIXPAGER}" esac echo '' done } if [ -n "${PAGER}" ]; then check_pager fi ;; esac # If user has a pager defined, or got assigned one above, use it. # If not, use less. # PAGER=${PAGER:-less} if [ -n "${VERBOSE}" -a ! "${PAGER}" = "less" ]; then echo " *** You have ${PAGER} defined as your pager so we will use that" echo '' sleep 3 fi # Assign the diff flag once so we will not have to keep testing it # DIFF_FLAG=${DIFF_FLAG:--u} # Assign the source directory # SOURCEDIR=${SOURCEDIR:-/usr/src} if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a \ -f ${SOURCEDIR}/../Makefile.inc1 ]; then echo " *** The source directory you specified (${SOURCEDIR})" echo " will be reset to ${SOURCEDIR}/.." echo '' sleep 3 SOURCEDIR=${SOURCEDIR}/.. fi if [ ! -f ${SOURCEDIR}/Makefile.inc1 ]; then echo "*** ${SOURCEDIR} was not found." if [ -f ./Makefile.inc1 ]; then echo " Found Makefile.inc1 in the current directory." echo -n " Would you like to set SOURCEDIR to $(pwd)? [no and exit] " read SRCDOT case "${SRCDOT}" in [yY]*) echo " *** Setting SOURCEDIR to $(pwd)" SOURCEDIR=$(pwd) ;; *) echo " **** No suitable ${SOURCEDIR} found, exiting" exit 1 ;; esac else echo " **** No suitable ${SOURCEDIR} found, exiting" exit 1 fi fi SOURCEDIR=$(realpath "$SOURCEDIR") # Setup make to use system files from SOURCEDIR MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk -DNO_FILEMON" # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then # Force FreeBSD 9 compatible output when available. if mtree -F freebsd9 -c -p /var/empty/ > /dev/null 2>&1; then MTREE_FLAVOR="-F freebsd9" else MTREE_FLAVOR= fi CHANGED=: for file in `mtree -eqL ${MTREE_FLAVOR} -f ${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED}${DESTDIR}/${file}:" fi done [ "$CHANGED" = ':' ] && unset CHANGED fi # Check the width of the user's terminal # if [ -t 0 ]; then w=`tput columns` case "${w}" in 0|'') ;; # No-op, since the input is not valid *) case "${SCREEN_WIDTH}" in '') SCREEN_WIDTH="${w}" ;; "${w}") ;; # No-op, since they are the same *) echo -n "*** You entered ${SCREEN_WIDTH} as your screen width, but stty " echo "thinks it is ${w}." echo '' echo -n "What would you like to use? [${w}] " read SCREEN_WIDTH case "${SCREEN_WIDTH}" in '') SCREEN_WIDTH="${w}" ;; esac ;; esac esac fi # Define what $Id tag to look for to aid portability. # ID_TAG=FreeBSD delete_temproot () { rm -rf "${TEMPROOT}" 2>/dev/null chflags -R 0 "${TEMPROOT}" 2>/dev/null rm -rf "${TEMPROOT}" || { echo "*** Unable to delete ${TEMPROOT}"; exit 1; } } case "${RERUN}" in '') # Set up the loop to test for the existence of the # temp root directory. # TEST_TEMP_ROOT=yes while [ "${TEST_TEMP_ROOT}" = "yes" ]; do if [ -d "${TEMPROOT}" ]; then echo "*** The directory specified for the temporary root environment," echo " ${TEMPROOT}, exists. This can be a security risk if untrusted" echo " users have access to the system." echo '' case "${AUTO_RUN}" in '') echo " Use 'd' to delete the old ${TEMPROOT} and continue" echo " Use 't' to select a new temporary root directory" echo " Use 'e' to exit mergemaster" echo '' echo " Default is to use ${TEMPROOT} as is" echo '' echo -n "How should I deal with this? [Use the existing ${TEMPROOT}] " read DELORNOT case "${DELORNOT}" in [dD]) echo '' echo " *** Deleting the old ${TEMPROOT}" echo '' delete_temproot unset TEST_TEMP_ROOT ;; [tT]) echo " *** Enter new directory name for temporary root environment" read TEMPROOT ;; [eE]) exit 0 ;; '') echo '' echo " *** Leaving ${TEMPROOT} intact" echo '' unset TEST_TEMP_ROOT ;; *) echo '' echo "invalid choice: ${DELORNOT}" echo '' ;; esac ;; *) # If this is an auto-run, try a hopefully safe alternative then # re-test anyway. TEMPROOT=/var/tmp/temproot.`date +%m%d.%H.%M.%S` ;; esac else unset TEST_TEMP_ROOT fi done echo "*** Creating the temporary root environment in ${TEMPROOT}" if mkdir -p "${TEMPROOT}"; then echo " *** ${TEMPROOT} ready for use" fi if [ ! -d "${TEMPROOT}" ]; then echo '' echo " *** FATAL ERROR: Cannot create ${TEMPROOT}" echo '' exit 1 fi echo " *** Creating and populating directory structure in ${TEMPROOT}" echo '' case "${VERBOSE}" in '') ;; *) press_to_continue ;; esac case "${PRE_WORLD}" in '') { cd ${SOURCEDIR} && case "${DESTDIR}" in '') ;; *) ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs >/dev/null ;; esac ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs >/dev/null && ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc >/dev/null && ${MM_MAKE} everything SUBDIR_OVERRIDE=etc >/dev/null && ${MM_MAKE} DESTDIR=${TEMPROOT} distribution >/dev/null;} || { echo ''; echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to"; echo " the temproot environment"; echo ''; exit 1;} ;; *) # Only set up files that are crucial to {build|install}world - { MM_PASSDIR="${SOURCEDIR}/lib/libc/gen" - # If on an older tree, use it instead. Delete after 13.0. - [ -f ${SOURCEDIR}/etc/master.passwd ] && MM_PASSDIR="${SOURCEDIR}/etc" - mkdir -p ${TEMPROOT}/etc && - cp -p ${MM_PASSDIR}/master.passwd ${TEMPROOT}/etc && - install -p -o root -g wheel -m 0644 ${MM_PASSDIR}/group ${TEMPROOT}/etc;} || + { mkdir -p ${TEMPROOT}/etc && + cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc && + install -p -o root -g wheel -m 0644 ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || { echo ''; echo ' *** FATAL ERROR: Cannot copy files to the temproot environment'; echo ''; exit 1;} ;; esac # Doing the inventory and removing files that we don't want to compare only # makes sense if we are not doing a rerun, since we have no way of knowing # what happened to the files during previous incarnations. case "${VERBOSE}" in '') ;; *) echo '' echo ' *** The following files exist only in the installed version of' echo " ${DESTDIR}/etc. In the vast majority of cases these files" echo ' are necessary parts of the system and should not be deleted.' echo ' However because these files are not updated by this process you' echo ' might want to verify their status before rebooting your system.' echo '' press_to_continue diff -qr ${DESTDIR}/etc ${TEMPROOT}/etc | grep "^Only in ${DESTDIR}/etc" | ${PAGER} echo '' press_to_continue ;; esac case "${IGNORE_MOTD}" in '') ;; *) echo '' echo "*** You have the IGNORE_MOTD option set in your mergemaster rc file." echo " This option is deprecated in favor of the IGNORE_FILES option." echo " Please update your rc file accordingly." echo '' exit 1 ;; esac # Avoid comparing the following user specified files for file in ${IGNORE_FILES}; do test -e ${TEMPROOT}/${file} && unlink ${TEMPROOT}/${file} done # We really don't want to have to deal with files like login.conf.db, pwd.db, # or spwd.db. Instead, we want to compare the text versions, and run *_mkdb. # Prompt the user to do so below, as needed. # rm -f ${TEMPROOT}/etc/*.db ${TEMPROOT}/etc/passwd \ ${TEMPROOT}/var/db/services.db # We only need to compare things like freebsd.cf once find ${TEMPROOT}/usr/obj -type f -delete 2>/dev/null # Delete stuff we do not need to keep the mtree database small, # and to make the actual comparison faster. find ${TEMPROOT}/usr -type l -delete 2>/dev/null find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null find -d ${TEMPROOT} -type d -empty -mindepth 1 -delete 2>/dev/null # Build the mtree database in a temporary location. case "${PRE_WORLD}" in '') MTREENEW=`mktemp -t mergemaster.mtree` mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null ;; *) # We don't want to mess with the mtree database on a pre-world run or # when re-scanning a previously-built tree. ;; esac ;; # End of the "RERUN" test esac # Get ready to start comparing files # Check umask if not specified on the command line, # and we are not doing an autorun # if [ -z "${NEW_UMASK}" -a -z "${AUTO_RUN}" ]; then USER_UMASK=`umask` case "${USER_UMASK}" in 0022|022) ;; *) echo '' echo " *** Your umask is currently set to ${USER_UMASK}. By default, this script" echo " installs all files with the same user, group and modes that" echo " they are created with by ${SOURCEDIR}/etc/Makefile, compared to" echo " a umask of 022. This umask allows world read permission when" echo " the file's default permissions have it." echo '' echo " No world permissions can sometimes cause problems. A umask of" echo " 022 will restore the default behavior, but is not mandatory." echo " /etc/master.passwd is a special case. Its file permissions" echo " will be 600 (rw-------) if installed." echo '' echo -n "What umask should I use? [${USER_UMASK}] " read NEW_UMASK NEW_UMASK="${NEW_UMASK:-$USER_UMASK}" ;; esac echo '' fi CONFIRMED_UMASK=${NEW_UMASK:-0022} # # Warn users who still have old rc files # for file in atm devfs diskless1 diskless2 network network6 pccard \ serial syscons sysctl alpha amd64 i386 sparc64; do if [ -f "${DESTDIR}/etc/rc.${file}" ]; then OLD_RC_PRESENT=1 break fi done case "${OLD_RC_PRESENT}" in 1) echo '' echo " *** There are elements of the old rc system in ${DESTDIR}/etc/." echo '' echo ' While these scripts will not hurt anything, they are not' echo ' functional on an up to date system, and can be removed.' echo '' case "${AUTO_RUN}" in '') echo -n 'Move these files to /var/tmp/mergemaster/old_rc? [yes] ' read MOVE_OLD_RC case "${MOVE_OLD_RC}" in [nN]*) ;; *) mkdir -p /var/tmp/mergemaster/old_rc for file in atm devfs diskless1 diskless2 network network6 pccard \ serial syscons sysctl alpha amd64 i386 sparc64; do if [ -f "${DESTDIR}/etc/rc.${file}" ]; then mv ${DESTDIR}/etc/rc.${file} /var/tmp/mergemaster/old_rc/ fi done echo ' The files have been moved' press_to_continue ;; esac ;; *) ;; esac esac # Use the umask/mode information to install the files # Create directories as needed # install_error () { echo "*** FATAL ERROR: Unable to install ${1} to ${2}" echo '' exit 1 } do_install_and_rm () { case "${PRESERVE_FILES}" in [Yy][Ee][Ss]) if [ -f "${3}/${2##*/}" ]; then mkdir -p ${PRESERVE_FILES_DIR}/${2%/*} cp ${3}/${2##*/} ${PRESERVE_FILES_DIR}/${2%/*} fi ;; esac if [ ! -d "${3}/${2##*/}" ]; then if install -m ${1} ${2} ${3}; then unlink ${2} else install_error ${2} ${3} fi else install_error ${2} ${3} fi } # 4095 = "obase=10;ibase=8;07777" | bc find_mode () { local OCTAL OCTAL=$(( ~$(echo "obase=10; ibase=8; ${CONFIRMED_UMASK}" | bc) & 4095 & $(echo "obase=10; ibase=8; $(stat -f "%OMp%OLp" ${1})" | bc) )) printf "%04o\n" ${OCTAL} } mm_install () { local INSTALL_DIR INSTALL_DIR=${1#.} INSTALL_DIR=${INSTALL_DIR%/*} case "${INSTALL_DIR}" in '') INSTALL_DIR=/ ;; esac if [ -n "${DESTDIR}${INSTALL_DIR}" -a ! -d "${DESTDIR}${INSTALL_DIR}" ]; then DIR_MODE=`find_mode "${TEMPROOT}/${INSTALL_DIR}"` install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" || install_error $1 ${DESTDIR}${INSTALL_DIR} fi FILE_MODE=`find_mode "${1}"` if [ ! -x "${1}" ]; then case "${1#.}" in /etc/mail/aliases) NEED_NEWALIASES=yes ;; /etc/login.conf) NEED_CAP_MKDB=yes ;; /etc/services) NEED_SERVICES_MKDB=yes ;; /etc/master.passwd) do_install_and_rm 600 "${1}" "${DESTDIR}${INSTALL_DIR}" NEED_PWD_MKDB=yes DONT_INSTALL=yes ;; /.cshrc | /.profile) local st_nlink # install will unlink the file before it installs the new one, # so we have to restore/create the link afterwards. # st_nlink=0 # In case the file does not yet exist eval $(stat -s ${DESTDIR}${COMPFILE#.} 2>/dev/null) do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" if [ -n "${AUTO_INSTALL}" -a $st_nlink -gt 1 ]; then HANDLE_LINK=l else case "${LINK_EXPLAINED}" in '') echo " *** Historically BSD derived systems have had a" echo " hard link from /.cshrc and /.profile to" echo " their namesakes in /root. Please indicate" echo " your preference below for bringing your" echo " installed files up to date." echo '' LINK_EXPLAINED=yes ;; esac echo " Use 'd' to delete the temporary ${COMPFILE}" echo " Use 'l' to delete the existing ${DESTDIR}/root/${COMPFILE##*/} and create the link" echo '' echo " Default is to leave the temporary file to deal with by hand" echo '' echo -n " How should I handle ${COMPFILE}? [Leave it to install later] " read HANDLE_LINK fi case "${HANDLE_LINK}" in [dD]*) rm "${COMPFILE}" echo '' echo " *** Deleting ${COMPFILE}" ;; [lL]*) echo '' unlink ${DESTDIR}/root/${COMPFILE##*/} if ln ${DESTDIR}${COMPFILE#.} ${DESTDIR}/root/${COMPFILE##*/}; then echo " *** Link from ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/} installed successfully" else echo " *** Error linking ${DESTDIR}${COMPFILE#.} to ${DESTDIR}/root/${COMPFILE##*/}" echo " *** ${COMPFILE} will remain for your consideration" fi ;; *) echo " *** ${COMPFILE} will remain for your consideration" ;; esac return ;; esac case "${DONT_INSTALL}" in '') do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" ;; *) unset DONT_INSTALL ;; esac else # File matched -x do_install_and_rm "${FILE_MODE}" "${1}" "${DESTDIR}${INSTALL_DIR}" fi return $? } if [ ! -d "${TEMPROOT}" ]; then echo "*** FATAL ERROR: The temproot directory (${TEMPROOT})" echo ' has disappeared!' echo '' exit 1 fi echo '' echo "*** Beginning comparison" echo '' # Pre-world does not populate /etc/rc.d. # It is very possible that a previous run would have deleted files in # ${TEMPROOT}/etc/rc.d, thus creating a lot of false positives. if [ -z "${PRE_WORLD}" -a -z "${RERUN}" ]; then echo " *** Checking ${DESTDIR}/etc/rc.d for stale files" echo '' cd "${DESTDIR}/etc/rc.d" && for file in *; do if [ ! -e "${TEMPROOT}/etc/rc.d/${file}" ]; then STALE_RC_FILES="${STALE_RC_FILES} ${file}" fi done case "${STALE_RC_FILES}" in ''|' *') echo ' *** No stale files found' ;; *) echo " *** The following files exist in ${DESTDIR}/etc/rc.d but not in" echo " ${TEMPROOT}/etc/rc.d/:" echo '' echo "${STALE_RC_FILES}" echo '' echo ' The presence of stale files in this directory can cause the' echo ' dreaded unpredictable results, and therefore it is highly' echo ' recommended that you delete them.' case "${AUTO_RUN}" in '') echo '' echo -n ' *** Delete them now? [n] ' read DELETE_STALE_RC_FILES case "${DELETE_STALE_RC_FILES}" in [yY]) echo ' *** Deleting ... ' rm ${STALE_RC_FILES} echo ' done.' ;; *) echo ' *** Files will not be deleted' ;; esac sleep 2 ;; *) if [ -n "${DELETE_STALE_RC_FILES}" ]; then echo ' *** Deleting ... ' rm ${STALE_RC_FILES} echo ' done.' fi esac ;; esac echo '' fi cd "${TEMPROOT}" if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; then . "${MM_PRE_COMPARE_SCRIPT}" fi # Things that were files/directories/links in one version can sometimes # change to something else in a newer version. So we need to explicitly # test for this, and warn the user if what we find does not match. # for COMPFILE in `find . | sort` ; do if [ -e "${DESTDIR}${COMPFILE#.}" ]; then INSTALLED_TYPE=`stat -f '%HT' ${DESTDIR}${COMPFILE#.}` else continue fi TEMPROOT_TYPE=`stat -f '%HT' $COMPFILE` if [ ! "$TEMPROOT_TYPE" = "$INSTALLED_TYPE" ]; then [ "$COMPFILE" = '.' ] && continue TEMPROOT_TYPE=`echo $TEMPROOT_TYPE | tr [:upper:] [:lower:]` INSTALLED_TYPE=`echo $INSTALLED_TYPE | tr [:upper:] [:lower:]` echo "*** The installed file ${DESTDIR}${COMPFILE#.} has the type \"$INSTALLED_TYPE\"" echo " but the new version has the type \"$TEMPROOT_TYPE\"" echo '' echo " How would you like to handle this?" echo '' echo " Use 'r' to remove ${DESTDIR}${COMPFILE#.}" case "$TEMPROOT_TYPE" in 'symbolic link') TARGET=`readlink $COMPFILE` echo " and create a link to $TARGET in its place" ;; *) echo " You will be able to install it as a \"$TEMPROOT_TYPE\"" ;; esac echo '' echo " Use 'i' to ignore this" echo '' echo -n " How to proceed? [i] " read ANSWER case "$ANSWER" in [rR]) case "${PRESERVE_FILES}" in [Yy][Ee][Ss]) mv ${DESTDIR}${COMPFILE#.} ${PRESERVE_FILES_DIR}/ || exit 1 ;; *) rm -rf ${DESTDIR}${COMPFILE#.} ;; esac case "$TEMPROOT_TYPE" in 'symbolic link') ln -sf $TARGET ${DESTDIR}${COMPFILE#.} ;; esac ;; *) echo '' echo "*** See the man page about adding ${COMPFILE#.} to the list of IGNORE_FILES" press_to_continue ;; esac echo '' fi done for COMPFILE in `find . -type f | sort`; do # First, check to see if the file exists in DESTDIR. If not, the # diff_loop function knows how to handle it. # if [ ! -e "${DESTDIR}${COMPFILE#.}" ]; then case "${AUTO_RUN}" in '') diff_loop ;; *) case "${AUTO_INSTALL}" in '') # If this is an auto run, make it official echo " *** ${COMPFILE} will remain for your consideration" ;; *) diff_loop ;; esac ;; esac # Auto run test continue fi case "${STRICT}" in '' | [Nn][Oo]) # Compare $Id's first so if the file hasn't been modified # local changes will be ignored. # If the files have the same $Id, delete the one in temproot so the # user will have less to wade through if files are left to merge by hand. # ID1=`grep "[$]${ID_TAG}:" ${DESTDIR}${COMPFILE#.} 2>/dev/null` ID2=`grep "[$]${ID_TAG}:" ${COMPFILE} 2>/dev/null` || ID2=none case "${ID2}" in "${ID1}") echo " *** Temp ${COMPFILE} and installed have the same Id, deleting" rm "${COMPFILE}" ;; esac ;; esac # If the file is still here either because the $Ids are different, the # file doesn't have an $Id, or we're using STRICT mode; look at the diff. # if [ -f "${COMPFILE}" ]; then # Do an absolute diff first to see if the files are actually different. # If they're not different, delete the one in temproot. # if diff -q ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ /dev/null 2>&1; then echo " *** Temp ${COMPFILE} and installed are the same, deleting" rm "${COMPFILE}" else # Ok, the files are different, so show the user where they differ. # Use user's choice of diff methods; and user's pager if they have one. # Use less if not. # Use unified diffs by default. Context diffs give me a headache. :) # # If the user chose the -F option, test for that before proceeding # if [ -n "$FREEBSD_ID" ]; then if diff -q -I'[$]FreeBSD.*[$]' "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > \ /dev/null 2>&1; then if mm_install "${COMPFILE}"; then echo "*** Updated revision control Id for ${DESTDIR}${COMPFILE#.}" else echo "*** Problem installing ${COMPFILE}, it will remain to merge by hand later" fi continue fi fi case "${AUTO_RUN}" in '') # prompt user to install/delete/merge changes diff_loop ;; *) # If this is an auto run, make it official echo " *** ${COMPFILE} will remain for your consideration" ;; esac # Auto run test fi # Yes, the files are different fi # Yes, the file still remains to be checked done # This is for the for way up there at the beginning of the comparison echo '' echo "*** Comparison complete" if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" test -e "${MTREEFILE}" && unlink ${MTREEFILE} mv ${MTREENEW} ${MTREEFILE} fi echo '' TEST_FOR_FILES=`find ${TEMPROOT} -type f -size +0 2>/dev/null` if [ -n "${TEST_FOR_FILES}" ]; then echo "*** Files that remain for you to merge by hand:" find "${TEMPROOT}" -type f -size +0 | sort echo '' case "${AUTO_RUN}" in '') echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " read DEL_TEMPROOT case "${DEL_TEMPROOT}" in [yY]*) delete_temproot ;; *) echo " *** ${TEMPROOT} will remain" ;; esac ;; *) ;; esac else echo "*** ${TEMPROOT} is empty, deleting" delete_temproot fi case "${AUTO_INSTALLED_FILES}" in '') ;; *) case "${AUTO_RUN}" in '') ( echo '' echo '*** You chose the automatic install option for files that did not' echo ' exist on your system. The following were installed for you:' echo "${AUTO_INSTALLED_FILES}" ) | ${PAGER} ;; *) echo '' echo '*** You chose the automatic install option for files that did not' echo ' exist on your system. The following were installed for you:' echo "${AUTO_INSTALLED_FILES}" ;; esac ;; esac case "${AUTO_UPGRADED_FILES}" in '') ;; *) case "${AUTO_RUN}" in '') ( echo '' echo '*** You chose the automatic upgrade option for files that you did' echo ' not alter on your system. The following were upgraded for you:' echo "${AUTO_UPGRADED_FILES}" ) | ${PAGER} ;; *) echo '' echo '*** You chose the automatic upgrade option for files that you did' echo ' not alter on your system. The following were upgraded for you:' echo "${AUTO_UPGRADED_FILES}" ;; esac ;; esac run_it_now () { [ -n "$AUTO_RUN" ] && return local answer echo '' while : ; do if [ "$RUN_UPDATES" = always ]; then answer=y elif [ "$RUN_UPDATES" = never ]; then answer=n else echo -n ' Would you like to run it now? y or n [n] ' read answer fi case "$answer" in y) echo " Running ${1}" echo '' eval "${1}" return ;; ''|n) if [ ! "$RUN_UPDATES" = never ]; then echo '' echo " *** Cancelled" echo '' fi echo " Make sure to run ${1} yourself" return ;; *) echo '' echo " *** Sorry, I do not understand your answer (${answer})" echo '' esac done } case "${NEED_NEWALIASES}" in '') ;; *) echo '' if [ -n "${DESTDIR}" ]; then echo "*** You installed a new aliases file into ${DESTDIR}/etc/mail, but" echo " the newaliases command is limited to the directories configured" echo " in sendmail.cf. Make sure to create your aliases database by" echo " hand when your sendmail configuration is done." else echo "*** You installed a new aliases file, so make sure that you run" echo " '/usr/bin/newaliases' to rebuild your aliases database" run_it_now '/usr/bin/newaliases' fi ;; esac case "${NEED_CAP_MKDB}" in '') ;; *) echo '' echo "*** You installed a login.conf file, so make sure that you run" echo " '/usr/bin/cap_mkdb ${DESTDIR}/etc/login.conf'" echo " to rebuild your login.conf database" run_it_now "/usr/bin/cap_mkdb ${DESTDIR}/etc/login.conf" ;; esac case "${NEED_SERVICES_MKDB}" in '') ;; *) echo '' echo "*** You installed a services file, so make sure that you run" echo " '/usr/sbin/services_mkdb -q -o ${DESTDIR}/var/db/services.db ${DESTDIR}/etc/services'" echo " to rebuild your services database" run_it_now "/usr/sbin/services_mkdb -q -o ${DESTDIR}/var/db/services.db ${DESTDIR}/etc/services" ;; esac case "${NEED_PWD_MKDB}" in '') ;; *) echo '' echo "*** You installed a new master.passwd file, so make sure that you run" if [ -n "${DESTDIR}" ]; then echo " '/usr/sbin/pwd_mkdb -d ${DESTDIR}/etc -p ${DESTDIR}/etc/master.passwd'" echo " to rebuild your password files" run_it_now "/usr/sbin/pwd_mkdb -d ${DESTDIR}/etc -p ${DESTDIR}/etc/master.passwd" else echo " '/usr/sbin/pwd_mkdb -p /etc/master.passwd'" echo " to rebuild your password files" run_it_now '/usr/sbin/pwd_mkdb -p /etc/master.passwd' fi ;; esac if [ -e "${DESTDIR}/etc/localtime" -a ! -L "${DESTDIR}/etc/localtime" -a -z "${PRE_WORLD}" ]; then # Ignore if TZ == UTC echo '' [ -n "${DESTDIR}" ] && tzs_args="-C ${DESTDIR}" if [ -f "${DESTDIR}/var/db/zoneinfo" ]; then echo "*** Reinstalling `cat ${DESTDIR}/var/db/zoneinfo` as ${DESTDIR}/etc/localtime" tzsetup $tzs_args -r else echo "*** There is no ${DESTDIR}/var/db/zoneinfo file to update ${DESTDIR}/etc/localtime." echo ' You should run tzsetup' run_it_now "tzsetup $tzs_args" fi fi echo '' if [ -r "${MM_EXIT_SCRIPT}" ]; then . "${MM_EXIT_SCRIPT}" fi case "${COMP_CONFS}" in '') ;; *) . ${DESTDIR}/etc/defaults/rc.conf (echo '' echo "*** Comparing conf files: ${rc_conf_files}" for CONF_FILE in ${rc_conf_files}; do if [ -r "${DESTDIR}${CONF_FILE}" ]; then echo '' echo "*** From ${DESTDIR}${CONF_FILE}" echo "*** From ${DESTDIR}/etc/defaults/rc.conf" for RC_CONF_VAR in `grep -i ^[a-z] ${DESTDIR}${CONF_FILE} | cut -d '=' -f 1`; do echo '' grep -w ^${RC_CONF_VAR} ${DESTDIR}${CONF_FILE} grep -w ^${RC_CONF_VAR} ${DESTDIR}/etc/defaults/rc.conf || echo ' * No default variable with this name' done fi done) | ${PAGER} echo '' ;; esac if [ -n "${PRESERVE_FILES}" ]; then find -d $PRESERVE_FILES_DIR -type d -empty -delete 2>/dev/null rmdir $PRESERVE_FILES_DIR 2>/dev/null fi exit 0 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright (c) 1998-2012 Douglas Barton # 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 AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.