Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 2004 18:11:40 +0200
From:      Andrea Campi <andrea+freebsd_current@webcom.it>
To:        Thomas Quinot <thomas@FreeBSD.org>
Cc:        current@freebsd.org
Subject:   Re: cvs commit: src/tools/tools/nanobsd Makefile i386.diskimage
Message-ID:  <20040821161140.GA690@webcom.it>
Resent-Message-ID: <20040821180426.GC690@webcom.it>
In-Reply-To: <200408162241.i7GMfwew040281@repoman.freebsd.org>
References:  <200408162241.i7GMfwew040281@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040821161140.GA690>