From owner-freebsd-emulation@FreeBSD.ORG Thu May 4 19:48:51 2006 Return-Path: X-Original-To: emulation@freebsd.org 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 9AEED16A401 for ; Thu, 4 May 2006 19:48:51 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5354543D46 for ; Thu, 4 May 2006 19:48:51 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 3CA1A1A4D82; Thu, 4 May 2006 12:48:51 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 9AE5551F27; Thu, 4 May 2006 15:48:50 -0400 (EDT) Date: Thu, 4 May 2006 15:48:50 -0400 From: Kris Kennaway To: Sean McNeil Message-ID: <20060504194850.GA70598@xor.obsecurity.org> References: <1146610240.80438.4.camel@triton.mcneil.com> <20060504164959.GA67641@xor.obsecurity.org> <1146763983.98779.12.camel@triton.mcneil.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <1146763983.98779.12.camel@triton.mcneil.com> User-Agent: Mutt/1.4.2.1i Cc: emulation@freebsd.org, Kris Kennaway Subject: Re: Linux expr command vs. FreeBSD version 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, 04 May 2006 19:48:51 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 04, 2006 at 10:33:03AM -0700, Sean McNeil wrote: > On Thu, 2006-05-04 at 12:49 -0400, Kris Kennaway wrote: > > On Tue, May 02, 2006 at 03:50:40PM -0700, Sean McNeil wrote: > > >=20 > > > I ran into a problem with paths when running linux emulation. It > > > appears that when looking for a file, linux emulation will first > > > try /compat/linux/path and if not found, /path. This causes grief wi= th > > > expr as the Linux version supports enhancements like "expr match" > > > whereas the FreeBSD version does not. To get around the issue, I put= a > > > symlink in /compat/linux/bin/expr -> /compat/linux/usr/bin/expr. I do= n't > > > know of any better solution. Anyone? > >=20 > > Why is this an issue for you? >=20 > Like I said, the FreeBSD expr command doesn't support things like "expr > match". FreeBSD puts expr in /bin and Linux puts it in /usr/bin. > Appropriately, my path looks at /bin before /usr/bin. >=20 > I have scripts that run perfect on a Linux machine and fail on FreeBSD > with Linux emulation because they use that very feature. Or just run the script in a chroot (chroot /compat/linux /bin/bash /your/script) so it doesn't see the FreeBSD filesystem at all. This is the only safe way to do it, really - there may be other differences that will cause more subtle aliasing problems. Kris --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEWlqhWry0BWjoQKURAt7JAKDyTpYz4cZuDpj712s9fK32AjY6rQCfZdU0 HV6uGlEdxr/vlWRAlIwRa58= =7jSD -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx--