dragonfly.git
3 years ago<sys/sysproto.h>: Regenerate after 'makesyscalls.sh' update
Aaron LI [Thu, 14 Jan 2021 11:30:41 +0000 (19:30 +0800)]
<sys/sysproto.h>: Regenerate after 'makesyscalls.sh' update

3 years agokern/makesyscalls.sh: Better place #undef and fix #endif comments
Aaron LI [Thu, 14 Jan 2021 11:24:42 +0000 (19:24 +0800)]
kern/makesyscalls.sh: Better place #undef and fix #endif comments

* Move the placement of '#undef PAD_' so it just follows the end of
  syscall argument section.

* Fix the comments of '#endif', so that the '_SYS_SYSPROTO_H_' and
  '_KERNEL' hierachies are now correct.

3 years agotest/vmm: Refactor Makefile by using <bsd.prog.mk>
Aaron LI [Sat, 16 Jan 2021 09:02:41 +0000 (17:02 +0800)]
test/vmm: Refactor Makefile by using <bsd.prog.mk>

3 years agoUse ${} instead of $() in various makefiles
Aaron LI [Sat, 16 Jan 2021 09:00:59 +0000 (17:00 +0800)]
Use ${} instead of $() in various makefiles

Also use ${.TARGET} and ${.ALLSRC] wherever impossible.

Minor style adjustment in at(1)'s makefiles.

3 years agoFix various mistakes (s/it were/it was/) in manual pages.
Sascha Wildner [Tue, 19 Jan 2021 01:36:45 +0000 (02:36 +0100)]
Fix various mistakes (s/it were/it was/) in manual pages.

3 years agolibutil/setusercontext: Apply FreeBSD's b149798e50fac1113a7.
Sascha Wildner [Tue, 19 Jan 2021 00:13:16 +0000 (01:13 +0100)]
libutil/setusercontext: Apply FreeBSD's b149798e50fac1113a7.

FBSD commit msg:

Fix a clang 3.5 warning about abs(3) being given an argument of type
quad_t in setusercontext().  While here, sanitize the clamping of the
priority value, and use the correct type for the return value of
login_getcapnum().

3 years agousr.sbin/fstyp: Fix exfat detection
Tomohiro Kusumi [Mon, 18 Jan 2021 16:34:09 +0000 (01:34 +0900)]
usr.sbin/fstyp: Fix exfat detection

from FreeBSD ddf61156132b610915325769cbb93ea11be0d433

3 years agoAdd a smbfs(5) manual page (taken from FreeBSD).
Sascha Wildner [Sat, 16 Jan 2021 16:08:48 +0000 (17:08 +0100)]
Add a smbfs(5) manual page (taken from FreeBSD).

3 years agolibc/citrus: Cleanup the DFprivate_1.0 section of the Symbol.map.
Sascha Wildner [Sat, 16 Jan 2021 15:59:47 +0000 (16:59 +0100)]
libc/citrus: Cleanup the DFprivate_1.0 section of the Symbol.map.

None of these symbols were ever in our libc.

3 years agolibc/citrus: Remove two unused header files.
Sascha Wildner [Sat, 16 Jan 2021 04:28:22 +0000 (05:28 +0100)]
libc/citrus: Remove two unused header files.

3 years agotalkd: Find users in more than one talk request.
Dan Cross [Wed, 13 Jan 2021 23:55:47 +0000 (23:55 +0000)]
talkd: Find users in more than one talk request.

talkd was written to use `utmpentry` from `who`, which
caches the results of read the `utmpx` file.  However,
talkd is usually invoked from inetd `wait` mode; it's
possible that a user might login after `talkd` starts;
with the cached utmpx data, one can't `talk` to that
user.

Further, consumption of the utmp data nulls it out for
subsequent requests.  The result is that the first talk
succeeds, but subsequent requests fail.

The fix is to avoid using the `utmpentry` machinery,
and just read `utmp` directly every time we need to.

Signed-off-by: Dan Cross <cross@gajendra.net>
3 years agotalk: talk into account sa_len field in sockaddr.
Dan Cross [Fri, 15 Jan 2021 03:16:17 +0000 (03:16 +0000)]
talk: talk into account sa_len field in sockaddr.

`osockaddr` predates the introduction of the sa_len
field in `struct sockaddr`.  The family has moved to
the second field in the structure, but `talk` didn't
account for this when it constructs a `sockaddr_in`
to send data to another system.

The failure case was kind of odd: one could `talk`
to a user on, say, a Linux machine, the remote user
could respond, and things would work as expected.
However, the inverse case, where a user on Linux
tried to `talk` to a user on Dragonfly failed: the
talk announcement would be made, but an attempt to
respond would fail with a protocol error since the
`sin_family` field would be zero.

Signed-off-by: Dan Cross <cross@gajendra.net>
3 years agoUpdate the pciconf(8) database.
Sascha Wildner [Fri, 15 Jan 2021 15:22:03 +0000 (16:22 +0100)]
Update the pciconf(8) database.

January 11, 2021 snapshot from https://pci-ids.ucw.cz

3 years agoSync cmp(1) with FreeBSD. Mainly for 80445b7a3f738e0b which fixes a bug.
Sascha Wildner [Fri, 15 Jan 2021 08:53:26 +0000 (09:53 +0100)]
Sync cmp(1) with FreeBSD. Mainly for 80445b7a3f738e0b which fixes a bug.

