A script /usr/share/example/diskless/clone_root is not follow 5.2R changes. The script not copy /lib and /libexec directories. Fix: ar# diff -c1 /usr/share/examples/diskless/clone_root clone_root and this is a change request./etc/rc.d/initdiskless. The original code does not copy .file (ex /root/.bashrc etc) ar# diff -c1 initdiskless.save initdiskless ====================================== Thank you.--NAfVmbld3iAnulJRaVFtAABlrA5uZk9aJKz8Wwgkj4FD3RkF Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" *** /usr/share/examples/diskless/clone_root Fri Feb 6 13:37:52 2004 --- clone_root Fri Feb 6 17:30:00 2004 *************** *** 6,8 **** # ! # $FreeBSD: src/share/examples/diskless/clone_root,v 1.1 2001/04/16 06:37:03 luigi Exp $ # --- 6,8 ---- # ! # $FreeBSD: src/share/examples/diskless/clone_root,v 1.1.2.4 2002/04/07 18:16:18 luigi Exp $ # *************** *** 48,51 **** # enable NFS server and set /etc/exports as ! # ${DEST} -maproot=0 -alldirs <list of diskless clients> ! # /usr -alldirs # --- 48,51 ---- # enable NFS server and set /etc/exports as ! # ${DEST} -ro -maproot=0 -alldirs <list of diskless clients> ! # /usr -ro -alldirs # *************** *** 81,83 **** PWFILES="master.passwd passwd spwd.db pwd.db" ! TOCOPY="bin boot compat etc modules sbin stand sys" --- 81,83 ---- PWFILES="master.passwd passwd spwd.db pwd.db" ! TOCOPY="bin boot compat etc modules sbin stand sys lib libexec" *************** *** 102,105 **** --- 102,111 ---- (cd / ; tar clf - conf ) | (cd ${DEST}; tar xvf - ) + mkdir -p ${DEST}/conf/base # original copy of /etc + (cd / ; tar clf - etc ) | (cd ${DEST}/conf/base && tar xvf - ) mkdir -p ${DEST}/conf/etc # used to mount things (cd /etc ; tar cvf - ${PWFILES} ) | (cd ${DEST}/etc ; tar xf - ) + (cd ${DEST}/conf/base ; find etc | cpio --create -H newc | \ + gzip > ${DEST}/conf/base/etc.cpio.gz ; rm -rf etc) + (cd ${DEST} ; find dev | cpio --create -H newc | \ + gzip > ${DEST}/conf/dev.cpio.gz ) } How-To-Repeat: sh /usr/share/example/diskless/clone_root all
Responsible Changed From-To: freebsd-bugs->luigi Assign to maintainer.
And another thing: tar l now gives the error "-l has different behaviors in different tar programs.". So in clone_root, -l should be replaced by --one-file-system. And another thing: The references to MAKEDEV in clone_root should be retired. -- Bob Bishop +44 (0)118 940 1243 rb@gid.co.uk fax +44 (0)118 940 1295
Hi, The next patch worked for me (FreeBSD-5.4-RELEASE-p1): ----- patch start ----- --- 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 "." } ----- patch stop ----- WBR -- bsam
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped