]> Zhao Yanbai Git Server - minix.git/log
minix.git
7 years agoreplace tickdelay with micro_delay to be quantum-agnostic 03/3503/1
rlfnb [Thu, 1 Jun 2017 09:02:25 +0000 (11:02 +0200)]
replace tickdelay with micro_delay to be quantum-agnostic

Change-Id: Ie449d797389a178372035d797c84b02d636788cd

7 years agoisofs: support directories with many entries 02/3502/1
David van Moolenbroek [Wed, 17 May 2017 23:21:45 +0000 (23:21 +0000)]
isofs: support directories with many entries

In particular, remove the hardcoded limit of 4096 entries in a single
directory, as there are (at least) real DVDs out there with more
entries than that.  The implementation of this change requires a
second pass on large directories; performance optimizations are left
to future work.

Change-Id: Ia865ac95797fa2dd36b086779c3f1fef6b2f6a6f

7 years agoat_wini: bump hardcoded ATAPI limit to DVD size 01/3501/1
David van Moolenbroek [Wed, 17 May 2017 23:16:52 +0000 (23:16 +0000)]
at_wini: bump hardcoded ATAPI limit to DVD size

at_wini was previously hardcoded to present ATAPI devices as having a
size of 800 MiB, which was enough for CDs but not for DVDs.  This
patch increases the device size to 8500 MiB, which should be large
enough to cover all DVDs.

Change-Id: I7d3192e4ecd0708a655663c1007ff517ed969580

7 years agoFix Makefile.boot small issue sync'ing with NetBSD 00/3500/1
Antoine Leca [Mon, 8 May 2017 12:15:09 +0000 (12:15 +0000)]
Fix Makefile.boot small issue sync'ing with NetBSD

Change-Id: I4f8cbfb9d4b6be8b31ce705cbecc4b12b7e1fe45

7 years agoFix lua 99/3499/1
David van Moolenbroek [Mon, 8 May 2017 11:53:38 +0000 (11:53 +0000)]
Fix lua

As reported by Jean-Baptiste Boric, lua would refuse to start,
throwing an error about incompatibility of numeric types.

This resolves #160.

Change-Id: I5cd6c3b2a35c7023946e4d14d4feedaaecb956fb

7 years agoheader cleanup 98/3498/1
rlfnb [Wed, 26 Apr 2017 22:51:30 +0000 (00:51 +0200)]
header cleanup

Change-Id: I4e169911591c56e91c301c5cb0bb3ea2d8140cf2

7 years agoFix pkgin_cd.sh 97/3497/2
Jean-Baptiste Boric [Tue, 11 Apr 2017 16:21:50 +0000 (18:21 +0200)]
Fix pkgin_cd.sh

Change-Id: I513c16b0691897f3c665532d50ed398967f3e4d0

7 years agoAdd releasetools/pkgsrc_cdimage.sh 96/3496/2
Jean-Baptiste Boric [Tue, 11 Apr 2017 16:19:55 +0000 (18:19 +0200)]
Add releasetools/pkgsrc_cdimage.sh

This script uses the image generation framework to create a pkgsrc CD
image, useful for MINIX installations without Internet connectivity.

Change-Id: Ife037f6b6958e38986afad0632f37999ecbb2b55

7 years agoRework package bundling mechanism 95/3495/2
Jean-Baptiste Boric [Tue, 11 Apr 2017 16:12:47 +0000 (18:12 +0200)]
Rework package bundling mechanism

Setting PACKAGE_DIR without PACKAGES will default to bundling all
packages in PACKAGE_DIR. PKG_INFO is also mandatory now.

Change-Id: Iaf02221ec91e9c54dc8caec6e9a01bccfc65cc31

7 years agoRemoved unused variable and cleaned whitespaces 94/3494/2
Ben Mezger [Thu, 16 Mar 2017 16:00:53 +0000 (13:00 -0300)]
Removed unused variable and cleaned whitespaces

Change-Id: Iaaf6b6f5f49f2d2599a3422250ad7e6e41838b82

7 years agoRemoved unused variables and cleaned whitespaces. 93/3493/2
Ben Mezger [Thu, 16 Mar 2017 15:56:01 +0000 (12:56 -0300)]
Removed unused variables and cleaned whitespaces.

Change-Id: Ib96d1c5bf7a1c65a99d77726fe54ccf37399f9eb

7 years agoRemoved unused variables and cleaned whitespaces. 92/3492/2
Ben Mezger [Thu, 16 Mar 2017 15:51:03 +0000 (12:51 -0300)]
Removed unused variables and cleaned whitespaces.

Change-Id: Ie5c1ad84ad162ab18443dd228686aba544ecb9ef

7 years agoPrevent arg from being used any further 91/3491/2
Ben Mezger [Thu, 16 Mar 2017 15:30:27 +0000 (12:30 -0300)]
Prevent arg from being used any further

Patch edited by David van Moolenbroek.

Change-Id: Ie25faffea359e735145dbb4ae2bd2d213488952b

7 years agodistrib: fix debug builds 90/3490/1
David van Moolenbroek [Sat, 6 May 2017 12:43:03 +0000 (14:43 +0200)]
distrib: fix debug builds

Reported by Jean-Baptiste Boric.

Change-Id: I1e9b156326385aa188c824557b6716c059e39fce

7 years agoNetwork stack feedback-based fixes 89/3489/1 213/head
David van Moolenbroek [Sun, 30 Apr 2017 15:33:24 +0000 (15:33 +0000)]
Network stack feedback-based fixes

Thanks to Lionel Sambuc!

Change-Id: Iae6b2caf58e2b58093e60c5004cfa477e43da154

7 years agotests: add advanced TCP/IP tests (test91-94) 88/3488/2
David van Moolenbroek [Thu, 29 Sep 2016 23:16:22 +0000 (23:16 +0000)]
tests: add advanced TCP/IP tests (test91-94)

Change-Id: I052102f6122f82b3307595990bf91f64e97a45a8

7 years agoImport NetBSD networking rc scripts 87/3487/2
David van Moolenbroek [Thu, 23 Feb 2017 21:57:15 +0000 (21:57 +0000)]
Import NetBSD networking rc scripts

IMPORTANT: this change has a docs/UPDATING entry!

Change-Id: I6f1e575166f5b47530a004c12aea9b45b571e13d

7 years agonetconf(8): rewrite 86/3486/2
David van Moolenbroek [Tue, 21 Feb 2017 23:34:25 +0000 (23:34 +0000)]
netconf(8): rewrite

When possible, network drivers are now started automatically.  That
means that netconf(8)'s network driver selection has become obsolete.
This patch changes netconf(8) to allow the user to specify a network
configuration (currently one of DHCP IPv4+IPv6, DHCP IPv4-only,
manual IPv4-only) for any hardware network interfaces that are
currently present.

