Date: Sun, 2 Jul 2006 19:57:28 GMT From: Florian Zavatzki <f_zavatzki@blue-network.org> To: freebsd-gnats-submit@FreeBSD.org Subject: conf/99721: [patch] /etc/rc.initdiskless problem copy dotfile in subdirectories to the MFS filesystem Message-ID: <200607021957.k62JvSHr093300@www.freebsd.org> Resent-Message-ID: <200607022000.k62K0Y3L007174@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 99721
>Category: conf
>Synopsis: [patch] /etc/rc.initdiskless problem copy dotfile in subdirectories to the MFS filesystem
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jul 02 20:00:34 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Florian Zavatzki
>Release: FreeBSD 6.1-RC
>Organization:
>Environment:
FreeBSD sol.blue-network.local 6.1-RC FreeBSD 6.1-RC #0: Thu Apr 13 20:17:20 CEST 2006 bc@sol.blue-network.local:/usr/obj/usr/src/sys/SOL-6-20060413 i386
>Description:
There is a problem with dot files or directories when a subdirectory template is directly copied to the MFS filesystem.
A file /conf/$ip/root/.foobar will not be copied, because the expression in line 303 cp -Rp $j/* /$subdir will only copy non dot files.
>How-To-Repeat:
Create a dot file in /conf/$ip/root (for example .foobar) and start a diskless client. There would be a MFS filesystem mounted on /root, but without .foobar.
>Fix:
Adding a simple cp -Rp $j/.* will result in a copy of the whole parent directory. So the easiest way would be to replace the copy with a tar command.
--- /etc/rc.initdiskless Sun Jul 2 21:17:03 2006
+++ rc.initdiskless Sun Jul 2 21:43:32 2006
@@ -300,7 +300,7 @@
subdir=${j##*/}
if [ -d $j -a ! -f $j.cpio.gz ]; then
create_md $subdir
- cp -Rp $j/* /$subdir
+ (cd $j; tar -cf - . | (cd /$subdir; tar -xpBf -))
fi
done
for j in /conf/$i/*.cpio.gz ; do
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607021957.k62JvSHr093300>
