From owner-freebsd-current@FreeBSD.ORG Mon Sep 19 17:08:12 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 9B2E516A41F for ; Mon, 19 Sep 2005 17:08:12 +0000 (GMT) (envelope-from cracauer@schlepper.zs64.net) Received: from schlepper.zs64.net (schlepper.zs64.net [212.12.50.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7BD043D45 for ; Mon, 19 Sep 2005 17:08:11 +0000 (GMT) (envelope-from cracauer@schlepper.zs64.net) Received: from schlepper.zs64.net (schlepper [212.12.50.230]) by schlepper.zs64.net (8.13.3/8.12.9) with ESMTP id j8JH8AMp042128 for ; Mon, 19 Sep 2005 19:08:10 +0200 (CEST) (envelope-from cracauer@schlepper.zs64.net) Received: (from cracauer@localhost) by schlepper.zs64.net (8.13.3/8.12.9/Submit) id j8JH8AbS042127 for freebsd-current@freebsd.org; Mon, 19 Sep 2005 13:08:10 -0400 (EDT) (envelope-from cracauer) Date: Mon, 19 Sep 2005 13:08:10 -0400 From: Martin Cracauer To: freebsd-current@freebsd.org Message-ID: <20050919130810.A41848@cons.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Subject: 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: Mon, 19 Sep 2005 17:08:12 -0000 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. I just created the appended message to freebsd-emulation but what I suggest doesn't work either. It seems that even with the right major and minor device number we won't get a working /dev/null outside of /dev. Any suggestions? I think it is required to have some capability for device entries in chrooted environments. The only working thing I came up with is this: mkdir /compat/linux/dev mkdir /compat/linux/dev-hidden mount -t devfs devfs /compat/linux/dev-hidden cd /compat/linux/dev rm -f null zero ln -s ../dev-hidden/null . ln -s ../dev-hidden/zero . Any ill effects to be expected from this hack? Here's the first message. Not that what I suggests does not work, I just include it for reference. -- cut here -- /usr/ports/emulators/linux_base/pkg-message recommendes: > You may wish to create and populate /compat/linux/dev/ if you plan to > chroot > into your Linux installation. For example: > > mkdir /compat/linux/dev > mknod /compat/linux/dev/null c 2 2 > chmod 666 /compat/linux/dev/null That won't work, as the major and minor device numbers are now a moving target with devfs. I think the only decent way to do this now is to have /etc/rc.conf LINUX_DEV_NULL="yes" and then . /etc/rc.conf if [ "$LINUX_DEV_NULL" != NO ] ; then # insert proper rc.conf parsing here ( IFS=" ," set -- `ls -l /dev/null` rm -f /compat/linux/dev/null mknod /compat/linux/dev/null c $5 $6 chmod 666 /compat/linux/dev/null ) fi -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ FreeBSD - where you want to go, today. http://www.freebsd.org/ -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ FreeBSD - where you want to go, today. http://www.freebsd.org/