Selection of network drivers that require manual configuration first
(mainly old ISA cards) is still supported, but now as a special case.

Change-Id: I6208fc75192eb7f0b061862aaf7507f71a620da4

7 years agoetc/rc: start lwip service 85/3485/2
David van Moolenbroek [Mon, 20 Feb 2017 14:07:55 +0000 (14:07 +0000)]
etc/rc: start lwip service

Change-Id: I10cfdcde490987b93c79532a2c53dda2307b83ce

7 years agoetc/rc: auto-start PnP ethernet drivers 84/3484/2
David van Moolenbroek [Mon, 20 Feb 2017 14:06:59 +0000 (14:06 +0000)]
etc/rc: auto-start PnP ethernet drivers

Change-Id: I0f6c955511cbb04d47093de28109b5084609856a

7 years agotests: adapt existing tests to new LWIP service 83/3483/2
David van Moolenbroek [Thu, 29 Sep 2016 23:08:31 +0000 (23:08 +0000)]
tests: adapt existing tests to new LWIP service

Change-Id: Id744e9d3fbe19733557011f8803593cf3768c35d

7 years agoping(8), traceroute(8): adapt to new LWIP service 82/3482/2
David van Moolenbroek [Thu, 29 Sep 2016 23:19:31 +0000 (23:19 +0000)]
ping(8), traceroute(8): adapt to new LWIP service

Change-Id: I0aae7199dfd9075201975e133cdaeab6bc2bd24f

7 years agoAdd lwip: a new lwIP-based TCP/IP service 81/3481/2
David van Moolenbroek [Thu, 29 Sep 2016 23:07:07 +0000 (23:07 +0000)]
Add lwip: a new lwIP-based TCP/IP service

This commit adds a new TCP/IP service to MINIX 3.  As its core, the
service uses the lwIP TCP/IP stack for maintenance reasons.  The
service aims to be compatible with NetBSD userland, including its
low-level network management utilities.  It also aims to support
modern features such as IPv6.  In summary, the new LWIP service has
support for the following main features:

- TCP, UDP, RAW sockets with mostly standard BSD API semantics;
- IPv6 support: host mode (complete) and router mode (partial);
- most of the standard BSD API socket options (SO_);
- all of the standard BSD API message flags (MSG_);
- the most used protocol-specific socket and control options;
- a default loopback interface and the ability to create one more;
- configuration-free ethernet interfaces and driver tracking;
- queuing and multiple concurrent requests to each ethernet driver;
- standard ioctl(2)-based BSD interface management;
- radix tree backed, destination-based routing;
- routing sockets for standard BSD route reporting and management;
- multicast traffic and multicast group membership tracking;
- Berkeley Packet Filter (BPF) devices;
- standard and custom sysctl(7) nodes for many internals;
- a slab allocation based, hybrid static/dynamic memory pool model.

Many of its modules come with fairly elaborate comments that cover
many aspects of what is going on.  The service is primarily a socket
driver built on top of the libsockdriver library, but for BPF devices
it is at the same time also a character driver.

Change-Id: Ib0c02736234b21143915e5fcc0fda8fe408f046f

7 years agoRMIB: add indirection support for sparse subtrees 80/3480/2
David van Moolenbroek [Fri, 30 Sep 2016 21:55:33 +0000 (21:55 +0000)]
RMIB: add indirection support for sparse subtrees

Normally, each RMIB subtree consists of an array of nodes, indexed
by node identifier.  In a sparsely filled subtree, most of the array
is empty and just wasting memory.  In that case, it may be beneficial
to have a level of indirection, with an intermediate array containing
pairs of node IDs and pointers to the actual nodes.  This patch adds
support for such indirection.

For the use cases that inspired this patch, net.inet and net.inet6,
the indirection shaves off a little under 16KB of memory from the
TCP/IP service.

Change-Id: Ic68ca3fee1a0f2032f77eef6df42728f9b9400e8

7 years agolibsys: allow for grant preallocation 79/3479/2
David van Moolenbroek [Fri, 4 Nov 2016 17:31:40 +0000 (17:31 +0000)]
libsys: allow for grant preallocation

Since the grant table is allocated dynamically, a system service always
runs the risk of running out of memory at run time when trying to
allocate a grant.  In order to allow services to mitigate that risk,
grants can now be preallocated, typically at system service startup,
using the new cpf_prealloc(3) libsys function.  The function takes a
'count' parameter that indicates the number of additional grants to
preallocate.  Thus, the function may be called from multiple submodules
within a service, each preallocating their own maximum of grants that
it may need at run time.

Change-Id: I6904726a722a8c27dfe2efa470e683718f310272

7 years agoImport new lwIP version into liblwip 78/3478/2
David van Moolenbroek [Thu, 29 Sep 2016 23:26:40 +0000 (23:26 +0000)]
Import new lwIP version into liblwip

In order to match NetBSD-style imports of external code, the library
has been restructured.  The full lwIP source tree is imported, except
for a few .git* files in its root directory, into dist/.  The MINIX 3
Makefiles and other custom files are located in lib/.  Finally, since
we need to apply a number of small patches to lwIP, these patches are
stored in patches/, in addition to being applied to the lwIP tree.

The currently imported version of lwIP is taken from its master
branch sometime after the 2.0.1 release, specifically git-7ffe5bf.

Change-Id: Ie03c4fa36fa928870263c191205d6d93f652a3cc

7 years agolance: perform full reinitialization for restarts 77/3477/2
David van Moolenbroek [Sun, 26 Feb 2017 16:04:50 +0000 (16:04 +0000)]
lance: perform full reinitialization for restarts

When performing a restart (CSR0 STOP, STRT), the behavior regarding
the NIC's current RX/TX descriptor ring counters varies between cards:
older LANCE cards do not reset the counters; newer PCnet cards do
reset them; VirtualBox's emulation is once again broken in that it
claims to emulate newer cards but implements the older behavior.

Changing the card's receive mode requires such a restart, and now that
the system can actually change receive modes dynamically as part of
normal network operation, this results in the lance driver breaking
all the time on at least VirtualBox.

Instead of trying to figure out exactly what is going on with the
counters during a restart, we now simply perform a full-blown
reinitialization every time the NIC is restarted.  That leaves no
ambiguity regarding the counters, and appears to be what drivers on
other OSes do as well.  As a bonus, this approach actually saves code.

Change-Id: I60fad2df6de4616d5de2cec39c09b60c15d854fb

7 years agolibnetdriver: rewrite 76/3476/2
David van Moolenbroek [Wed, 12 Oct 2016 04:41:08 +0000 (04:41 +0000)]
libnetdriver: rewrite

This is a driver-breaking update to the netdriver library, which is
used by all network drivers.  The aim of this change is to make the
library more compatible with NetBSD, and in particular with various
features that are expected to be supported by the NetBSD userland.
The main changes made by this patch are the following:

- each network driver now has a NetBSD-style short device name;
- drivers are not expected to receive packets right after startup;
- extended support for receipt modes, including multicast lists;
- support for multiple parallel send, receive requests;
- embedding of I/O vectors in send and receive requests;
- support for capabilities, including checksum offloading;
- support for reporting link status updates to the TCP/IP stack;
- support for setting and retrieving media status;
- support for changing the hardware (MAC) address;
- support for NetBSD interface flags IFF_DEBUG, IFF_LINK[0-2];
- support for NetBSD error statistics;
- support for regular time-based ("tick") callbacks.

IMPORTANT: this patch applies a minimal update to the existing drivers
in order to make them work at all with the new netdriver library.  It
however does *not* change all drivers to make use of the new features.
In fact, strictly speaking, all drivers are now violating requirements
imposed by the new library in one way or another, most notably by
enabling packet receipt when starting the driver.  Changing all the
drivers to be compliant, and to support the newly added options, is
left to future patches.  The existing drivers should currently *not*
be taken as examples of how to implement a new network driver!

With that said, a few drivers have already been changed to make use of
some of the new features: fxp, e1000, rtl8139, and rtl8169 now report
link and media status, and the last three of those now support setting
the hardware MAC address on the fly.  In addition, dp8390 has been
changed to default to PCI autoconfiguration if no configuration is
specified through environment variables.

Change-Id: I4b3ea9c0b9bc25d5b0609c6ff256fb0db71cdc42

7 years agosyslogd(8): drop some MINIX-specific changes 75/3475/1
David van Moolenbroek [Fri, 17 Feb 2017 11:41:41 +0000 (11:41 +0000)]
syslogd(8): drop some MINIX-specific changes

Change-Id: Ic286b89975eeea1abf0d5086ee13dfb9ab57d8ba

7 years agoftpd(8): drop some MINIX-specific changes 74/3474/1
David van Moolenbroek [Sun, 5 Mar 2017 16:13:32 +0000 (16:13 +0000)]
ftpd(8): drop some MINIX-specific changes

Also put in a crude way to clean up zombies when ftpd(8) is running
in daemon mode, because we do not yet support SA_NOCLDWAIT.

Change-Id: I8a7db1d665c432d736db833b0022d0340764db1f

7 years agoImport NetBSD httpd(8) 73/3473/1
David van Moolenbroek [Sun, 5 Mar 2017 16:03:54 +0000 (16:03 +0000)]
Import NetBSD httpd(8)

Also known as bozohttpd(8).

Change-Id: I40e955b5654674f2c708b10e5e403ca9cbc92534

7 years agoImport NetBSD rtadvd(8) 72/3472/1
David van Moolenbroek [Sun, 19 Feb 2017 14:27:23 +0000 (14:27 +0000)]
Import NetBSD rtadvd(8)

Change-Id: I22626843d85c78f0fadefd58d61d7a85d285b2b8

7 years agoImport NetBSD ndp(8) 71/3471/1
David van Moolenbroek [Sun, 19 Feb 2017 01:14:53 +0000 (01:14 +0000)]
Import NetBSD ndp(8)

Like arp(8), this utility already uses the NetBSD 8 protocol for
talking to the operating system through routing sockets.

Like arp(8), this utility is not fully functional, due to limitations
of lwIP.  While ndp(8) should provide a proper (read-only) view of the
contents of the Neighbor Discovery table, any attempts to modify the
table will fail.  In addition, various other ndp(8) features are not
supported.  On MINIX 3, the prefix and default router lists are not
managed by the operating system however, but rather by dhcpcd(8);
therefore, an implementation of the features related to those lists
would not provide any actual functionality.

Change-Id: I479bfc8141ba69fe50c1b2f7091933267ce6fa3e

7 years agoImport NetBSD tcpdump(8) 70/3470/1
David van Moolenbroek [Sun, 19 Feb 2017 00:56:10 +0000 (00:56 +0000)]
Import NetBSD tcpdump(8)

For now, printing of Sun RPC requests is disabled because we do not
yet have the RPC header files.  This should affect basically noone,
as we do not have any RPC-based programs yet, for the same reason.

Change-Id: Ie7818faaaacdc104d8b2c37a68866b4ce18247d6

7 years agoImport NetBSD libpcap 69/3469/1
David van Moolenbroek [Sun, 19 Feb 2017 00:34:03 +0000 (00:34 +0000)]
Import NetBSD libpcap

As part of this, we import bpf_filter.c from NetBSD.  Even though that
file is part of the NetBSD kernel, it is also used by userland (as is
clear here).  Our LWIP service has its own bpf_filter.c implementation
but that implementation has certain limits (e.g. on program size) that
are fine for a system service but should not apply to userland.

The libpcap code has a number of blocks guarded by __NetBSD__, but
none of those blocks apply to MINIX 3.  In particular, some of the
alignment logic used for NetBSD may in fact not work in our case.

Change-Id: Ib187e22d627c929e111d5d4a991c3bee3c0154cb

7 years agoImport NetBSD dhclient(8), dhcpd(8), dhcrelay(8) 68/3468/1
David van Moolenbroek [Thu, 16 Feb 2017 16:31:25 +0000 (16:31 +0000)]
Import NetBSD dhclient(8), dhcpd(8), dhcrelay(8)

dhcrelay(8) and omshell(1) have not been tested.

Change-Id: I0cad89f65666af4e366a86e130ce8df0894c3bb4

7 years agoImport NetBSD named(8) 67/3467/1
David van Moolenbroek [Thu, 16 Feb 2017 17:11:19 +0000 (17:11 +0000)]
Import NetBSD named(8)

Also known as ISC bind.  This import adds utilities such as host(1),
dig(1), and nslookup(1), as well as many other tools and libraries.

Change-Id: I035ca46e64f1965d57019e773f4ff0ef035e4aa3

7 years agoImport NetBSD dhcpcd(8) 66/3466/1
David van Moolenbroek [Thu, 16 Feb 2017 15:54:23 +0000 (15:54 +0000)]
Import NetBSD dhcpcd(8)

The port could be improved by adding support for pselect(2).

Other than that, this port has a few MINIX-specific changes:

- we undefine IN_IFF_ flags to stop dhcpcd from thinking that we have
  operating system support for link-local IPv4 address management;
- we work around one crash bug that seems triggered by using dhcpcd
  on some but not all interfaces;
- we add "noalias" to the default dhcpcd.conf(5) configuration file.

Change-Id: I8a81c2c2af353c5ce08335673b1ab2d4b39178da

7 years agoImport NetBSD resolvconf(8) 65/3465/1
David van Moolenbroek [Thu, 16 Feb 2017 13:21:17 +0000 (13:21 +0000)]
Import NetBSD resolvconf(8)

