From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 6 12:25:20 2011 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A281065672 for ; Thu, 6 Jan 2011 12:25:20 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id BD3008FC15 for ; Thu, 6 Jan 2011 12:25:19 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3A550.dip.t-dialin.net [87.179.165.80]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 1F3BB844012; Thu, 6 Jan 2011 13:25:12 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id D990F245A; Thu, 6 Jan 2011 13:25:08 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p06COrpT025488; Thu, 6 Jan 2011 13:24:53 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 06 Jan 2011 13:24:53 +0100 Message-ID: <20110106132453.15152nbxllwpqu80@webmail.leidinger.net> Date: Thu, 06 Jan 2011 13:24:53 +0100 From: Alexander Leidinger To: Andre Albsmeier References: <20101230075124.GA12923@curry.mchp.siemens.de> <20101231144800.00005c6d@unknown> <20110101224629.GA30540@curry.mchp.siemens.de> <20110102115021.00000c8b@unknown> <20110105191915.GA43997@curry.mchp.siemens.de> <20110106085753.21096d6vr5bqpq1w@webmail.leidinger.net> <20110106103226.GA59969@curry.mchp.siemens.de> In-Reply-To: <20110106103226.GA59969@curry.mchp.siemens.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 1F3BB844012.A38E8 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.274, required 6, autolearn=disabled, RDNS_NONE 1.27) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1294921515.72307@i+ARbIJn98r7A5yNDwveAA X-EBL-Spam-Status: No Cc: "freebsd-emulation@freebsd.org" Subject: Re: 7.3-STABLE and Linux version of SIMetrix X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 06 Jan 2011 12:25:20 -0000 Quoting Andre Albsmeier (from Thu, 6 Jan 2011 11:32:26 +0100): > On Thu, 06-Jan-2011 at 08:57:53 +0100, Alexander Leidinger wrote: >> Quoting Andre Albsmeier (from Wed, 5 Jan >> 2011 20:19:15 +0100): >> > My solution is eerie but it works. This is what I did: >> > >> > 1. cd /compat/linux >> > 2. mkdir dev >> > 3. cd dev >> > 4. ln -s /tmp shm >> >> As long as you do not need to access something from dev (FreeBSD one), >> this works. As soon as you need to access something from there it >> depends upon the software. If the software is doing a readdir, the >> user experience will be worse. And if it does not allow to enter a > > Let me see if I got this: Now I have a /compat/linux/dev directory > which means that if some Linux programme wants to look into /dev it > will see just the shm entry. If there wasn't my dev directory it > would have continued to FreeBSD's /dev... Correct. >> Can you please try a solution with devfs.conf (I never tried if it >> allows to link outside of dev)? > > I added the following line to devfs.conf > > link /tmp shm > > and removed my dev stuff under /compat/linux. And it still works ;-). That's great. > The devfs.conf thing makes it possible to simplify the (ugly) > patch a bit: > > --- /sys/compat/linux/linux_stats.c.ORI 2008-01-10 20:11:51.000000000 +0100 > +++ /sys/compat/linux/linux_stats.c 2011-01-06 11:26:53.000000000 +0100 > @@ -379,6 +379,7 @@ > struct statfs bsd_statfs; > char *path; > int error; > + unsigned char shm = 0; > > LCONVPATHEXIST(td, args->path, &path); > > @@ -387,10 +388,14 @@ > printf(ARGS(statfs, "%s, *"), path); > #endif > error = kern_statfs(td, path, UIO_SYSSPACE, &bsd_statfs); > + if( strncmp( path, "/dev/shm", 8 ) == 0 ) > + shm = ( path[8] == '\0' || (path[8] == '/' && path[9] == '\0') ); > LFREEPATH(path); > if (error) > return (error); > bsd_to_linux_statfs(&bsd_statfs, &linux_statfs); > + if( shm ) > + linux_statfs.f_type = 0x01021994; > return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); > } > > Thanks for the hint with devfs.conf, that's a lot better! Thanks for the patch. Bye, Alexander. -- Freedom begins when you tell Mrs. Grundy to go fly a kite. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137