From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 15 01:55:26 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 71E2B16A4CF for ; Wed, 15 Sep 2004 01:55:26 +0000 (GMT) Received: from lakermmtao06.cox.net (lakermmtao06.cox.net [68.230.240.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1A8043D68 for ; Wed, 15 Sep 2004 01:55:25 +0000 (GMT) (envelope-from conrads@cox.net) Received: from dolphin.local.net ([68.11.71.51]) by lakermmtao06.cox.net (InterMail vM.6.01.03.02.01 201-2131-111-104-103-20040709) with ESMTP <20040915015522.RYFQ10360.lakermmtao06.cox.net@dolphin.local.net>; Tue, 14 Sep 2004 21:55:22 -0400 Received: from dolphin.local.net (localhost.local.net [127.0.0.1]) by dolphin.local.net (8.13.1/8.13.1) with ESMTP id i8F1tNRa011251; Tue, 14 Sep 2004 20:55:23 -0500 (CDT) (envelope-from conrads@dolphin.local.net) Received: (from conrads@localhost) by dolphin.local.net (8.13.1/8.13.1/Submit) id i8F1tDGC011250; Tue, 14 Sep 2004 20:55:13 -0500 (CDT) (envelope-from conrads) Date: Tue, 14 Sep 2004 20:55:13 -0500 From: Conrad Sabatier To: Brooks Davis Message-ID: <20040915015513.GB11111@cox.net> References: <20040914133535.3aa9ee21@dolphin.local.net> <20040914185236.GA31186@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040914185236.GA31186@odin.ac.hmc.edu> User-Agent: Mutt/1.4.2.1i cc: freebsd-emulation@freebsd.org Subject: Re: /dev, /proc support in a chrooted Linux emulation environment X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2004 01:55:26 -0000 On Tue, Sep 14, 2004 at 11:52:36AM -0700, Brooks Davis wrote: > On Tue, Sep 14, 2004 at 01:35:35PM -0500, Conrad J. Sabatier wrote: > > I've been exploring running Linux binaries under a chrooted Linux shell > > (entering the environment via "chroot /compat/linux /bin/bash"). I've > > had remarkable success in installing and running quite a few rpms beyond > > those found in the linux_base port, but have found that /dev support (as > > well as /proc) doesn't work as expected when running Linux apps within > > such an environment. > > > > Programs/scripts attempting to access, for example, /dev/null complain > > about no such file or device. The same for /dev/ttyX, /dev/zero, etc. > > > > Similar problems occur attempting to use /proc/*. I'm also experiencing > > some networking problems, mainly with DNS resolution, but for now, my > > main concern is /dev and /proc. > > > > I realize that the method I'm using for running Linux apps is not what > > was intended with FreeBSD's Linux emulation mode, but it's interesting > > enough that I want to continue delving into it. My goal is to have as > > near-complete a working Linux environment as possible, one that would > > support running practically any Linux app within this chrooted > > environment and would, for all intents and purposes, appear as a "real" > > Linux to any programs running within it. > > > > Are there any suggestions as to how I might remedy some of these > > problems? Or is this simply beyond the scope/capabilities of the Linux > > emulator at this time? > > You can provide a fairly complete linux /proc with linprocfs. Yes, I am using linprocfs. But even so, certain parts are either missing or not working properly. > /dev is > more difficult. You can try mounting devfs in your linux /dev which > may work for many applications. Hmm, that's a thought. Hadn't thought of trying that yet. > For the moment, you can also make > nodes like /dev/null and /dev/zero with mknod, but I believe that > functionality will be going away. I've tried doing that, but the devices still don't function properly. I've installed Linux's MAKEDEV package as well (into the chrooted environment), and even with all the devices being created by the package's install script, they still don't work. > I suspect we will eventually need a lindevfs to make devices show up the > way linux wants them to. I think you're probably right. That would be a cool feature to add to the emulator, for sure. Wonder how difficult it would be. -- Conrad J. Sabatier -- "In Unix veritas"