Reported-by: William Ahern <william@25thandclement.com>
3 years agohexdump.1/operator.7: Use Ta instead of literal tabs.
Sascha Wildner [Wed, 13 Jan 2021 13:16:45 +0000 (14:16 +0100)]
hexdump.1/operator.7: Use Ta instead of literal tabs.

3 years agokernel - Fix atime field for PTYs
Matthew Dillon [Tue, 12 Jan 2021 06:33:02 +0000 (22:33 -0800)]
kernel - Fix atime field for PTYs

* Fix the atime field for PTYs.  A calculation in the shortcut code
  that avoids having to update the timestamp on every read() or
  write() was reversed.

Reported-by: dancrossnyc
3 years agofinger - Take into account terminal session ID
Matthew Dillon [Tue, 12 Jan 2021 06:22:14 +0000 (22:22 -0800)]
finger - Take into account terminal session ID

* The 'w' command tries to figure out what process is running on a TTY
  line and emit that as part of its output. Update its heuristics to
  select the "most interesting" process.

Reported-by: dancrossnyc
Bug-report: #3260

3 years agofinger - Remove -T option
Matthew Dillon [Tue, 12 Jan 2021 06:20:06 +0000 (22:20 -0800)]
finger - Remove -T option

* This doesn't appear to work against anything, so remove it. FreeBSD
  apparently removed this option in 2007.

Reported-by: dancrossnyc
Bug-report: #3258

3 years agofinger - Fix 'lastlogx' logic
Matthew Dillon [Tue, 12 Jan 2021 06:18:10 +0000 (22:18 -0800)]
finger - Fix 'lastlogx' logic

* finger(1) was simply incorrect in how it was trying to access
  the `lastlogx` database; fix it to use the correct interface.

Reported-by: dancrossnyc
Bug-report: #3257

3 years agofinger - Reduce printed Login name field width so line fits 80 cols
Matthew Dillon [Tue, 12 Jan 2021 06:13:40 +0000 (22:13 -0800)]
finger - Reduce printed Login name field width so line fits 80 cols

* With the TTY field expanded, reduce the Login name field width
  so the output still fits in 80 cols.

3 years agofinger - Widen TTY field to avoid truncation
Matthew Dillon [Tue, 12 Jan 2021 06:08:30 +0000 (22:08 -0800)]
finger - Widen TTY field to avoid truncation

* Widen the printed TTY field to deal with
  longer tty names.

Reported-by: dancrossnyc
Bug-report: #3256

3 years agousr.sbin/fstyp: Sync with NetBSD
Tomohiro Kusumi [Sun, 10 Jan 2021 15:12:06 +0000 (00:12 +0900)]
usr.sbin/fstyp: Sync with NetBSD

3 years agosys/vfs/ext2fs: Fix comment on htree dirent (disabled) issue on DragonFly
Tomohiro Kusumi [Sat, 9 Jan 2021 15:39:56 +0000 (00:39 +0900)]
sys/vfs/ext2fs: Fix comment on htree dirent (disabled) issue on DragonFly

This sounded like ext3 on Linux had a similar problem, which is not true.

3 years agousr.sbin/fstyp: Minor fix for HAMMER2
Tomohiro Kusumi [Sat, 9 Jan 2021 15:27:33 +0000 (00:27 +0900)]
usr.sbin/fstyp: Minor fix for HAMMER2

3 years agousr.sbin/fstyp: Don't assert(0) for invalid HAMMER1/2 ondisk
Tomohiro Kusumi [Sat, 9 Jan 2021 14:17:04 +0000 (23:17 +0900)]
usr.sbin/fstyp: Don't assert(0) for invalid HAMMER1/2 ondisk

Given purpose of fstyp, don't kill the process for invalid ondisk.
Just fail HAMMER1/2 detection.

3 years agosys/vfs/hammer2: Add hammer2_print_uuid_mismatch()
Tomohiro Kusumi [Sat, 9 Jan 2021 13:29:16 +0000 (22:29 +0900)]
sys/vfs/hammer2: Add hammer2_print_uuid_mismatch()

3 years agomd5.1: Remove dead references from SEE ALSO.
Sascha Wildner [Sat, 9 Jan 2021 12:55:30 +0000 (13:55 +0100)]
md5.1: Remove dead references from SEE ALSO.

Reported-by: aly
3 years agolibc/citrus: Fix some typos in DFprivate_1.0 in the Symbol.map.
Sascha Wildner [Sat, 9 Jan 2021 12:10:20 +0000 (13:10 +0100)]
libc/citrus: Fix some typos in DFprivate_1.0 in the Symbol.map.

3 years agokernel - Remove MAP_VPAGETABLE
Matthew Dillon [Thu, 7 Jan 2021 19:54:11 +0000 (11:54 -0800)]
kernel - Remove MAP_VPAGETABLE

* This will break vkernel support for now, but after a lot of mulling
  there's just no other way forward.  MAP_VPAGETABLE was basically a
  software page-table feature for mmap()s that allowed the vkernel
  to implement page tables without needing hardware virtualization support.

