From owner-freebsd-current@FreeBSD.ORG Sun Aug 19 20:01:59 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A378C106566B for ; Sun, 19 Aug 2012 20:01:59 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 611928FC14 for ; Sun, 19 Aug 2012 20:01:58 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q7JK1vXW045797; Sun, 19 Aug 2012 20:01:57 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id dj2wk5u9j7eqzhvhpxqnunmysa; Sun, 19 Aug 2012 20:01:57 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Tim Kientzle In-Reply-To: Date: Sun, 19 Aug 2012 13:01:56 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <20120812132047.GA33526@psconsult.nl> To: Current FreeBSD , Paul Schenkeveld X-Mailer: Apple Mail (2.1278) Cc: Garrett Cooper Subject: Re: make package fails in chroot: tar: getvfsbyname failed: No such file or directory 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: Sun, 19 Aug 2012 20:01:59 -0000 On Aug 19, 2012, at 12:17 PM, Garrett Cooper wrote: > On Sun, Aug 19, 2012 at 9:45 AM, Tim Kientzle wrote: >> >> On Aug 12, 2012, at 6:20 AM, Paul Schenkeveld wrote: >> >>> Hi, >>> >>> I have a wrapper script that builds packages in a chroot environment >>> which happily runs on release 6 thru 9 and earlier 10 but fails with: >>> >>> tar: getvfsbyname failed: No such file or directory >>> >>> on a recent -CURRENT. >> >> libarchive does do an initial getvfsbyname() when you ask it >> to traverse a directory tree so that it can accurately handle later >> requests about mountpoints and filesystem types. This code >> is admittedly a little intricate. > > The problem most likely is the fact that all mountpoints are > exposed via chroot, thus, if it's checking to see if a mountpoint > exists, it may exist outside of the chroot. > I reviewed the code to refresh my memory. Some of what I said before was not quite right. Libarchive's directory traversal tracks information about the filesystem type so that clients such as bsdtar can efficiently skip synthetic filesystems (/dev or /proc) or network filesystems (NFS or SMB mounts). The net effect is something like this: For each file: stat() or lstat() or fstat() the file look up dev number in an internal cache if the dev number is new: fstatfs() the open fd to get the FS name getvfsbyname() to identify the FS type Unless there's a logic error in libarchive itself, this would suggest that somehow fstatfs() is returning a filesystem type that getvfsbyname() can't identify. Paul: What filesystem are you using? What does "mount" show? Does it work outside the chroot? Tim