from the version used by NetBSD/alpha, with several changes by me.
Support for asking for root device and root file system type on any
kernel, obsoleting "options GENERIC".
- Make my mountroothook implementation used by the sparc and x68k
ports machine-independent, and use it here. Mountroothooks allow
devices to execute special functions before being mounted as the
root device (such as ejecting the floppy and prompting for a new
floppy disk).
- Make swapconf() machine-independent. It was identical on all ports.
(1) after removing a shutdown hook (in shutdownhook_disestablish()),
free it. We created it, we have to free it. Without this,
shutdownhook_disestablish() leaks memory.
(2) in doshutdownhooks(), before running each hook, remove it from the
shutdown hook list. This makes sure that every hook is tried once
(because doshutdownhooks() is called from before rebooting, and
a fault in a shutdown hook will cause doshutdownhooks() to be called
again), but prevents the hooks from potentially being run infinitely
(as used to be possible, in the above-mentioned situation).