* The basic problem is that the VM system is moving to an extent-based
  mechanism for tracking VM pages entered into PMAPs and is no longer
  indexing individual terminal PTEs with pv_entry's.

  This means that the VM system is no longer able to get an exact list of
  PTEs in PMAPs that a particular vm_page is using.  It just has a
  flag 'this page is in at least one pmap' or 'this page is not in any
  pmaps'.  To track down the PTEs, the VM system must run through the
  extents via the vm_map_backing structures hanging off the related
  VM object.

  This mechanism does not work with MAP_VPAGETABLE.  Short of scanning
  the entire real pmap, the kernel has no way to reverse-index a page
  that might be indirected through MAP_VPAGETABLE.

* We will need actual hardware mmu virtualization to get the vkernel
  working again.

3 years agoSync ACPICA with Intel's version 20210105.
Sascha Wildner [Tue, 5 Jan 2021 20:57:48 +0000 (21:57 +0100)]
Sync ACPICA with Intel's version 20210105.

iasl: Remove support for obsolete tables

Also, update copyrights.

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

3 years agotimeout.1: Use .Fx
Sascha Wildner [Mon, 4 Jan 2021 22:39:59 +0000 (23:39 +0100)]
timeout.1: Use .Fx

3 years agosockaddr_snprintf.3: Use .Er for errno values.
Sascha Wildner [Mon, 4 Jan 2021 05:13:38 +0000 (06:13 +0100)]
sockaddr_snprintf.3: Use .Er for errno values.

3 years agotimeout(1): Add -v/--verbose option to show diagnosis info
Aaron LI [Sun, 3 Jan 2021 07:03:03 +0000 (15:03 +0800)]
timeout(1): Add -v/--verbose option to show diagnosis info

The -v/--verbose option enables this utility to show diagnosis info to
stderr about any signal sent on timeout.

This implementation refers to GNU coreutils's timeout(1).

3 years agotimeout(1): Reduce some duplicate code
Aaron LI [Sun, 3 Jan 2021 05:52:10 +0000 (13:52 +0800)]
timeout(1): Reduce some duplicate code

Merge the 'sig_alrm' and 'sig_term' conditionals, and thus reduce some
duplicate code.

3 years agotimeout(1): Some minor tweaks and improvements
Aaron LI [Sun, 3 Jan 2021 04:26:39 +0000 (12:26 +0800)]
timeout(1): Some minor tweaks and improvements

* Define exit status and macros and use them
* Improve the second kill logic by setting 'do_second_kill = false'
  after configuring the second kill
* Minor style tweaks
* Reorder options in the man page, as well as the usage help
* Reorder the exit status in the man page
* Enhance the HISTORY section in the man page (obtained from NetBSD)

3 years agotimeout(1): Port to DragonFly
Aaron LI [Sun, 3 Jan 2021 04:11:56 +0000 (12:11 +0800)]
timeout(1): Port to DragonFly

Our procctl(2) is different from FreeBSD's procctl(2), so need to adjust
its usage.

Also hook into our build system and update the man page.

3 years agoImport timeout(1) from FreeBSD
Aaron LI [Sun, 3 Jan 2021 02:46:46 +0000 (10:46 +0800)]
Import timeout(1) from FreeBSD

The timeout(1) utility runs a command with a time limit.  It has also
been imported into NetBSD.  This utility first appeared in GNU
coreutils.

This is a verbatim copy of FreeBSD's version.  Necessary modifications
and updates will follow.

3 years agoFix some -Wjump_misses_init warnings (found by clang).
Sascha Wildner [Sat, 2 Jan 2021 21:26:51 +0000 (22:26 +0100)]
Fix some -Wjump_misses_init warnings (found by clang).

3 years agonetstat(1): Clean up struct nlist array.
Sascha Wildner [Sat, 2 Jan 2021 20:50:01 +0000 (21:50 +0100)]
netstat(1): Clean up struct nlist array.

3 years agogetaddrinfo(1): Actually hook into the build and remove unneeded headers.
Sascha Wildner [Sat, 2 Jan 2021 17:22:26 +0000 (18:22 +0100)]
getaddrinfo(1): Actually hook into the build and remove unneeded headers.

The <sys/cdefs.h> should be removed along with the __FBSDID and we
include either <sys/types.h> or <sys/param.h> but not both.

3 years agoImport getaddrinfo(1) from FreeBSD
Aaron LI [Sat, 2 Jan 2021 11:21:30 +0000 (19:21 +0800)]
Import getaddrinfo(1) from FreeBSD

The getaddrinfo(1) utility resolves host and service names to socket
addresses with getaddrinfo(3) and prints them in a user-friendly format.

Obtained from FreeBSD, which obtained it from NetBSD.

The examples in the man page has been adjusted to use
'www.dragonflybsd.org' instead of NetBSD ones :D

Thank swildner for bringing in sockaddr_snprintf(3) to libutil from
NetBSD, which is required by this utility.

3 years agolibutil: Add sockaddr_snprintf() (taken from NetBSD).
Sascha Wildner [Sat, 2 Jan 2021 07:27:05 +0000 (08:27 +0100)]
libutil: Add sockaddr_snprintf() (taken from NetBSD).

The man page has been adjusted a bit since we don't support Apple Talk
protocol.

3 years agosetbuf.3: Mention stdbuf(1) and update HISTORY & BUGS sections
Aaron LI [Sat, 2 Jan 2021 02:56:31 +0000 (10:56 +0800)]
setbuf.3: Mention stdbuf(1) and update HISTORY & BUGS sections

