From nobody@FreeBSD.org  Sun Aug 31 21:32:13 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D6771065682
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 31 Aug 2008 21:32:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 6A3458FC1E
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 31 Aug 2008 21:32:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m7VLWC3U053087
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 31 Aug 2008 21:32:12 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m7VLWCwR053086;
	Sun, 31 Aug 2008 21:32:12 GMT
	(envelope-from nobody)
Message-Id: <200808312132.m7VLWCwR053086@www.freebsd.org>
Date: Sun, 31 Aug 2008 21:32:12 GMT
From: Alexander Churanov <alexanderchuranov@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] Impossible to fetch devel/valgrind from the jail
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127015
>Category:       ports
>Synopsis:       [patch] Impossible to fetch devel/valgrind from the jail
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    barner
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 31 21:40:01 UTC 2008
>Closed-Date:    Tue Sep 23 07:03:21 UTC 2008
>Last-Modified:  Tue Sep 23 07:10:04 UTC 2008
>Originator:     Alexander Churanov
>Release:        6.2-RELEASE
>Organization:
N/A
>Environment:
FreeBSD jail 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Mon Mar 24 09:45:45 MSK 2008     root@localhost:/usr/obj/usr/src/sys/HOMEBSD  i386
>Description:
The "make fetch" in devel/valgrind refuses to download distfiles if running inside a jail. It complains about missing procfs. The procfs, however, is correctly working and accessible.

The issue was observed on FreeBSD 6.2 Release, using ports collection from August, 21 2008.

Expected behavior: presence of procfs is not verified when running targets like "fetch".

Acceptable behavior: actual presence of procfs is verified.

>How-To-Repeat:
1) Setup a jail with access to internet.
2) Uncompress "ports" collection into /usr/ports directory inside a jail.
3) Mount the "procfs" filesystem to /proc directory inside a jail from the host OS.
3) Start shell in the jail, cd into "devel/valgrind", type make fetch.
>Fix:
Modify the Makefile to verify that procfs is running and accessible instead of examining output of "/sbin/mount". See the suggested patch.

Patch attached with submission follows:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/devel/valgrind/Makefile,v
retrieving revision 1.30
diff -U3 -r1.30 Makefile
--- Makefile	21 Aug 2008 06:16:52 -0000	1.30
+++ Makefile	25 Aug 2008 23:02:29 -0000
@@ -44,7 +44,7 @@
 PLIST_SUB+=	RELENG_7="@comment "
 .endif
 
-PROCFS!=	/sbin/mount | ${GREP} '^procfs' | ${AWK} '{print $1}'
+PROCFS!=	if test -r /proc/curproc/status; then echo "procfs"; else echo ""; fi
 
 pre-everything::
 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->barner 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Aug 31 21:40:10 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127015 
State-Changed-From-To: open->closed 
State-Changed-By: barner 
State-Changed-When: Tue Sep 23 07:03:20 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127015 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/127015: commit references a PR
Date: Tue, 23 Sep 2008 07:02:22 +0000 (UTC)

 barner      2008-09-23 07:02:14 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/valgrind       Makefile 
     devel/valgrind-snapshot Makefile 
   Log:
   - Fix build from within jails
   
   PR:             ports/127015
   Submitted by:   Alexander Churanov
   Approved by:    portmgr (erwin)
   
   Revision  Changes    Path
   1.29      +1 -1      ports/devel/valgrind-snapshot/Makefile
   1.31      +1 -1      ports/devel/valgrind/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
