Subject: Re: /dev/MAKEDEV and mknod -[rR]
To: None <tech-userlevel@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-userlevel
Date: 02/25/2007 12:33:52
On Sun, 25 Feb 2007, der Mouse wrote:
> Under 3.1, I note that /dev/MAKEDEV always runs either mknod -r or
> mknod -R to create devices.
>
> This would be neither here nor there, except that today I tried to set
> up a diskless 3.1 machine with root on an NFS server running an OS
> that doesn't have -r or -R options to mknod. This meant I couldn't
> use ./MAKEDEV on the server to make devices.
You could have made a one-line change to MAKEDEV to let it pass whatever
options you like to mknod.
> But my impression is that you're supposed to be able to run MAKEDEV on
> the NFS server in such circumstances, in which case this amounts to a
> bug. (I'd argue the lack of an option to override it is a bug in any
> case.)
There's a "-m" flag, which you could point to a script that ignores "-r"
before invoking the native mknod on your server.
Given that the NFS server might not run anything resembling Unix, might
not have a /bin/sh-like shell, might not have a mknod command, or might
have a mknod command that doesn't support any of our non-traditional
options (-F netbsd, -r, -R, -m mode, -u user, -g group), it's not
clear to me that it's worth trying to make MAKEDEV work on foreign
NFS servers. I think that it should be enough for us to support
generating a tarball via "./MAKEDEV -s whatever | ${TOOL_PAX} -w -M"
on a cross-build system, followed by whatever the NFS server needs to
unpack the resulting tarball.
--apb (Alan Barrett)