Re: devfs

Richard Gooch (rgooch@atnf.CSIRO.AU)
Fri, 9 Jan 1998 11:16:12 +1100


Alan Cox writes:
> > The FSSTND (Linux filesystem standard document) suggests the possibility
> > of a read-only root filesystem. Read-only filesystems help reduce the
> > chance that mistakes, crashes, and crackers (evil hackers) might damage
> > something. The Linux root filesystem can not be read-only because the
> > normal /dev must be read-write to allow tty ownership changes. With the
> > devfs, the root filesystem can be read-only. The current /dev could be
> > trouble for Linux embedded in ROM.
>
> Firstly. The fsstnd does not say /dev has to reamin on the root fs. Its also
> not really an issue for a ROM based Linux - you tend to unpack a compressed
> image from expensive slow flash into cheap ramdisk

If you have an embedded system with a ROM-FS or a CD-ROM then your
root FS is read-only. From my updated README:

You can get around this by creating a RAMDISC at boot time, making
an ext2 filesystem in it, mounting it somewhere and copying the
contents of /dev into it, then unmounting it and mounting it over
/dev. A devfs is a cleaner way of solving this.

> > With devfs, the kernel can chown ptys back to root when a process
> > does not need them anymore. The kernel might be able to let normal
> > users chown their own pty or it might perform the chown automatically.
>
> This solvable in user space by having a single pty allocation daemon. The
> tty/pty issue is irrelevant the wisdom or otherwise of a devfs.

True, you can do it with a user-space daemon. But you then have to
change applications to call it. Devfs doesn't need application
changes.

Regards,

Richard....