Also known as "openresolv".  Needed for dhcpcd(8).

Change-Id: Ibcb616837e9a5293377e451c6f6218a37260ed80

7 years agoImport NetBSD inetd(8) 64/3464/1
David van Moolenbroek [Wed, 15 Feb 2017 20:53:10 +0000 (20:53 +0000)]
Import NetBSD inetd(8)

Do not start it by default just yet.

Change-Id: Id8d2dd33eb67ae74b3ef3060638e20c781e8e37d

7 years agoImport NetBSD telnetd(8) 63/3463/1
David van Moolenbroek [Wed, 15 Feb 2017 20:36:35 +0000 (20:36 +0000)]
Import NetBSD telnetd(8)

Change-Id: Ie1ae80e8a4945f6f4ccce8f468c1b04a8d89cf43

7 years agoImport NetBSD telnet(1) 62/3462/1
David van Moolenbroek [Wed, 15 Feb 2017 17:41:07 +0000 (17:41 +0000)]
Import NetBSD telnet(1)

Change-Id: Ib58b43cc9baabe183a59410212827f65ec117277

7 years agoImport NetBSD traceroute6(8) 61/3461/1
David van Moolenbroek [Wed, 15 Feb 2017 17:31:54 +0000 (17:31 +0000)]
Import NetBSD traceroute6(8)

Change-Id: I040651cf29a9efd6b85afafe6813e48c2f1a4f2d

7 years agoImport NetBSD ping6(8) 60/3460/1
David van Moolenbroek [Wed, 15 Feb 2017 17:16:18 +0000 (17:16 +0000)]
Import NetBSD ping6(8)

Change-Id: Ife49f5fac0e50852c74a0f85b6129c204d172c68

7 years agoImport NetBSD arp(8) 59/3459/1
David van Moolenbroek [Wed, 15 Feb 2017 13:02:59 +0000 (13:02 +0000)]
Import NetBSD arp(8)

Behaviorally this port should already be largely on par with the
NetBSD 8 version, in that it sets the RTF_LLDATA flag on routing
socket requests to indicate that they target link-local data.

Many parts of the arp(8) functionality are currently not yet supported
by the operating system, largely due to lwIP not exposing appropriate
means of implementing them.

Change-Id: Icfac054b4deddda03eee4acf0e261aa48cd031ba

7 years agoImport NetBSD netstat(1) 58/3458/1
David van Moolenbroek [Wed, 15 Feb 2017 12:35:47 +0000 (12:35 +0000)]
Import NetBSD netstat(1)

The port forces the use of sysctl(7), as obtaining information through
KVM is not and will never be viable.  The sysctl mode of netstat(1) is
currently somewhat limited and buggy, though.  We fix a few minimal
issues, but more improvements will have to come from NetBSD reimports.

Some of netstat(1)'s views are currently not supported by the
operating system.  Later improvements on this point will not require
changes to the imported code, though.

Change-Id: If74a6811f0fc81bd1ecc31010a28379b14b2a0eb

7 years agoImport NetBSD route(8) 57/3457/1
David van Moolenbroek [Wed, 15 Feb 2017 12:08:12 +0000 (12:08 +0000)]
Import NetBSD route(8)

Change-Id: I724a2a56157ea72afdd3f6a82239687894c8e3e8

7 years agoImport NetBSD ifconfig(8) 56/3456/1
David van Moolenbroek [Wed, 15 Feb 2017 11:17:52 +0000 (11:17 +0000)]
Import NetBSD ifconfig(8)

Not all of its functionality is actually implemented in the operating
system.  In addition, a few modules (agr, vlan) have been disabled
because we have not imported the necessary headers yet.

Change-Id: I4c9271065d640bd9112b4bd27e2652e1d51b18b4

7 years agoImport NetBSD libwrap 55/3455/1
David van Moolenbroek [Fri, 17 Feb 2017 11:40:49 +0000 (11:40 +0000)]
Import NetBSD libwrap

Change-Id: Ib8b979fb9a96c2048b8ea93038944c743048bff4

7 years agoImport NetBSD nsswitch.conf(5) 54/3454/1
David van Moolenbroek [Thu, 23 Feb 2017 18:43:50 +0000 (18:43 +0000)]
Import NetBSD nsswitch.conf(5)

Change-Id: I0464b474d50b39cd6259c492e1fae6fecfd9d984

7 years agoImport NetBSD hosts(5) 53/3453/1
David van Moolenbroek [Tue, 14 Feb 2017 23:22:42 +0000 (23:22 +0000)]
Import NetBSD hosts(5)

Change-Id: I0924dcc7d4eb9151b77305f370360722d4a7533a

7 years agolibutil: drop some MINIX-specific changes 52/3452/1
David van Moolenbroek [Sun, 5 Mar 2017 17:26:14 +0000 (17:26 +0000)]
libutil: drop some MINIX-specific changes

Change-Id: I8deeac84deb4a986b62caabe96c8f7c722d97921

7 years agoEnable IPv6 support 51/3451/1
David van Moolenbroek [Tue, 14 Feb 2017 22:19:53 +0000 (22:19 +0000)]
Enable IPv6 support

Change-Id: I3f68c38ca5efbecd04941064542ed24004db1429

7 years agoEnable a few more NetBSD functions 50/3450/1
David van Moolenbroek [Tue, 14 Feb 2017 22:14:15 +0000 (22:14 +0000)]
Enable a few more NetBSD functions

Change-Id: Ia8463adfb12b465bd43a62aee9f14b21eaa13b19

7 years agoPTY: add minimal support for TIOCPKT 49/3449/1
David van Moolenbroek [Wed, 15 Feb 2017 19:27:45 +0000 (19:27 +0000)]
PTY: add minimal support for TIOCPKT

With TIOCPKT enabled, each piece of output is preceded by a zero byte
on the PTY master.  In addition, a non-zero byte is a flags field
that conveys information about changes on the pseudoterminal.  This
patch implements the former, but not the latter.  That is enough to
get telnetd(8) going, however.  TIOCPKT support may be extended later.

Change-Id: I6ef9cc8cf1b4406147b088400fc8499684b62a30

7 years agoRetire MINIX rlogin(1) 48/3448/1
David van Moolenbroek [Tue, 14 Feb 2017 18:56:20 +0000 (18:56 +0000)]
Retire MINIX rlogin(1)

Change-Id: Ib85e74e5333e8fffa05631dbc760284761bf3ecb

7 years agoRetire MINIX rget(1), rput(1) 47/3447/1
David van Moolenbroek [Tue, 14 Feb 2017 18:53:43 +0000 (18:53 +0000)]
Retire MINIX rget(1), rput(1)

Change-Id: I70e3ec9281275730c589fb7683801dc1ca584cab

7 years agoRetire MINIX in.telnetd(8) 46/3446/1
David van Moolenbroek [Tue, 14 Feb 2017 18:51:12 +0000 (18:51 +0000)]
Retire MINIX in.telnetd(8)

