dragonfly.git
2 years agolibc: Fix a number of .PATH related issues in the Makefiles.
Sascha Wildner [Sat, 6 Nov 2021 10:23:42 +0000 (11:23 +0100)]
libc: Fix a number of .PATH related issues in the Makefiles.

* Adjust a couple of .PATHs in libc's Makefiles so that libc_rtld can
  reuse them.

* Remove non-existent .PATHs.

2 years agolibc/Makefile.inc: Sort includes alphabetically.
Sascha Wildner [Sat, 6 Nov 2021 10:20:56 +0000 (11:20 +0100)]
libc/Makefile.inc: Sort includes alphabetically.

2 years agofile(1): Fix a small issue in a magic(5) file.
Sascha Wildner [Fri, 5 Nov 2021 19:07:41 +0000 (20:07 +0100)]
file(1): Fix a small issue in a magic(5) file.

2 years agokernel: Fix LINT64 build.
Sascha Wildner [Thu, 4 Nov 2021 09:03:23 +0000 (10:03 +0100)]
kernel: Fix LINT64 build.

* Add a needed file to sys/conf/files.

* Shield the drm code from 'DEBUG' being defined via opt_global.h (DEBUG
  is a kernel configuration option). This was breaking amdgpu's atom.c
  that defines its own 'DEBUG' macro.

2 years agokernel/files: Remove duplicate line.
Sascha Wildner [Wed, 3 Nov 2021 21:04:07 +0000 (22:04 +0100)]
kernel/files: Remove duplicate line.

2 years agodrm: enable amdgpu module build; update radeon to use updated ttm api
Sergey Zigachev [Wed, 3 Nov 2021 12:17:47 +0000 (17:17 +0500)]
drm: enable amdgpu module build; update radeon to use updated ttm api

2 years agodrm/ttm: Update to match amdgpu driver, Linux 4.19 based
Sergey Zigachev [Wed, 3 Nov 2021 12:04:02 +0000 (17:04 +0500)]
drm/ttm: Update to match amdgpu driver, Linux 4.19 based

2 years agodrm/amdgpu: Replace firmware names
Sergey Zigachev [Wed, 3 Nov 2021 11:55:24 +0000 (16:55 +0500)]
drm/amdgpu: Replace firmware names

2 years agodrm/amdgpu: Port to DragonFly
Sergey Zigachev [Wed, 3 Nov 2021 10:34:41 +0000 (15:34 +0500)]
drm/amdgpu: Port to DragonFly

* This commit does not build as it requires ttm changes from
  the corresponding commit

Amdgpu driver changes:
* Builds with CONFIG_DRM_AMD_DC and CONFIG_DRM_AMD_DC_DCN1_0 defined
* Support for older GPUs (SI, CIK) is not implemented
* Several functions for display core module require msse and
  mhard-float gcc flags to be set; and they require special
  treatment from kernel by utilizing kernel_fpu_begin/kernel_fpu_end
  functions
* It is required that tunable set amdgpu_hw_i2c=1 to work around
  panic during module load
* Thunderbolt support is disabled
* Amdgpu trace infrastructure replaced by a stub

Drm changes:
* register_framebuffer is called at the later stage, after crtcs
  were properly initialized
* drm_close implemented
* drm_connector_update_edid_property implemented
* Fix drm device stays locked in case of an error or module shutdown
* Imported drm gem framebuffer helper functions
* Fixed null pointer deref in the drm mmap ioctl
* Imported atomic64_inc and atomic_long_* functions from Linux
* Imported bitmap_complement function from Linux
* Imported kfifo struct from Linux
* Implemented dma fence array properly
* Imported rb_root_cached struct from Linux
* Implemented several dma fence functions

Co-authored-by: François Tigeot <ftigeot@wolfpond.org>
Co-authored-by: Matthew Dillon <dillon@apollo.backplane.com>
2 years agodrm: Import the amdgpu driver from Linux 4.19
Sergey Zigachev [Wed, 3 Nov 2021 09:30:23 +0000 (14:30 +0500)]
drm: Import the amdgpu driver from Linux 4.19

2 years agousr.sbin/fstyp: Fix intra-object buffer overread for labeled msdosfs volumes
Tomohiro Kusumi [Wed, 3 Nov 2021 13:35:00 +0000 (22:35 +0900)]
usr.sbin/fstyp: Fix intra-object buffer overread for labeled msdosfs volumes

Volume labels, like directory entries, are padded with spaces and so
have no NUL terminator. Whilst the MIN for the dsize argument to strlcpy
ensures that the copy does not overflow the destination, strlcpy is
defined to return the number of characters in the source string,
regardless of the provided dsize, and so keeps reading until it finds a
NUL, which likely exists somewhere within the following fields, but On
CHERI with the subobject bounds enabled in the compiler this buffer
overread will be detected and trap with a bounds violation.

