Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 May 2005 00:41:53 +0400
From:      Boris Samorodov <bsam@ipt.ru>
To:        freebsd-stable@FreeBSD.org
Subject:   clone_root [a followup to conf/62417]
Message-ID:  <86637486@srv.sem.ipt.ru>

next in thread | raw e-mail | index | archive | help
--=-=-=

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

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86637486>