Subject: install/22974: Disklabel on vnd fails during mac68k 1.5 build
To: None <gnats-bugs@gnats.netbsd.org>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: netbsd-bugs
Date: 09/27/2003 15:44:21
>Number:         22974
>Category:       install
>Synopsis:       Disklabel on vnd fails during mac68k 1.5 build
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 27 14:13:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
>Release:        NetBSD 1.5.4 / NetBSD 1.6K
>Organization:
Einzeln auftretender Radfahrer
>Environment:
System: NetBSD q700 1.6K NetBSD 1.6K (FG54) #12: Fri Dec 20 10:17:57 CET 2002 hauke@q700:/usr/src/sys/arch/mac68k/compile/FG54 mac68k
Architecture: m68k
Machine: mac68k

>Description:

	I am trying to build a 1.5.4 snapshot on a 1.6K mac68k box. By
	chrooting to a 1.5.4alpha binary snapshot this goes pretty well, but
	then stops in '/usr/src/distrib/mac68k/instkernel/ramdisk'.


>How-To-Repeat:

cc -static -o ramdiskbin ramdiskbin.o cat.cro chmod.cro chown.cro chroot.cro cp.cro dd.cro df.cro disklabel.cro ed.cro fsck.cro fsck_ffs.cro ftp.cro gzip.cro ifconfig.cro init.cro less.cro ln.cro ls.cro mkdir.cro mknod.cro mount.cro mount_cd9660.cro mount_ffs.cro mount_msdos.cro mount_nfs.cro mount_kernfs.cro mt.cro mv.cro newfs.cro ping.cro pwd.cro reboot.cro restore.cro rm.cro route.cro sed.cro sh.cro shutdown.cro slattach.cro stty.cro swapctl.cro sync.cro test.cro tip.cro umount.cro sysinst.cro pax.cro tset.cro -L/build/destdir/usr/lib  -lbz2 -ledit -lutil -lcurses -ltermcap -lrmt -lcrypt -ll -lm
strip ramdiskbin
dd if=/dev/zero of=ramdisk.fs count=5120
5120+0 records in
5120+0 records out
2621440 bytes transferred in 8 secs (327680 bytes/sec)
vnconfig -v -c /dev/vnd0c ramdisk.fs
/dev/vnd0c: 2621440 bytes on ramdisk.fs
newfs -m 0 -o space -i 5120 /dev/rvnd0a
Warning: 1024 sector(s) in last cylinder unallocated
/dev/rvnd0a:    5120 sectors in 3 cylinders of 64 tracks, 32 sectors
        2.5MB in 1 cyl groups (16 c/g, 16.00MB/g, 512 i/g)
super-block backups (for fsck -b #) at:
 32,
newfs: ioctl (WDINFO): Invalid argument
newfs: /dev/rvnd0a: can't rewrite disk label
*** Error code 1


-- when I try the command sequence 'outside' the chroot, i.e. with the
1.6K binaries, the result is the same:


[hauke@q700] ~ # cd /var/tmp
[hauke@q700] /var/tmp # dd if=/dev/zero of=ramdisk.fs count=5120
5120+0 records in
5120+0 records out
2621440 bytes transferred in 8.136 secs (322202 bytes/sec)
[hauke@q700] /var/tmp # vnconfig -v -c /dev/vnd1c ramdisk.fs
/dev/vnd1c: 2621440 bytes on ramdisk.fs
[hauke@q700] /var/tmp # newfs -m 0 -o space -i 5120 /dev/rvnd1a
Warning: 1024 sector(s) in last cylinder unallocated
/dev/rvnd1a:    5120 sectors in 3 cylinders of 64 tracks, 32 sectors
        2.5MB in 1 cyl groups (12 c/g, 12.00MB/g, 512 i/g)
super-block backups (for fsck -b #) at:
 32,
newfs: ioctl (WDINFO): Invalid argument
newfs: /dev/rvnd1a: can't rewrite disk label
[hauke@q700] /var/tmp # disklabel /dev/vnd1c
# /dev/vnd1c:
type: vnd
disk: vnd
label: default label
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 2
total sectors: 5120
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

3 partitions:
#        size    offset     fstype  [fsize bsize cpg/sgs]
 a:      5120         0     4.2BSD      0     0     0   # (Cyl.    0 - 2*)
 b:      5120         0     4.2BSD      0     0     0   # (Cyl.    0 - 2*)
 c:      5120         0     4.2BSD      0     0     0   # (Cyl.    0 - 2*)
disklabel: boot block size 0
disklabel: super block size 0


>Fix:

Pulling up a newer change

[hauke@q700] /<6>instkernel/ramdisk > cvs diff -u -r 1.10 -r 1.11 Makefile
Index: Makefile
===================================================================
RCS file: /cvsroot/src/distrib/mac68k/instkernel/ramdisk/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -u -r1.10 -r1.11
--- Makefile    2001/10/13 06:15:17     1.10
+++ Makefile    2002/02/05 23:10:02     1.11
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2001/10/13 06:15:17 jmc Exp $
+#      $NetBSD: Makefile,v 1.11 2002/02/05 23:10:02 wormey Exp $

 .ifndef NOTESOBJDIR
 NOTESOBJDIR!=cd ${.CURDIR}/../../../notes/mac68k; ${MAKE} ${MAKEFLAGS} -V
.OBJDIR
@@ -31,6 +31,8 @@
        dd if=/dev/zero of=${IMAGE} count=5120
        vnconfig -v -c ${VND_CDEV} ${IMAGE}
 #      disklabel -rw ${VND_CDEV} ${DISKTYPE}
+       -disklabel ${VND} >tmplabel
+       disklabel -r -R ${VND} tmplabel
        newfs -m 0 -o space -i 5120 ${VND_RDEV}
        mount ${VND_DEV} ${MOUNT_POINT}
        ${MTREE} -def ${.CURDIR}/${MTREECONF} -p ${MOUNT_POINT}/ -u


fixes the problem, and lets me finish the build successfully.

Please do also request a pull-up to the 1.5 release branch.

>Release-Note:
>Audit-Trail:
>Unformatted: