RE: Anyway to mknod from kernel?

Bret Indrelee (bindrelee@sbs-cp.com)
Tue, 26 Oct 1999 15:59:27 -0500


Alan Cox [mailto:alan@lxorguk.ukuu.org.uk] wrote:
> > Is there any way for the kernel module to do the 'mknod'
> commands from
> > within the module? I would rather have the code create the
> inode rather than
>
> You can hack it up. Its a bad idea as you have no idea if the
> root file
> system would even be writeable. The whole goal is to do in
> user space what
> you can sanely without kernel help. mknod is definitely user space

I don't agree that mknod is user space.

On other systems I've had to do it both ways, creating the inodes within the
kernel or using a script after creating the device.

In my experience with dynamic allocation of major numbers, especially if you
have switchs that selectively enable certain features (i.e. use different
minor devices), it has been a lot easier for maintenance to have the code in
the driver rather than a separate script.

Many of the other UNIX systems that started with requiring you to run a
script have changed to having the driver create the inodes.

I'm not sure which way I'll go right now, creating the script in /proc or
trying to do it from kernel. I do know which way I would prefer to do it.

-Bret

-------------------------------------------------------------
SBS Technologies, Connectivity Products
... solutions for real-time connectivity

Bret Indrelee, Engineer
SBS Technologies, Inc., Connectivity Products
1284 Corporate Center Drive, St. Paul MN 55121
Direct: (651) 905-4731
Main: (651) 905-4700 Fax: (651) 905-4701
E-mail: bindrelee@sbs-cp.com http://www.sbs.com
-------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/