Obtained-from: FreeBSD
Reported-by: swildner
3 years agoImport stdbuf(1) together with libstdbuf(3) from FreeBSD
Aaron LI [Fri, 1 Jan 2021 14:08:34 +0000 (22:08 +0800)]
Import stdbuf(1) together with libstdbuf(3) from FreeBSD

The stdbuf(1) is a utility to change the initial buffering of stdin,
stdout and stderr streams for a given command.  It achieves this
functionality by preloading the libstdbuf(3) library and configuring the
needed environment variables.  Under the hood, libstdbuf(3) library
calls setvbuf(3) to do the actual work.

Changes from FreeBSD:
* Removed 32bit i386 code from stdbuf(1)
* Fix typos and update HISTORY section in libstdbuf.3 man page
* Update the example to actually work on DragonFly

3 years agomandoc.db.5: Adjust a bit to DragonFly.
Sascha Wildner [Fri, 1 Jan 2021 14:48:50 +0000 (15:48 +0100)]
mandoc.db.5: Adjust a bit to DragonFly.

3 years agonewvers.sh: Simplify a bit more.
Sascha Wildner [Fri, 1 Jan 2021 13:28:16 +0000 (14:28 +0100)]
newvers.sh: Simplify a bit more.

3 years agoRemove /usr/share/examples/etc/bsd-style-copyright.
Sascha Wildner [Fri, 1 Jan 2021 13:09:28 +0000 (14:09 +0100)]
Remove /usr/share/examples/etc/bsd-style-copyright.

/usr/share/examples/etc is supposed to hold the contents of an
unchanged /etc directory only. Also, our template is in
/COPYRIGHT so there is no point to keep a different one. Examples
of n-clause BSD licenses are widely available online, when needed.

Clean up newvers.sh, which was using the file for vers.c generation.
There is no need to put a license on generated files, let alone such
simple ones.

3 years ago<unistd.h>: chroot_kernel() is DragonFly specific only.
Sascha Wildner [Fri, 1 Jan 2021 11:01:21 +0000 (12:01 +0100)]
<unistd.h>: chroot_kernel() is DragonFly specific only.

Its prototype was put into the wrong #if/#endif section in 72f12c5b169.

3 years agolibc/gen/devname.c: No need to include <paths.h>
Aaron LI [Fri, 1 Jan 2021 07:31:53 +0000 (15:31 +0800)]
libc/gen/devname.c: No need to include <paths.h>

3 years agoRemove obsolete dev_mkdb(8)
Aaron LI [Fri, 1 Jan 2021 07:14:03 +0000 (15:14 +0800)]
Remove obsolete dev_mkdb(8)

The devname(3) has long been updated to determine the device name via
the 'kern.devname' sysctl provided by devfs(5).  The dev.db created by
dev_mkdb(8) is thus unused and obsolete.  So remove dev_mkdb(8) as well
and update relevant parts.

3 years agodevname.3: Add a little example
Aaron LI [Fri, 1 Jan 2021 07:04:37 +0000 (15:04 +0800)]
devname.3: Add a little example

Obtained from FreeBSD but with some updates.

3 years agodevname(3): Remove obsolete code that queries dev.db
Aaron LI [Fri, 1 Jan 2021 06:28:58 +0000 (14:28 +0800)]
devname(3): Remove obsolete code that queries dev.db

In the old days of static /dev, devname(3) would get the name by
querying the /var/run/dev.db created by dev_mkdb(8).  Now that we have
dynamic /dev provided by devfs(5), the device name is provided by the
'kern.devname' sysctl, thus obsoleting the db query code.

I've tested to verify that the db query code isn't being used now.  So
it's safe to remove this obsolete code.  Cleanups to dev_mkdb(8) and
related code would follow.

Meanwhile, update the man page to reflect the current code.

Discussed-with: swildner

3 years agoBump copyrights. Good riddance 2020
Sascha Wildner [Thu, 31 Dec 2020 21:07:29 +0000 (22:07 +0100)]
Bump copyrights. Good riddance 2020

3 years agoRemove <sys/types.h> from <ftw.h>.
Sascha Wildner [Thu, 31 Dec 2020 18:12:46 +0000 (19:12 +0100)]
Remove <sys/types.h> from <ftw.h>.

3 years agoClean up the POSIX namespace of <iconv.h>, <dirent.h>, and <sys/stat.h>.
Sascha Wildner [Thu, 31 Dec 2020 17:50:35 +0000 (18:50 +0100)]
Clean up the POSIX namespace of <iconv.h>, <dirent.h>, and <sys/stat.h>.

Some small residue in <sys/stat.h> remains for older specs, due to the
kind of bumpy history of that header between issues 6 and 7. Namely,
struct timespec should not be defined in these cases. But this is good
enough for now.

Thanks to zrj for testing with a full dports bulk.

3 years agoKeep /etc/regdomain.xml in sync with our tree.
Sascha Wildner [Thu, 31 Dec 2020 17:32:44 +0000 (18:32 +0100)]
Keep /etc/regdomain.xml in sync with our tree.

It's not a file that might have system specific changes.

