Subject: Re: FAQ or other info starting points?
To: None <netbsd-users@netbsd.org>
From: Thomas J. Trebisky <tom@as.arizona.edu>
List: netbsd-users
Date: 10/07/1994 17:21:48
	How I got 1.0_Beta onto my cold dead hardware.


Apology, Disclaimer, and general cop-out
_________________________________________

There is probably a much easier way to do all this.  I could surely do this in
a few hours instead of a few days now that I have done it once.  There are almost
surely mistakes and grevious misadvice in the outline that follows, but it may
be a real help to the utter neophyte, and should be a source of mirth and amusement
to the experienced veteran.  On the other hand, I have had a lot of fun,
both doing all this and even typing this little blurb into the computer.
If you try this and everything goes haywire and you loose all your data, you
should have expected that from the very beginning, you should have expected
it to happen many times before you achieved success, don't say I didn't warn
you.

Introduction:
--------------

I have been fooling around with NetBSD, at least the sources ever since its
first days, mostly with ideas of doing a port to a m68k box.  Actually I
started with 4.3BSD and then the Jolitz 386bsd stuff appeared.  But anyway
to make a long story short I have never had hardware that could run an
out-of-the-can NetBSD untill just recently.  Well the tides here at work
brought me the hardware and the approval to give NetBSD a whirl (my boss is
suspicious that I will spend all my time fooling around kernel hacking,
and maybe he is right).  So I find a 486 PC with a 540M IDE drive here in
my office with nothing but DOS on the hard drive.  My challenge is: given
a set of 3 floppies (holding the 0.9 release), and access to the net to
get NetBSD running on this machine.

If you are bored reading this by now, give up, it will only get worse.
But I am writing this to give a hint or two to those who may try to do what
I spent several days doing in the interim before an official 1.0 release
comes out.  Murphy's law being what it is, my taking the time to generate
a document like this virtually guarantees that this will happen early
tomorrow morning and that all this is a waste of my time, but you never
know.

Preparation:
____________

My particular hardware includes a single 1.44M floppy drive, and a 3com
network card (etherlink-II, 8-bit, 3c503).  I also have access to
numerous other computers with network connectivity.  Some of these run
DOS and have the capability to ftp files from most anywhere and then I
can use rawrite to put those on floppies.

First get the images of the 3 0.9 boot floppies and use rawrite to put
them onto 3 formatted floppy disks.  While you are getting rawrite.exe
from someplace (perhaps ftp.cdrom.com in tools/dostools or some such),
also get pfdisktc and os-bs if you want to coexist with dos as I did.
Put these on a 4th floppy which you have previously made dos-bootable.
(sorry, I am not going to go thru all the details of these steps, you
have to sweat a little bit to do all this).  Boot the dos floppy and
run pfdisk and partition your hard drive to suit your fancy, pfdisk
comes with documentation and is a much better tool than dos FDISK,
which isn't really saying a whole lot.  I partitioned my 540M drive like
this:

	1	4	0	127	dos
	2	165	128	1047	netbsd
	3	0	0	0
	4	0	0	0

My drive is a Western Digital Caviar with 1048 cylinders, 16 heads, 63 spt.
I set aside the first 128 cylinders for DOS (roughly 64M) and the rest for
netbsd.  When this is done run os-bs and install the boot selector.
After this, I used another pair of floppies and installed DOS 5.0 on the
first partition and verified that I could boot it.

Now I boot the NetBSD-0.9 aha floppy and grind thru the install process which
is quite straightforward except for a point or two.  Lacking any other advice
I made the root partition 64 cylinders (about 32M) and the swap partition
64 cylinders (again 32M), Swap is thus about twice my ram (which is 16M), and
root is ample (I hope, it is now 33 percent full with the whole business done).

In order, what I type to the 0.9 install is:

	Size of NetBSD part	920*16*63 = 927360 (where 920 = 1048-128)
	Offset			128*16*63 = 129024
	Root			64*16*63  = 64512
	Swap			64*16*63  = 64512
	Next			792*16*63 = 798336
	Mount point	usr (not /usr)

After halting as requested, I reinsert the kernel floppy and after it
asks me to insert the fs floppy, I just leave the kernel floppy in and
hit return (you are supposed to do this) and then tell it to copy the
kernel to wd0a

Then just plow thru the rest of the procedure and soon you are running a
miniature version of 0.9

It was at this point I discovered two things:

	1) In the months since I made these 0.9 boot floppies, 0.9 has
	virtually disappeared from the net (due to legal hasslenoia),
	{   rumour has it you can get it over the pond, try:
		src.doc.ic.ac.uk /packages/NetBSD }

	2) 1.0 is out in Beta (under the pseudonym -current), but has
	no bootstrap procedure, you need to be running 0.9 to upgrade.

	3) (Three things, I forgot)  My 3c503 card under 0.9 can only
	run in thin-net mode thru the BNC connector, and in our shop
	the only hookups possible are thru an AUI cable, if I could have
	borrowed a thin-net repeater, life would have been trivial, but
	this was not to be.

