From owner-freebsd-questions@FreeBSD.ORG Sat Mar 1 20:31:20 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A09501065671 for ; Sat, 1 Mar 2008 20:31:20 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 153288FC19 for ; Sat, 1 Mar 2008 20:31:19 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl24-64.kln.forthnet.gr [77.49.151.64]) (authenticated bits=0) by igloo.linux.gr (8.14.1/8.14.1/Debian-9) with ESMTP id m21KV4DO005363; Sat, 1 Mar 2008 22:31:10 +0200 Received: by kobe.laptop (Postfix, from userid 1000) id 7E3A022802; Sat, 1 Mar 2008 22:31:04 +0200 (EET) Date: Sat, 1 Mar 2008 22:31:04 +0200 From: Giorgos Keramidas To: Steve Bertrand Message-ID: <20080301203104.GB2077@kobe.laptop> References: <47C81ACA.5010800@ibctech.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47C81ACA.5010800@ibctech.ca> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.01, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.39, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: Upgrading a removable disk installation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2008 20:31:20 -0000 On 2008-02-29 09:46, Steve Bertrand wrote: > Hi all, > > I have a couple of systems that run from USB thumb sticks. These machines > run 6.2. > > I'd like to do a typical source upgrade to 7.0 on a test machine. > > To do this, I plug the USB disk into a 'host' machine, and to save space on > the thumb drive, I csup the sources to the standard locations on the host > machine. > > My thumb drive 'OS' slice is mounted as /var/removable-os on the host > machine. > > What I am unclear about is how I go about telling buildworld etc on the > host machine. that I want to install the updates to the /var/removable-os > location, instead of the default '/'. It should be easy to use DESTDIR for this. I regularly update my USB flash installation using the DESTDIR support of our Makefiles and the following (a slightly modified version of the process described by Warner Losh in a series of excellent blog posts at his weblog). The commands below use sh(1) syntax, but it should be easy to `port' them to csh(1) too: # cd /usr/src # export MAKEOBJDIRPREFIX='/ws/obj/bsd.i836' # export TARGET='i386' # export TARGET_ARCH='i386' # make buildworld # make buildkernel KERNCONF=KERAMIDA # fdisk -I da0 # fdisk -B da0 # bsdlabel -w da0s1 auto # bsdlabel -B da0s1 # newfs -L USBROOT /dev/da0s1a # mount /dev/da0s1a /mnt # make installworld DESTDIR=/mnt # make installkernel DESTDIR=/mnt KERNCONF=KERAMIDA INSTALL_NODEBUG=t # make distrib-dirs DESTDIR=/mnt # make distribution DESTDIR=/mnt # echo /dev/ufs/USBROOT / ufs rw 1 1 > /mnt/etc/fstab # echo ifconfig_DEFAULT=DHCP > /mnt/etc/rc.conf # echo 'hostname="demo"' >> /mnt/etc/rc.conf As long as you have a base system which can buildworld for the target version/release, this should work. Notes ***** You can obviously skip the change for `MAKEOBJDIRPREFIX', `TARGET' and `TARGET_ARCH', if you are building the same version & architecture for the USB flash disk. I usually customize `GENERIC', but you can use `KERNCONF=GENERIC' where I have used `KERNCONF=KERAMIDA' above. References ********** http://bsdimp.blogspot.com/ Warner's weblog. http://bsdimp.blogspot.com/2007/10/building-bootable-freebsdi386-images.html A post which describes the steps I copied above. See the comments of the blog post too. They contain a fair amount of useful tips. http://bsdimp.blogspot.com/2007/12/building-bootable-arm-sd.html Yet another well written post, by Warner. This time it describes how to build an SD disk for ARM systems, but it is also a nice read. Some of the bits are quite interesting, i.e. the description of how the hypothetical ARM-based system boots :)