3 years agonetproto/802_11: Sync some channel definitions from FreeBSD
Aaron LI [Thu, 31 Dec 2020 06:56:25 +0000 (14:56 +0800)]
netproto/802_11: Sync some channel definitions from FreeBSD

Some of these channel definitions are required by the last commit as
they're being used in 'regdomain.c'.

Also update 'wlan/ieee80211.c' a bit so that it builds fine.

3 years agoifconfig(8): Update regdomain.[ch] to support new regdomain.xml
Aaron LI [Thu, 31 Dec 2020 05:40:11 +0000 (13:40 +0800)]
ifconfig(8): Update regdomain.[ch] to support new regdomain.xml

The '/etc/regdomain.xml' has been updated in
dbe4ac417a2b77e29fd0326277263c3bbccf7ebe.  However, ifconfig(8) has not
been updated to support the new netbands (e.g., 11ac) and thus
ifconfig(8) emits some warnings like:

```
ifconfig: unknown netband mode "11ac" at line 114
ifconfig: ignore "band" of unknown netband at line 115
ifconfig: ignore "freqband" of unknown netband at line 116
ifconfig: ignore "maxpower" of unknown netband at line 117
ifconfig: unexpected XML token "maxpower" data "17" at line 117
ifconfig: ignore "flags" of unknown netband at line 118
ifconfig: flags without freqband or netband at line 118 ignored
```

Update 'regdomain.[ch]' from FreeBSD to support the new regdomain.xml,
together with minor fixes.

Obtained-from: FreeBSD

3 years agoifconfig(8): Fix regdomain.xml parsing issue
Aaron LI [Thu, 31 Dec 2020 15:13:50 +0000 (23:13 +0800)]
ifconfig(8): Fix regdomain.xml parsing issue

The original regdomain.[ch] code can't handle unknown netbands in
regdomain.xml, mainly because it didn't distinguish the following two
cases:

* <netband><band><freqband ref="xxx">...
* <freqband id="xxx">...

Therefore, it tried to strdup(id) but with 'id = NULL' and thus caused
segfault errors with the new regdomain.xml, like:

```
ifconfig: unknown mode "11ac" at line 114
ifconfig: band without enclosing netband at line 115
[1]    326065 segmentation fault (core dumped)  ifconfig
```

This commit fixes the above segfault error by ignoring unknown netbands.
Although ifconfig(8) emits some warnings about unknown/unexpected
elements, it works as expected :D

Reported-by: Gonzalo Nemmi (noob237 on IRC)
3 years agoAdd <endian.h>, which for now only includes <sys/endian.h>.
Sascha Wildner [Wed, 30 Dec 2020 17:47:46 +0000 (18:47 +0100)]
Add <endian.h>, which for now only includes <sys/endian.h>.

An <endian.h> header was recently approved by The Austin Group:
https://www.austingroupbugs.net/view.php?id=162

Add one now, mainly for dports. It will be further POSIXized later.

3 years agoetc/Makefile: Install 'group' and 'master.passwd' to examples/etc
Aaron LI [Wed, 30 Dec 2020 14:33:50 +0000 (22:33 +0800)]
etc/Makefile: Install 'group' and 'passwd' to examples/etc

Add back installation of 'group' to '/usr/share/examples/etc'.  In
addition, also install 'master.passwd' there.

The point is that '/usr/share/examples/etc' should have all config files
that the initial '/etc' have.

Suggested-by: swildner
3 years agoSync zoneinfo database with tzdata2020f from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Wed, 30 Dec 2020 12:07:02 +0000 (13:07 +0100)]
Sync zoneinfo database with tzdata2020f from ftp://ftp.iana.org/tz/releases

Nothing to see, just a fix in the upstream build infrastructure.

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

3 years agolibc/gen/gen_private.h: Include <sys/types.h> for off_t.
Sascha Wildner [Wed, 30 Dec 2020 10:55:23 +0000 (11:55 +0100)]
libc/gen/gen_private.h: Include <sys/types.h> for off_t.

Do not rely on the including file to bring it in.

3 years agokernel: Staticize a few variables.
Sascha Wildner [Wed, 30 Dec 2020 09:06:19 +0000 (10:06 +0100)]
kernel: Staticize a few variables.

3 years agolibc/fmtcheck: Sync with FreeBSD (only comments).
Sascha Wildner [Tue, 29 Dec 2020 19:40:57 +0000 (20:40 +0100)]
libc/fmtcheck: Sync with FreeBSD (only comments).

3 years ago<machine/smp.h>: Remove some prototypes of non-existent functions.
Sascha Wildner [Tue, 29 Dec 2020 18:58:44 +0000 (19:58 +0100)]
<machine/smp.h>: Remove some prototypes of non-existent functions.

Reported-by: zrj
3 years agoetc/Makefile: Improve update of _dhcp user and dhcpcd files
Aaron LI [Tue, 29 Dec 2020 14:06:59 +0000 (22:06 +0800)]
etc/Makefile: Improve update of _dhcp user and dhcpcd files

* Update the 'master.passwd' file to set the new home for the '_dhcp'
  user, and then the 'pw-update.sh' script will update it to system.
* Simplify the dhcpcd files move logic a bit.

3 years agotools/pw-update.sh: No need to invoke pwd_mkdb(8)
Aaron LI [Tue, 29 Dec 2020 13:51:13 +0000 (21:51 +0800)]
tools/pw-update.sh: No need to invoke pwd_mkdb(8)

