dragonfly.git
3 years agoBring in efibootmgr(8) from FreeBSD.
Sascha Wildner [Sat, 13 Jun 2020 06:52:58 +0000 (08:52 +0200)]
Bring in efibootmgr(8) from FreeBSD.

Taken-from: FreeBSD

3 years agoinitrd/mkinitrd.sh: Use 'du -t' to simplify size calculation
Aaron LI [Fri, 12 Jun 2020 15:57:01 +0000 (23:57 +0800)]
initrd/mkinitrd.sh: Use 'du -t' to simplify size calculation

The du(1)'s '-t' option calculates the apparent size, which is what we
want here for determining the required size of the initrd image.  This
saves us a shell function to do the same work.

3 years agoetc/periodic: Use 'LINKS' to create links for 220.snapshot-hammer2
Aaron LI [Fri, 12 Jun 2020 14:58:42 +0000 (22:58 +0800)]
etc/periodic: Use 'LINKS' to create links for 220.snapshot-hammer2

Avoid the ad-hoc 'ln' command.  In addition, the original linked-to
files are absolute paths but missing the '${DESTDIR}', so they can be on
two different installations.  Use 'LINKS' that creates hard-links to
fix this issue.

Reviewed-by: swildner, deef
3 years agomk/bsd.README: Document 'SYMLINKS' and update 'LINKS' and 'MLINKS'
Aaron LI [Fri, 12 Jun 2020 14:54:53 +0000 (22:54 +0800)]
mk/bsd.README: Document 'SYMLINKS' and update 'LINKS' and 'MLINKS'

* Add description of 'SYMLINKS' that creates symbolic links.
* 'MLINKS' creates hard links rather than soft links.
* Update description of 'LINKS' and the example.  '${DESTDIR}' will be
  auto prepended so it should not be used.

Reviewed-by: swildner
3 years agoUpgrade less(1). 2/2
Daniel Fojt [Fri, 12 Jun 2020 11:34:05 +0000 (13:34 +0200)]
Upgrade less(1). 2/2

- update README.{DELETED,DRAGONFLY}
- import regenerated defines.h
- fix -Werror=unused-variable in screen.c

3 years agoUpgrade less(1). 1/2
Daniel Fojt [Fri, 12 Jun 2020 11:33:18 +0000 (13:33 +0200)]
Upgrade less(1). 1/2

Merge branch vendor/LESS into master.

3 years agovendor/less: upgrade from 481 to 551
Daniel Fojt [Fri, 12 Jun 2020 11:32:09 +0000 (13:32 +0200)]
vendor/less: upgrade from 481 to 551

- unicode tables updated
- new commands added
- new cmdline options introduced
- bugs and memory leaks fixed

For details see:

http://www.greenwoodsoftware.com/less/news.487.html
http://www.greenwoodsoftware.com/less/news.530.html
http://www.greenwoodsoftware.com/less/news.551.html

3 years agokernel - Refactor sysclock_t from 32 to 64 bits (2)
Matthew Dillon [Thu, 11 Jun 2020 22:57:04 +0000 (15:57 -0700)]
kernel - Refactor sysclock_t from 32 to 64 bits (2)

* Cputimer reload values can be negative, check condition and
  set a small positive reload value instead.

* Also avoids muldivu64() overflow warnings on the console.

Reported-by: kworr
3 years agoshare/example/Makefile: Sort better.
Sascha Wildner [Thu, 11 Jun 2020 20:37:18 +0000 (22:37 +0200)]
share/example/Makefile: Sort better.

3 years agoProperly ignore "trim" failures in swapon(8).
Daniel Fojt [Thu, 11 Jun 2020 18:11:55 +0000 (20:11 +0200)]
Properly ignore "trim" failures in swapon(8).

When trying to "trim" a swap device that doesn't support this, just ignore
particular ioctl() failure and continue activating the swap. This actually
matches the behaviour described in swapon(8) manpage.

Issue: https://bugs.dragonflybsd.org/issues/3207

3 years agoUpgrade diffutils. 2/2
Daniel Fojt [Wed, 10 Jun 2020 09:32:29 +0000 (11:32 +0200)]
Upgrade diffutils. 2/2

- update README.{DELETED,DRAGONFLY}
- regenerate header files
- adapt Makefile to vendor update

3 years agoUpgrade diffutils. 1/2
Daniel Fojt [Thu, 11 Jun 2020 12:33:51 +0000 (14:33 +0200)]
Upgrade diffutils. 1/2

Merge branch vendor/DIFFUTILS into master.

3 years agovendor/diffutils: upgrade from 3.3 to 3.7 vendor/DIFFUTILS
Daniel Fojt [Wed, 10 Jun 2020 09:05:53 +0000 (11:05 +0200)]
vendor/diffutils: upgrade from 3.3 to 3.7