Change-Id: Ib54998e7a81f924d19b8013ef567703996d24a03

7 years agoRetire MINIX telnet(1) 45/3445/1
David van Moolenbroek [Tue, 14 Feb 2017 18:48:16 +0000 (18:48 +0000)]
Retire MINIX telnet(1)

..which, for some strange reason, was installed as "ttn".

Change-Id: I5ad2f969ad7978a27fb7345f8434470ca427d429

7 years agoRetire MINIX rarpd(8) 44/3444/1
David van Moolenbroek [Tue, 14 Feb 2017 18:43:37 +0000 (18:43 +0000)]
Retire MINIX rarpd(8)

Change-Id: I2d7b7edbb8fa6000ba368d156cf947e7691cf454

7 years agoRetire MINIX irdpd(8) 43/3443/1
David van Moolenbroek [Tue, 14 Feb 2017 18:38:28 +0000 (18:38 +0000)]
Retire MINIX irdpd(8)

Change-Id: Id11c6db9db5da18346d993cb9c3faa4313ed3ed4

7 years agoRetire MINIX arp(8) 42/3442/1
David van Moolenbroek [Tue, 14 Feb 2017 18:31:45 +0000 (18:31 +0000)]
Retire MINIX arp(8)

Change-Id: I8351fbb99d73811282e46dae7fae1b6abb130bf2

7 years agoRetire MINIX tcpd(8) 41/3441/1
David van Moolenbroek [Tue, 14 Feb 2017 18:24:20 +0000 (18:24 +0000)]
Retire MINIX tcpd(8)

Change-Id: If419d441c5df0b9f2e29db1ef0d904d102739f9b

7 years agoRetire MINIX host(1) 40/3440/1
David van Moolenbroek [Tue, 14 Feb 2017 17:55:19 +0000 (17:55 +0000)]
Retire MINIX host(1)

Change-Id: I19d2e866d6d397d3bff9ba698cb8ec26267ee82c

7 years agoRetire MINIX dhcpd(8) 39/3439/1
David van Moolenbroek [Tue, 14 Feb 2017 17:50:02 +0000 (17:50 +0000)]
Retire MINIX dhcpd(8)

Change-Id: I4b8c738b6176ce390a7a7817b0dcaf9caffe636c

7 years agoRetire MINIX hostaddr(1) 38/3438/1
David van Moolenbroek [Tue, 14 Feb 2017 17:43:49 +0000 (17:43 +0000)]
Retire MINIX hostaddr(1)

Change-Id: I30c7b5fe4c96ea040c3eea46f1dc4d9bd135745d

7 years agoRetire MINIX nonamed(8) 37/3437/1
David van Moolenbroek [Tue, 14 Feb 2017 17:34:20 +0000 (17:34 +0000)]
Retire MINIX nonamed(8)

Also retire support for the MINIX versions of /etc/hosts and
/etc/resolv.conf.  These files will be brought back with NetBSD
imports, although like NetBSD, MINIX 3 will be using external
resolvers directly from then on.  Since resolv.conf is hand-created
rather than installed, we do not mark it as obsolete.

Change-Id: Ie6154d5a4d8d977c19b9754bf920ae868680e9d1

7 years agoRetire MINIX pr_routes(8) 36/3436/1
David van Moolenbroek [Tue, 14 Feb 2017 17:19:12 +0000 (17:19 +0000)]
Retire MINIX pr_routes(8)

Change-Id: Ic7494d097f9d19185b7173edb7590044baee5abc

7 years agoRetire MINIX add_route(8) 35/3435/1
David van Moolenbroek [Tue, 14 Feb 2017 17:17:29 +0000 (17:17 +0000)]
Retire MINIX add_route(8)

Change-Id: I900a3c6ac8e8fac15f5f84960bb89f92aeb90863

7 years agoRetire MINIX ifconfig(8) 34/3434/1
David van Moolenbroek [Tue, 14 Feb 2017 17:08:55 +0000 (17:08 +0000)]
Retire MINIX ifconfig(8)

Change-Id: I26f3ceff01bbd31e4c009752c7454a58e8a72abf

7 years agoRetire inet: the previous MINIX TCP/IP service 33/3433/1
David van Moolenbroek [Tue, 14 Feb 2017 15:26:43 +0000 (15:26 +0000)]
Retire inet: the previous MINIX TCP/IP service

This commit (temporarily) leaves MINIX 3 without a TCP/IP service.

Thanks go out to Philip Homburg for providing this TCP/IP stack in the
first place.  It has served MINIX well for a long time.

Change-Id: I0e3eb6fe64204081e4e3c2b9d6e6bd642f121973

7 years agoRetire lwip: the previous lwIP-based TCP/IP service 32/3432/1
David van Moolenbroek [Mon, 13 Feb 2017 22:52:16 +0000 (22:52 +0000)]
Retire lwip: the previous lwIP-based TCP/IP service

Change-Id: Id9bbf96344a6e9d796f6773547588a981e70bf0f

7 years agoRetire MINIX tcpstat(1), udpstat(1) 31/3431/1
David van Moolenbroek [Tue, 14 Feb 2017 16:22:04 +0000 (16:22 +0000)]
Retire MINIX tcpstat(1), udpstat(1)

This needs to be done before retiring inet itself, since these
utilities include headers from inet directly.

Also retire the now-obsolete paramvalue(3).

Change-Id: I9b27771190a6a32ee533b0c0d9d37f61a16ee36c

7 years agotests: add advanced UDS tests (test90) 30/3430/1
David van Moolenbroek [Thu, 21 Jul 2016 20:50:47 +0000 (20:50 +0000)]
tests: add advanced UDS tests (test90)

Change-Id: Ib4b81d441368fd9b7e7c7b9cab802bb01fa04065

7 years agoUDS: full rewrite 29/3429/1
David van Moolenbroek [Sun, 21 Feb 2016 22:59:04 +0000 (22:59 +0000)]
UDS: full rewrite

This new implementation of the UDS service is built on top of the
libsockevent library.  It thereby inherits all the advantages that
libsockevent brings.  However, the fundamental restructuring
required for that change also paved the way for resolution of a
number of other important open issues with the old UDS code.  Most
importantly, the rewrite brings the behavior of the service much
closer to POSIX compliance and NetBSD compatibility.  These are the
most important changes:

- due to the use of libsockevent, UDS now supports multiple suspending
  calls per socket and a large number of standard socket flags and
  options;
- socket address matching is now based on <device,inode> lookups
  instead of canonized path names, and socket addresses are no longer
  altered either due to canonization or at connect time;
- the socket state machine is now well defined, most importantly
  resolving the erroneous reset-on-EOF semantics of the old UDS, but
  also allowing socket reuse;