The pw(8) utility already handles the database update, so no need to
manually invoke the pwd_mkdb(8).

3 years agotools/pw-update.sh: Improve to update user/group
Aaron LI [Tue, 29 Dec 2020 13:48:53 +0000 (21:48 +0800)]
tools/pw-update.sh: Improve to update user/group

Before this change, this script would only add new users and/or groups,
but wouldn't modify existing users/groups.  This change add this
ability.

3 years agoRemove last remains of FSMID support from userland.
Sascha Wildner [Mon, 28 Dec 2020 22:28:43 +0000 (23:28 +0100)]
Remove last remains of FSMID support from userland.

The kernel side was added in 2005 (7d15906a7a159575b1983f7c1fadde4b)
and removed again in 2009 (d98152a8b8a4b368ca0e08b84302f2f2).

Approved-by: dillon
3 years agodhcpcd: update README.DRAGONFLY
Roy Marples [Mon, 28 Dec 2020 14:10:28 +0000 (14:10 +0000)]
dhcpcd: update README.DRAGONFLY

3 years agoMerge branch 'vendor/DHCPCD'
Roy Marples [Mon, 28 Dec 2020 14:08:41 +0000 (14:08 +0000)]
Merge branch 'vendor/DHCPCD'

3 years agoUpdate to dhcpcd-9.4.0 with the following changes:
Roy Marples [Mon, 28 Dec 2020 14:06:21 +0000 (14:06 +0000)]
Update to dhcpcd-9.4.0 with the following changes:

 * DHCP: For anonymous, just use a generic ClientID
 * link: Split hardware address randomisation out of anonymous option
 * link: Only report hardware changes for active interfaces
 * link: Report errors obtaining recv buffer size on overflow
 * hooks: Add NOCARRIER_ROAMING reason
 * hooks: interface_order now reflects priorities again

3 years agoSync zoneinfo database with tzdata2020e from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Mon, 28 Dec 2020 00:28:17 +0000 (01:28 +0100)]
Sync zoneinfo database with tzdata2020e from ftp://ftp.iana.org/tz/releases

* Volgograd switched to Moscow time on 2020-12-27 at 02:00.

* Correct many pre-1986 transitions.

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

3 years agoopenresolv: update README.DRAGONFLY
Roy Marples [Sun, 27 Dec 2020 18:49:30 +0000 (18:49 +0000)]
openresolv: update README.DRAGONFLY

3 years agoopenresolv: build avahi-daemon and mdnsd subscribers
Roy Marples [Sun, 27 Dec 2020 18:47:52 +0000 (18:47 +0000)]
openresolv: build avahi-daemon and mdnsd subscribers

3 years agoMerge branch 'vendor/OPENRESOLV'
Roy Marples [Sun, 27 Dec 2020 18:45:53 +0000 (18:45 +0000)]
Merge branch 'vendor/OPENRESOLV'

3 years agoopenresolv: Update to version 3.12.0 with the following changes:
Roy Marples [Sun, 27 Dec 2020 18:43:42 +0000 (18:43 +0000)]
openresolv: Update to version 3.12.0 with the following changes:

 * Default support for WireGuard interfaces
 * Add allow_interfaces and deny_interfaces configuration knobs

 * notify avahi-daemon of resolv.conf being changed
 * notify mdsnd of resolv.conf being changed

 * Allow configurations to be marked as Deprecated and Acivtated
 * Harden resolvconf lock detection

3 years agodevname.3: Update man page to align wht the code
Aaron LI [Sun, 27 Dec 2020 12:46:48 +0000 (20:46 +0800)]
devname.3: Update man page to align wht the code

3 years agoAdd nsmb.conf.5 man page
Aaron LI [Sun, 27 Dec 2020 10:07:51 +0000 (18:07 +0800)]
Add nsmb.conf.5 man page

Obtained-from: FreeBSD

3 years agoetc/Makefile: Minor style tweaks
Aaron LI [Sun, 27 Dec 2020 10:02:02 +0000 (18:02 +0800)]
etc/Makefile: Minor style tweaks

3 years agoetc/Makefile: No need to try to install 'group' file
Aaron LI [Sun, 27 Dec 2020 09:59:23 +0000 (17:59 +0800)]
etc/Makefile: No need to try to install 'group' file

Similar to the 'master.passwd', no need to try to install the 'group'
file, because its update has already been handled by the 'pw-update.sh'
script.

3 years agoetc/Makefile: Use 'pw-update.sh' to add users and groups
Aaron LI [Sun, 27 Dec 2020 09:35:13 +0000 (17:35 +0800)]
etc/Makefile: Use 'pw-update.sh' to add users and groups

After this change, if we want to add a new user/group, just add it to
the 'master.passwd' and/or 'group' files.  No need to add ad-hoc pw(8)
commands in this Makefile.

3 years agotools: Add pw-update.sh to add new users and groups
Aaron LI [Sun, 27 Dec 2020 09:21:01 +0000 (17:21 +0800)]
tools: Add pw-update.sh to add new users and groups

This script is derived my 'dfly-update' tool [1], and will be used in
'make upgrade' to help add new users and groups.

[1] https://github.com/liweitianux/dfly-update

