While here, fix some quoting, change some style, and attempt
to properly handle wedge names with embedded newlines, and those
that end with a '/' character (not particularly happy with the
solution to that last one, but it is better than it was).
Is there a reason that characters that need encoding in wedge names
(white space, and more) are encoded as %%XX (XX is the hex value of
the char - but 2 % chars? Why?). That remains unchanged, but as
the script already relied upon sh's $'...' quoting, I think we can rely
upon printf as well, so replace the old (very elegant, but slow) encoding
function with a much simpler one (does the same thing).
scripts. $@ is unspecified except when used in a place where
field splitting can occur (which is never in an assignment),
X=$@ (with or without double quotes) is simply wrong.
Use $* instead of $@ in such places, or as here, simply change
the way things are done (very very slightly) and DTRT.
once with a list of all found devices. This lets us batch calls to MAKEDEV
which results in a noticeable improvement in Raspberry Pi boot time.
Run the initial device enumeration hooks before detaching from the foreground,
ensuring that any required devices have been created before the rc.d script
exits.
listens on drvctl for new devices and invokes MAKEDEV for them.
missing:
- manual page
- rc.d script
- more testing
but it works well enough to make new disk nodes appear in /dev when
netbsd sees them and they're missing. you will need to make sure
you have a new /dev/MAKEDEV for this to work properly (postinstall
should handle this normally, of course.)
thanks jared!