Date: Wed, 16 Apr 2003 15:01:13 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Jake Burkholder <jake@locore.ca> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/sunlabel Makefile Message-ID: <20030416120113.GC38592@sunbay.com> In-Reply-To: <20030416114542.GC16563@locore.ca> References: <200304152349.h3FNnV5u063919@repoman.freebsd.org> <20030416063257.GB2349@sunbay.com> <20030416112658.GB16563@locore.ca> <20030416113202.GB38592@sunbay.com> <20030416114542.GC16563@locore.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
--rqzD5py0kzyFAOWN Content-Type: multipart/mixed; boundary="sHrvAb52M6C8blB9" Content-Disposition: inline --sHrvAb52M6C8blB9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 16, 2003 at 07:45:42AM -0400, Jake Burkholder wrote: > Apparently, On Wed, Apr 16, 2003 at 02:32:02PM +0300, > Ruslan Ermilov said words to the effect of; >=20 > > On Wed, Apr 16, 2003 at 07:26:59AM -0400, Jake Burkholder wrote: > > > Apparently, On Wed, Apr 16, 2003 at 09:32:57AM +0300, > > > Ruslan Ermilov said words to the effect of; > > >=20 > > > > On Tue, Apr 15, 2003 at 04:49:31PM -0700, Jake Burkholder wrote: > > > > > jake 2003/04/15 16:49:31 PDT > > > > >=20 > > > > > FreeBSD src repository > > > > >=20 > > > > > Modified files: > > > > > sbin/sunlabel Makefile=20 > > > > > Log: > > > > > Hardlink sunlabel to disklabel so make release is happy. (This= only affects > > > > > sparc64, where bsd^H^H^Hdisklabel isn't built.) > > > > > =20 > > > > > Revision Changes Path > > > > > 1.2 +1 -0 src/sbin/sunlabel/Makefile > > > > >=20 > > > > Um, need to care about cross-releases too. I will send you the > > > > patches when they are ready. > > >=20 > > > Tell me what you intend to do first. > > >=20 > > Make disklabel(8) and sunlabel(8) MI and available on all platforms, > > so that i386 can cross-release sparc64, and vice versa. The "vice > > versa" part is complete but uncommitted, and includes GEOM endianness > > fixes that phk@ has not yet committed. > >=20 > > Fix release/ to use sunlabel(8) for sparc64. >=20 > Ok, I don't mind doing the endian conversion for sunlabel so that it > works on little endian platforms, I started it but haven't finished > and just wanted to get release building on sparc64. I'd really like > it if disklabel was called bsdlabel, and we install a hard link to > disklabel based on the architecture. >=20 Would it be too hard to fold the sunlabel functionality into disklabel? disklabel(8) already provides the "-m machine" option that supports all our current platforms that use BSD labels. I planned on enabling disklabel on sparc64 platform too, and this commit, well, hardens it a bit (by installing a hard-link from sunlabel to disklabel). How about the attached patch instead? release/sparc64/doFS.sh is the stripped down copy of release/scripts/doFS.sh with s/disklabel/bsdlabel/. It can be further cleaned up by removing the dofs_vn() since we don't support bootstrapping the 5.0-CURRENT sparc64 release on 4.x. Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --sHrvAb52M6C8blB9 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Content-Transfer-Encoding: quoted-printable Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/release/Makefile,v retrieving revision 1.768 diff -u -r1.768 Makefile --- Makefile 15 Apr 2003 09:54:19 -0000 1.768 +++ Makefile 16 Apr 2003 11:59:03 -0000 @@ -245,9 +245,8 @@ # Where the bootstrap ports (see DOCPORTS) get installed. LOCALDIR=3D /usr/local/bin =20 -# ia64 is different enough that we want our own doFS.sh. -.if ${TARGET_ARCH} =3D=3D "ia64" -DOFS_SH=3D ${.CURDIR}/ia64/doFS.sh +.if exists(${.CURDIR}/${TARGET_ARCH}/doFS.sh) +DOFS_SH=3D ${.CURDIR}/${TARGET_ARCH}/doFS.sh .elif ${TARGET} !=3D ${MACHINE} DOFS_SH=3D ${.CURDIR}/scripts/doFS.sh ${TARGET} .else Index: sparc64/doFS.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: sparc64/doFS.sh diff -N sparc64/doFS.sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sparc64/doFS.sh 16 Apr 2003 11:59:03 -0000 @@ -0,0 +1,133 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +set -ex + +export BLOCKSIZE=3D512 + +FSIMG=3D$1; shift +RD=3D$1 ; shift +MNT=3D$1 ; shift +FSSIZE=3D$1 ; shift +FSPROTO=3D$1 ; shift +FSINODE=3D$1 ; shift +FSLABEL=3D$1 ; shift + +# +# We don't have any bootblocks on ia64. Note that -B implies -r, +# so we have to specifically specify -r when we don't have -B. +# disklabel fails otherwise. +# +if [ -f "${RD}/trees/base/boot/boot" ]; then + BOOT=3D"-B -b ${RD}/trees/base/boot/boot" +elif [ -f "${RD}/trees/base/boot/boot1" ]; then + BOOT=3D"-B -b ${RD}/trees/base/boot/boot1" + if [ -f "${RD}/trees/base/boot/boot2" ]; then + BOOT=3D"${BOOT} -s ${RD}/trees/base/boot/boot2" + fi +else + BOOT=3D"-r" +fi + +deadlock=3D20 + +dofs_vn () { + if [ "x$VNDEVICE" =3D "x" ] ; then + VNDEVICE=3Dvn0 + fi + u=3D`expr $VNDEVICE : 'vn\([0-9]*\)' || true` + VNDEVICE=3Dvnn$u + + rm -f /dev/*vnn* + mknod /dev/rvnn${u} c 43 `expr 65538 + $u '*' 8` + mknod /dev/rvnn${u}c c 43 `expr 2 + $u '*' 8` + mknod /dev/vnn${u} b 15 `expr 65538 + $u '*' 8` + mknod /dev/vnn${u}c b 15 `expr 2 + $u '*' 8` + + while true=20 + do + rm -f ${FSIMG} + + umount /dev/${VNDEVICE} 2>/dev/null || true + umount ${MNT} 2>/dev/null || true + vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true + + dd of=3D${FSIMG} if=3D/dev/zero count=3D${FSSIZE} bs=3D1k 2>/dev/null + + vnconfig -s labels -c /dev/r${VNDEVICE} ${FSIMG} + + trap "umount ${MNT}; vnconfig -u /dev/r${VNDEVICE}; rm -f /dev/*vnn*" EXIT + + sunlabel -w ${BOOT} ${VNDEVICE} ${FSLABEL} + newfs -i ${FSINODE} -o space -m 0 /dev/r${VNDEVICE}c + + mount /dev/${VNDEVICE}c ${MNT} + + if [ -d ${FSPROTO} ]; then + (set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT}) + else + cp -p ${FSPROTO} ${MNT} + fi + + df -ki ${MNT} + + set `df -ki ${MNT} | tail -1` + + echo "*** Filesystem is ${FSSIZE} K, $4 left" + echo "*** ${FSINODE} bytes/inode, $7 left" + break; + done +} + +dofs_md () { + while true=20 + do + rm -f ${FSIMG} + + if [ "x${MDDEVICE}" !=3D "x" ] ; then + umount /dev/${MDDEVICE} 2>/dev/null || true + umount ${MNT} 2>/dev/null || true + mdconfig -d -u ${MDDEVICE} 2>/dev/null || true + fi + + dd of=3D${FSIMG} if=3D/dev/zero count=3D${FSSIZE} bs=3D1k 2>/dev/null + + MDDEVICE=3D`mdconfig -a -t vnode -f ${FSIMG}` + if [ ! -c /dev/${MDDEVICE} ] ; then + echo "No /dev/$MDDEVICE" 1>&2 + exit 1 + fi + + trap "umount ${MNT}; mdconfig -d -u ${MDDEVICE}" EXIT + + sunlabel -w ${BOOT} ${MDDEVICE} ${FSLABEL} + newfs -i ${FSINODE} -o space -m 0 /dev/${MDDEVICE}c + + mount /dev/${MDDEVICE}c ${MNT} + + if [ -d ${FSPROTO} ]; then + (set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT}) + else + cp -p ${FSPROTO} ${MNT} + fi + + df -ki ${MNT} + + set `df -ki ${MNT} | tail -1` + + echo "*** Filesystem is ${FSSIZE} K, $4 left" + echo "*** ${FSINODE} bytes/inode, $7 left" + break; + done +} + +case `uname -r` in +[1-4].*) + dofs_vn + ;; +*) + dofs_md + ;; +esac --sHrvAb52M6C8blB9-- --rqzD5py0kzyFAOWN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+nUYJUkv4P6juNwoRAuQ1AKCBL+cGnOKMJJ4qmRmNfH2mt+sQpwCdE/ej VnQNm1uPe62o4Sp2PNswNWI= =kbf/ -----END PGP SIGNATURE----- --rqzD5py0kzyFAOWN--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030416120113.GC38592>