Subject: floppy image construction fails
To: None <port-i386@NetBSD.ORG>
From: None <Havard.Eidnes@runit.sintef.no>
List: port-i386
Date: 07/04/1997 19:12:09
----Next_Part(Fri_Jul__4_19:09:32_1997)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

it seems that the build procedure for the floppy images on i386
hasn't been updated after the "vnd can have disklabel" changes.
First off, I had to change /dev/vnd0a to /dev/vnd0d in the
Makefile to make vnconfig happy, since it otherwise said "device
not configured".  This made it go this far:

===> ramdisk
dd if=/dev/zero of=ramdisk-12G.fs count=2880
2880+0 records in
2880+0 records out
1474560 bytes transferred in 1 secs (1474560 bytes/sec)
vnconfig -t floppy3 -v -c /dev/vnd0d ramdisk-12G.fs
/dev/vnd0d: 1474560 bytes on ramdisk-12G.fs using geometry 512/18/2/80
newfs -m 0 -o space -i 5120 -c 80 /dev/rvnd0d floppy3
/dev/rvnd0d:    2880 sectors in 80 cylinders of 2 tracks, 18 sectors
        1.4MB in 1 cyl groups (80 c/g, 1.41MB/g, 320 i/g)
super-block backups (for fsck -b #) at:
 32,newfs: ioctl (WDINFO): No such process
newfs: /dev/rvnd0d: can't rewrite disk label

*** Error code 1

Stop.

Oops.

Further testing reveals that it is indeed the missing disklabel
which is the problem, so the build procedure needs to be updated
to take into account the need to put a proper disklabel on the
vnd device.  Attached is an approximation of a typescript showing
what I had to do to complete the construction of a boot floppy
image from yesterday's sources.


Regards,

- Havard

----Next_Part(Fri_Jul__4_19:09:32_1997)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

vader# pwd
/usr/src/distrib/i386/floppies/ramdisk
vader# cd obj
vader# vnconfig -u /dev/vnd0d
vader# dd if=/dev/zero of=ramdisk-12G.fs count=2880
2880+0 records in
2880+0 records out
1474560 bytes transferred in 1 secs (1474560 bytes/sec)
vader# vnconfig -t floppy3 -v -c /dev/vnd0d ramdisk-12G.fs
/dev/vnd0d: 1474560 bytes on ramdisk-12G.fs using geometry 512/18/2/80
vader# disklabel -r /dev/vnd0d
disklabel: no disk label
vader# 
vader# disklabel -r -w /dev/vnd0d floppy3
vader# disklabel /dev/vnd0d
# /dev/vnd0d:
type: unknown
disk: floppy
label: 
flags:
bytes/sector: 512
sectors/track: 18
tracks/cylinder: 2
sectors/cylinder: 36
cylinders: 80
total sectors: 2880
rpm: 300
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

3 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:     2880        0    unused      512  4096         # (Cyl.    0 - 79)
  b:     2880        0    unused        0     0         # (Cyl.    0 - 79)
  c:     2880        0    unused        0     0         # (Cyl.    0 - 79)
vader# newfs -m 0 -o space -i 5120 -c 80 /dev/rvnd0d floppy3
newfs: `d' partition is unavailable
vader# newfs -m 0 -o space -i 5120 -c 80 /dev/rvnd0a floppy3
newfs: /dev/rvnd0a: : Device not configured
vader# disklabel -r vnd0d > /tmp/proto

edit /tmp/proto: set partitions to 4, add d partition (not sure
this is needed), setup a partition as 4.2BSD with semi-sensible
cpg value.

vader# disklabel -R -r /dev/vnd0d /tmp/proto
vader# disklabel vnd0d
# /dev/rvnd0d:
type: unknown
disk: floppy
label: 
flags:
bytes/sector: 512
sectors/track: 18
tracks/cylinder: 2
sectors/cylinder: 36
cylinders: 80
total sectors: 2880
rpm: 300
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

4 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:     2880        0    4.2BSD      512  4096    16   # (Cyl.    0 - 79)
  b:     2880        0    unused        0     0         # (Cyl.    0 - 79)
  c:     2880        0    unused        0     0         # (Cyl.    0 - 79)
  d:     2880        0    unused        0     0         # (Cyl.    0 - 79)
vader# 
vader# newfs -m 0 -o space -i 5120 -c 80 /dev/vnd0a floppy3
newfs: /dev/vnd0a: not a character-special device
/dev/vnd0a:     2880 sectors in 80 cylinders of 2 tracks, 18 sectors
        1.4MB in 1 cyl groups (80 c/g, 1.41MB/g, 288 i/g)
super-block backups (for fsck -b #) at:
 32,
vader# 
vader# mount /dev/vnd0a /mnt
vader# mtree -def /usr/src/distrib/i386/floppies/ramdisk/mtree.conf -p /mnt/ -u
missing: ./bin (created)
missing: ./dev (created)
missing: ./etc (created)
missing: ./mnt (created)
missing: ./mnt2 (created)
missing: ./kern (created)
missing: ./sbin (created)
missing: ./tmp (created)
missing: ./usr (created)
missing: ./usr/bin (created)
missing: ./usr/mdec (created)
missing: ./usr/sbin (created)
missing: ./usr/share (created)
missing: ./usr/share/misc (created)
vader# 
vader# sh
# TOPDIR=/usr/src/distrib/i386/floppies/ramdisk/.. CURDIR=/usr/src/distrib/i386/floppies/ramdisk OBJDIR=/usr/src/distrib/i386/floppies/ramdisk/obj  TARGDIR=/mnt sh /usr/src/distrib/i386/floppies/ramdisk/../runlist.sh /usr/src/distrib/i386/floppies/ramdisk/list
# exit
vader# 
vader# df -i /mnt
Filesystem  1K-blocks     Used    Avail Capacity iused   ifree  %iused  Mounted on
/dev/vnd0a       1375     1089      286    79%     214      72    75%   /mnt
vader# 
vader# umount /mnt
vader# cat /*bin/* >/dev/null
vader# vnconfig -u /dev/vnd0d
vader#


and then the boot floppy image:


vader# cd /usr/src/distrib/i386/floppies/bootfloppy/obj
vader# dd if=/dev/zero of=boot12G.fs bs=100k count=12
12+0 records in
12+0 records out
1228800 bytes transferred in 1 secs (1228800 bytes/sec)
vader# vnconfig -t floppy5 -v -c /dev/vnd0d boot12G.fs
/dev/vnd0d: 1228800 bytes on boot12G.fs using geometry 512/15/2/80
vader# disklabel -r -w /dev/vnd0d floppy5
vader# disklabel -r vnd0d >/tmp/proto2

edit /tmp/proto2: set partitions to 4, add d partition (not sure
it's needed), set a partition to 4.2BSD with semi-sensible cpg
value.

vader# disklabel -R -r vnd0d /tmp/proto2
vader# disklabel -r vnd0d
# /dev/rvnd0d:
type: unknown
disk: floppy5
label: 
flags:
bytes/sector: 512
sectors/track: 15
tracks/cylinder: 2
sectors/cylinder: 30
cylinders: 80
total sectors: 2400
rpm: 300
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

4 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:     2400        0    4.2BSD      512  4096    16   # (Cyl.    0 - 79)
  b:     2400        0    unused      512  4096         # (Cyl.    0 - 79)
  c:     2400        0    unused      512  4096         # (Cyl.    0 - 79)
  d:     2400        0    unused      512  4096         # (Cyl.    0 - 79)
vader# 
vader# newfs -m 0 -o space -i 6144 -c 80 /dev/rvnd0a floppy5
/dev/rvnd0a:    2400 sectors in 80 cylinders of 2 tracks, 15 sectors
        1.2MB in 1 cyl groups (80 c/g, 1.17MB/g, 192 i/g)
super-block backups (for fsck -b #) at:
 32,
vader# 
vader# mount /dev/vnd0a /mnt
vader# sh
# TOPDIR=/usr/src/distrib/i386/floppies/bootfloppy/.. CURDIR=/usr/src/distrib/i386/floppies/bootfloppy OBJDIR=/usr/src/distrib/i386/floppies/bootfloppy/obj  TARGDIR=/mnt sh /usr/src/distrib/i386/floppies/bootfloppy/../runlist.sh /usr/src/distrib/i386/floppies/bootfloppy/../bootfloppy-common/list
COPY    ${OBJDIR}/netbsd.ram.gz netbsd.gz
# exit
vader# 
vader# df -i /mnt
Filesystem  1K-blocks     Used    Avail Capacity iused   ifree  %iused  Mounted on
/dev/vnd0a       1147     1036      111    90%       2     188     1%   /mnt
vader# 
vader# rm -f /mnt/boot
vader# umount /mnt
vader# /usr/mdec/installboot -v -f /usr/mdec/biosboot.sym /dev/rvnd0a
/usr/mdec/biosboot.sym: entry point 0
proto bootblock size 29184
room for 5 filesystem blocks at 0x4c0
/dev/vnd0a is not mounted
mounted /dev/vnd0a at /tmp/installboot014724
unmounting
Will load 42 blocks.
dblk: 2192, num: 8
dblk: 2200, num: 8
dblk: 2208, num: 8
dblk: 2216, num: 8
dblk: 2224, num: 8
dblk: 105, num: 2
BSD partition starts at sector 0
vader# cat /*bin/* > /dev/null
vader# vnconfig -u /dev/vnd0d
vader# 

----Next_Part(Fri_Jul__4_19:09:32_1997)----