Re: device entries outside /proc with procfs (for chroot)

From: Brian Candler <B.Candler_at_pobox.com>
Date: Tue, 20 Sep 2005 08:47:16 +0100
On Mon, Sep 19, 2005 at 05:18:57PM +0000, Poul-Henning Kamp wrote:
> In message <20050919130810.A41848_at_cons.org>, Martin Cracauer writes:
> >I noticed the creation of /dev/ entries outside of /dev doesn't work
> >anymore.  This is needed for chroot environments, which rely on
> >/dev/null on a regular basis.
> 
> mount -t devfs foo /chroot/dev
> 
> Consider devfs(8) rules as a filtering method.

It took me a while to work out exactly how to configure this, so here's the
recipe (from a FreeBSD 5.4 box)

    [/etc/rc.conf]
    devfs_set_rulesets="/chroot/dev=devfsrules_jail"

Then run "/etc/rc.d/devfs start"

Under FreeBSD 5.4 at least, mknod still works. But using devfs is much
better since you get all necessary pty devices.

    $ ls /chroot/dev
    fd      ptyp2   ptyp7   ptypc   stderr  ttyp2   ttyp7   ttypc   zero
    log     ptyp3   ptyp8   ptypd   stdin   ttyp3   ttyp8   ttypd
    null    ptyp4   ptyp9   ptype   stdout  ttyp4   ttyp9   ttype
    ptyp0   ptyp5   ptypa   ptypf   ttyp0   ttyp5   ttypa   ttypf
    ptyp1   ptyp6   ptypb   random  ttyp1   ttyp6   ttypb   urandom

Regards,

Brian.
Received on Tue Sep 20 2005 - 05:47:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:43 UTC