Subject: Re: make release failure and opendisk(3) change
To: None <current-users@netbsd.org>
From: Bang Jun-Young <junyoung@mogua.com>
List: current-users
Date: 11/08/2001 07:53:27
On Wed, Nov 07, 2001 at 11:09:22PM +0900, Bang Jun-Young wrote:
> Hi,
> 
> While I was trying to make release today, I got the following
> error:
> 
> vnconfig -v -c /dev/vnd0d ramdisk-big.fs.tmp  512/128/1/32
> vnconfig: /dev/vnd0d: opendisk: Operation not supported by device
> *** Error code 1
> 
> This was due to a change made to opendisk(3) by lukem on 11/1:
> 
> revision 1.8
> date: 2001/11/01 06:53:25;  author: lukem;  state: Exp;  lines: +43 -26
> Enforce is iscooked arg;
> 	if zero, a matching path must be of type S_IFCHR, and
> 	if non-zero, a matching path must be of type S_IFBLK.
> 
> So when you call opendisk for block device, the last argument
> must be non-zero, otherwise error is returned.
> 
> I'm attaching the patch that fixes the problem. Would anybody
> commit this to the tree?

Oops, I'm sorry. There's some confusion between vnd0 and rvnd0
in a couple of Makefiles under distrib/i386/floppies. The correct
fix would be like:


Index: Makefile
===================================================================
RCS file: /cvsroot/basesrc/distrib/i386/floppies/bootfloppy-big/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- distrib/i386/floppies/bootfloppy-big/Makefile	2000/10/17 21:08:43	1.10
+++ distrib/i386/floppies/bootfloppy-big/Makefile	2001/11/07 22:43:30
@@ -57,8 +57,8 @@
 realall:	netbsd
 	-rm -f ${IMAGE}.tmp
 	dd if=/dev/zero of=${IMAGE}.tmp count=${DISKSIZE}
-	vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}.tmp
-	disklabel -rw ${VND_CDEV} ${DISKTYPE}
+	vnconfig -t ${DISKTYPE} -v -c ${VND_CRDEV} ${IMAGE}.tmp
+	disklabel -rw ${VND_CRDEV} ${DISKTYPE}
 	newfs -B le -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV} ${DISKTYPE}
 	${MDEC}/installboot -v -f ${BOOTCODE} ${VND_RDEV}
 	mount ${VND_DEV} ${MOUNT_POINT}
@@ -67,12 +67,12 @@
 	@echo ""
 	@df -i ${MOUNT_POINT}
 	umount ${MOUNT_POINT}
-	vnconfig -u ${VND_CDEV}
+	vnconfig -u ${VND_CRDEV}
 	mv -f ${IMAGE}.tmp ${IMAGE}
 
 unconfig:
 	-umount -f ${MOUNT_POINT}
-	-vnconfig -u ${VND_DEV}
+	-vnconfig -u ${VND_RDEV}
 	-/bin/rm -f ${IMAGE} ${IMAGE}.tmp
 
 netbsd: ${KERN}


Index: Makefile.inc
===================================================================
RCS file: /cvsroot/basesrc/distrib/i386/floppies/bootfloppy-common/Makefile.inc,v
retrieving revision 1.32
diff -u -r1.32 Makefile.inc
--- distrib/i386/floppies/bootfloppy-common/Makefile.inc	2001/07/02 14:10:09	1.32
+++ distrib/i386/floppies/bootfloppy-common/Makefile.inc	2001/11/07 22:44:28
@@ -29,12 +29,12 @@
 	@echo Making disk number one
 	rm -f ${IMAGE}.tmp
 	dd if=/dev/zero of=${IMAGE}.tmp count=${DISKSIZE}
-	vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}.tmp
+	vnconfig -t ${DISKTYPE} -v -c ${VND_CRDEV} ${IMAGE}.tmp
 	dd bs=8k seek=1 count=${BLOCK8K} if=${FSTMP} of=${VND_CDEV}
-	disklabel -rw ${VND_CDEV} ${DISKTYPE}
+	disklabel -rw ${VND_CRDEV} ${DISKTYPE}
 	@echo "installing new bootblocks"
 	${MDEC}/installboot -b 17 -v -f ${BOOTCODE} ${VND_RDEV}
-	vnconfig -u ${VND_CDEV}
+	vnconfig -u ${VND_CRDEV}
 	@ls -l ${FSTMP} | (read mode links uid gid size junk; \
 		dksize=$$((${DISKSIZE} * 512 - 8 * 1024)); \
 		disks=$$(($$size / $$dksize + 1)); \

Anyway, those who updated their sources between 11/1 and 11/7 for the
last time should update again to the latest if you want to 'make release'
on i386. ;) 

Jun-Young

-- 
Bang Jun-Young <junyoung@mogua.com>