Jason Thorpe gave me a number of valuable suggestions at this point in time,
and essentially convinced me that running 1.0-Beta was a more sensible thing
to do than chasing after 0.9 and gave me some clues as to how to go about it.

Making the switch:
___________________

I discovered on ftp.iastate.edu what looks a lot like a binary snapshot
of -current (dated 8-1-94 it turns out).  Also after looking thru the
0.9 stuff on my drive I see mread, so my options boil down to ftp-ing
stuff to one of our machines and putting on floppies some adequate
subset of the -current stuff and floppy-netting these onto my NetBSD
box using mread.  Defining an adequate subset is a bit tricky, if I had
ftp running, It would have been easy, I would have grabbed everything.

Here is what I did dump into /usr/current:

	netbsd-aha
	bin.tar.gz
	usr.misc.tar.gz

	from sbin.tar.gz : halt ifconfig init mknod mount reboot
				route shutdown umount
	from usr.bin.tar.gz  : ftp gunzip tar more
	from usr.sbin	     : update bad144

These last I fiddled with on one of our suns, I extracted the files I wanted
and then transfered them via floppies to avoid the problem that the tar.gz
files for some of these would not fit on a floppy.  I tried to use the guide
of replicating everything I found in the 0.9 mini-unix or whatever you wanna
call it.  All of this junk is accumulating in /usr/current, so I haven't
made any commitments yet.

Next, I made a couple directories that I called /bin9, /sbin9 and /usr/bin9 and
put the 0.9 executables I would need in them by doing cp /bin/* /bin9 and
the like.  Then I reset the path via PATH=:/bin9:/sbin9:/usr/bin9:.......
You get the idea, then I began untarring and putting the stuff from
/usr/current into their proper homes, all the time wondering what I had
forgotten (it turned out this was /usr/libexec and /usr/lib, see below).
The final step was to copy /usr/current/netbsd-aha to /netbsd

Then I held my breath and rebooted - amazingly it booted up, but complained
about no ld.so.  Rats, and it turns out I am running 1.0 now but cannot run
ftp since it is linked to use the shared library which I forgot, and I have
lost mread.

Getting the shared libraries:
_____________________________

This really belongs in the preparations to the reboot, but here is what I
did.  On one of our suns, I split the /usr/libexec.tar.gz into two pieces
so as to fit them onto a single 1.44 floppy using dd:

	dd if=usr.libexec.tar.gz of=part1 count=2000
	dd if=usr.libexec.tar.gz of=part2 skip=2000

Then I ftp-ed these to a PC and used rawrite to put them on floppies.
Then on the netbsd box I did this:

	dd if=/dev/rfd0a of=part1 count=2000
	dd if=/dev/rfd0a of=part2 count=xxxxx
		where xxxxx is the block count reported by the last dd
		above plus one for the partial last block.

	cat part1 part2 | gunzip >usr.libexec.tar

gunzip whines a bit about the extra junk at the end of the file, but does
its job just fine in any event

This process was repeated for usr.lib.tar and we are getting pretty close
to up and running.

Getting the network going:
__________________________

My 3c503 gave some grief.  It turns out that this card cannot be jumpered to
be a ed0 interface, but it can be set up as a ed1 interface by setting its
i/o address to 0x250 and iomem to 0xd8000
	(looking at src/sys/arch/i386/conf/GENERICAHA was the tipoff here).

Once this was done the kernel found the card at bootup during autoconfig and
reported it which was a moment of joy.  After this the line:

ifconfig ed0 128.196.xx.xx netmask 0xffffff00 link0

got me up and running on my AUI cable, and with the shared libraries I can
run ftp now and connect to a site on our local net (namely one of our suns
where I had dumped all the stuff from iastate).  To go to iastate directly
would have required another line like:

route add default 128.196.xxx.xxx

to tell the new system about our gateway ....

At this point I used ftp to get the full binary distribution of
1.0 and installed everything by running ( cd / ; tar xvpf /usr/current/xxx.tar )
over and over again on all the .tar files.

Final details:
______________

I made the mistake of running the 0.9 configure script as-is.
It mostly worked right, but I had to fiddle with the hostname.ed1
file and add a field for the broadcast address that is apparently an
addition to the 1.0 world.

I forgot to run /dev/MAKEDEV and the boot up fell on its face trying to find
/dev/ttyv0, this was fixable by typing a ^C during a reboot and miraculously
getting a single user shell (well, something like that).
I was careful to flush out a few apparently obsolete special files from 0.9.

The next mistake was to let the system go multiuser before setting a root
password (oops) -- and you don't just edit the /etc/passwd file either, that
doesn't do a bit of good, use the passwd program.  Use a quick finger at the
keyboard and type netbsd -s when it prompts briefly before booting netbsd,
this will get you a single user shell and you can set a password.

The last things I did were to rip-off /etc/hosts and /etc/resolv.conf from
one of our suns and put the name of our gateway into /etc/mygate and things
now seem pretty civilized.  Just need to add a username for myself and then
get in the groove with a more current version of current.  Then on with the
adventure.

GOOD LUCK!