- sockets are now connected before being accepted instead of being
  held in connecting state, unless the LOCAL_CONNWAIT option is set
  on either the connecting or the listening socket;
- connect(2) on datagram sockets is now supported (needed by syslog),
  and proper datagram socket disconnect notification is provided;
- the receive queue now supports segmentation, associating ancillary
  data (in-flight file descriptors and credentials) with each segment
  instead of being kept fully separately; this is a POSIX requirement
  (and needed by tmux);
- as part of the segmentation support, the receive queue can now hold
  as many packets as can fit, instead of one;
- in addition to the flags supported by libsockevent, the MSG_PEEK,
  MSG_WAITALL, MSG_CMSG_CLOEXEC, MSG_TRUNC, and MSG_CTRUNC send and
  receive flags are now supported;
- the SO_PASSCRED and SO_PEERCRED socket options are replaced by
  LOCAL_CREDS and LOCAL_PEEREID respectively, now following NetBSD
  semantics and allowing use of NetBSD libc's getpeereid(3);
- memory usage is reduced by about 250 KB due to centralized in-flight
  file descriptor tracking, with a limit of OPEN_MAX total rather than
  of OPEN_MAX per socket;
- memory usage is reduced by another ~50 KB due to removal of state
  redundancy, despite the fact that socket path names may now be up to
  253 bytes rather than the previous 104 bytes;
- compared to the old UDS, there is now very little direct indexing on
  the static array of sockets, thus allowing dynamic allocation of
  sockets more easily in the future;
- the UDS service now has RMIB support for the net.local sysctl tree,
  implementing preliminary support for NetBSD netstat(1).

Change-Id: I4a9b6fe4aaeef0edf2547eee894e6c14403fcb32

7 years agoRMIB: expose full node path; improve restartability 28/3428/1
David van Moolenbroek [Fri, 30 Sep 2016 21:46:18 +0000 (21:46 +0000)]
RMIB: expose full node path; improve restartability

A single function may be used to handle the implementation of more
than one node.  In some cases, the behavior of that function may
depend on the path name used to reach the node.  Therefore, provide
the full path name as part of the call information.

As a result, RMIB has to save the paths for each of its remote MIB
mount points.  That in turn also allows it to autonomously remount its
mount points after a MIB service restart, thus bringing us a step
closer to proper recovery after a MIB crash without requiring the
service using RMIB to perform explicit steps.  As before, the missing
ingredient is actual notification of MIB service restarts, and proper
support for *that* will likely require changes to the DS service.

Change-Id: Ic0c79931d6f3a76c2c998047f8b47350fd0fa5b0

7 years agoPM/libsys: extend getepinfo, add getsockcred(3) 27/3427/1
David van Moolenbroek [Tue, 12 Jul 2016 14:46:27 +0000 (14:46 +0000)]
PM/libsys: extend getepinfo, add getsockcred(3)

The service-only getepinfo(2) PM call returns information about a
given endpoint.  This patch extends that call so that it returns
enough information to allow correctly filling a sockcred structure.
A new getsockcred(3) function is added to libsys to fill an actual
sockcred structure with the obtained information.  However, for the
caller's convenience, the groups list is kept separate.

Change-Id: I9f1a6d1a221c77eabaa3498ff4ec9a5fb922e4fd

7 years agolibsys: retire getnucred in favor of getepinfo 26/3426/1
David van Moolenbroek [Wed, 27 Jan 2016 23:24:56 +0000 (23:24 +0000)]
libsys: retire getnucred in favor of getepinfo

The getnucred() function was used by UDS to obtain credentials of user
processes in a form used in the UDS API, namely the ucred structure.
Since the NetBSD merge, this structure has changed drastically (aside
from being renamed to "uucred"), and it is no longer in UDS's best
interest to use this structure internally.  Therefore, getnucred() is
no longer a useful API either, and instead we directly use the
previously private getepinfo() function to obtain credentials.

Change-Id: I80bc809de716ec0a9b7497cb109d2f2708a629d5

7 years agoUDS: prepare for socket file creation in bind(2) 25/3425/1
David van Moolenbroek [Sun, 27 Dec 2015 19:35:12 +0000 (19:35 +0000)]
UDS: prepare for socket file creation in bind(2)

This patch prepares for moving of the creation of socket files on the
file system from the libc bind(2) stub into the UDS service.  This
change is necessary for the socket type agnostic libc implementation.
The change is not yet activated - the code that is not yet used is
enclosed in "#if NOT_YET" blocks.  The activation needs to be atomic
with UDS's switch to libsockdriver; otherwise, user applications may
break.

As part of the change, various UDS bind(2) semantics are changed to
match the POSIX standard and other operating systems.  In
implementation terms, the service-only VFS API checkperms(2) is
renamed to socketpath(2), and extended with a new subcall which
creates a new socket file.  An extension to test56 checks the new
bind(2) semantics of UDS, although most new tests are still disabled
until activation as well.

Finally, as further preparation for a more structural redesign of the
UDS service, also return the <device,inode> number pair for the
created or checked file name, and make returning the canonized path
name optional.

Change-Id: I892d04b3301d4b911bdc571632ddde65fb747a8a

7 years agoAdd libsockevent: a socket event dispatching library 24/3424/1
David van Moolenbroek [Thu, 21 Jul 2016 20:59:26 +0000 (20:59 +0000)]
Add libsockevent: a socket event dispatching library

This library provides an event-based abstraction model and dispatching
facility for socket drivers.  Its main goal is to eliminate any and
all need for socket drivers to keep track of pending socket calls.
Additionally, this library takes over responsibility of a number of
other tasks that would otherwise be duplicated between socket drivers,
but in such a way that individual socket drivers retain a large degree
of freedom in terms of API behavior.  The library's main features are:

- suspension, resumption, and cancellation of socket calls;
- an abstraction layer for select(2);
- state tracking of shutdown(2);
- pending (asynchronous) errors and the SO_ERROR socket option;
- listening-socket tracking and the SO_ACCEPTCONN socket option;
- generation of SIGPIPE signals; SO_NOSIGPIPE, MSG_NOSIGNAL;
- send and receive low-watermark tracking, SO_SNDLOWAT, SO_RCVLOWAT;
- send and receive timeout support and SO_SNDTIMEO, SO_RCVTIMEO;
- an abstraction layer for the SO_LINGER socket option;
- tracking of various on/off socket options as well as SO_TYPE;
- a range of pre-checks on socket calls that are required POSIX.

In order to track per-socket state, the library manages an opaque
"sock" object for each socket.  The allocation of such objects is left
entirely to the socket driver.  Each sock object has an associated
callback table for calls from libsockevent to the socket driver.  The
socket driver can raise events on the sock object in order to flag
that any previously suspended operations of a particular type should
be resumed.  The library may defer processing such raised events if
immediate processing could interfere with internal consistency.

