From owner-svn-src-all@FreeBSD.ORG Wed Nov 21 10:38:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5915A939; Wed, 21 Nov 2012 10:38:13 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE248FC15; Wed, 21 Nov 2012 10:38:11 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so4010782lbb.13 for ; Wed, 21 Nov 2012 02:38:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=voBT3Sui4j6G3jXvbvfbGqeU4R8Ml1ZwX51rr/1oFrk=; b=RHD/9UJlAJcYUvSoL6idiwALPL9vAg/FZaRi68OS6YULHv5bnX4DXxWtxM9PrCTt0b yP+p2dPLmqviZdJlS0nMNyfwAnSbrP4YdPGb+MUZqXvEGbmym0Pqzu/CPrIKRDimwQhI p58gDEMqJ/bAxRQOo+p8tp4OSprVAOpYGdyPhePc1odo8/VhEREXU9BrkeXcxE1aB5I+ VCJ4X9W6C1a0AVXJYOyjiqkjczsOiVXhFAaVyXO//X6Y3ULR3VJ2axBeK7n642QbttSQ ysn/zoHzZBG0wxdA2+QzOsoRIS8pivuY3aBDXu83ymmFvUtd9R6A3Ac1t3YAQSAEOnVs VhUw== MIME-Version: 1.0 Received: by 10.112.49.133 with SMTP id u5mr7258439lbn.105.1353494290707; Wed, 21 Nov 2012 02:38:10 -0800 (PST) Received: by 10.112.131.232 with HTTP; Wed, 21 Nov 2012 02:38:10 -0800 (PST) Received: by 10.112.131.232 with HTTP; Wed, 21 Nov 2012 02:38:10 -0800 (PST) In-Reply-To: <20121121002013.S6273@besplex.bde.org> References: <201211181421.qAIEL5KT042019@svn.freebsd.org> <20121120105858.GA73018@zibbi.meraka.csir.co.za> <20121121002013.S6273@besplex.bde.org> Date: Wed, 21 Nov 2012 10:38:10 +0000 Message-ID: Subject: Re: svn commit: r243228 - head/etc From: Chris Rees To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, John Hay , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 10:38:13 -0000 On 20 Nov 2012 13:53, "Bruce Evans" wrote: > > On Tue, 20 Nov 2012, John Hay wrote: > >> On Sun, Nov 18, 2012 at 02:21:05PM +0000, Chris Rees wrote: >>> >>> Log: >>> cp -R misses out dotfiles; use pax instead to copy file hierarchies >>> >>> PR: conf/99721 (based on) >>> Submitted by: Florian Zavatzki >>> Approved by: hrs >>> MFC after: 1 month >>> >>> Modified: >>> head/etc/rc.initdiskless >>> >>> Modified: head/etc/rc.initdiskless >>> ============================================================================== >>> --- head/etc/rc.initdiskless Sun Nov 18 14:05:28 2012 (r243227) >>> +++ head/etc/rc.initdiskless Sun Nov 18 14:21:05 2012 (r243228) >>> @@ -354,7 +354,7 @@ for i in ${templates} ; do >>> subdir=${j##*/} >>> if [ -d $j -a ! -f $j.cpio.gz ]; then >>> create_md $subdir >>> - cp -Rp $j/ /$subdir >>> + (cd $j && pax -rw . /$subdir) >>> fi >>> done >>> for j in /conf/$i/*.cpio.gz ; do >> >> >> Have you tested this on a diskless and readonly system? It looks like pax >> need to write something in /tmp and it might not be writeable yet. I got >> an error, after the first of /bin/pax not found and having to add that to >> the list of files needed. > > > It uses mkstemp(3), normally in /tmp but it honors $TMPDIR. It seems to > always create 1 temporary file (even for copying a single regular file), > and sometimes 2 temporary files. Both of the temporary files seem to be > to hold metadata for file times and hashes, in case it is too large for > memory. cp -Rp probably needs to do the same (except it is imperfect to > unnecessarily assume that /tmp is writable), to fix its link and timestamp > handling. > > BTW, I think it is a large bug that ed and vi create temporary files even > before you change anything. Even view(1) (vi -R) wants to scribble on > /var/tmp/vi.recover. At least it doesn't refuse to start if this is not > writeable. ed(1) is considerably more broken. It > - hard codes /tmp and doesn't use _PATH_TMP or honor $TMPDIR > - always scribbles in /tmp > - refuses to start if /tmp is not writeable. > This makes ed(1) wlays broken in single user shells until '/' is mounted > rw, although ed is the only editor that is sure to be there and the > reason for using a single user shell is often that there is a problem > with mounting '/' rw. *sigh* Hiroki Sato tested it, but i don't know if he had ro /. This appears to have caused a few problems, possibly more than the benefit of the change (hard links). I'm inclined to be a coward and just revert this later; anyone who can get there before me, feel free. When I'm done with the other rc PRs (haha) I'll look at fixing our cp. Chris