From owner-freebsd-stable@FreeBSD.ORG Sat May 28 20:40:44 2005 Return-Path: X-Original-To: freebsd-stable@FreeBSD.org Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2B6216A41C for ; Sat, 28 May 2005 20:40:44 +0000 (GMT) (envelope-from bsam@bsam.ru) Received: from bsam.ru (gw.ipt.ru [80.253.10.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AE8D43D49 for ; Sat, 28 May 2005 20:40:44 +0000 (GMT) (envelope-from bsam@bsam.ru) Received: from bsam by bsam.ru with local (Exim 4.30; FreeBSD) id 1Dc881-000CXp-Pj; Sun, 29 May 2005 00:41:53 +0400 To: freebsd-stable@FreeBSD.org From: Boris Samorodov Date: Sun, 29 May 2005 00:41:53 +0400 Message-ID: <86637486@srv.sem.ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: "Boris B. Samorodov" Cc: Subject: clone_root [a followup to conf/62417] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2005 20:40:45 -0000 --=-=-= Hi! This PR is about one year old. I've just submit a patch to FreeBSD-5.4-RELEASE, which worked just fine for me. Could anybody look at this PR? The patch is very simple but helpful: --=-=-= Content-Disposition: inline; filename=clone.patch Content-Description: patch for clone_root --- clone_root.orig Sat May 28 18:20:09 2005 +++ clone_root Sun May 29 00:12:28 2005 @@ -79,7 +79,7 @@ SYSDIRS="dev proc root usr var" DIRS="cdrom home mnt" PWFILES="master.passwd passwd spwd.db pwd.db" -TOCOPY="bin boot compat etc modules sbin stand sys" +TOCOPY="bin boot compat etc lib libexec sbin stand" init_diskless_root() { echo "Cleaning old diskless root ($DEST)" @@ -89,7 +89,7 @@ mkdir -p $DEST && echo "New diskless root created." echo "+++ Now copy original tree from / ..." ex="" - (cd / ; tar -clf - ${TOCOPY} ) | (cd $DEST; tar xvf - ) + (cd / ; tar --one-file-system -cf - ${TOCOPY} ) | (cd $DEST; tar xvf - ) #(cd / ; find -x dev | cpio -o -H newc ) | \ # (cd $DEST; cpio -i -H newc -d ) echo "+++ Fixing permissions on some objects" @@ -99,7 +99,7 @@ update_conf_and_pw() { echo "+++ Copying files in /conf and password files" (cd ${DEST} ; rm -rf conf ) - (cd / ; tar clf - conf ) | (cd ${DEST}; tar xvf - ) + (cd / ; tar --one-file-system -cf - conf ) | (cd ${DEST}; tar xvf - ) mkdir -p ${DEST}/conf/etc # used to mount things (cd /etc ; tar cvf - ${PWFILES} ) | (cd ${DEST}/etc ; tar xf - ) } @@ -113,12 +113,9 @@ done echo "." ln -s /var/tmp ${DEST}/tmp - echo "+++ Now use MAKEDEV to create devices ${DEVICES}" - (cd $DEST/dev ; cp /dev/MAKEDEV . ) - (cd $DEST/dev ; /dev/MAKEDEV ${DEVICES} ) (cd $DEST/dev ; ln -s /dev/sysmouse mouse ) - echo "+++ Copying kernel from /sys/compile/DISKLESS" - cp /sys/compile/DISKLESS/kernel $DEST/kernel + echo "+++ Copying kernel from /usr/obj/usr/src/sys/DISKLESS" + cp /usr/obj/usr/src/sys/DISKLESS/kernel $DEST/boot/kernel/kernel echo "." } --=-=-= WBR -- bsam --=-=-=--