The sockevent library is layered on top of libsockdriver, and should
be used by all socket driver implementations if at all possible.

Change-Id: I3eb2c80602a63ef13035f646473360293607ab76

7 years agoAdd libsockdriver: a library for socket drivers 23/3423/1
David van Moolenbroek [Sun, 21 Feb 2016 22:15:35 +0000 (22:15 +0000)]
Add libsockdriver: a library for socket drivers

This library provides abstractions for socket drivers, and should be
used as the basis for all socket driver implementations.  It provides
the following functionality:

  - a function call table abstraction, hiding the details of the
    socket driver protocol with simple parameters and presenting the
    socket driver with callback functions very similar to the BSD
    socket API calls made from userland;
  - abstracting data structures and helper functions for suspending
    and resuming blocking calls;
  - abstracting data structures and helper functions for copying data
    from and to the caller.

Overall, the library is similar to lib{block,char,fs,input,net}driver
in concept.  Some of the abstractions provided here should in fact be
applied to libchardriver as well.  As always, for the case that the
provided message loop is too restrictive, a set of more low-level
message processing functions is provided.

Change-Id: I79ec215f5e195c3b0197e223636f987d3755fb13

7 years agoVFS: support close-on-exec flag for copyfd(2) 22/3422/1
David van Moolenbroek [Wed, 20 Jul 2016 13:03:03 +0000 (13:03 +0000)]
VFS: support close-on-exec flag for copyfd(2)

The flag is supported only when copying out file descriptors (i.e.
COPYFD_TO).  It will be used by UDS to support MSG_CMSG_CLOEXEC.

Change-Id: I46bfd04b5f28e22ec48938e43e42f78d3931220d

7 years agoVFS: deny copying sockets to owning socket driver 21/3421/1
David van Moolenbroek [Wed, 20 Jul 2016 12:47:34 +0000 (12:47 +0000)]
VFS: deny copying sockets to owning socket driver

This patch stops a socket driver from using copyfd(2) to copy in a
file descriptor that is a reference to a socket owned by that socket
driver, returning EDEADLK instead.  In effect, this will stop deadlock
and resource exhaustion issues with UDS once it has been converted to
a socket driver.  See the comment in the patch for details.

Change-Id: I5728a405eabda207725618231a6ff7be2d517146

7 years agoVFS: support for suspending close(2) for sockets 20/3420/1
David van Moolenbroek [Mon, 25 Jul 2016 11:11:37 +0000 (11:11 +0000)]
VFS: support for suspending close(2) for sockets

This change effectively adds the VFS side of support for the SO_LINGER
socket option, by allowing file descriptor close operations to be
suspended (and later resumed) by socket drivers.  Currently, support
is limited to the close(2) system call--in all other cases where file
descriptors are closed (dup2, close-on-exec, process exit..), the
close operation still completes instantly.  As a general policy, the
close(2) return value will always indicate that the file descriptor
has been closed: either 0, or -1 with errno set to EINPROGRESS.  The
latter error may be thrown only when a suspended close is interrupted
by a signal.

As necessary for UDS, this change also introduces a closenb(2) system
call extension, allowing the caller to bypass blocking SO_LINGER close
behavior.  This extension allows UDS to avoid blocking on closing the
last reference to an in-flight file descriptor, in an atomic fashion.
The extension is currently part of libsys, but there is no reason why
userland would not be allowed to make this call, so it is deliberately
not protected from use by userland.

Change-Id: Iec77d6665232110346180017fc1300b1614910b7

7 years agoVFS: change select(2) semantics for closed filps 19/3419/1
David van Moolenbroek [Thu, 2 Feb 2017 16:20:33 +0000 (16:20 +0000)]
VFS: change select(2) semantics for closed filps

If a select(2) call was issued on a file descriptor for which the file
pointer was closed due to invalidation (FILP_CLOSED), typically as the
result of a character/socket driver dying, the call would previously
return with an error: EINTR upon call entry or EIO on invalidation at
at a later time.  Especially the former could severely confuse
applications, which would assume the call was interrupted by a signal,
restart the select call and immediately get EINTR again, ad infinitum.

This patch changes the select(2) semantics such that for closed filps,
the file descriptor is returned as readable and/or writable (depending
on the requested operations), as such letting the entire select call
finish successfully.  Applications will then typically attempt to read
from and/or write to the file descriptor, resulting in an I/O error
that they should generally be better equipped to handle.

This patch also fixes a potential problem with returning early from a
select(2) call if a bad file descriptor is given: previously, in such
cases not all actions taken so far would be undone; now they are.

Change-Id: Ia6581f8789473a8a6c200852fccf552691a17025

7 years agoVFS: add BSD socket API, socket driver support 18/3418/1
David van Moolenbroek [Sun, 21 Feb 2016 19:28:24 +0000 (19:28 +0000)]
VFS: add BSD socket API, socket driver support

This patch adds the implementation of the BSD socket system calls
which have been introduced in an earlier patch.  At the same time, it
adds support for communication with socket drivers, using a new
"socket device" (SDEV_) protocol.  These two parts, implemented in
socket.c and sdev.c respectively, form the upper and lower halves of
the new BSD socket support in VFS.  New mapping functionality for
socket domains and drivers is added as well, implemented in smap.c.

The rest of the changes mainly facilitate the separation of character
and socket driver calls, and do not make any fundamental alterations.
For example, while this patch changes VFS's select.c rather heavily,
the new select logic for socket drivers is the exact same as for
character drivers; the changes mainly separate the driver type
specific parts from the generic select logic further than before.

Change-Id: I2f13084dd3c8d3a68bfc69da0621120c8291f707

7 years agoRS: add infrastructure for mapping socket drivers 17/3417/1
David van Moolenbroek [Sun, 21 Feb 2016 18:43:17 +0000 (18:43 +0000)]
RS: add infrastructure for mapping socket drivers

This patch introduces the first piece of support for the concept of
"socket drivers": services that implement one or more socket protocol
families.  The latter are also known as "domains", as per the first
parameter of the socket(2) API.  More specifically, this patch adds
the basic infrastructure for specifying that a particular service is
the socket driver for a set of domains.

Unlike major number mappings for block and character drivers, socket
domain mappings are static.  For that reason, they are specified in
system.conf files, using the "domain" keyword.  Such a keyword is to
be followed by one or more protocol families, without their "PF_"
prefix.  For example, a service with the line "domain INET INET6;"
will be mapped as the socket driver responsible for the AF_INET and
AF_INET6 protocol families.

This patch implements only the infrastructure for creating such
mappings; the actual mapping will be implemented in VFS in a later
patch.  The infrastructure is implemented in service(8), RS, and VFS.

For now there is a hardcoded limit of eight domains per socket driver.
This may sound like a lot, but the upcoming new LWIP service will
already use four of those.  Also, it is allowed for a service to be
both a block/character driver and a socket driver at the same time,
which is a requirement for the new LWIP service.