Summary of notable changes:

- new options --color and --palette to generate and configure colored
  output, compatible with less -R
- when binary files differ, diff now exits with status 1 as POSIX requires
- unless the --ignore-file-name-case option is used, diff now
  considers file names to be equal only if they are byte-for-byte
  equivalent
- diff -B no longer generates incorrect output if the two inputs each end
  with a one-byte incomplete line
- diff --brief no longer reports a difference for unusual identical files
- diff3 no longer malfunctions due to use-after-free
- using an invalid regular expression with --ignore-matching-lines=RE (-I)
  no longer causes stack overflow
- possible uninitialized memory read with --strip-trailing-cr fixed
- default algorithm has been adjusted to output higher-quality results,
  and further tweaked to deal better with larger files

For a complete history of changes see:

http://git.savannah.gnu.org/cgit/diffutils.git/log/

3 years agokernel: fix misleading error from allocating file descriptors
Daniel Fojt [Thu, 11 Jun 2020 09:25:27 +0000 (11:25 +0200)]
kernel: fix misleading error from allocating file descriptors

Return EINVAL instead of EMFILE when requested new file descriptor number
exceeds the limit.

Discussed with: Sascha Wildner

3 years agoDeduplicate login environment setup.
Daniel Fojt [Tue, 9 Jun 2020 11:28:45 +0000 (13:28 +0200)]
Deduplicate login environment setup.

Revise default environment assignments in login.conf(5).

Update share/skel/dot.profile to match share/skel/dot.cshrc, ie. comment
assignments done via login.conf (PATH, BLOCKSIZE, umask).