taken from FreeBSD
34fb1c133c5b8616f14f1d740d99747b427f5571
63d24336fd1aad81a4bdefb11d8c487cee5f88a0

2 years ago<readpassphrase.h>: Remove duplicate include.
Sascha Wildner [Tue, 2 Nov 2021 20:24:28 +0000 (21:24 +0100)]
<readpassphrase.h>: Remove duplicate include.

2 years agomakefs.8: Document msdos fs support.
Sascha Wildner [Tue, 2 Nov 2021 16:26:52 +0000 (17:26 +0100)]
makefs.8: Document msdos fs support.

Taken-from: FreeBSD

2 years agokernel: Add xdisk to LINT64.
Sascha Wildner [Tue, 2 Nov 2021 16:09:26 +0000 (17:09 +0100)]
kernel: Add xdisk to LINT64.

2 years agoxdisk.4: Some cleanup.
Sascha Wildner [Tue, 2 Nov 2021 16:09:08 +0000 (17:09 +0100)]
xdisk.4: Some cleanup.

Also add an xdisk(4) reference to hammer2.8.

2 years agokernel - Make getpeereid() work with socketpair()
Matthew Dillon [Sun, 31 Oct 2021 20:43:11 +0000 (13:43 -0700)]
kernel - Make getpeereid() work with socketpair()

* getpeereid() now works with socketpair() sockets.

Requested-by: rtzoeller
2 years agokernel - Add kernel_fpu_begin() and kernel_fpu_end()
Matthew Dillon [Sun, 31 Oct 2021 19:06:56 +0000 (12:06 -0700)]
kernel - Add kernel_fpu_begin() and kernel_fpu_end()

* Add kernel_fpu_begin() and kernel_fpu_end().  Some linux stuff
  in amdgpu will need it.

  Generally speaking the entire FP system needs a rewrite, but I'm
  not doing that now.

2 years agousr.sbin/makefs: Ignore the "tags" keyword in mtree manifests
Tomohiro Kusumi [Sun, 31 Oct 2021 15:27:28 +0000 (00:27 +0900)]
usr.sbin/makefs: Ignore the "tags" keyword in mtree manifests

An install using -DNO_ROOT emits mtree entries containing tags used by
pkgbase.  makefs(8) can safely ignore them, so do that rather than
emitting a warning for each entry.

taken from FreeBSD ed42b22abc48ba53aaa38e1e64438b6d71e7e944

2 years agousr.sbin/makefs: fix use-after-free in read_mtree_keywords()
Tomohiro Kusumi [Sun, 31 Oct 2021 15:25:27 +0000 (00:25 +0900)]
usr.sbin/makefs: fix use-after-free in read_mtree_keywords()

The st variable is used as a shortcut for &node->inode->st, but in one
branch just before the exit we update node->inode without changing st.

taken from FreeBSD 12ad8bdb34aa990bcc4f3faa92a6e0557385d2b2

2 years agousr.sbin/makefs: Fix -Wpointer-sign warnings in makefs
Tomohiro Kusumi [Sun, 31 Oct 2021 15:14:25 +0000 (00:14 +0900)]
usr.sbin/makefs: Fix -Wpointer-sign warnings in makefs

UFS part taken from FreeBSD fe41c64b577251fd1df89aa6c722a877b88b402b
iso9660 part is unchanged.

2 years agousr.sbin/makefs: Also set UFS di_birthtime when building on Linux
Tomohiro Kusumi [Sun, 31 Oct 2021 14:45:06 +0000 (23:45 +0900)]
usr.sbin/makefs: Also set UFS di_birthtime when building on Linux

Since st_birthtime doesn't exists on Linux (unless you use statx(2)),
we instead populate it with the st_ctime value.

taken from FreeBSD 1e9f67e2e4bcfb5aff72b184b5fce5f1faf3ca68

2 years agousr.sbin/makefs: Fix "time" mtree attribute handling
Tomohiro Kusumi [Sun, 31 Oct 2021 12:34:33 +0000 (21:34 +0900)]
usr.sbin/makefs: Fix "time" mtree attribute handling

When processing mtree(5) MANIFEST files, makefs(8) previously threw an
error if it encountered an entry whose "time" attribute contained a
non-zero subsecond component (e.g. time=1551620152.987220000).

Update the handling logic to properly assign the subsecond component if
built with nanosecond support, or silently discard it otherwise.

Also, re-enable the time attribute for the kyua tests.

taken from FreeBSD 286258a9a0e39cfce79d3b072a665b88bfb422c7

2 years agousr.sbin/makefs: Improve error handling
Tomohiro Kusumi [Sun, 31 Oct 2021 12:30:06 +0000 (21:30 +0900)]
usr.sbin/makefs: Improve error handling

