From des@des.no Tue Jul 25 22:50:02 2006 Date: Tue, 25 Jul 2006 20:49:27 +0200 From: "Dag-Erling [iso-8859-1] Sm?rgrav" To: Eric Anderson Cc: freebsd-fs@freebsd.org Subject: Re: Advice for hacking on ufs/ffs [ The following text is in the "iso-8859-1" character set. ] [ Your display is set for the "KOI8-R" character set. ] [ Some special characters may be displayed incorrectly. ] Eric Anderson writes: > DES - anything special with the nfs root'ed box, to make this work > well? Not really. Here's a short summary. Assume you have a spare disk in your workstation, ad1, which you are going to use for your test box. Create and populate a file system for your test box: % mkdir /box % echo '/dev/ad1 /box ufs rw 2 2' >>/etc/fstab % newfs -U /box % mount /box % mergemaster -i -D /box % cd /usr/src % make installworld DESTDIR=/box Check out a source tree: % cd /box/usr % cvs -R -q -d /home/ncvs co -P src Chroot into your sandbox: % echo 'devfs /box/dev devfs rw 0 0' >>/etc/fstab % mount /box/dev % chroot /box /bin/sh At this point you want to create an appropriate make.conf and kernel config for your test box. Useful make.conf settings include: # build *everything* with debugging symbols DEBUG_FLAGS ?= -g # and leave them in when installing STRIP = # empty # don't clean out your previous build before rebuilding the kernel - # you'll be doing that a lot NO_KERNELCLEAN = YES When you are ready, build and install world and kernel: [still inside the chroot] % cd /usr/src % make buildworld buildkernel && make installworld installkernel You don't really need to chroot; you can do everything outside the sandbox, making sure that DESTDIR and __MAKE_CONF are correctly defined. I find it easier to work in a chroot because it saves me from having to remember just that. If you're going to use a serial console, kick up the speed a notch: [still inside the chroot] % cat >>/boot/loader.conf <>/etc/fstab </usr/local/etc/dhcp.conf <>/etc/rc.conf % /usr/local/etc/rc.d/isc-dhcpd.sh start Of course, you also need to set up NFS and TFTP: [nfs] % echo 'nfs_server_enable="YES"' >>/etc/rc.conf % echo 'mountd_enable="YES"' >>/etc/rc.conf % echo '/box -maproot=root -network 10.0.0.0 -mask 255.255.255.0' >>/etc/exports % /etc/rc.d/nfsserver start % /etc/rc.d/mountd start [tftp] % mkdir /tftpboot % cp /box/boot/pxeboot /tftpboot % sed -i.bak -e 's/^#tftp/tftp/' /etc/inetd.conf % echo 'inetd_enable="YES"' >>/etc/rc.conf % /etc/rc.d/inetd start At this point, if I didn't miss anything, you should be able to just switch on your test box and watch it boot. DES -- Dag-Erling Sm?rgrav - des@des.no _______________________________________________ freebsd-fs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-fs To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"