3 years agotools: Update commit-msg script a bit
Aaron LI [Sun, 27 Dec 2020 03:40:11 +0000 (11:40 +0800)]
tools: Update commit-msg script a bit

3 years agokernel - Fix callout structural corruption bug
Matthew Dillon [Sat, 26 Dec 2020 19:25:21 +0000 (11:25 -0800)]
kernel - Fix callout structural corruption bug

* _callout_cancel_quick() was not properly testing whether
  the callout being canceled matched sc->next, resulting
  it occassional kernel panics under certain circumstances.

* Could be triggered during dsynth runs.

* Fixed by adding the proper test.

Reported-by: zrj
3 years agosys/vfs/hammer2: Add initial multi-volumes support for HAMMER2
Tomohiro Kusumi [Fri, 25 Dec 2020 16:36:00 +0000 (01:36 +0900)]
sys/vfs/hammer2: Add initial multi-volumes support for HAMMER2

This commit adds initial multi-volumes support for HAMMER2. Maximum
supported volumes is 64. The feature and implementation is similar to
multi-volumes support in HAMMER1.

1. ondisk changes
=================
This commit bumps volume header version from 1 to 2, and adds four new
volume header fields using reserved fields in version 1. Other ondisk
structures are unchanged.
* "volu_id" - volume id from 0 to 63, where 0 represents root volume.
* "nvolumes" - number of volumes. All volumes have same the same value.
* "total_size" - sum of "volu_size" in volumes. All volumes have the
  same value.
* "volu_loff[HAMMER2_MAX_VOLUMES]" - A 512 bytes table which contains
  start offset of max 64 volumes within "total_size". All volumes have
  the same value.

Version 1 volume header has 0 for above fields, so HAMMER2 internally
treats "nvolumes" as 1, and "total_size" as "volu_size" to be able to
handle version 1 and 2 transparently.

All volumes have 4 headers, but only root volume ones are relevant.
Non-root volume headers have their own unique "volu_id" and "volu_size",
but other fields are unimportant and never used. Non-root volume headers
have sroot blockset[i] whose type is HAMMER2_BREF_TYPE_INVALID. Non-root
volume headers don't have boot/aux area, so freemap area start from
offset 0. Non-root volume headers are readonly and never updated after
creation. This means non-root volumes are just extra storage to extend
fs size and internally make up a single virtual volume whose size is
"total_size".

It currently doesn't automatically upgrade an existing version 1 fs to
version 2. Only newly created fs becomes version 2 for now.

2. volumes layout
=================
Basically similar to HAMMER1. A first block device argument provided for
newfs_hammer2(8) becomes the root volume, and if specified remaining
devices extend "total_size" as non-root volumes. All volumes except for
the last one have 1GiB (freemap level1) aligned "volu_size".

This means each volume's start offset within "total_size" is also 1GiB
(freemap level1) aligned. The start offsets of volumes are stored in
volu_loff[HAMMER2_MAX_VOLUMES]. Each volu_loff[n] (0 <= n < nvolumes)
represents start offset of volume n within "total_size". Unused volumes
have -1 for volu_loff[n].
e.g. If a fs consists of 1 volume, volu_loff[0] has 0 and rests have -1.
e.g. If a fs consists of 3 volumes, x GiB root volume, y GiB volume,
  and z GiB volume, volu_loff[0] has 0, volu_loff[1] has x, volu_loff[2]
  has x+y, and rests have -1.

Low level I/O function in HAMMER2 uses this linear offsets table to
determine a device vnode to use and relative offset within the device
vnode, for a given blockref's "data_off". This is different from HAMMER1
where logical offset had embedded volume id bits (i.e. there were holes
in logical address space). HAMMER2 needs this table to support multi-
volumes without changing current logical offset mechanism.

Unless all volumes are specified and mountable, mount_hammer2(8) fails
like it failed in HAMMER1. This also applies to other userspace commands
which require volumes specification, except for fstyp(8).

3. userspace commands
=====================
Basically same as or similar to HAMMER1.
* newfs_hammer2(8) takes a list of block device paths as argv[].
* mount_hammer2(8) takes block device paths or names in "a:b:c:..."
  format.
* hammer2(8) takes block device paths or names in "a:b:c:..." format for
  directives which require volumes specification. This commit also adds
  "volume-list" directive and an ioctl command HAMMER2IOC_VOLUME_LIST,
  which are similar to the one in HAMMER1.
* fsck_hammer2(8) takes device paths or names in "a:b:c:..." format.
* fstyp(8) takes device paths in "path1:path2:path3:..." format.

4. limitations
==============
* hammer2(8) "info" directive ignores multi-volumes block devices.
* hammer2(8) "growfs" directive doesn't support multi-volumes fs.
* fstyp(8) is unable to find PFS label via -l option if the PFS inode or
  its parent indirect blocks are located beyond root volume.
* hammer2(8) doesn't support "volume-add" and "volume-del" directives
  which existed in HAMMER1, and there is currently no plan to support.

3 years agonet/ip_mroute: Fix 'struct igmpmsg' for x86_64
Uglymotha [Thu, 24 Dec 2020 16:28:58 +0000 (17:28 +0100)]
net/ip_mroute: Fix 'struct igmpmsg' for x86_64

