From owner-freebsd-current@FreeBSD.ORG Sat Aug 21 18:04:28 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 917DC16A4CE; Sat, 21 Aug 2004 18:04:28 +0000 (GMT) Received: from sardine.webcom.it (gen053.n002.c03.escapebox.net [213.73.82.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 238F643D2F; Sat, 21 Aug 2004 18:04:28 +0000 (GMT) (envelope-from "") Received: from [213.140.17.96] (helo=brian) by webcom.it with asmtp (Exim 3.36 #1) id 1ByaE6-00065E-00; Sat, 21 Aug 2004 18:04:26 +0000 Resent-From: andrea@webcom.it Resent-Date: Sat, 21 Aug 2004 20:04:26 +0200 Resent-Message-ID: <20040821180426.GC690@webcom.it> Resent-To: Thomas Quinot , current@freebsd.org Date: Sat, 21 Aug 2004 18:11:40 +0200 From: Andrea Campi To: Thomas Quinot Message-ID: <20040821161140.GA690@webcom.it> References: <200408162241.i7GMfwew040281@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200408162241.i7GMfwew040281@repoman.freebsd.org> User-Agent: Mutt/1.5.6i Received: from andrea by webcom.it with asmtp (Exim 3.36 #1) id 1ByaE6-00065E-00; Sat, 21 Aug 2004 18:04:26 +0000 cc: current@freebsd.org Subject: Re: cvs commit: src/tools/tools/nanobsd Makefile i386.diskimage X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2004 18:04:28 -0000 Hi Thomas, On Mon, Aug 16, 2004 at 10:41:58PM +0000, Thomas Quinot wrote: > thomas 2004-08-16 22:41:58 UTC > > FreeBSD src repository > > Modified files: > tools/tools/nanobsd Makefile i386.diskimage > Log: > Properly identify the root filesystem to be used in /etc/fstab in each > slice of the flash card, ensuring that the loader will mount the root fs > from the booted slice by default. I think this is not what you intended to do: =================================================================== RCS file: /usr/local/www/cvsroot/FreeBSD/src/tools/tools/nanobsd/i386.diskimage,v retrieving revision 1.7 retrieving revision 1.8 diff -u -p -r1.7 -r1.8 --- src/tools/tools/nanobsd/i386.diskimage 2004/05/28 21:23:23 1.7 +++ src/tools/tools/nanobsd/i386.diskimage 2004/08/16 22:41:58 1.8 [...] @@ -43,18 +69,40 @@ fdisk ${MD} boot0cfg -B -b ${WD}/boot/boot0sio -s 1 -m 3 ${MD} rm -f ${TMPFILE1} bsdlabel -w -B ${MD}s1 -newfs -O1 -U ${MD}s1a -newfs -O1 -U ${MD}s3 + +# Prepare primary root slice + +newfs ${PRIROOTLABEL} -O1 -U ${MD}s1a mount /dev/${MD}s1a ${TMPMNT} (cd ${WD} && find . -print | cpio -dump ${TMPMNT}) || true +make_fstab ${PRIROOTSLICE} df ${TMPMNT} umount ${TMPMNT} + +# Prepare alternative root slice + +dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k +if [ -n "${ALTROOTLABEL}" ]; then + tunefs ${ALTROOTLABEL} /dev/${MD}s2a +fi +mount /dev/${MD}s2a ${TMPMNT} +make_fstab ${ALTROOTSLICE} +umount ${TMPMNT} + make_fstab creates the /etc/fstab file in ${WD}, but in both cases you call it *after* copying from ${WD} to the destination filesystem, so in fact they are noops. I think you should probably change make_fstab like this: make_fstab () { echo "/dev/$1 / ufs ro 1 1" > $2/etc/fstab } and pass it the destination: make_fstab ${ALTROOTSLICE} ${TMPMNT} What do you think? I can send you a diff if you prefer. Bye, Andrea -- Weird enough for government work.