clone_root [a followup to conf/62417]
Boris Samorodov
bsam at ipt.ru
Sat May 28 13:40:45 PDT 2005
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:
-------------- next part --------------
--- 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 "."
}
-------------- next part --------------
WBR
--
bsam
More information about the freebsd-stable
mailing list