Change-Id: I93352d488fc6c481e7079248082895d388c39f2d

7 years agolibc: switch to NetBSD getifaddrs(3) 16/3416/1
David van Moolenbroek [Fri, 17 Jun 2016 14:11:47 +0000 (14:11 +0000)]
libc: switch to NetBSD getifaddrs(3)

Change-Id: I698f7cef84506ebd7beed6974a232eb75ab853c3

7 years agoImport NetBSD getent(1) 15/3415/1
David van Moolenbroek [Thu, 9 Mar 2017 18:58:26 +0000 (18:58 +0000)]
Import NetBSD getent(1)

Disable RPC support for now.

Change-Id: I5ccb435220bf20cd9089cdd7aacb7d126f62f119

7 years agoFix two mistakes in IP1000 driver 14/3414/1
Jia-Ju Bai [Thu, 9 Mar 2017 07:26:42 +0000 (07:26 +0000)]
Fix two mistakes in IP1000 driver

Change-Id: Iafdfc7496c0ed45727f414c35350cf86b644413b

7 years agoisofs: fix reported st_blocks stat(2) field 13/3413/1
David van Moolenbroek [Sun, 26 Feb 2017 22:18:21 +0000 (22:18 +0000)]
isofs: fix reported st_blocks stat(2) field

The st_blocks field should count 512-byte units, not file system
block units.  The previous computation would cause utilities such
as du(1), when used on isofs, to be off by a factor four.

Change-Id: If47c234079d19bd5b41f35a97780667efd822509

7 years agoetc: replace one more "service" with minix-service 12/3412/1
David van Moolenbroek [Sat, 25 Feb 2017 23:59:13 +0000 (23:59 +0000)]
etc: replace one more "service" with minix-service

This omission would cause the test set to hang, at least, if the
old /bin/service was indeed deleted.

Change-Id: I9423ecc77a4bf778973de81a49300748ce8c3dfd

7 years agoramdisk: clean up CD boot output 11/3411/1
David van Moolenbroek [Fri, 24 Feb 2017 18:18:16 +0000 (18:18 +0000)]
ramdisk: clean up CD boot output

In particular, remove a stray '1'.

Change-Id: If82689060a92a4af318b01325492627944fba07f

7 years agoshare: also install other existing manpages 10/3410/1
David van Moolenbroek [Thu, 23 Feb 2017 13:35:03 +0000 (13:35 +0000)]
share: also install other existing manpages

A pair of manual pages were already present in /usr/share/man, but
not yet installed.  Install them as well.  Lots and lots more from
NetBSD's set of manual pages should be imported, though.

Change-Id: Ie2e8946967afcb2e71de563f06fa331586dcb31d

7 years agoImport NetBSD service(8) 09/3409/1
David van Moolenbroek [Thu, 23 Feb 2017 11:40:08 +0000 (11:40 +0000)]
Import NetBSD service(8)

Change-Id: I48a4958424ebcdbd279b11e5425a6cd1b4a73121

7 years agoNo longer auto-start pkgsrc packages 08/3408/1
David van Moolenbroek [Thu, 23 Feb 2017 11:34:42 +0000 (11:34 +0000)]
No longer auto-start pkgsrc packages

In order to comply with the pkgsrc standards, pkgsrc packages are no
longer auto-started.  Instead, we require that users follow the common
pkgsrc procedure: to start a pkgsrc package as part of system startup,
copy its startup script from /usr/pkg/etc/rc.d to /etc/rc.d, and make
the appropriate changes to /etc/rc.conf.

This change affects in particular the openssh package, of which its
ssh daemon is no longer auto-started.  However, installing this
package also no longer causes all kinds of Kerberos-related warnings
to be reported at boot time now.

Also remove a leftover reference to the defunct ddekit usb package.

Change-Id: I4d42f6ca1ab5e3bc2ec296bc7c0e3056964ae451

7 years agoInitial import of NetBSD rc system 07/3407/1
David van Moolenbroek [Mon, 13 Feb 2017 13:35:23 +0000 (13:35 +0000)]
Initial import of NetBSD rc system

IMPORTANT: this change has a docs/UPDATING entry!

This patch performs an initial import of the infrastructure and a
subset of the NetBSD set of rc startup and shutdown scripts.  The
"initial" refers to the fact that this is not yet a full switch to the
NetBSD rc system: the MINIX ramdisk rc script, which (typically) runs
as the first thing, is kept as is.  After mounting the root file
system, the ramdisk rc script will start the NetBSD rc infrastructure
by invoking /etc/rc, however.  The regular MINIX startup-and-shutdown
script has been moved from /etc/rc to /etc/rc.minix, and is now
invoked as part of the NetBSD rc infrastructure through a bridge rc
script /etc/rc.d/minixrc.  /etc/rc.minix invokes /usr/etc/rc as before.

Switching over the ramdisk to the NetBSD system and decomposing the
MINIX rc.minix script into smaller components are left to future work.
Also, the current pkgsrc etc/rc.d auto-start functionality is left as
is, even though it should be removed (see the etc/usr/rc comment).

Change-Id: Ia96cae7c426e94b85c67978dc1307dacc4b09fc5

7 years agoVM: fix race condition communicating with VM 06/3406/1
David van Moolenbroek [Thu, 23 Feb 2017 11:20:33 +0000 (11:20 +0000)]
VM: fix race condition communicating with VM

After processing certain asynchronous requests from VFS, VM would send
an asynchronous reply without supplying the AMF_NOREPLY flag.  As a
result, this asynchronous reply could be taken as the result of an
ipc_sendrec() call, causing the entire VM/VFS communication to become
desynchronized.  The end result was a deadlock-induced panic during a
later request.

This bug was exposed because of the higher-than-usual concurrency
level in the NetBSD rc scripts.  The fix consists of properly setting
the AMF_NOREPLY flag for asynchronous replies.

Change-Id: Iafafe2fdd67f212ecbf27a53862cefba2e4cf7e8

7 years agoVBOX: update current time immediately at startup 05/3405/1
David van Moolenbroek [Mon, 20 Feb 2017 19:13:04 +0000 (19:13 +0000)]
VBOX: update current time immediately at startup

Performing the update at any later time may cause rc scripts to work
with a wrong date, which may have side effects, such as databse files
getting regenerated on every boot.

Change-Id: Idfdbf67ad285300c982d95769007dc88c522b908

7 years agoImport NetBSD services_mkdb(8) 04/3404/1
David van Moolenbroek [Mon, 20 Feb 2017 14:23:24 +0000 (14:23 +0000)]
Import NetBSD services_mkdb(8)

Change-Id: Ia3fc2479d2abb2dbe9afd1b60e0ffbaf377bcf5a