Drop etc/root and update "distribution" target in Makefile to use
share/skel/* instead.

Discussed with and reviewed by: Sascha Wildner
Issue: https://bugs.dragonflybsd.org/issues/3220

3 years agoworld - Change serial port default from 9600 to 115200
Matthew Dillon [Wed, 10 Jun 2020 21:00:28 +0000 (14:00 -0700)]
world - Change serial port default from 9600 to 115200

* Long overdue change, all serial port defaults are now set to
  115200.

* NOTE: legacy BIOS boot0/boot1 use int 0x14 to set the serial
  console baud rate.  This BIOS call only supports up to 9600.
  But once you get into the boot loader it should be able to set
  the correct baud rate.

3 years agoboot.8: Markup a kernel configuration option better.
Sascha Wildner [Wed, 10 Jun 2020 20:06:46 +0000 (22:06 +0200)]
boot.8: Markup a kernel configuration option better.

3 years agouefi.8: Add a reference to efidp(8).
Sascha Wildner [Wed, 10 Jun 2020 19:27:54 +0000 (21:27 +0200)]
uefi.8: Add a reference to efidp(8).

3 years agohammer2.8: Sort SEE ALSO.
Sascha Wildner [Wed, 10 Jun 2020 14:14:19 +0000 (16:14 +0200)]
hammer2.8: Sort SEE ALSO.

3 years agoSync shutdown(8) and reboot(8) with FreeBSD
Krzysztof Piecuch [Sat, 6 Jun 2020 21:55:06 +0000 (21:55 +0000)]
Sync shutdown(8) and reboot(8) with FreeBSD

shutdown now understands offsets in seconds, minutes and hours.
reboot is harder to kill ignoring SIGPIPE, SIGINT, SIGQUIT and SIGSTP.

Taken-from: FreeBSD

3 years agoStop overwriting /etc/gettytab on every 'make upgrade'.
Sascha Wildner [Tue, 9 Jun 2020 19:05:42 +0000 (21:05 +0200)]
Stop overwriting /etc/gettytab on every 'make upgrade'.

There isn't really any important movement in it from our side, but there
are some scenarios (autologin for example) where a user may have changed
it.

3 years agokernel - Refactor sysclock_t from 32 to 64 bits
Matthew Dillon [Tue, 9 Jun 2020 16:08:16 +0000 (09:08 -0700)]
kernel - Refactor sysclock_t from 32 to 64 bits

* Refactor the core cpu timer API, changing sysclock_t from 32
  to 64 bits.  Provide a full 64-bit count from all sources.

* Implement muldivu64() using gcc's 128-bit integer type.  This
  functions takes three 64-bit valus, performs (a * b) / d
  using a 128-bit intermediate calculation, and returns a 64-bit
  result.

  Change all timer scaling functions to use this function which
  effectively gives systimers the capability of handling any
  timeout that fits 64 bits for the timer's resolution.

* Remove TSC frequency scaling, it is no longer needed.  The
  TSC timer is now used at its full resolution.

* Use atomic_fcmpset_long() instead of a clock spinlock when
  updating the msb bits for hardware timer sources less than
  64 bits wide.

* Properly recalculate existing systimers when the clock source
  is changed.  Existing systimers were not being recalculated,
  leading to the system failing to boot when time sources had
  radically different clock frequencies.

3 years agodrm/linux: Add work_pending()
François Tigeot [Tue, 9 Jun 2020 07:32:37 +0000 (09:32 +0200)]
drm/linux: Add work_pending()

3 years agodrm/linux: Add raw_read_seqcount()
François Tigeot [Tue, 9 Jun 2020 07:31:49 +0000 (09:31 +0200)]
drm/linux: Add raw_read_seqcount()

3 years agodrm/linux: Add swiotlb_max_segment()
François Tigeot [Tue, 9 Jun 2020 07:30:24 +0000 (09:30 +0200)]
drm/linux: Add swiotlb_max_segment()

3 years agosbin/newfs_hammer2: Remove extra line break after printf outputs
Tomohiro Kusumi [Mon, 8 Jun 2020 17:50:04 +0000 (02:50 +0900)]
sbin/newfs_hammer2: Remove extra line break after printf outputs

This probably came from newfs_hammer.c, but HAMMER2 doesn't have
a note after this.

3 years agoread.2: improve formatting of previous addition
Daniel Fojt [Mon, 8 Jun 2020 17:11:42 +0000 (19:11 +0200)]
read.2: improve formatting of previous addition

- start sentences on new lines
- highlight mentioned functions properly
- add a reference to readdir(3)

Pointed out by: Sascha Wildner

3 years agoread.2: describe EISDIR error
Daniel Fojt [Mon, 8 Jun 2020 13:13:52 +0000 (15:13 +0200)]
read.2: describe EISDIR error

Discussed with: Sascha Wildner

3 years agokernel: more precious errors from read()ing hammer and hammer2
Daniel Fojt [Mon, 8 Jun 2020 12:42:10 +0000 (14:42 +0200)]
kernel: more precious errors from read()ing hammer and hammer2

To conform POSIX, return EISDIR instead of EINVAL when trying to read(2)
a directory from hammer or hammer2 filesystem.

Discussed with and reviewed by: Sascha Wildner

3 years agoImplement periodic hammer2 snapshots.
Daniel Fojt [Mon, 8 Jun 2020 07:38:49 +0000 (09:38 +0200)]
Implement periodic hammer2 snapshots.

- add new periodic(8) script 220.snapshot-hammer2 to daily interval
- symlink the script also into weekly and monthly intervals
- extend default periodic.conf(5) with variables to configure the script
- describe new variables in periodic.conf.5 manpage
- mention the functionality also in hammer2.8 manpage

Note: "daily" variables are used by the script as defaults, so it's
      possible to set custom cron entry for different periodic invocation
      of the script, to create for example hourly snapshots

Discussed with, reviewed and tested by: Matthew Dillon

3 years agodrm/linux: Rewrite dev_printk()
François Tigeot [Mon, 8 Jun 2020 05:51:16 +0000 (07:51 +0200)]
drm/linux: Rewrite dev_printk()

3 years agodrm/linux: Rewrite seq_printf()
François Tigeot [Mon, 8 Jun 2020 05:46:06 +0000 (07:46 +0200)]
drm/linux: Rewrite seq_printf()

3 years agodrm/mm: Fix definitions of alloc_pages() and __free_pages()
François Tigeot [Mon, 8 Jun 2020 05:42:44 +0000 (07:42 +0200)]
drm/mm: Fix definitions of alloc_pages() and __free_pages()

3 years agodrm/linux: Add mutex_lock_nested() and mutex_trylock_recursive()
François Tigeot [Mon, 8 Jun 2020 05:42:20 +0000 (07:42 +0200)]
drm/linux: Add mutex_lock_nested() and mutex_trylock_recursive()

3 years agodrm/linux: Add list_for_each_entry_safe_reverse()
François Tigeot [Mon, 8 Jun 2020 05:39:28 +0000 (07:39 +0200)]
drm/linux: Add list_for_each_entry_safe_reverse()

Obtained-from: FreeBSD

3 years agodrm/linux: Improve put_user()
François Tigeot [Mon, 8 Jun 2020 05:35:44 +0000 (07:35 +0200)]
drm/linux: Improve put_user()

3 years agoefidp.8: Remove unneeded .Pp
Sascha Wildner [Sun, 7 Jun 2020 20:50:44 +0000 (22:50 +0200)]
efidp.8: Remove unneeded .Pp

3 years agokernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug) (3)
Matthew Dillon [Sun, 7 Jun 2020 18:30:49 +0000 (11:30 -0700)]
kernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug) (3)

* Fix a second timer overflow.  The systimer clock variable is
  actualy only 32 bits, a 10 minute timeout will overflow it.
  Change the kqueue timeout to 1 minute to work-around.

  (We really need to redo sysclock_t from 32 to 64 bits)

* This should finally fix both swildner's panic and rsmarples
  continued early timeout issue.

Reported-by: swildner, rsmarples
3 years agodrm: Add linux/llist.h
François Tigeot [Sun, 7 Jun 2020 08:11:47 +0000 (10:11 +0200)]
drm: Add linux/llist.h

Mostly obtained from OpenBSD with a few key modifications

3 years agodrm/linux: Fix casting issues in cmpxchg()
François Tigeot [Sun, 7 Jun 2020 08:09:41 +0000 (10:09 +0200)]
drm/linux: Fix casting issues in cmpxchg()

3 years agolibefivar: Fix (instead of silence) the remaining warnings in libefivar.
Sascha Wildner [Sun, 7 Jun 2020 07:49:43 +0000 (09:49 +0200)]
libefivar: Fix (instead of silence) the remaining warnings in libefivar.

3 years agokernel - Increase KNOTE_CACHE_MAX
Matthew Dillon [Sat, 6 Jun 2020 18:08:22 +0000 (11:08 -0700)]
kernel - Increase KNOTE_CACHE_MAX

* Increase KNOTE_CACHE_MAX from 8 to 64 descriptors.  These are tiny
  descriptors, we can afford to have a larger per-cpu cache.

3 years agokernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug) (2)
Matthew Dillon [Sat, 6 Jun 2020 18:05:53 +0000 (11:05 -0700)]
kernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug) (2)

* Certain unsupported EV_ERROR events can cause kern_kevent() to
  live-lock, which hits a 'checkloop failed' panic.  Silently
  deregister such events.

* Complain and deregister any kqueue event on behalf of *poll()
  which does not set any poll return flags.

Reported-by: swildner
3 years agosbin/fsck_hammer2: Fix siz in tsnprintf()
Tomohiro Kusumi [Sat, 6 Jun 2020 17:12:06 +0000 (02:12 +0900)]
sbin/fsck_hammer2: Fix siz in tsnprintf()

Prevent small terminal width causing newline behavior in
print_blockref_stats() in verify_blockref().

3 years agoBring in efidp(8) from FreeBSD.
Sascha Wildner [Sat, 6 Jun 2020 07:09:28 +0000 (09:09 +0200)]
Bring in efidp(8) from FreeBSD.

Taken-from: FreeBSD

3 years agoSync uefisign(8) with FreeBSD.
Sascha Wildner [Sat, 6 Jun 2020 06:35:24 +0000 (08:35 +0200)]
Sync uefisign(8) with FreeBSD.

Taken-from: FreeBSD

3 years agoSync libefivar and efivar(8) with FreeBSD.
Sascha Wildner [Sat, 6 Jun 2020 05:30:48 +0000 (07:30 +0200)]
Sync libefivar and efivar(8) with FreeBSD.

Some larger adjustments were needed in efivar-dp-xlate.c to work
around geom.

Taken-from: FreeBSD

3 years agodrm: Switch to the OpenBSD dma-fence implementation
François Tigeot [Sat, 6 Jun 2020 04:50:06 +0000 (06:50 +0200)]
drm: Switch to the OpenBSD dma-fence implementation

The old NetBSD one did not respect sleep/wakeup sequences Linux code expects

3 years agodrm/linux/dma-buf: Rename struct fence to dma_fence
François Tigeot [Sat, 6 Jun 2020 04:49:35 +0000 (06:49 +0200)]
drm/linux/dma-buf: Rename struct fence to dma_fence

3 years agohammer2 - Enhance pfs-list and pfs-delete (2)
Matthew Dillon [Fri, 5 Jun 2020 20:34:41 +0000 (13:34 -0700)]
hammer2 - Enhance pfs-list and pfs-delete (2)

* Fix cast error last commit.

Reported-by: CuteLarva
3 years agohammer2 - Enhance pfs-list and pfs-delete
Matthew Dillon [Fri, 5 Jun 2020 19:33:26 +0000 (12:33 -0700)]
hammer2 - Enhance pfs-list and pfs-delete

* Enhance pfs-list to list PFSs available across all mounted hammer2
  filesystems instead of just the current directory's mount.  A
  specific mount may be specified via -s mountpt.

* Enhance pfs-delete to look for the PFS name across all mounted
  hammer2 filesystems instead of just the current directory's mount.

  As a safety, pfs-delete will refuse to delete PFS names which are
  duplicated across multiple mounts.  A specific mount may be specified
  via -s mountpt.

3 years agoautofs: Fix example file installation.
Sascha Wildner [Fri, 5 Jun 2020 09:42:31 +0000 (11:42 +0200)]
autofs: Fix example file installation.

Reported-by: deef
3 years agokernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug)
Matthew Dillon [Thu, 4 Jun 2020 23:33:04 +0000 (16:33 -0700)]
kernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug)

* Fix a bug where large timeouts or very small timeouts could
  overflow the ustimeout variable.  Change the internal timeout
  cap to ensure that no overflow occurs.

* Fix another bug where the internal timeout cap could cause
  ppoll() to return early.  Internal tsleep (etc) timeouts
  need to be ignored because the external timeout might be
  larger and will handle the error return for us when it is
  checked.

* Refactor kern_kevent() to be somewhat more efficient.

Reported-by: rsmarples
3 years agoA little cleanup after recent dhcpcd(8) changes.
Sascha Wildner [Thu, 4 Jun 2020 21:31:34 +0000 (23:31 +0200)]
A little cleanup after recent dhcpcd(8) changes.

* Remove /var/chroot via 'make upgrade' for now.

* Use spaces for indenting in BSD.var.dist.

* Un-document dhcpcd_chrootdir and /var/chroot.

3 years agodhcp: Restore /var/empty as the homedir
Roy Marples [Thu, 4 Jun 2020 21:26:12 +0000 (21:26 +0000)]
dhcp: Restore /var/empty as the homedir

Punt the old chroot /var/chroot/dhcp

3 years agoautofs: Continue installing auto_master to /usr/share/examples/etc too.
Sascha Wildner [Thu, 4 Jun 2020 21:24:30 +0000 (23:24 +0200)]
autofs: Continue installing auto_master to /usr/share/examples/etc too.

We keep an unmodified copy of our shipped /etc in /usr/share/examples/etc
and the recent move of auto_master from etc/ (where we get this copying
gratis) to usr.sbin/autofs requires an extra Makefile now.

3 years agoedk2: Bring in a bunch of additional TianoCore EDK II headers.
Sascha Wildner [Thu, 4 Jun 2020 19:31:29 +0000 (21:31 +0200)]
edk2: Bring in a bunch of additional TianoCore EDK II headers.

Taken from the MdePkg of the edk2-stable202005 tag of the
git://github.com/tianocore/edk2 repository. All I modified was
killing CRs using 'tr -d "\015"'.

In preparation for some upcoming efidp work in libefivar.

3 years agoedk2: Sync our TianoCore EDK II headers with the edk2-stable202005 tag.
Sascha Wildner [Thu, 4 Jun 2020 19:29:47 +0000 (21:29 +0200)]
edk2: Sync our TianoCore EDK II headers with the edk2-stable202005 tag.

3 years agoFD_SET: cast away signed vs unsigned conversion warnings
Roy Marples [Thu, 4 Jun 2020 15:50:20 +0000 (15:50 +0000)]
FD_SET: cast away signed vs unsigned conversion warnings

3 years agodhcpcd: Update README
Roy Marples [Thu, 4 Jun 2020 13:29:54 +0000 (13:29 +0000)]
dhcpcd: Update README

3 years agoBuild with dhcpcd-9.1.1
Roy Marples [Thu, 4 Jun 2020 13:27:21 +0000 (13:27 +0000)]
Build with dhcpcd-9.1.1

3 years agoMerge branch 'vendor/DHCPCD'
Roy Marples [Thu, 4 Jun 2020 13:25:22 +0000 (13:25 +0000)]
Merge branch 'vendor/DHCPCD'

3 years agoImport dhcpcd-9.1.1 with the following changes:
Roy Marples [Thu, 4 Jun 2020 13:23:18 +0000 (13:23 +0000)]
Import dhcpcd-9.1.1 with the following changes:

 * Restore dumping leases from stdin
 * auth: Only accept RECONFIGURE messages from LL addresses
 * auth: Access the RDM monotonic counter file via privsep
 * ARP: call arp_announced() when cancelling it
 * BSD: fwip(4) interfaces are now ignored by default
 * privsep: Ensure IPC buffers are large enough to carry messages
 * privsep: Only open RAW sockets for the needed protocols
 * privsep: Fix indirect ioctls returning data
 * privsep: wait for processes on SIGCHLD rather than when sent a STOP cmd
 * eloop: just use ppoll/pollts(2), falling back to pselect(2)

3 years agodrm/linux: Add pid_nr()
François Tigeot [Thu, 4 Jun 2020 11:35:29 +0000 (13:35 +0200)]
drm/linux: Add pid_nr()

3 years agodrm/linux: Fix ratelimit.h copyright
François Tigeot [Thu, 4 Jun 2020 11:33:43 +0000 (13:33 +0200)]
drm/linux: Fix ratelimit.h copyright

3 years agonrelease: Stop putting the wpa_supplicant pkg on our install media.
Sascha Wildner [Thu, 4 Jun 2020 10:19:08 +0000 (12:19 +0200)]
nrelease: Stop putting the wpa_supplicant pkg on our install media.

Base wpa_supplicant was recently upgraded to 2.9.

3 years agobuild.7: mention "build-all" and "install-all" targets
Daniel Fojt [Thu, 4 Jun 2020 07:01:24 +0000 (09:01 +0200)]
build.7: mention "build-all" and "install-all" targets

Describe "build-all" and "install-all" targets in both Makefile
and build(7).

Submitted by: Pierre-Alain TORET <pierre-alain.toret@protonmail.com>
Issue: https://bugs.dragonflybsd.org/issues/3229

3 years agokernel: avoid possible sysctl integer overflow in acpi_thinkpad(4)
Daniel Fojt [Thu, 4 Jun 2020 05:28:22 +0000 (07:28 +0200)]
kernel: avoid possible sysctl integer overflow in acpi_thinkpad(4)

3 years agoautofs: Remove BUGS section from autofs(5)
Tomohiro Kusumi [Wed, 3 Jun 2020 17:28:36 +0000 (02:28 +0900)]
autofs: Remove BUGS section from autofs(5)

vfs.autofs.mount_on_stat was initially nop, but removed later on.

3 years agoautofs: Sync autofs(5) with FreeBSD
Tomohiro Kusumi [Wed, 3 Jun 2020 17:20:05 +0000 (02:20 +0900)]
autofs: Sync autofs(5) with FreeBSD

from freebsd/freebsd@215ce0ad1ae5c6fa927904738502bfe39bf56ac2

Minimize diff vs FreeBSD.
vfs.autofs.mount_on_stat (automount on vop_getattr) is unsupported.

3 years agokernel/acpi: sync acpi_thinkpad with FreeBSD acpi_ibm
Pierre-Alain TORET [Wed, 3 Jun 2020 14:13:14 +0000 (16:13 +0200)]
kernel/acpi: sync acpi_thinkpad with FreeBSD acpi_ibm

Note: sysctl(8) variables hw.acpi.thinkpad.* have moved to
      dev.acpi_thinkpad.0.*

Discussed with: Sascha Wildner
Reviewed and tested by: Daniel Fojt

3 years agodrm: Add Coccinelle transformation scripts
François Tigeot [Wed, 3 Jun 2020 12:30:25 +0000 (14:30 +0200)]
drm: Add Coccinelle transformation scripts

In order to automate various changes in cases where the original
Linux source code cannot be used unmodified.

3 years agokernel/efirt: Fix a kfree(NULL) panic when deleting a UEFI variable.
Sascha Wildner [Tue, 2 Jun 2020 18:24:30 +0000 (20:24 +0200)]
kernel/efirt: Fix a kfree(NULL) panic when deleting a UEFI variable.

There is no data in this case. Rest of function is ok, just a forgotten
datasize check.

3 years agoUpgrade grep(1). 2/2
Daniel Fojt [Tue, 2 Jun 2020 16:59:02 +0000 (18:59 +0200)]
Upgrade grep(1). 2/2

Adapt master branch to vendor update:

- update README.DELETED and README.DRAGONFLY
- re-generate header files
- adapt build
- sync manpage grep.1 with vendor

Reviewed by: Sascha Wildner

3 years agoUpgrade grep(1). 1/2
Daniel Fojt [Tue, 2 Jun 2020 16:58:15 +0000 (18:58 +0200)]
Upgrade grep(1). 1/2

Merge branch 'vendor/GREP' into master.

3 years agovendor/grep: upgrade from 2.22 to 3.4 vendor/GREP
Daniel Fojt [Tue, 2 Jun 2020 16:56:39 +0000 (18:56 +0200)]
vendor/grep: upgrade from 2.22 to 3.4

3 years agoautofs: Move autofs related configs to usr.sbin/autofs/
Tomohiro Kusumi [Tue, 2 Jun 2020 14:30:05 +0000 (23:30 +0900)]
autofs: Move autofs related configs to usr.sbin/autofs/

from freebsd/freebsd@b92449059479770813b2766a0e757d1176e2fab6

FreeBSD has moved autofs scripts to autofs userspace code a while ago.
The end result doesn't change.

3 years agobsd-family-tree: Sync with FreeBSD (2.11BSD release date fix).
Sascha Wildner [Tue, 2 Jun 2020 08:40:39 +0000 (10:40 +0200)]
bsd-family-tree: Sync with FreeBSD (2.11BSD release date fix).

3 years agoetc/network.subr: enhance wlan initialization
Daniel Fojt [Fri, 29 May 2020 17:34:24 +0000 (19:34 +0200)]
etc/network.subr: enhance wlan initialization

Introduce new functions wlan_get_unused() and wlan_is_parent(),
and extend wlan_up() to utilize them.

With this change, devices configured the traditional way in rc.conf(5)
are created first, and then all other wireless interfaces are assigned
to next available wlan<index> devices automatically.

This allows either to have wlan configured manually in rc.conf(5) via
"wlans_<iface>" or to remove the static assignment and let devices be
auto-created. With dhcpcd_enable and wpa_supplicant_enable in rc.conf,
no further configuration is then needed to get network connectivity.

Furthermore, this will allow to enhance devd(8) default configuration,
so that also hot-pluggable wireless interfaces are automatically detected
and brought up (ie. assigned to wlan<index> devices).

Reviewed by: Aaron LI

3 years agodhcpcd: Move any existing files out of the dhcp chroot.
Roy Marples [Mon, 1 Jun 2020 13:57:36 +0000 (13:57 +0000)]
dhcpcd: Move any existing files out of the dhcp chroot.

So it's empty once more.

3 years agodhcpcd: Remove chroot setup and restore things as they were before
Roy Marples [Mon, 1 Jun 2020 10:12:39 +0000 (10:12 +0000)]
dhcpcd: Remove chroot setup and restore things as they were before

Newer dhcpcd has an empty chroot.

3 years agoMerge branch 'vendor/DHCPCD'
Roy Marples [Mon, 1 Jun 2020 10:02:34 +0000 (10:02 +0000)]
Merge branch 'vendor/DHCPCD'

3 years agoUpdate to dhcpcd-9.1.0 with the following changes:
Roy Marples [Mon, 1 Jun 2020 09:57:38 +0000 (09:57 +0000)]
Update to dhcpcd-9.1.0 with the following changes:

 * Leases are stored outside the chroot again
 * The chroot directory can now be (and should be) empty [1]
 * BPF: set write filters when supported
 * ARP is now per address rather than per interface
 * Filter allowed ioctls in the privileged actioneer
 * Filter allowed UDP ports used by sendto(2) in the privileged actioneer
 * Filter allowed file paths in the privileged actioneer
 * route socket is now drained on overflow as it cannot be
   re-opened by the unpriviledged user

 * hostname can no longer be clobbered by SLAAC
 * grep is no longer used by the test hook
 * Interface hardware address type changes are now picked up
 * Fixed some RA timing issues
 * Fixed nd_* option parsing in dhcpcd.conf
 * Allow SIGPIPE in scripts
 * Default dhcpcd.conf no longer sends the current hostname
 * Default dhcpcd.conf no longer sends a vendorclassid

3 years agodsynth - Track contents of dports to detect changes
Matthew Dillon [Sun, 31 May 2020 00:36:00 +0000 (17:36 -0700)]
dsynth - Track contents of dports to detect changes

* Stat information and path names for the files making up a port
  (in the dports directly tree) is rolled-up into a CRC and tracked
  by dsynth.

* By default, dsynth automatically rebuilds any dport that it detects
  has changed, even if a binary package file already exists, including
  any dependent ports.

* Add the -x and -xx options which may be used to override this behavior.

3 years agokernel/pci: Remove embedded newlines in sysctl descriptions.
Sascha Wildner [Sat, 30 May 2020 18:12:23 +0000 (20:12 +0200)]
kernel/pci: Remove embedded newlines in sysctl descriptions.

3 years agokernel/pci: Correct an old TUNABLE_INT() to TUNABLE_ULONG().
Sascha Wildner [Sat, 30 May 2020 17:46:09 +0000 (19:46 +0200)]
kernel/pci: Correct an old TUNABLE_INT() to TUNABLE_ULONG().

While here, make the sysctl description look nicer.

3 years agodsynth - Work on count mismatch issues, fix binary pkg deletion
Matthew Dillon [Sat, 30 May 2020 15:43:20 +0000 (08:43 -0700)]
dsynth - Work on count mismatch issues, fix binary pkg deletion

* The remaining count issue was due to an incorrect test
  involving PKGF_NOTREADY, which also happens to be the code
  which is supposed to delete packages with missing or modified
  dependencies.

* Fix the test.  This should fix both the remaining count issue
  (any remaining issues will be logged in 05*.log), and hopefully
  also properly delete packages with missing or modified dependencies
  at the start of the run (logged as DELETE-PACKAGE in 00*.log).

Reported-by: tuxillo
3 years agodsynth - Work on count mismatch issues
Matthew Dillon [Sat, 30 May 2020 06:38:11 +0000 (23:38 -0700)]
dsynth - Work on count mismatch issues

* Sometimes the individual counts do not add up to the total
  count.

* Fix an issue where 'pkg' is not always accounted for.

* Fix an issue where certain ignored packages are not passed on
  to the service list.

* Log unexpected PKGF_PACKAGED state in 05_abnormal*.log.  This
  typically occurs on incremental runs and is not being properly
  accounted for.

* Log any packages left over on the origination list after the
  run completes to 05_abnormal*.log.  These are usually dependencies
  on ports which do not exist in dports.

3 years agoRemove references to acpinames(8) from various manual pages.
Sascha Wildner [Fri, 29 May 2020 20:17:14 +0000 (22:17 +0200)]
Remove references to acpinames(8) from various manual pages.

3 years agousr.sbin/autofs: Cleanup workaround code for a VFS bug
Tomohiro Kusumi [Fri, 29 May 2020 16:46:19 +0000 (01:46 +0900)]
usr.sbin/autofs: Cleanup workaround code for a VFS bug

3 years agoautofs: Minimize non functional diff vs FreeBSD
Tomohiro Kusumi [Fri, 29 May 2020 15:45:05 +0000 (00:45 +0900)]
autofs: Minimize non functional diff vs FreeBSD

3 years agosys/sys/mount.h: Add fsidcmp()
Tomohiro Kusumi [Thu, 28 May 2020 17:33:09 +0000 (02:33 +0900)]
sys/sys/mount.h: Add fsidcmp()

Only used by autofs at the moment.

from freebsd/freebsd@30596480c966b8d8bc7436df3467ab2eac145751

3 years agoSync ACPICA with Intel's version 20200528.
Sascha Wildner [Fri, 29 May 2020 07:05:17 +0000 (09:05 +0200)]
Sync ACPICA with Intel's version 20200528.

* Remove acpinames(8). Its functionality is covered by acpiexec(8)'s
  'namespace' command.

* Add preliminary support for 'PlatformRtMechanism' address space
  (will be in the next ACPI specification).

* Fix some issues in iasl(8).

For detailed list, please see sys/contrib/dev/acpica/changes.txt.

3 years agokernel - Fix efivar panic
Matthew Dillon [Fri, 29 May 2020 05:41:32 +0000 (22:41 -0700)]
kernel - Fix efivar panic

* The efirt driver uses direct-map mode, and creates an independent
  pmap to hold it.  The direct map typically uses userspace addresses,
  so SMAP must be disabled across any EFI call.

* Add smap_open(), smap_close(), smap_smep_disable(), and
  smap_smep_enable() calls for C.

  NOTE: We also have to set pcb_onfault to non-NULL to bypass failsafe
checks done in trap().

* Hack the EFI address space code to disable SMAP and SMEP across
  the EFI call.  Unfortunately since we also have to disable SMEP,
  these functions have to manipulate CR4.

Reported-by: daftaupe
3 years agopatch(1): sync with FreeBSD to version 2.0-12u11
Daniel Fojt [Tue, 26 May 2020 14:24:08 +0000 (16:24 +0200)]
patch(1): sync with FreeBSD to version 2.0-12u11

Summary of notable changes from previous sync:

- add -Vnone option to disable backup files
- avoid infinite loop asking for a filename
- add support for git generated diffs
- don't overrun line buffer in some cases
- fix the file removal test
- give /dev/null patches special treatment

3 years agoTest commit.
Daniel Fojt [Thu, 28 May 2020 06:56:25 +0000 (08:56 +0200)]
Test commit.

Update test/test/README as suggested in committer(7).

Recommended by: Sascha Wildner :)

3 years agoClean up the namespace of <sys/timeb.h>.
Sascha Wildner [Tue, 26 May 2020 17:22:04 +0000 (19:22 +0200)]
Clean up the namespace of <sys/timeb.h>.

While here, do some whitespace cleanup.

3 years agodrm/linux: Add down_write_killable()
François Tigeot [Mon, 25 May 2020 20:24:02 +0000 (22:24 +0200)]
drm/linux: Add down_write_killable()

3 years agoCURDIR returns an absolute path, so GENLOGDIR does not need this slash in it.
Justin C. Sherrill [Mon, 25 May 2020 15:51:04 +0000 (11:51 -0400)]
CURDIR returns an absolute path, so GENLOGDIR does not need this slash in it.

3 years agomount_msdos: Oops, really sort.
Sascha Wildner [Sun, 24 May 2020 20:28:09 +0000 (22:28 +0200)]
mount_msdos: Oops, really sort.