Bail out if one of the files
scheduled to go to the FS image we are making cannot be read (e.g. EPERM).
Current behaviour when we issue waring but still proceeed and return success
is definitely not correct: masking out error condition as well as making a
slighly inconsistent FS where attempt to access the file in question ends up
in EBADF.

taken from FreeBSD 781e78182da4fb382485b9cb71127a7c2a2588b0

2 years agoxdisk - Link into tree, add manual page
Matthew Dillon [Sun, 31 Oct 2021 02:49:07 +0000 (19:49 -0700)]
xdisk - Link into tree, add manual page

* Link the xdisk driver into the tree and add a quick manual page.
  The xdisk driver uses libdmsg + the hammer2 service daemon to
  implement remote block devices over a network.

  The hammer2 service daemon is the lynchpin of the system, see
  the section on setting up /etc/hammer2 in the hammer2 manual page
  for more information.

* xdisk works like a dedicated block device, so is NOT like a NFS share.
  At any given time, a particular block device should only be open for
  writing by a single client.  The driver needs some work w/regards to
  maintaining open ref counts and such across the mini-cloud.  Multiple
  clients should not try to share the same block device.

  That said, filesystem performance over xdisk block devices should be
  very good.  Since the filesystem is running on the client-side, system
  buffer cache, read-ahead, and write buffering may be fully employed
  and performance will generally be better than NFS.

* Note that libdmsg has been in the tree awhile but is still considered
  highly experimental.  It uses encrypted connections but the encryption
  is not considered to be robust at this time.  Authentication is implemented
  via a combination of public/private key pairs and IP addresses.

  The hammer2 manual page describes the directives that may be used to
  create these keys.

2 years agolibdmsg - Get the encryption operational again
Matthew Dillon [Sun, 31 Oct 2021 01:06:10 +0000 (18:06 -0700)]
libdmsg - Get the encryption operational again

* Currently encrypts/decrypts, but the algorithm is really just a
  place-holder for something better.  It does not use any openssl
  algos beyond basic public key exchange, session key exchange, and
  raw aes-256-gcm encryption with a block IV increment to prevent replay
  attacks.

* Note that in the final protocol there will be two verifiers embedded
  in the dmsg itself, rather than tacked on via the transport.  One is
  the 32-bit header crc (there is also an aux-data crc), and the second
  is a 64-bit verifier that the link-level is intended to replace and check.
  The dmsg also has a signature and 24 random bits to mix things up.

2 years agohammer2.8: Minor fixes
Antonio Huete Jimenez [Sat, 30 Oct 2021 16:14:33 +0000 (18:14 +0200)]
hammer2.8: Minor fixes

2 years agohammer2.8: Adds a reference to -d option
Antonio Huete Jimenez [Sat, 30 Oct 2021 16:07:25 +0000 (18:07 +0200)]
hammer2.8: Adds a reference to -d option

2 years agousr.sbin/makefs: Add FAT support (taken from FreeBSD)
Tomohiro Kusumi [Tue, 26 Oct 2021 15:21:14 +0000 (00:21 +0900)]
usr.sbin/makefs: Add FAT support (taken from FreeBSD)

Basically same as FreeBSD version, except that several denode
functions (that makefs(8) is trying to override kernel ones using
the same name) have slightly different arguments in DragonFly.

