Subject: Patches into cvs
To: None <>
From: J Lachlan Kanaley <>
List: port-sgimips
Date: 07/05/2004 10:57:03
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


I was wondering if anyone could/should put the patches that Scott
supplied in an earlier email to allow cross-compiling netbsd-sgimips
under freebsd into the main cvs tree in case anyone else wishes to do
this?  The two patches are attached.

- lachlan


James Lachlan Kanaley

phone:  (02) 9517 3209
mobile: 0427 368 345

Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch.1"

--- ../src/etc/etc.sgimips/	Sat Nov 15 19:58:27 2003
+++	Thu May 27 11:22:46 2004
@@ -13,22 +13,60 @@
 INSTALLATION_DIRS+=	installation/netboot \
+SGI.image= ${RELEASEDIR}/${MACHINE}/installation/cdrom/netbsd-sgimips.img
+THISHOSTSYS!= uname -s
+# Set up vnode/memory-disk port-specific stuff
+# Default to NetBSD
+VDEV=		vnd0
+VDEVF=		r${VDEV}d
+VDEVCREATE=	vnconfig ${VDEV} ${SGI.image}
+VDEVDESTROY=	vnconfig -u ${VDEV}
+.if ${THISHOSTSYS} == "FreeBSD"
+FREEBSDTYPE!=	which mdconfig
+.if ${FREEBSDTYPE} == ""
+# FreeBSD 4.x and prior
+VDEV=		vn0
+VDEVF=		r${VDEV}c
+VDEVCREATE=	vnconfig -s labels -c ${VDEV} ${SGI.image}
+VDEVLABEL=	disklabel -w -r ${VDEV} auto
+# FreeBSD 5.x and later
+VDEV=		md0
+VDEVCREATE=	mdconfig -a -t vnode -u ${VDEV} -f ${SGI.image}
+VDEVDESTROY=	mdconfig -d -u ${VDEV}
+# FreeBSD 5 bsdlabel requires "-m i386" on platforms other than i386
+# otherwise, disk block zero cannot be written to.  On the alpha,
+# FreeBSD's bsdlabel will even fail with a floating exception without
+# it.
+VDEVLABEL=	bsdlabel -m i386 -w -r ${VDEV} auto
 	gzip -d -c ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-INSTALL32_IP2x.gz > ${RELEASEDIR}/ip2x
 	gzip -d -c ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-INSTALL32_IP3x.gz > ${RELEASEDIR}/ip3x
 	echo "ip2x=${RELEASEDIR}/ip2x" >> ${CDROM.pathlist}
 	echo "ip3x=${RELEASEDIR}/ip3x" >> ${CDROM.pathlist}
-SGI.image= ${RELEASEDIR}/${MACHINE}/installation/cdrom/netbsd-sgimips.img
 	dd if=/dev/zero of=${SGI.image} bs=1m count=120
-	vnconfig vnd0 ${SGI.image}
-	${TOOLDIR}/bin/nbsgivol -f -i vnd0
-	${TOOLDIR}/bin/nbsgivol -f -w aoutboot ${DESTDIR}/usr/mdec/aoutboot vnd0
-	${TOOLDIR}/bin/nbsgivol -f -w ip2xboot ${DESTDIR}/usr/mdec/ip2xboot vnd0
-	${TOOLDIR}/bin/nbsgivol -f -w ip3xboot ${DESTDIR}/usr/mdec/ip3xboot vnd0
-	vnconfig -u vnd0
+	${TOOLDIR}/bin/nbsgivol -f -i ${VDEVF}
+	${TOOLDIR}/bin/nbsgivol -f -w aoutboot ${DESTDIR}/usr/mdec/aoutboot ${VDEVF}
+	${TOOLDIR}/bin/nbsgivol -f -w ip2xboot ${DESTDIR}/usr/mdec/ip2xboot ${VDEVF}
+	${TOOLDIR}/bin/nbsgivol -f -w ip3xboot ${DESTDIR}/usr/mdec/ip3xboot ${VDEVF}
 	dd if=${CDROM.image} of=${SGI.image} bs=512 seek=3135
 	mv ${SGI.image} ${CDROM.image}
 	rm -f ${RELEASEDIR}/ip2x ${RELEASEDIR}/ip3x

Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch.2"

Index: sys/arch/sgimips/stand/sgivol/sgivol.c
RCS file: /cvsroot/src/sys/arch/sgimips/stand/sgivol/sgivol.c,v
retrieving revision 1.8
diff -r1.8 sgivol.c 
> #ifdef __NetBSD__
> #else
>               sprintf(buf, "/dev/%s", argv[0]);
> #endif