From owner-freebsd-current@FreeBSD.ORG Tue Sep 20 07:47:02 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C29FB16A41F for ; Tue, 20 Sep 2005 07:47:02 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from leto.uk.clara.net (leto.uk.clara.net [80.168.69.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F83443D48 for ; Tue, 20 Sep 2005 07:47:02 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from sr-fw1.router.uk.clara.net ([195.8.68.130] helo=bloodhound.noc.clara.net) by leto.uk.clara.net with esmtp (Exim 4.43) id 1EHcqC-000J15-7p; Tue, 20 Sep 2005 08:47:00 +0100 Received: from personal by bloodhound.noc.clara.net with local (Exim 4.52 (FreeBSD)) id 1EHcqS-0004jj-U7; Tue, 20 Sep 2005 08:47:16 +0100 Date: Tue, 20 Sep 2005 08:47:16 +0100 From: Brian Candler To: Poul-Henning Kamp Message-ID: <20050920074716.GB18149@uk.tiscali.com> References: <20050919130810.A41848@cons.org> <1950.1127150337@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1950.1127150337@critter.freebsd.dk> User-Agent: Mutt/1.4.2.1i Cc: Martin Cracauer , freebsd-current@freebsd.org Subject: Re: device entries outside /proc with procfs (for chroot) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2005 07:47:02 -0000 On Mon, Sep 19, 2005 at 05:18:57PM +0000, Poul-Henning Kamp wrote: > In message <20050919130810.A41848@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.