This commit adds #ifdef MAKEFS here and there in
sys/vfs/msdosfs/*.h, which is the same in FreeBSD makefs(8).

FreeBSD makefs(8) now uses m_buf and m_vnode instead of overriding
kernel structs (using that they can't be included in userspace),
but DragonFly still uses buf and vnode defined in makefs(8).

2 years agodhcpcd: Note update to 9.4.1
Roy Marples [Fri, 22 Oct 2021 14:01:25 +0000 (15:01 +0100)]
dhcpcd: Note update to 9.4.1

2 years agodhcpcd: remove parts of the build import-src now does.
Roy Marples [Fri, 22 Oct 2021 13:58:25 +0000 (14:58 +0100)]
dhcpcd: remove parts of the build import-src now does.

2 years agoMerge branch 'vendor/DHCPCD'
Roy Marples [Fri, 22 Oct 2021 13:51:47 +0000 (14:51 +0100)]
Merge branch 'vendor/DHCPCD'

2 years agoUpdate to dhcpcd-9.4.1 with the following changes:
Roy Marples [Fri, 22 Oct 2021 13:48:37 +0000 (14:48 +0100)]
Update to dhcpcd-9.4.1 with the following changes:

 * BSD: Find the correct interface for tunnelled routes
 * OpenBSD: Fix uniqueness of routes for matching priorities
 * Linux: Support more platforms for seccomp (thanks to Fabrice Fontaine)
 * eloop: Process all waiting fd's as they come in
 * control: Unlink sockets when not in privsep
 * privsep: Renamed Master to Manager
 * privsep: Renamed Privilged Actioneer to Privileged Proxy
 * privsep: Fix getting interface VLANID on BSD
 * privsep: Enforce proper alignment of serialized struct cmsghdr
 * IPv4LL: Don't remove statically assigned addresses
 * routes: Fix route comparision for network prefixes with different masks
 * DHCP6: Only send FQDN for SOLICIT, REQUEST, RENEW, or REBIND messages
 * DHCP6: Don't spam the log when a RA repeatedly triggers an INFORM
 * DHCP: Fix infinite INFORM messages

2 years agoSync zoneinfo database with tzdata2021e from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Fri, 22 Oct 2021 10:06:29 +0000 (12:06 +0200)]
Sync zoneinfo database with tzdata2021e from ftp://ftp.iana.org/tz/releases

Previously, we were on 2021a.

For a detailed list of changes, see share/zoneinfo/NEWS.

2 years agonet: Allow binding of unspecified address without address existance
Roy Marples [Wed, 20 Oct 2021 09:12:41 +0000 (10:12 +0100)]
net: Allow binding of unspecified address without address existance

This removes a broken check. The comment says it's broken, but
it's only broken by it's existance.

2 years agodsynth - Conditionally avoid passing PKG_SUFX make env
Matthew Dillon [Sun, 17 Oct 2021 21:24:02 +0000 (14:24 -0700)]
dsynth - Conditionally avoid passing PKG_SUFX make env

* Avoid WARNINGs in the logs due to passing PKG_SUFX into make env.
  Remove this for pkg versions 1.17 or bigger.

* Fixes WARNING's in the logs and related sleep 10's generated by
  the port Mk files.

2 years agodsynth - Add PKG_COMPRESSION_FORMAT
Matthew Dillon [Sun, 17 Oct 2021 17:37:36 +0000 (10:37 -0700)]
dsynth - Add PKG_COMPRESSION_FORMAT

* Generate a PKG_COMPRESSION_FORMAT env variable in addition to
  PKG_SUFX.  This should fix the compression format used for
  package generation to be the one specified in dsynth.ini.

* For now keep PKG_SUFX in case dsynth is run on an older system.
  It will cause dports to generate warnings in the logs, which can
  be ignored.

2 years agodsynth - Support pkg 1.17 (.pkg suffix for packages)
Matthew Dillon [Sun, 17 Oct 2021 17:17:56 +0000 (10:17 -0700)]
dsynth - Support pkg 1.17 (.pkg suffix for packages)

* When scanning for binary packages, check for .pkg suffixed
  files unconditionally in addition to checking for the older
  .<compression_fmt> files.

* Use the template-generated pkg-static when regenerating the
  repo, otherwise an older pkg or pkg-static installed on the
  system will be used and cause problems with the new .pkg
  suffix format.

* Also give a 'reason' for why the template gets regenerated,
  when dsynth decides it needs to.

2 years agodsynth: Explicitly fail when the chroot can't resolve DNS names
Antonio Huete Jimenez [Sun, 17 Oct 2021 16:05:25 +0000 (18:05 +0200)]
dsynth: Explicitly fail when the chroot can't resolve DNS names

2 years agoinit(8): Remove unneeded libcrypto linking.
Sascha Wildner [Mon, 11 Oct 2021 06:45:17 +0000 (08:45 +0200)]
init(8): Remove unneeded libcrypto linking.

2 years agoLocal adjustments for OpenSSH-8.3p1.
Sascha Wildner [Sat, 9 Oct 2021 11:25:53 +0000 (13:25 +0200)]
Local adjustments for OpenSSH-8.3p1.

2 years agoMerge branch 'vendor/OPENSSH'
Sascha Wildner [Sat, 9 Oct 2021 11:25:09 +0000 (13:25 +0200)]
Merge branch 'vendor/OPENSSH'

2 years agoImport OpenSSH-8.8p1
Sascha Wildner [Sat, 9 Oct 2021 11:24:01 +0000 (13:24 +0200)]
Import OpenSSH-8.8p1

2 years agoRevert "fdisk(8): check the result of read_s0()"
Sascha Wildner [Sun, 3 Oct 2021 21:55:31 +0000 (23:55 +0200)]
Revert "fdisk(8): check the result of read_s0()"

This reverts commit f01e65a33a3d0f4dc120b24b3298d75b1bb8f909.

We must ignore read_s0() errors when -I is passed.

This unbreaks ISO/IMG building.

2 years agobot test #2
Antonio Huete Jimenez [Sat, 2 Oct 2021 15:49:40 +0000 (17:49 +0200)]
bot test #2

2 years agobot test
Antonio Huete Jimenez [Sat, 2 Oct 2021 10:54:19 +0000 (12:54 +0200)]
bot test

2 years agoSync ACPICA with Intel's version 20210930.
Sascha Wildner [Fri, 1 Oct 2021 10:57:04 +0000 (12:57 +0200)]
Sync ACPICA with Intel's version 20210930.

* Add new "Windows 2020" _OSI string.

* Improve iasl(8).

* Some sleep/resume fixes (that I guess do not affect us).

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

2 years agolibressl: Fix validation errors in certificate chains with expired certificates
Antonio Huete Jimenez [Fri, 1 Oct 2021 07:33:55 +0000 (09:33 +0200)]
libressl: Fix validation errors in certificate chains with expired certificates

 - Local patch to LibreSSL, from OpenBSD 6.9 errata 018, September 30, 2021.
 - Tested with pkg, fetch.

Reported-by: zach, others
Taken-from: OpenBSD

2 years agoman.1: Add some examples (taken from FreeBSD).
Sascha Wildner [Fri, 24 Sep 2021 20:39:01 +0000 (22:39 +0200)]
man.1: Add some examples (taken from FreeBSD).

2 years agomandoc(1): Update local files for 1.14.6.
Sascha Wildner [Fri, 24 Sep 2021 20:27:08 +0000 (22:27 +0200)]
mandoc(1): Update local files for 1.14.6.

2 years agoMerge branch 'vendor/MDOCML'
Sascha Wildner [Fri, 24 Sep 2021 20:26:26 +0000 (22:26 +0200)]
Merge branch 'vendor/MDOCML'

2 years agoImport mandoc-1.14.6. vendor/MDOCML
Sascha Wildner [Fri, 24 Sep 2021 20:25:36 +0000 (22:25 +0200)]
Import mandoc-1.14.6.

See https://mandoc.bsd.lv/NEWS for a list of changes.

2 years agoFix a typo in a locale upgrade script.
Sascha Wildner [Fri, 24 Sep 2021 12:53:59 +0000 (14:53 +0200)]
Fix a typo in a locale upgrade script.

2 years agoFix .In abuse and a wrong include path in three manual pages.
Sascha Wildner [Thu, 16 Sep 2021 15:44:40 +0000 (17:44 +0200)]
Fix .In abuse and a wrong include path in three manual pages.

2 years agoFix some include file paths (.In) in two manual pages.
Sascha Wildner [Thu, 16 Sep 2021 07:38:47 +0000 (09:38 +0200)]
Fix some include file paths (.In) in two manual pages.

2 years agoUpdate the pciconf(8) database.
Sascha Wildner [Wed, 15 Sep 2021 15:02:55 +0000 (17:02 +0200)]
Update the pciconf(8) database.

September 14, 2021 snapshot from https://pci-ids.ucw.cz

2 years agoSome additions and fixes related to fdatasync(2) and posix_fallocate(2).
Sascha Wildner [Tue, 14 Sep 2021 20:14:14 +0000 (22:14 +0200)]
Some additions and fixes related to fdatasync(2) and posix_fallocate(2).

* Fix a small issue in VOP_FDATASYNC()'s definition in <sys/vfsops.h>.

* Mention fdatasync() in fsync.2 (this basically syncs that manual page
  with FreeBSD, with a few adjustments).

* Add a manual page for posix_fallocate() (from FreeBSD, with a few
  adjustments).

* Mention fdatasync() in the list of reentrant functions in sigaction.2.

* In pthread_testcancel.3, mention fdatasync() in the list of functions
  for which a cancellation point will occur.

* Mention VOP_FDATASYNC() in VOP_FSYNC.9 (partly taken from FreeBSD).

* Remove a compatibility define in the fsstress tool.

Thanks to tkusumi for reviewing.

2 years agogencat(1): Bump WARNS to 6.
Sascha Wildner [Mon, 13 Sep 2021 15:25:11 +0000 (17:25 +0200)]
gencat(1): Bump WARNS to 6.

2 years agosys/kern: Add fdatasync(2)
Tomohiro Kusumi [Sat, 11 Sep 2021 16:57:53 +0000 (01:57 +0900)]
sys/kern: Add fdatasync(2)

Based on the following FreeBSD commits in 2016.
295af703a0d7987c6cf4987e7b7f5f07b3ca1221
1c1cc89580f0fbfabaf6f6c7f0f6440eef0c128e

Add the syscall and also add it to pthread's cancellation point.
The default behavior is same as fsync(2), which is fine but inefficient.

2 years agolibc: Remove __NO_TLS checks inherited from FreeBSD.
Sascha Wildner [Sat, 11 Sep 2021 17:43:09 +0000 (19:43 +0200)]
libc: Remove __NO_TLS checks inherited from FreeBSD.

2 years agolibc: Move posix_fallocate() to the right place in Symbol.map.
Sascha Wildner [Sat, 11 Sep 2021 17:39:59 +0000 (19:39 +0200)]
libc: Move posix_fallocate() to the right place in Symbol.map.

2 years agosys/kern: Move vop_stdallocate() within vfs_default.c
Tomohiro Kusumi [Sat, 11 Sep 2021 15:40:04 +0000 (00:40 +0900)]
sys/kern: Move vop_stdallocate() within vfs_default.c

vop_allocate stuff are usually placed after vop_markatime,
but looking at vfs_default.c this std function should probably
be the last.

2 years ago<sys/kernel.h>: Remove unused SI_BOOT2_VMM definition.
Sascha Wildner [Thu, 9 Sep 2021 14:26:21 +0000 (16:26 +0200)]
<sys/kernel.h>: Remove unused SI_BOOT2_VMM definition.

2 years agosys/kern: Add posix_fallocate(2)
Tomohiro Kusumi [Wed, 8 Sep 2021 14:09:44 +0000 (23:09 +0900)]
sys/kern: Add posix_fallocate(2)

Based on the initial posix_fallocate(2) implementation in FreeBSD
from d91f88f7f38078ac6dd4b0f0e77470d605d1518e in 2011.

There is nothing special or efficient about the default behavior.
VFS has no knowledge of fs details.

2 years ago<sys/*.h>: Fix some include guard related comments.
Sascha Wildner [Tue, 7 Sep 2021 20:38:59 +0000 (22:38 +0200)]
<sys/*.h>: Fix some include guard related comments.

2 years ago<sys/*.h>: Fix some include guard names.
Sascha Wildner [Tue, 7 Sep 2021 20:34:29 +0000 (22:34 +0200)]
<sys/*.h>: Fix some include guard names.

2 years agokernel/libc: Remove the old vmm code.
Sascha Wildner [Tue, 7 Sep 2021 16:18:25 +0000 (18:18 +0200)]
kernel/libc: Remove the old vmm code.

Removes the kernel code and two system calls.

Bump __DragonFly_version too.

Reviewed-by: aly, dillon
2 years agoinstaller: Use <sys/diskmbr.h>'s define instead of a constant.
Sascha Wildner [Tue, 7 Sep 2021 02:34:42 +0000 (04:34 +0200)]
installer: Use <sys/diskmbr.h>'s define instead of a constant.

2 years agokernel: In some files, make it clearer that only 0 is returned.
Sascha Wildner [Sun, 5 Sep 2021 12:57:01 +0000 (14:57 +0200)]
kernel: In some files, make it clearer that only 0 is returned.

The error case has already been dealt with earlier in the function.

2 years agohammer2 - Fix panic when /tmp and /var/tmp are nullfs mounts
Matthew Dillon [Wed, 1 Sep 2021 23:07:22 +0000 (16:07 -0700)]
hammer2 - Fix panic when /tmp and /var/tmp are nullfs mounts

* Certain illegal rename operations can cause a panic() in hammer2
  when /tmp and/or /var/tmp are nullfs mounts into an H2 filesystem.

* Catch the situation, report it, and generate an error code instead
  of panicing.

Reported-by: tuxillo and at least one other person recently
2 years agousr.sbin/fstyp: Add BeFS support
Tomohiro Kusumi [Thu, 26 Aug 2021 15:04:26 +0000 (00:04 +0900)]
usr.sbin/fstyp: Add BeFS support

from FreeBSD 0e92585cde5101506720ca1b904372317b7d84b6

2 years agosys/vfs/ext2fs: Correct a typo in an error message
Tomohiro Kusumi [Thu, 26 Aug 2021 14:15:07 +0000 (23:15 +0900)]
sys/vfs/ext2fs: Correct a typo in an error message

from FreeBSD 47f880ebeb3092b1b7bbc6d75e82532e43bbf010

2 years agoMake a number of headers self-sufficient.
Sascha Wildner [Fri, 27 Aug 2021 14:06:00 +0000 (16:06 +0200)]
Make a number of headers self-sufficient.

Also, do not trust headers to bring in needed headers.

2 years ago<sys/mman.h>: Remove MAP_RENAME, MAP_NORESERVE and MAP_NOEXTEND defines.
Sascha Wildner [Fri, 27 Aug 2021 13:15:37 +0000 (15:15 +0200)]
<sys/mman.h>: Remove MAP_RENAME, MAP_NORESERVE and MAP_NOEXTEND defines.

They were all inherited from FreeBSD and never implemented nor used.
FreeBSD never implemented them either and has removed all of them by
now.

Pointed-out-by: rtzoeller
2 years agoFix grammar issues in a few manual pages.
Sascha Wildner [Mon, 23 Aug 2021 21:36:56 +0000 (23:36 +0200)]
Fix grammar issues in a few manual pages.

2 years agolibnvmm.3: Fix some typos.
Sascha Wildner [Mon, 23 Aug 2021 20:07:35 +0000 (22:07 +0200)]
libnvmm.3: Fix some typos.

2 years agokernel/acpi: Remove the never used ACPI_NO_SEMAPHORES kernel option.
Sascha Wildner [Sun, 22 Aug 2021 11:00:44 +0000 (13:00 +0200)]
kernel/acpi: Remove the never used ACPI_NO_SEMAPHORES kernel option.

2 years agoSome trivial changes to better comply with strict aliasing. (2)
Sascha Wildner [Sat, 21 Aug 2021 21:40:36 +0000 (23:40 +0200)]
Some trivial changes to better comply with strict aliasing. (2)

Now that the warnings are fixed, do not pass -fno-strict-aliasing
anymore.

2 years agogetconf(1): Add support for retrieving _SC_PHYS_PAGES.
Sascha Wildner [Sat, 21 Aug 2021 21:16:34 +0000 (23:16 +0200)]
getconf(1): Add support for retrieving _SC_PHYS_PAGES.

2 years agoboot0cfg(8): Use some constants from <sys/diskmbr.h>.
Sascha Wildner [Sat, 21 Aug 2021 19:27:50 +0000 (21:27 +0200)]
boot0cfg(8): Use some constants from <sys/diskmbr.h>.

While here, rename DOSMAGICOFFSET to DOSMAGICOFF, like DOSPARTOFF.

2 years agoSome trivial changes to better comply with strict aliasing.
Gwenio [Thu, 7 Mar 2013 17:31:42 +0000 (12:31 -0500)]
Some trivial changes to better comply with strict aliasing.

2 years ago<sys/diskmbr.h>: Don't expose the partition type struct/array for boot code.
Sascha Wildner [Sat, 21 Aug 2021 20:35:50 +0000 (22:35 +0200)]
<sys/diskmbr.h>: Don't expose the partition type struct/array for boot code.

2 years agodefaults/compilers.conf: Add CCVER definitions for clang11.
Sascha Wildner [Sat, 21 Aug 2021 17:21:34 +0000 (19:21 +0200)]
defaults/compilers.conf: Add CCVER definitions for clang11.

2 years ago<sys/diskmbr.h>: Minor style fix (missed in last commit).
Sascha Wildner [Sat, 21 Aug 2021 14:56:10 +0000 (16:56 +0200)]
<sys/diskmbr.h>: Minor style fix (missed in last commit).

2 years agoinstaller(8): Move the contents of sysids.h into <sys/diskmbr.h>.
Sascha Wildner [Sat, 21 Aug 2021 14:42:36 +0000 (16:42 +0200)]
installer(8): Move the contents of sysids.h into <sys/diskmbr.h>.

It is needed by both fdisk(8) and the installer.

<sys/diskmbr.h> seems reasonable because it already has defines for
various partition types. Use them in the struct. Adjust the naming of
the structure and the array to match the rest of <sys/diskmbr.h>.

Based on a patch by Alexander Kuleshov <kuleshovmail@gmail.com>.

Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2875>

2 years agosysconf.3: Document more constants.
Sascha Wildner [Fri, 20 Aug 2021 21:36:12 +0000 (23:36 +0200)]
sysconf.3: Document more constants.

2 years agofdisk(8): check the result of the write_s0()
Alexander Kuleshov [Mon, 28 Dec 2015 12:34:55 +0000 (18:34 +0600)]
fdisk(8): check the result of the write_s0()

This patch provides a check of the write_s0() function call
which can be -1 on failure.

2 years agofdisk(8): close boot_fd on failure
Alexander Kuleshov [Mon, 28 Dec 2015 12:22:50 +0000 (18:22 +0600)]
fdisk(8): close boot_fd on failure

The init_boot() function opens/reads the /boot/mbr file or
file which is given with the -b option. There are couple
failure cases can be occured there. So we need to close
file description of /boot/mbr.

2 years agofdisk(8): check the result of read_s0()
Alexander Kuleshov [Mon, 28 Dec 2015 12:12:31 +0000 (18:12 +0600)]
fdisk(8): check the result of read_s0()

The read_s0() function can return -1 on failure, so we need to
check its result.

2 years agofdisk(8): check result of the read_disk() function
Alexander Kuleshov [Mon, 28 Dec 2015 11:50:15 +0000 (17:50 +0600)]
fdisk(8): check result of the read_disk() function

During detection of the sector size, the read_disk function may
return '-1'. This patch provides check for this case.

2 years agofdisk(8): check result of the getdevpath(3)
Alexander Kuleshov [Mon, 28 Dec 2015 11:47:58 +0000 (17:47 +0600)]
fdisk(8): check result of the getdevpath(3)

We are using the getdevpath(3) function in the fdisk.c As described
in the manual:

getdevpath() returns a pointer to a malloc()'d path on success and NULL
on failure.  If a failure occurs errno will be set appropriately.

So, we need to check the result of the getdevapth() call.

2 years agofdisk: use macros from the <sys/diskmbr.h>
Alexander Kuleshov [Mon, 28 Dec 2015 11:45:34 +0000 (17:45 +0600)]
fdisk: use macros from the <sys/diskmbr.h>

The fdisk(8) contains definitions of the C:H:S related macros. In
the same time, the <sys/diskmbr.h> header provides the same set of
macros. Let's use it, instead of self written.

2 years agoperiodic/accounting: Fix a missing "Doing login accounting:" line.
Sascha Wildner [Sat, 21 Aug 2021 10:47:43 +0000 (12:47 +0200)]
periodic/accounting: Fix a missing "Doing login accounting:" line.

While here, sync monthly/200.accounting with FreeBSD, adjust the
periodic.conf.5 manual page for the changes in 980397133d362b559ec,
and also point out that daily's accounting is process accounting
(from FreeBSD).

Submitted-by: James Cook (falsifian)
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/3289>
               <https://bugs.dragonflybsd.org/issues/3290>

2 years agodsynth.1: Document hooks
Antonio Huete Jimenez [Fri, 20 Aug 2021 22:41:13 +0000 (00:41 +0200)]
dsynth.1: Document hooks

Suggested-and-reviewed-by: swildner
2 years ago<errno.h>: Make ENOTRECOVERABLE and EOWNERDEAD visible unconditionally.
Sascha Wildner [Sun, 15 Aug 2021 10:40:20 +0000 (12:40 +0200)]
<errno.h>: Make ENOTRECOVERABLE and EOWNERDEAD visible unconditionally.

The problem here is that GCC will expect these errnos to be
visible unconditionally for its C++ headers - and errors in
<bits/error_constants> if they aren't - as soon as we set the
HAVE_E* for them in GCC's config.h.

On the other hand we have software such as www/qt5-webengine
that sets _POSIX_C_SOURCE and/or _XOPEN_SOURCE to older standards
that didn't specify those two errnos.

If anything, it is rather a "fault" of GCC's C++ header handling
than one of qt5-webengine.

Reported-by: tuxillo
2 years ago<signal.h>/<ucontext.h>: Split those two headers better.
Sascha Wildner [Sun, 15 Aug 2021 10:32:08 +0000 (12:32 +0200)]
<signal.h>/<ucontext.h>: Split those two headers better.

<signal.h> needs only ucontext_t and stack_t from <ucontext.h>. Split
those out to <sys/_ucontext.h> and stop including the full <ucontext.h>
from <signal.h> and vice versa, for userland.

In <ucontext.h>, continue defining siginfo_t for non-POSIX because
third party code expects us to.

This has been tested with a full dports bulk build.

2 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 15 Aug 2021 10:24:39 +0000 (12:24 +0200)]
Update the pciconf(8) database.

July 25, 2021 snapshot from https://pci-ids.ucw.cz

2 years ago<stdio.h>: Clean up the POSIX namespace better.
Sascha Wildner [Sat, 14 Aug 2021 00:51:31 +0000 (02:51 +0200)]
<stdio.h>: Clean up the POSIX namespace better.

* Include just <machine/stdint.h> for POSIX, but leave <sys/types.h>
  otherwise for the traditional expectations of third party code.

* POSIX did not require <stdio.h> to define off_t until Issue 7, even
  though ftello() and fseeko() were using it for a long time. This
  seems to be a "bug" in the specification, so adjust the visibility
  of off_t to match that of the functions. Actually use off_t for the
  ftello() and fseeko() prototypes.

Tested with a full bulk build.

2 years agoInclude <inttypes.h> instead of <cpu/inttypes.h> in world.
Sascha Wildner [Thu, 5 Aug 2021 07:20:01 +0000 (09:20 +0200)]
Include <inttypes.h> instead of <cpu/inttypes.h> in world.

Remove the unneeded inclusions otherwise.

2 years agolibc: Clean up the Symbol.maps a bit.
Sascha Wildner [Fri, 13 Aug 2021 23:49:08 +0000 (01:49 +0200)]
libc: Clean up the Symbol.maps a bit.

* Remove sysv_cond_wait and sysv_cond_signal because these functions
  were always static.

* Remove tre_have_approx because this function is only available with
  -DTRE_APPROX which we never used, nor build with right away.

* Remove pthread_init since there was never a pthread_init in libc.
  Seems to be just a typo.

* Remove mexitcount which was kernel only.

* Add a comment to a symbol that will only show up when libc is built
  with a debug option.

2 years agolibc: Clean up some kernel profiling bits.
Sascha Wildner [Sat, 14 Aug 2021 00:48:11 +0000 (02:48 +0200)]
libc: Clean up some kernel profiling bits.