From nobody@FreeBSD.org  Mon Oct 31 20:27:21 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8DC8A16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Oct 2005 20:27:21 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 380BC43D46
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Oct 2005 20:27:21 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j9VKRKUp091447
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Oct 2005 20:27:20 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j9VKRKBB091446;
	Mon, 31 Oct 2005 20:27:20 GMT
	(envelope-from nobody)
Message-Id: <200510312027.j9VKRKBB091446@www.freebsd.org>
Date: Mon, 31 Oct 2005 20:27:20 GMT
From: Joerg Pulz <Joerg.Pulz@frm2.tum.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /etc/rc.initdiskless broken
X-Send-Pr-Version: www-2.3

>Number:         88293
>Category:       conf
>Synopsis:       /etc/rc.initdiskless broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    brooks
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 31 20:30:17 GMT 2005
>Closed-Date:    Wed Jan 11 06:23:26 GMT 2006
>Last-Modified:  Wed Jan 11 06:23:26 GMT 2006
>Originator:     Joerg Pulz
>Release:        FreeBSD 6.0-RC1
>Organization:
TU-Munich / ZWE FRM-II
>Environment:
FreeBSD localhost 6.0-RC1 FreeBSD 6.0-RC1 #0: Sun Oct  9 20:32:57 UTC 2005     root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC i386
>Description:
              Setting up a FreeBSD diskless client with read-only root filesystem
              is not working if one is using /conf/base/etc.cpio.gz as /etc base.

              The first problem is the use of the pax(1) command to extract the
              etc.cpio.gz file into the mfs for /etc. pax(1) is bailing out with
              > pax: Invalid combination of options: -f -p -r -x
              If the "-x cpio" option is removed pax(1) is working correctly and
              is determining the archive type automatically.

              The next problem is related to pax(1) too but only happens with a
              read-only /tmp via NFS. pax(1) tries to create a temporary file to
              store directory times in /tmp. If /tmp comes read-only (together
              with / via NFS) pax(1) is bailing out again. Unfortunately, it is
              not possible to create an mfs based /tmp without hacking
              rc.initdiskless as mounting filesystems from /etc/fstab or creating
              an mfs based /tmp via /etc/rc.d/tmp is done later.

              The same applies to FreeBSD-5.4 and /etc/rc.d/initdiskless.
>How-To-Repeat:
              Follow the instructions for diskless(8) to setup the whole thing.
              Generate an appropriate /conf/base/etc.cpio.gz from your
              distribution /etc dir.
              PXEboot the client and wait for rc.initdiskless to kick in.
>Fix:
              The first problem can be fixed by removing "-x cpio" from the pax(1)
              invocation line in rc.initdiskless.
              The second problem can be fixed by forcing the execution of
              "/etc/rc.d/tmp start" in /etc/rc before rc.initdiskless is started.
>Release-Note:
>Audit-Trail:

From: Brooks Davis <brooks@one-eyed-alien.net>
To: Joerg Pulz <Joerg.Pulz@frm2.tum.de>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/88293: /etc/rc.initdiskless broken
Date: Mon, 31 Oct 2005 13:12:34 -0800

 I've committed the removal of -x cpio, mostly to record the problem.
 Please try the following patch.  Since we're already using /rescue, we
 might as well use tar which is way more capable than pax.
 
 --- /etc/rc.initdiskless	Wed Oct 26 16:09:35 2005
 +++ rc.initdiskless	Mon Oct 31 13:07:53 2005
 @@ -309,7 +309,7 @@
  	if [ -f $j ]; then
  	    create_md $subdir
  	    echo "Loading /$subdir from cpio archive $j"
 -	    (cd / ; /rescue/pax -x cpio -r -z -p e -f $j)
 +	    (cd / ; /rescue/tar -xpf $j)
  	fi
      done
      for j in /conf/$i/*.remove ; do
 
 -- Brooks

From: Joerg Pulz <Joerg.Pulz@frm2.tum.de>
To: Brooks Davis <brooks@one-eyed-alien.net>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/88293: /etc/rc.initdiskless broken
Date: Mon, 31 Oct 2005 22:54:08 +0100 (CET)

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 
 On Mon, 31 Oct 2005, Brooks Davis wrote:
 
 > I've committed the removal of -x cpio, mostly to record the problem.
 > Please try the following patch.  Since we're already using /rescue, we
 > might as well use tar which is way more capable than pax.
 >
 > --- /etc/rc.initdiskless	Wed Oct 26 16:09:35 2005
 > +++ rc.initdiskless	Mon Oct 31 13:07:53 2005
 > @@ -309,7 +309,7 @@
 > 	if [ -f $j ]; then
 > 	    create_md $subdir
 > 	    echo "Loading /$subdir from cpio archive $j"
 > -	    (cd / ; /rescue/pax -x cpio -r -z -p e -f $j)
 > +	    (cd / ; /rescue/tar -xpf $j)
 > 	fi
 >     done
 >     for j in /conf/$i/*.remove ; do
 
 Hi Brooks,
 
 i tried your suggested patch and it is working fine. This solves both 
 problems i described in the PR.
 
 Thanks a lot.
 Joerg
 
 
 - -- 
 The beginning is the most important part of the work.
  				-Plato
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (FreeBSD)
 
 iD8DBQFDZpKCSPOsGF+KA+MRAifdAJ45XhUwlGIK2xI+4Ks7++NLWw7zYwCgtC/m
 Ec+BykXGl7WvY/Q1Y4MGkZw=
 =jNPv
 -----END PGP SIGNATURE-----
State-Changed-From-To: open->patched 
State-Changed-By: brooks 
State-Changed-When: Mon Oct 31 22:00:51 GMT 2005 
State-Changed-Why:  
Switched to tar in HEAD. 


Responsible-Changed-From-To: freebsd-bugs->brooks 
Responsible-Changed-By: brooks 
Responsible-Changed-When: Mon Oct 31 22:00:51 GMT 2005 
Responsible-Changed-Why:  
Switched to tar in HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88293 
State-Changed-From-To: patched->closed 
State-Changed-By: brooks 
State-Changed-When: Wed Jan 11 06:22:49 UTC 2006 
State-Changed-Why:  
Merged to RELENG_5 today and RELENG_6 prior to 6.0 release. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=88293 
>Unformatted:
