Subject: Patches into cvs
To: None <port-sgimips@netbsd.org>
From: J Lachlan Kanaley <kanaley@student.usyd.edu.au>
List: port-sgimips
Date: 07/05/2004 10:57:03
--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hello,
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
email: kanaley@student.usyd.edu.au
web: http://users.tpg.com.au/adslclfu
--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch.1"
--- ../src/etc/etc.sgimips/Makefile.inc Sat Nov 15 19:58:27 2003
+++ Makefile.inc.new Thu May 27 11:22:46 2004
@@ -13,22 +13,60 @@
INSTALLATION_DIRS+= installation/netboot \
installation/diskimage
+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}
+VDEVLABEL= :
+
+.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
+.else
+# FreeBSD 5.x and later
+VDEV= md0
+VDEVF= ${VDEV}c
+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
+.endif
+.endif
+
iso-image-md-pre:
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
-
iso-image-md-post:
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
+
+ ${VDEVCREATE}
+ ${VDEVLABEL}
+
+ ${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}
+
+ ${VDEVDESTROY}
+
dd if=${CDROM.image} of=${SGI.image} bs=512 seek=3135
mv ${SGI.image} ${CDROM.image}
rm -f ${RELEASEDIR}/ip2x ${RELEASEDIR}/ip3x
--C7zPtVaVf+AK4Oqc
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
251a252
> #ifdef __NetBSD__
252a254,256
> #else
> sprintf(buf, "/dev/%s", argv[0]);
> #endif
--C7zPtVaVf+AK4Oqc--