From owner-freebsd-fs@FreeBSD.ORG Tue Jul 25 18:49:40 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5AFE716A4E7 for ; Tue, 25 Jul 2006 18:49:40 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CD0B43D49 for ; Tue, 25 Jul 2006 18:49:34 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 7D56F2086; Tue, 25 Jul 2006 20:49:28 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id E0C7F2082; Tue, 25 Jul 2006 20:49:27 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id BABE733C31; Tue, 25 Jul 2006 20:49:27 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: Eric Anderson References: <20060724185205.17021.qmail@web31812.mail.mud.yahoo.com> <86wta1en0e.fsf@xps.des.no> <44C6430D.1050506@centtech.com> Date: Tue, 25 Jul 2006 20:49:27 +0200 In-Reply-To: <44C6430D.1050506@centtech.com> (Eric Anderson's message of "Tue, 25 Jul 2006 11:13:01 -0500") Message-ID: <86lkqheczs.fsf@xps.des.no> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org Subject: Re: Advice for hacking on ufs/ffs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2006 18:49:40 -0000 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=3D/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 ?=3D -g # and leave them in when installing STRIP =3D # empty # don't clean out your previous build before rebuilding the kernel - # you'll be doing that a lot NO_KERNELCLEAN =3D 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=3D"YES"' >>/etc/rc.conf % echo 'mountd_enable=3D"YES"' >>/etc/rc.conf % echo '/box -maproot=3Droot -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=3D"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 --=20 Dag-Erling Sm=F8rgrav - des@des.no