The `struct igmpmsg` currently uses `u_long` to define the unused fields
instead of `uint32_t`.  This breaks the mroute API on 64 bit systems,
because `u_long` is 64bit there.  The following code in `ip_mroute.c`
happily corrupts kernel upcall messages on 64bit systems as the fields
are incorrectly shifted 8bytes to the right, overwriting the destination
ip address in the packet.

```
/*
 * Send message to routing daemon to install
 * a route into the kernel table
 */
im = mtod(mm, struct igmpmsg *);
im->im_msgtype = IGMPMSG_NOCACHE;
im->im_mbz = 0;
im->im_vif = vifi;
```

Fix this issue by replacing `u_long` with `uint32_t` in `struct igmpmsg`.
This change has also been made in FreeBSD at:
https://github.com/freebsd/freebsd/commit/3dd767ffd091fb1e586741a1aedfcd67884312a4

This fix is submitted by Uglymotha at GitHub:
https://github.com/DragonFlyBSD/DragonFlyBSD/pull/11

3 years ago<netinet6/in6.h>: Revert one change that didn't improve anything.
Sascha Wildner [Fri, 25 Dec 2020 10:03:11 +0000 (11:03 +0100)]
<netinet6/in6.h>: Revert one change that didn't improve anything.

Definitions with a leading underscore are not relevant for POSIX
and the code is more readable this way.

3 years ago<netinet/in.h>: Clean up the POSIX namespace.
Sascha Wildner [Fri, 25 Dec 2020 09:18:41 +0000 (10:18 +0100)]
<netinet/in.h>: Clean up the POSIX namespace.

Thanks to zrj for testing it with a full dports bulk build.

3 years ago<netinet/in6.h>/<sys/mount.h>: Use __BSD_VISIBLE where intended.
Sascha Wildner [Mon, 21 Dec 2020 06:51:08 +0000 (07:51 +0100)]
<netinet/in6.h>/<sys/mount.h>: Use __BSD_VISIBLE where intended.

Only <sys/cdefs.h> should check the _POSIX_C_SOURCE and _XOPEN_SOURCE
definitions. The rest should always use *_VISIBLE.

3 years ago<netinet/in.h>: Fix comment indent.
Sascha Wildner [Sun, 20 Dec 2020 18:59:03 +0000 (19:59 +0100)]
<netinet/in.h>: Fix comment indent.

3 years agosbin/newfs_hammer2: Minor cleanup
Tomohiro Kusumi [Sun, 20 Dec 2020 12:59:40 +0000 (21:59 +0900)]
sbin/newfs_hammer2: Minor cleanup

to make multi-volumes diff (which uses *vol for other purpose) clearer.
In HAMMER2 the volume header variable is basically always *voldata.

3 years agosbin/fsck_hammer2: Don't print "exceeds volume size" in find_best_zone()
Tomohiro Kusumi [Sun, 20 Dec 2020 07:03:52 +0000 (16:03 +0900)]
sbin/fsck_hammer2: Don't print "exceeds volume size" in find_best_zone()

No need to print while seeking for a best zone.

3 years agodrm/i915: Enable I915_PARAM_MMAP_VERSION
François Tigeot [Sat, 19 Dec 2020 09:48:01 +0000 (10:48 +0100)]
drm/i915: Enable I915_PARAM_MMAP_VERSION

3 years agodrm/i915: Update PCI IDs from Linux 5.8
François Tigeot [Sat, 19 Dec 2020 09:47:32 +0000 (10:47 +0100)]
drm/i915: Update PCI IDs from Linux 5.8

This brings in support for new Coffee Lake, Amber Lake, Whiskey Lake
and Comet Lake GPUs.

3 years agodrm: Update to Linux 4.15.18
François Tigeot [Sat, 19 Dec 2020 09:42:40 +0000 (10:42 +0100)]
drm: Update to Linux 4.15.18

* Create /dev/dri/renderD* devices
  Generally handle /dev entries creation as close to Linux as possible.

* Add drm master support
  Sync authentification code with Linux 4.15.18

* handle vm_mm->mmap_sem in ttm page fault operations

* Update dma-fence code from OpenBSD

* This commit contains sleep/wakeup and other changes
  from Matthew Dillon <dillon@apollo.backplane.com>

3 years agoSync ACPICA with Intel's version 20201217.
Sascha Wildner [Fri, 18 Dec 2020 23:43:19 +0000 (00:43 +0100)]
Sync ACPICA with Intel's version 20201217.

* Fix exception code class checks.

* Better GCC 10 support.

* Some -Wimplicit-fallthrough fixes.

* Miscellaneous improvements in the tools.

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

3 years agocpdup - Add support for lchmod(), lutimes(), and lchflags() (2)
Matthew Dillon [Fri, 18 Dec 2020 19:12:43 +0000 (11:12 -0800)]
cpdup - Add support for lchmod(), lutimes(), and lchflags() (2)

* Fix bug in xlink, lchflags() was being called with the wrong
  path after a link failure and so could not unlock schg files
  to link to them.

3 years agosys/vfs/hammer: modify directory ctime when adding entry
Daniel Fojt [Thu, 17 Dec 2020 17:15:26 +0000 (18:15 +0100)]
sys/vfs/hammer: modify directory ctime when adding entry

In addition to mtime, update also ctime of a directory when adding
new entry there.

Related to issue: https://bugs.dragonflybsd.org/issues/3251
Reviewed by: Matthew Dillon