Subject: NetBSD/pc532 binary snapshot #2
To: None <port-pc532@sun-lamp.cs.berkeley.edu, pc532@bungi.com>
From: Raymond A. Wiker <etorwi@hisoy.etn.ericsson.se>
List: port-pc532
Date: 04/18/1994 09:11:00
	Hi, all. I've just been looking at the second binary snapshot,
and the short summary of my experiences is that the tar files were OK,
and the new kernels seem more stable than those of just over a month
ago, and much more stable than those I built myself about three weeks
ago. The RAM root image also contained everything that was required,
although I think that the previous version (from the first snapshot)
lacked a few essentials - maybe Julian Stacey was too quick off the
mark after the announcement, and got some old files?

	Thanks again to Phil, who has done a great job and given us a
freely distributable OS that does justice to the pc532!

	I didn't use the install script, because I have a (small!)
Minix partition just after the boot images partition, and I need this
for transferring files to/from the system, as my QIC-150 drive does
not work under NetBSD (yet). A brief description of how I did this may
be of interest to others:
	
	0) This is from memory, and may contain errors. It is also
somewhat dependent on my setup. Caveat Emptor.

	1) I started with a tape containing all the tar files, the
root image and the kernels. 

	2) First of all, I booted Minix and used hdsetup to create two
new partitions for NetBSD, one for swap and one for root; I used the
first two partitions since the kernels expect to find root at
partition 0 (sd?a) and swap at partition 1. I could also have made a
separate /usr partition, but I didn't this time. If I had, I would
have made a 15 MByte root partition, and allocated the rest to
/usr. Note: It is also necessary to make one partition the whole disk;
traditionally this is partition "c", but I made both "c" and "d"
(partition 2 and 3) map the whole disk.

	Some additional notes: My version of Minix does not use the
disklabel for anything, although the monitor understands enough to
find the images partition, and boot from a specified image. I have to
recompile Minix each time I change the partitions that I need to
access from Minix, but I don't expect I will ever compile Minix
again... 
	
	In hdsetup, FS type 0 is unknown or unused, type 1 is swap,
type 7 is BSD FFS, and type 10 is full disk. For the FFS partitions I
chose frag size=512, frags/block=8 (block size=4096), cyls/group=16.
I'm not certain whether the last figure is reasonable, as I got only
2.5 MBytes per cylinder group - comments, anyone?

	3) Then, I extracted the RAM root kernel (netbsd.rd.gz) and
RAM root fs, gunzipped them and dd'ed them to the start of the root
partition:
	% dd if=netbsd.rd of=/dev/hd4
	% dd if=ram.root of=/dev/hd4 bs=512 seek=1000
	(/dev/hd4 is a Minix partition that corresponds to partition 0
in the disklabel. The correlation between my Minix disk layout and the
bsd disklabel is not complete ;-)

	4) I then dd'ed the tar file containing all the tar files,
kernels etc to the swap partition:
	% dd if=/dev/rst0 of=/dev/hd5
	(/dev/hd5 corresponds to the second BSD partition (swap), and
rst0 is my QIC-150 tape drive.)

	5) Then, I exited Minix, and did the following from the
monitor:
	> init
	> baud d'19200
	(Only necessary if you have a 9600 baud monitor. In fact,
yesterday was the first time I got the "baud" command to work - I
never realised that hexadecimal was default for the baud rate...)
	> read d'100512 2000 400
	> read d'101512 200000 d'3000
	(My first BSD partition starts at block d'100512, and I put
the ram.root 1000 blocks after the start of the partition.)
	> run 2020
	(NetBSD boots from RAM-disk.)

	6) Once into NetBSD, I did the following:
	# mount -u /
	# newfs /dev/rsd0a
	# mount /dev/sd0a /mnt
	# cd /
	# tar -cf - .profile script dev etc | (cd /mnt; tar -xvBf -)
	(There may be other files that should be copied as well; I
don't remember at the moment.)
	# cd /mnt
	# tar -xvf /dev/rsd0b
	(Extracts all the binaries from the swap partition (which is
not used from the RAM-disk kernel), and puts them in the directory
"bins".)
	# for i in bins/*.tar.gz; do
	# if [ "$i" != "bins/util.tar.gz" ]; then
	(util.tar.gz is not needed for this method of installation.)
	#    tar -xzf $i
	# fi
	# done

	(Set the path so that we have access to all the binaries just
extracted.)
	# PATH=/bin:/usr/bin:/sbin:/usr/sbin:.; hash -r; export PATH
	(Now, copy the right kernel to /mnt, which will be the new
root. I am using disk 0.)
	# cp bins/netbsd.sd0.gz .
	# gunzip netbsd.sd0.gz
	# mv netbsd.sd0 netbsd

	# hdsetup /dev/rsd0c
	(hdsetup has been extracted... This assumes that rsd0c is
setup as the whole disk, and that there is a boot image partition.)
	> add netbsd
	(Adding image netbsd, with name "netbsd".)
	> exit
	(Writing headers...)

	# cd /mnt/etc
	# echo "/dev/sd0a   / ufs rw 1 1" > fstab
	(This assumes that you are installing on disk 0. You could of
course use an editor for this, as vi, ed and mg have now been
extracted. The problem is that the /tmp files for vi may not exist,
the termcap file may not be on the ram root and you have to set TERM
to run vi or mg...)

	# sync; halt
	(Back to monitor.)

	> init
	> baud d'19200
	> boot netbsd
	(Boots netbsd, with root on sd0a, swap on sd0b.)

	# cd script
	# sh maketrees
	(This command should work without problems - I only saw an
error message about "Couldn't open MAKEDEV.local".)
	# vi makeetc
	(The makeetc script is slightly broken - the variable settings
for BINOWN, BINGRP and BIN1 are not valid sh syntax. Remove the
space(s) after the "=" sign, and put quotes about the value that
should be assigned to BIN1. Also, the variables MTREE and NAMEDB are
not given values - I don't know what they should be. The "install"
command for BIN1 may need to be evall'ed, since BIN1 now is a single
string of names - just put "eval " in front of "install".)
	# sh makeetc
	(This command should also work, now - I got warnings because I
hadn't set the variables MTREE and NAMEDB.)
	
	(You should now have a system that is ready to go multiuser as
soon as you exit from the current shell.)

	# exit

	If you have a tape monitor, it may be possible to do this with
4 tapes, or a single tape containing 4 files: a disklabel, the
ram-disk kernel, the ram root and the binaries tar file. This is left
as an exercise (meaning that I'm not to clear on the details ;-)

	I hope this may be of help to somebody.

	//Raymond.


Raymond Wiker / etorwi@hisoy.etn.ericsson.se / ETO.ETORWI
C/o Ericsson A/S, Boks 44, 4817 HIS, NORWAY / Tel +47 370 51482

------------------------------------------------------------------------------