home *** CD-ROM | disk | FTP | other *** search
/ Amiga GigaPD 3 / Amiga_GigaPD_v3_3of3.iso / netbsd / docs / netbsd.install.720 < prev    next >
Text File  |  1993-06-25  |  37KB  |  982 lines

  1. How To Get NetBSD Going on Your Amiga - A Beginner's Guide
  2. ----------------------------------------------------------
  3.  
  4. v0.03 (Draft) December 1993 - use with kernel vmunix.714 or vmunix.720
  5.  
  6. This is a short note I wrote to help other people installing NetBSD
  7. for the first time: I am no expert, I am a beginner too, and hopefully
  8. this will be beneficial to the simplicity of this note. I would
  9. appreciate any comments by e-mail to dcc@dcs.ed.ac.uk, or by post to
  10. 12 West Savile Tr, Edinburgh, SCOTLAND EH9 3DZ.
  11.  
  12. Additions to this note by Alan Bair <abair@amcu-tx.sps.mot.com>
  13.  
  14. Please note that NetBSD for the Amiga is under continual development,
  15. and any documentation inevitably goes out of date as soon as it is
  16. written - so don't take this as absolute truth!
  17.  
  18.  
  19. 1. What is NetBSD?
  20.  
  21. NetBSD is a copyrighted but freely distributable version of the BSD
  22. variant of the Unix operating system - in layman's terms, it's Unix.
  23. When it runs on an Amiga, it takes over the entire machine, turning it
  24. into a Unix workstation. You cannot run AmigaOS (Workbench) at the
  25. same time.
  26.  
  27.  
  28. 2. What kind of Amiga do I need?
  29.  
  30. You will need an Amiga with:
  31.  
  32.     a. An MMU (i.e. 68020+68851, 68030 (not EC), or 68040 (not EC/LC))
  33.        and FPU (i.e. 68881/68882, or built into 68040 as above)
  34.  
  35. In particular, this rules out standard A1200's and A4000/030's, and
  36. most A1200 accelerator cards. Currently, all 68040-based Amiga systems
  37. (A4000, PPI, Fusion, etc.) have full MMU and FPU.
  38.  
  39.     b. A supported hard disk controller
  40.  
  41. Currently, supported controllers include the A3000 builtin, A2091, PPI
  42. Zeus and GVP Series II. Support for other controllers is being worked
  43. on; in particular, someone should be supporting the A1200/A4000
  44. builtin IDE fairly soon. You CAN currently use an A4000/040 provided
  45. you have a supported SCSI controller (i.e. on a Zorro card) and enough
  46. disk space for NetBSD on the SCSI side. The AmigaOS support stuff can
  47. be kept on your IDE drive(s).
  48.  
  49.     c. Enough memory 
  50.  
  51. 4Mb of FastRAM is a minimum, and at least 8Mb is strongly recommended.
  52. You will need at least 1Mb of ChipRAM due to the way the kernel is
  53. loaded.
  54.  
  55. People are already running NetBSD successfully on a wide variety of
  56. Amigas; the traditional A3000's, A4000's with SCSI add-ons, and
  57. heavily expanded A2000's and even A500's. I used to have an A1000
  58. setup which would run it :-)
  59.  
  60.  
  61. 3. How much disk space will it take?
  62.  
  63. A lot. As much as you can spare and then some :-) Realistically, you
  64. need around 100Mb to install a useable system, before you do anything
  65. with it. Read the rest of this note to help you decide what your
  66. requirements will be.
  67.  
  68. Many people purchase another hard disk specifically for NetBSD -
  69. naturally, you should get the largest one you can justify ;-), but it
  70. should be at least 200Mb in size.
  71.  
  72.  
  73. 4. How can I find out more?
  74.  
  75. a. Join the NetBSD mailing list - send an e-mail message to
  76. netbsd-admin@cbmuucp.commodore.com with the body "subscribe". Note
  77. that NetBSD is not a Commodore product and is in no way associated
  78. with any of their companies.
  79.  
  80. b. Subscribe to the Usenet News group comp.unix.amiga
  81.  
  82.  
  83.  
  84. Installing NetBSD
  85. -----------------
  86.  
  87. Installation is best done in two phases:
  88.  
  89.    1. Obtain the AmigaDOS bootstrap tools and root filesystem image
  90.       and install and test them
  91.  
  92.    2. Set up partitions and install the system software and 
  93.       applications you need
  94.  
  95. Before describing these procedures, I will briefly discuss the Amiga's
  96. RDB hard disk paritioning mechanism and the Unix file system.
  97.  
  98. Before you install anything, read through the entire procedure
  99. carefully and think about how you want to divide up your disk space.
  100.  
  101.  
  102.  
  103. The Unix File System
  104. --------------------
  105.  
  106. Unlike most operating systems, in which the file system is a
  107. collection of separate devices with a tree of directories on each,
  108. Unix views the file system as one big tree - like all good computer
  109. trees, it is upside down, with the root at the top. Distinct trees of
  110. files (e.g. different disks or partitions, or even file systems from
  111. another computer on a network) are plugged in at various points in
  112. the tree (this action is called "mounting").
  113.  
  114. When choosing how to partition your system, remember that Unix file
  115. systems have soft links - this allows directories or even individual
  116. files to be placed elsewhere in the file system (e.g. in another
  117. partition) with a link pointing to the real location. So accurate
  118. partitioning isn't as crucial as with other operating systems. In the
  119. final event you can always back up your files, repartition and
  120. reinstall once you have used NetBSD for a while and get to know your
  121. needs better.
  122.  
  123.  
  124.  
  125. The Amiga RDB System
  126. --------------------
  127.  
  128. The Rigid Disk Block (RDB) is the mechanism the Amiga uses to store
  129. information about hard disk partitions. The first cylinder of any hard
  130. disk (or similar device on a SCSI bus) is reserved for this
  131. information. When you partition a disk (with HDToolBox, FaastPrep,
  132. etc.) the partitioning program will write this data on the disk - when
  133. the computer boots under AmigaOS, it reads this to determine what the
  134. partitions of the disk are, what filing systems they have, whether or
  135. not it should mount them automatically, and whether they can be used
  136. to boot the system.
  137.  
  138. NetBSD also uses the RDB information to locate its partitions on the
  139. hard disk(s); however, it ignores the AmigaOS partition names, and
  140. instead uses the DosType designator to identify the different BSD
  141. partitions.
  142.  
  143. The DosType is a four byte field; the AmigaOS filing system types are
  144. given by the characters "DOS" followed by a number (currently from 0
  145. to 3, e.g. OFS is 0, FFS is 1, DCFFS is 3). In hexadecimal, the code
  146. for FFS is "0x444F5301".
  147.  
  148. NetBSD partitions use this field to identify the partition name; the
  149. root partition is named ASCII "BSDR", i.e. 0x42534452, swap is "BSDS"
  150. (0x42534453) and other partitions are "BSDD", "BSDE" etc. (0x42534444,
  151. 0x42534445 etc.)
  152.  
  153.  
  154.  
  155. Phase I - Installing Root and Booting NetBSD
  156. --------------------------------------------
  157.  
  158. *******************************************************************
  159. * It is STRONGLY recommended that you back up all your hard disks *
  160. * before attempting to install NetBSD                             *
  161. *******************************************************************
  162.  
  163. You will need to obtain the relevant files from ftp.eunet.ch or one of
  164. the mirror sites. At eunet the files are in directory
  165. "pub/NetBSD-Amiga", the kernel binaries are in
  166. "pub/NetBSD-Amiga/kernel", and some tools are in
  167. "pub/NetBSD-Amiga/contrib/ados". Some of the utilities you may already
  168. have, and some may be available from other places which do not carry
  169. NetBSD. All filenames will henceforth assume the NetBSD-Amiga directory.
  170. Also check "pub/NetBSD-Amiga/incoming" for recent updates.
  171.  
  172. Disk space: You'll need about 15-20Mb as a minimum on the AmigaDOS side
  173. for tools and bits and pieces; temporary space to unpack stuff is
  174. virtually essential as well (unless you have loads and loads of RAM).
  175. You will need to make two of the NetBSD hard disk partitions; one for
  176. the rootfs (10Mb for the 720 version, 8Mb for the old version), and one
  177. for the swap (at least twice the size of your FastRAM).
  178.  
  179. The swap partition serves two purposes - it acts as backing store for
  180. the virtual memory system, and it is also used for the /tmp directory
  181. (which stores temporary files like the T: directory in AmigaOS). If
  182. you have a lot of programs running simultaneously you will need more
  183. virtual memory; if it runs out you will have problems. It is
  184. recommended that the size of the swap partition is (a) at least twice
  185. the RAM size and (b) at least 32Mb.
  186.  
  187. Before doing this part of the installation, read the rest of this note
  188. and decide what you want your final disk partitions to look like.
  189.  
  190. In the rest of this note, commands to by typed in to the computer
  191. appear like this:
  192.  
  193.    dir
  194.  
  195. Where output is also shown, a prompt will also be shown with the
  196. commands: if it ends in "$", it is a NetBSD shell prompt; a ">"
  197. indicates the AmigaOS shell:
  198.  
  199.    1.SYS:NetBSD> dir                          ; AmigaOS
  200.  
  201.    root(6)$ ls                                ! NetBSD
  202.  
  203.  
  204. Software you will need:
  205.  
  206. 1. gzip (GNUzip) - this is the GNU file compression utility. available
  207. from Aminet and elsewhere. All the NetBSD stuff is compressed with it.
  208.  
  209. 2. filetodev - this (dangerous toy) writes blocks of data to a disk
  210. "in the raw". You will use to lay down the rootfs image. It is
  211. provided with BFFS in the file "contrib/ados/bffs11.lzh". (Once you
  212. have NetBSD up and running, BFFS allows you to read files in NetBSD
  213. partitions while using AmigaDOS).
  214.  
  215. An alternative to this is DCP which allows you to specify partitions
  216. rather than block numbers. It is in the file dcp1.1.lha. There is also
  217. the streamtodev program which again allows the use of partition names.
  218. It is in the file device-streams.tar.gz.
  219.  
  220. 3. loadbsd - this AmigaOS program boots NetBSD. Get the newest version
  221. in NetBSD-Amiga/bin (currently named "loadbsd")
  222.  
  223. 4. A kernel image, from the subdirectory "kernel". The current version
  224. is "vmunix.714", which does not include 68040 support. Later kernels
  225. will do so. Earlier kernels have different versions for use with the
  226. 68040, e.g. "vmunix.713-040". At the time of writing vmunix.720 has
  227. been released with a new set of shared library binaries, but is not
  228. yet stable on many configurations. However, if you have an A4000, you
  229. should use vmunix.720    
  230.  
  231. 5. A root file system image. The latest one, dated 18-dec-93, which is 
  232. 20480 blocks (10Mb) when unpacked, is called "rootfs_720.gz". This
  233. image contains the vmunix.720 kernel. The old version, dated 13-Jun-93, 
  234. which is 16448 blocks (about 8Mb) when unpacked, is called
  235. "rootfs.gz".
  236.  
  237. You should get the latest version you can irrespective of what kernel
  238. you will be using.
  239.  
  240. You will also need a suitable AmigaDOS hard disk partitioning utility;
  241. it is recommended that you use Commodore's own HDToolBox, as certain
  242. 3rd party products (notably GVP's "FaastPrep") will not allow you to
  243. make the settings you need.
  244.  
  245.  
  246. Doing the installation:
  247.  
  248. 1. Download and unpack the files mentioned above and have them ready
  249. to use on your Amiga. e.g. to unpack rootfs.gz, "gzip -d rootfs.gz".
  250. The AmigaOS utilities will be packed with things like LhA. Note the
  251. size in blocks of the rootfs you have downloaded - this can be
  252. calculated by getting the size in bytes of the unpacked version from
  253. the AmigaOS "list" command and dividing by 512:
  254.  
  255.    size in blocks = size in bytes / 512
  256.  
  257. The 720 rootfs is 20480 blocks in size, and the old one was 16448
  258. blocks; wherever you see the number 20480, substitute the size you
  259. have calculated.
  260.  
  261. 2. Start up HDToolBox - if you have a GVP or other non-Commmodore
  262. controller, you will need to start it from the shell (CLI) and give it
  263. the name of the device driver (e.g. for GVP II "hdtoolbox gvpscsi.device")
  264.  
  265. Note the SCSI unit numbers of the various devices (disks, tapes,
  266. etc.). NetBSD assumes disks will be devices 0-3 and 6, and tapes (if
  267. any) 4 & 5. If your system doesn't fit into this, it is suggested that
  268. you change it (AmigaDOS won't care). If you just have one hard disk to
  269. be used with NetBSD, make it unit 6 if possible (some people have
  270. reported problems when using other unit numbers). The unit number of a
  271. SCSI device can usually be changed using a set of 3 jumpers found on
  272. the device, or in the case of pre-boxed units by a dial on the back.
  273.  
  274. You need to know the number of blocks per cylinder for the drive on
  275. which you will make the root partition. You can find this out from the
  276. drive type editor in HDToolBox:
  277.  
  278.    - From the main screen, select the drive in question
  279.    - Click "Change Drive Type"
  280.    - Click to select the type matching the drive
  281.    - Click on "Edit Old Drive Type" or if none are listed, click on
  282.      "Define new drive type", "Read Configuration From Drive" then
  283.      "CONTINUE" to get the selected drives characteristics.
  284.    - Note the number of heads and blocks per track
  285.    - Click "Quit" etc. to get out of this mode
  286.  
  287. The number of blocks per cylinder is the number of heads multiplied by
  288. the number of blocks per track. 
  289.  
  290. Note: This drive "geometry" is imaginary; most hard disks put a
  291. variable number of blocks on a track depending on its radius, and SCSI
  292. devices talk in block numbers, but AmigaDOS likes to have cylinder,
  293. head and block. Therefore you can have different geometries for
  294. different drives of the same type depending on how they were first
  295. partitioned, what controller you have, etc. DO NOT trust values from a
  296. leaflet that came with the drive, find out from HDToolBox.
  297.  
  298. 3. You will create the BSD partitions on the respective disks using
  299. the following procedure - instructions refer to the HDToolBox supplied
  300. with AmigaOS 2.04; other versions or other RDB editors may be slightly
  301. different:
  302.  
  303.    - Select the drive by clicking on it
  304.    - Click on "Partition Drive" (HDToolBox partition mode)
  305.    - Click on "Advanced Options" to turn them on
  306.    - Click on "New Partition"
  307.    - Click on the empty space where the partition will go
  308.    - Grab the arrow under the partition and adjust the size
  309.    - Grab the partition box (black rectangle) and move it if need be
  310.    - Change the "Bootable?" option to "No"
  311.    - Click in the device name box (marked "CHANGE_ME") and alter it
  312.      to something sensible (NetBSD doesn't care)
  313.    - Click on "Change File System for Partition" (HDToolBox File
  314.      System Menu). You will find the default setup (usually FFS)
  315.    - Click on "Custom File System"
  316.    - Change "Blocks Reserved" and "PreAlloc" to 0 
  317.    - Change "Auto mount this partition?" to "No"
  318.    - Change "Use Custom boot code?" to "No"
  319.    - The "Identifier" or "DosType" box will show something like
  320.      0x444F5301 (FFS). Change this to the BSD partition identifier
  321.      (e.g. for the Root Partition, 0x42534452, "BSDR")
  322.    - Click "OK" to return to partition mode
  323.    - Note the "Start Cylinder", "End Cylinder" and "Total Cylinder"
  324.      numbers for the partition, and note the SCSI device number 
  325.      (usually 0 to 6) of the disk it is on
  326.    - If all partitions for this drive are done, click "Ok" to return
  327.      to the main screen. Click "Save Changes to Drive". If you are
  328.      overwriting old partitions you will get a warning - if you're
  329.      not sure what you've done is right, think again, but if you are, 
  330.      click "Continue".
  331.  
  332. 4. Create a partition for the rootfs using the method above; it should
  333. be exactly or just over the size of the rootfs you downloaded (i.e.
  334. Total Cylinders * Blocks Per Cylinder >= 20480 Blocks for 720 version)
  335. any extra space will be wasted for the moment, but once you have NetBSD 
  336. running it is possible to rebuild the rootfs, so if you want to leave a 
  337. bigger space for it, that's OK. The partition type should be 0x42534452 
  338. (ASCII "BSDR").
  339.  
  340. 5. Create a swap partition - this will be used as swap space for
  341. NetBSD's virtual memory, and for scratch space (the /tmp directory).
  342. It should be at least TWICE the size of the Amiga's RAM. The partition
  343. type should be 0x42534453 ("BSDS"). NetBSD only uses swap space when
  344. running (no permanent files are stored on it), so you can use it as
  345. scratch space for AmigaDOS in between NetBSD sessions (e.g. as swap
  346. space for GigaMem) if you like.
  347.  
  348. 6. You are now finished with HDToolBox - if you have overwritten old
  349. partitions, it will force you to reboot when you quit.
  350.  
  351. 7. Now we will put the rootfs image in the partition we reserved for
  352. it. 
  353.  
  354. ********************************************************************
  355. * You are reminded again of the advice to back up the rest of your *
  356. * system. This stage is highly dangerous and one mistake could     *
  357. * trash the contents of your hard disk(s)!                         *
  358. ********************************************************************
  359.  
  360. We need to know which block number the partition starts at, which
  361. we calculate as:
  362.  
  363.    Start Block = Start Cylinder * Blocks Per Cylinder
  364.  
  365. using the values for the drive you noted in stage 2, and the cylinder
  366. numbers for the partition from stage 3. If you forgot to note this, go 
  367. back into HDToolBox and check the values.
  368.  
  369. Calculate the size in blocks, using:
  370.  
  371.    Size = (End Cylinder - Start Cylinder + 1) * Blocks Per Cylinder
  372.  
  373. This size should be at least as large as the rootfs image (20480 or
  374. more blocks). If it isn't, go back to stage 4 and make it bigger.
  375.  
  376. Ensure that the image is uncompressed, i.e. you have an AmigaDOS file
  377. "rootfs_720" of size 10485760 and not "rootfs_720.gz".
  378.  
  379. We will use the filetodev program to write the image to the disk; it
  380. takes 6 parameters:
  381.  
  382.    - the start block number
  383.    - the image size (i.e. 20480 or whatever, not the partition size)
  384.    - the name of the file (e.g. "rootfs_720")
  385.    - the AmigaDOS device name for your controller
  386.         (e.g. "gvpscsi.device")
  387.    - the device number of the disk
  388.    - the number of buffers to use (e.g. 1000)
  389.  
  390. Example: I have an A3000, and I am placing my NetBSD partitions on a
  391. Maxtor 7345SR which is unit 6 (using the built-in SCSI controller).
  392.  
  393. Geometry for the Maxtor, from HDToolBox:
  394.  
  395.    Unit = 6
  396.    Cylinders = 3518
  397.    Heads = 1 (not true in reality; see stage 2)
  398.    Blocks Per Track = 192
  399.  
  400. I calculate Blocks Per Cylinder = 1 * 192 = 192
  401.  
  402. The BSDR partition:
  403.  
  404.    Start Cylinder = 3408
  405.    End Cylinder = 3517
  406.    Total Cylinders = 110
  407.  
  408. Start block: 3408 * 192 = 654336
  409.  
  410. I check the size: (3517 - 3408 + 1) * 192 = 21120   (bigger than 20480)
  411.  
  412. I use the following command:
  413.  
  414.    filetodev 654336 20480 rootfs_720 scsi.device 6 1000
  415.  
  416. Note: If filetodev scares the willies out of you (I have trashed my
  417. AmigaDOS system partition more than once with it), some kindly person
  418. (Chris Hooper) has written a slightly less dangerous tool, called
  419. "dcp". Another possiblity is devtostream, written by Chris Hopps.
  420. Get them from the ftp site and use it instead if you like.
  421.  
  422. 8. If there are any patches you know are *definitely* required to run
  423. the kernel you have on your system, you may as well apply them at this
  424. stage. See the section below on how to use binpatch.
  425.  
  426. If you are using an A4000, you need kernel version vmunix.720 or
  427. later, which has a flag to tell it you are using an A4000 (it's
  428. actually very difficult for the kernel to determine automagically
  429. which Amiga you have), and you need to patch it thus:
  430.  
  431.    binpatch -s _a4000_flag -r 1 vmunix.720
  432.  
  433. 9. You are now ready to test NetBSD in single user mode. Use the 
  434. versions of loadbsd and vmunix that you got (ensure that they have
  435. been decompressed first), e.g.
  436.  
  437.    loadbsd vmunix.714
  438.  
  439. If all goes well, the Amiga will go through a soft reboot, and you
  440. should see a plain screen with something like:
  441.  
  442.    (C) ....... Regents of the University of California
  443.    ..... godzilla.eunet.ch....
  444.    AMIGA A3000 (68030, 68882 25MHz FPU)
  445.    ....
  446.    sd6: Maxtor 7345 rev. 9.60
  447.    ....
  448.    root device /dev/sd6a
  449.    ...
  450.  
  451.    root(1)$ _
  452.  
  453. NetBSD is running in single user mode, and the prompt is from the
  454. shell (bash). Try a few simple commands (e.g. "ls -l"). When bored,
  455. use the command "reboot".
  456.  
  457. If it doesn't work, look for suggestions below, and ask for help on the
  458. News and mailing list forums.
  459.  
  460.  
  461. Problems With Booting NetBSD 
  462. ----------------------------
  463.  
  464. Getting the kernel to boot into single-user mode is 90% of the battle
  465. in getting NetBSD to work. A few common problems are:
  466.  
  467. 1. NetBSD boots but hangs shortly after recognising the hard disk
  468. types. This can be caused by NetBSD turning on drive sync and/or
  469. trying to do DMA to non-DMAable areas. Obtain the program "binpatch"
  470. from the ftp site (see below).
  471.  
  472. a. Drive sync - there is a table (an array of bytes) in the kernel
  473. which tells it not to enable synchronous transfers for individual SCSI
  474. devices; it is called "_inhibit_sync". The bytes are set to 1 to
  475. inhibit sync, 0 to allow sync. To turn off sync for drives 0-3:
  476.  
  477.    1.SYS:NetBSD> binpatch -s _inhibit_sync -r 0x01010101 vmunix.714
  478.    0x1426c: 0 (0x0)
  479.  
  480. for drives 4-7, calculate the address of the next word, using the base
  481. address of _inhibit_sync returned by binpatch, e.g. 0x1426c + 4 =
  482. 0x14270 (hexadecimal):
  483.  
  484.    1.SYS:NetBSD> binpatch -a 0x14270 -r 0x01010101 vmunix.714
  485.  
  486. However, if a drive is already set to synchronous mode by AmigaDOS, it
  487. may lock up the SCSI bus if sync is not enabled in NetBSD. To patch
  488. the value for a single drive, calculate the address of it's byte flag
  489. (base address of _inhibit_sync + unit number) and patch it, e.g. drive 6
  490.  
  491.    1.SYS:NetBSD> binpatch -a 0x14272 -b -r 0 vmunix.714
  492.  
  493. b. DMA - on some systems you might have a DMA SCSI controller, but
  494. have some FastRAM to which it cannot do DMA transfers, e.g. an
  495. accelerated A2000 with 32-bit FastRAM and a Zorro-II controller. If
  496. NetBSD tries to DMA directly to the 32-bit RAM it will crash. To turn
  497. off SCSI DMA, simply:
  498.  
  499.    1.SYS:NetBSD> binpatch -s _scsi_no_dma -r 1 vmunix.714
  500.  
  501. Note: the system will run much slower with DMA off, so only do it if
  502. you have to!
  503.  
  504. 2. The message "no suitable root" - this means the kernel couldn't
  505. find the root partition. You may have installed it incorrectly, like
  506. setting the "DOSType" hex value for "BSDR", but this message can also 
  507. appear if there are drive sync problems, etc. Check your installation 
  508. and apply the treatment above.
  509.  
  510. 3. The monitor goes crazy - some kernels may be set up to use default
  511. screen modes your monitor can't handle; try the following patch:
  512.  
  513.    1.SYS:NetBSD> binpatch -s _ite_default_height -r 200 vmunix.714
  514.  
  515.  
  516. How to Use "binpatch"
  517. ---------------------
  518.  
  519. The binpatch program allows you to change constants (statics) in the
  520. NetBSD kernel without recompiling it. It is capable of reading and
  521. using the symbol table (list of variable names) in the kernel binary,
  522. e.g.
  523.  
  524.    1.SYS:NetBSD> binpatch -s _scsi_no_dma -r 1 vmunix.714
  525.    0x1436ba: 0 (0x0)
  526.  
  527. Here, binpatch reports the address of the variable _scsi_no_dma and the old
  528. value (0), and replaces it with the new value given (1). The options
  529. to binpatch include:
  530.  
  531.       -a <address>         Patch the variable at address given
  532.       -b                   Patch a single byte (as opposed to 32-bit word)
  533.       -r <value>           Replace with given value
  534.       -s <name>            Patch the variable with the given symbolic name
  535.       
  536.  
  537.  
  538. Phase II - Installing the Software and Setting Up Multi-User Mode
  539. -----------------------------------------------------------------
  540.  
  541. Read the whole section before proceeding.
  542.  
  543. You should now have a minimal NetBSD installation with rootfs and swap
  544. partitions. We will now create additional partitions to install the
  545. operating system and other software. To calculate the size(s) needed,
  546. use the following rough formula:
  547.  
  548.   HDToolBox size (Mb) = (Installed blocks / 2048) * 1.2
  549.  
  550. The reason for the 1.2 scaling factor (apart from a safety margin and
  551. allowing for formatting) is that NetBSD reserves part of each
  552. partition: a partition will be reported as being 100% full when it
  553. still has some space left - root and other superusers will be allowed
  554. to write to the partition, but ordinary users will not.
  555.  
  556. The following table gives the installed size in 512 byte blocks for
  557. each of the bin-...gz archives (make sure you get the ones that go
  558. with the kernel you are using, the 720 ones are currently in the
  559. ".../NetBSD-Amiga/incoming" subdirectory). There are two sizes given:
  560. the first size is for the executables that use shared libraries, and
  561. these need vmunix.720 or later to work. The size in brackets is for
  562. the old statically linked executables which are larger but work with
  563. any kernel.
  564.  
  565.  
  566.    Archive                       Unpacks to   Installed Size (old)
  567.    -------                       ----------   --------------------
  568.  
  569.    These files are essential for proper operation of NetBSD:
  570.    
  571.    bin-bin.tar.gz                /bin   (Included in new rootfs)
  572.    bin-sbin.tar.gz               /sbin  (Included in new rootfs)
  573.  
  574.    bin-usr.sbin.tar.gz           /usr/sbin      3108  (10960)
  575.    bin-usr.bin.tar.gz            /usr/bin      13174  (25686)
  576.    bin-usr.lib.tar.gz            /usr/lib       5184  ( 2416)
  577.    bin-usr.libexec.tar.gz        /usr/libexec   3766  ( 3882)
  578.    bin-usr.share.tar.gz          /usr/share    25038  (25038)
  579.  
  580.    Total:                                      50270  (67982)
  581.  
  582.  
  583.    Not essential, but useful:
  584.  
  585.    For building code -
  586.  
  587.    bin-usr.include.tar.gz        /usr/include   2274? ( 2258)
  588.  
  589.    GCC, Emacs, etc. (compiling and editing) - 
  590.  
  591.    bin-usr.gnu.tar.gz            /usr/gnu      61156? (61156)
  592.  
  593.    For a little break -
  594.  
  595.    bin-usr.games.tar.gz          /usr/games     6172? ( 6172?)
  596.  
  597.    Total:                                      69602? (69586?)
  598.  
  599.    Current X11R5 (lib, libs, bin, include)     46170?
  600.  
  601. To begin with, I decided to make a 100Mb partition for /usr, and to
  602. make a 70Mb partition to be mounted as /home, for the NetBSD users' home
  603. directories. Since I used the old rootfs, I left an 11Mb space for the
  604. partition and later rebuilt it to get a root partition 11Mb in size.
  605.  
  606. Decide what partitions you want; you could just rebuild the rootfs
  607. (see below) onto one enormous partition and keep everything there, but
  608. the usual caveats about backups etc. apply to NetBSD as much as to
  609. AmigaDOS. In the instructions that follow I assume my system with the
  610. partitions I detailed above; vary them according to what you have set
  611. out.
  612.  
  613. Now decide how you are going to get the bin-...gz files into NetBSD -
  614. basically, you need a temporary space to copy them to. If you are
  615. lucky enough to have a SCSI tape drive you can use that, otherwise the
  616. easiest way is to create an extra NetBSD partition, which we will
  617. leave unformatted, and to use that.
  618.  
  619.  
  620. 1. Set the partitions up with HDToolBox, using the same method as
  621. before. The partitions should be given types 0x42534444 ("BSDD"),
  622. 0x42534445 ("BSDE") etc. up to 0x42534448 ("BSDH") If you are using
  623. more than one drive, reuse the names (i.e. start from "BSDD" with each
  624. drive). If you will be using a scratch partition (rather than tape) to
  625. install the files, create it too. It will have to accommodate the
  626. largest file (uncompressed), so I would suggest one of at least 30Mb
  627. in size to cope with "bin-usr.gnu.tar.gz".  Keep in mind the following
  628. rules:
  629.  
  630.    - Only one each of "BSDD" etc. per disk
  631.    - Only one rootfs on the whole system
  632.    -  "    "  swap   "   "    "     "
  633.  
  634. I made "BSDD" for /usr, "BSDE" for /home and a 30Mb scratch partition
  635. which I called 0x42534447 ("BSDG").
  636.  
  637. 2. We will now boot NetBSD and format the partitions. You will need to
  638. know the relation between partition types (in HDToolBox) and the
  639. special file names on the NetBSD side; the special file name
  640. incorporates the drive number (SCSI device number) and the partition
  641. type, e.g. on my system:
  642.  
  643.     Partition       Partition Type ID         NetBSD Special File
  644.     ---------       -----------------         -------------------
  645.  
  646.     root            0x42534452 "BSDR"         /dev/sd6a
  647.     swap            0x42534453 "BSDS"         /dev/sd6b
  648.     /usr            0x42534444 "BSDD"         /dev/sd6d
  649.     /home           0x42534445 "BSDE"         /dev/sd6e
  650.  
  651. If I put a "BSDE" partition on my Quantum (SCSI ID 0), it would be
  652. /dev/sd0e
  653.  
  654. 3. Boot NetBSD into single user mode as before.
  655.  
  656. 4. Format each of your new partitions (but NOT rootfs nor swap) using
  657. the newfs command. If you will be using a scratch partition to install
  658. the bin-...gz files, don't bother formatting it. In my case, the
  659. commands are:
  660.  
  661.     newfs /dev/rsd6d
  662.     newfs /dev/rsd6e
  663.  
  664. Note the "r" - the device used is /dev/rsd6d and not /dev/sd6d. Ignore
  665. any "Can't write disklabel" messages.
  666.  
  667. 5. Currently, the rootfs is mounted as a read-only file system. To
  668. make it writable, we have to remount it, e.g.:
  669.  
  670.    mount -u /dev/sd6a /     
  671.  
  672. Substitute the appropriate device name for your disk in place of "sd6a".
  673.  
  674. 6. We will now create the mount points for these partitions. A mount
  675. point is the place on the filing system where a partition is attached,
  676. and it merely consists of an empty directory. Again, following my
  677. example:
  678.  
  679.    mkdir /usr ; chmod 755 /usr
  680.    mkdir /home ; chmod 755 /home
  681.  
  682. You will find the two in this example already exist in the rootfs you
  683. are given, but you may need to create others.
  684.  
  685. 7. Now we need to create a table listing the partitions. Since we
  686. don't have an editor installed yet we'll just have to type it in. 
  687. ( Actually you can use "ed" if you know its command syntax ) You
  688. can use TABs instead of spaces, and the alignment isn't important.
  689. Here I have shown the prompt as it doesn't appear while you're typing
  690. the file in. Here is how it looks on my system:
  691.  
  692.    root(26)$ cat > /etc/fstab
  693.    /dev/sd6a       /       ufs     rw      1       1
  694.    /dev/sd6b       /tmp    mfs     rw      1       1
  695.    /dev/sd6d       /usr    ufs     rw      1       1
  696.    /dev/sd6e       /home   ufs     rw      1       1
  697.    <Ctrl-D>
  698.  
  699. Note that /tmp is mfs while the others are ufs. If you make a mistake,
  700. exit with Ctrl-D and start again.
  701.  
  702. 8. Now look at the file system; the "df" command shows all mounted
  703. partitions and their size:
  704.  
  705.    df
  706.  
  707. It should show just the root partition.
  708.  
  709. 9. Now we tell mount to mount all the partitions listed in /etc/fstab:
  710.  
  711.    mount -av 
  712.  
  713. and try df again:
  714.  
  715.    df
  716.  
  717. All of your partitions should appear. If there are any problems, use
  718. the command "umount -av" to unmount the partitions and go back and do
  719. /etc/fstab again.
  720.  
  721. 10. Now we will shut down NetBSD and get the files ready to install.  
  722. Unmount the partitions:
  723.  
  724.    umount -av
  725.  
  726. and then flush the file system buffers:
  727.  
  728.    sync ; sync ; sync
  729.  
  730. and then:
  731.  
  732.    reboot
  733.  
  734. You should follow a similar procedure every time you shut down NetBSD
  735. to avoid corrupting the file system; however, to shut down from
  736. multi-user mode you should use the "shutdown now" command.
  737.  
  738.  
  739. 11. The procedure for installing a bin-...gz archive is as follows:
  740.  
  741.    - from AmigaOS, put it on your temporary space
  742.        (i.e. tape or scratch partition)
  743.    - Boot NetBSD and mount the partitions
  744.    - Unpack it into the NetBSD filesystem
  745.    - Shutdown NetBSD, reboot AmigaOS and do the next one
  746.  
  747. Of course, if you have more than one scratch partition, or more than
  748. one blank tape, you can do several in one NetBSD cycle.
  749.  
  750. *********************************************************************
  751. * Use a tape drive if you can since it is quicker, easier and safer *
  752. * than using a scratch partition.                                   *
  753. *********************************************************************
  754.  
  755. The procedure for a scratch partition is:
  756.  
  757. a. Calculate its start block and size as you did with rootfs; my
  758. scratch partition starts at cylinder 541 and ends at 861, so I
  759. calculated:
  760.  
  761.    start block = 541 * 192 = 103872
  762.  
  763.    size = (861 - 541 + 1) * 192 = 61632
  764.  
  765. b. In AmigaOS, uncompress the archive, e.g.
  766.  
  767.    gzip -d bin-usr.bin.tar.gz
  768.  
  769. c. Calculate the tar file's size in blocks, by:
  770.  
  771.    Blocks = File size / 512
  772.  
  773.    e.g.
  774.  
  775.    Size of bin-usr.bin.tar = 12892160 / 512 = 25180
  776.  
  777. d. Use filetodev to put it on the scratch partition, e.g.
  778.  
  779.    filetodev 103872 25180 bin-usr.bin.tar scsi.device 6 1000
  780.  
  781. e. Boot up NetBSD, mount the partitions, and unpack the file into the
  782. root directory, e.g.
  783.  
  784.    mount -av
  785.    cd /
  786.    tar xvfp /dev/sd6g
  787.  
  788. It should be possible to just dump the compressed archive onto the
  789. partition and decompress it on the fly (using "tar xvzfp /dev/sd6g")
  790. but I couldn't get this to work with filetodev. ( The current tar
  791. does not support gzip compressed files. Try the command sequence:
  792. gzip -d </dev/rsd6g | tar xvfp - )
  793.  
  794.  
  795. The procedure for tape is slightly easier. Just put the compressed
  796. file on the tape, e.g.
  797.  
  798.    copy bin-usr.bin.tar.gz tape:
  799.  
  800. ( For the tape: device support, pick up the dtape10.lzh package. )
  801.  
  802. Then boot NetBSD and unpack it:
  803.  
  804.    mount -av
  805.    cd /
  806.    gzip -d </dev/rst0 | tar xvfp -
  807.  
  808. The current tar does not support gziped files, but when it does, the
  809. command to use would be: tar xzvfp /dev/rst0. 
  810.  
  811. When shutting down NetBSD, remember to unmount the partitions and
  812. flush the file system buffers:
  813.  
  814.    umount -av
  815.    sync ; sync ; sync
  816.    reboot
  817.  
  818. Once you have it installed, the command "fastboot" has the same effect
  819. (unmounting etc.) as the above sequence of commands.
  820.  
  821.  
  822. 12. After a few repetitions, you should have all the software
  823. installed. We can now configure NetBSD for single user mode. Boot up
  824. NetBSD, and use the following commands:
  825.  
  826.    mount -av                  (as always)
  827.    export TERM=vt200          (needed by the editors)
  828.  
  829. If you used the old rootfs, edit /etc/gettytab (with vi, emacs or
  830. whatever) and change ":ap:" to ":np:" in the entry for default (around
  831. line 20), e.g.
  832.  
  833.   vi /etc/gettytab
  834.  
  835. Most generic Unix books have a chapter on using "vi", but here is a
  836. minimum to get you started:
  837.  
  838. Vi is a "modal editor", i.e. the keys work differently depending on
  839. the mode.
  840.  
  841. Normal Mode:
  842.  
  843.   h        Left
  844.   l        Right
  845.   j        Down
  846.   Return   Down
  847.   k        Right
  848.   Space    Right
  849.   i        Enter insert mode, starting before the current character
  850.   a        (Append) Enter insert mode, starting after current char.
  851.   x        Delete current character
  852.   :d       Delete a line                  |
  853.   :x       Exit and save the file         | Press return after any
  854.   :quit!   Abort the edit                 | of these commands
  855.   
  856. Insert Mode:
  857.  
  858.   Type text to insert it, press ESC to end. You can only edit the
  859.   line you are currently typing.
  860.  
  861. You may now want to change the list of users. Edit the password file
  862. with:
  863.  
  864.   vipw 
  865.  
  866. The file consists of lines like this:
  867.  
  868.   fred:k%56Fj:234:567::0:0:Fred Bloggs:/home/fred:/bin/bash
  869.  
  870. Each represents a user. The colons (":") separate the fields. The
  871. important ones are the 2nd one (their password, encrypted), the 3rd
  872. and 4th (user and group id's), the 8th (real name), 9th (login
  873. directory) and 10th (login program).
  874.  
  875. Make sure that root has no encrypted password (for now), and that
  876. there is a user to log in as. Make one for yourself if you like.
  877.  
  878. Exit vi, and the user database will be updated. If you have added
  879. users, create their home directories as follows:
  880.  
  881.    mkdir /home/fred ; chown fred /home/fred
  882.  
  883. If you used the old rootfs, edit /etc/rc and comment out the line
  884. which starts the program "named".
  885.  
  886. 13. To start multi user mode, exit the single user mode shell:
  887.  
  888.    exit
  889.  
  890. If all is well, after a few messages you should see a prompt like:
  891.  
  892.    BSD 4.3 on amy.domain.domain (console)
  893.  
  894.    login: _
  895.  
  896. To shut down from multi user mode, log in as root (or use "su") and
  897. use the command:
  898.  
  899.    shutdown -r now
  900.  
  901.  
  902. Rebuilding the Root Partition
  903. -----------------------------
  904.  
  905. When you received it, the rootfs image you got was a canned copy of a
  906. fully formatted partition, and there was no way you could alter the
  907. size. If you installed NetBSD using the old 16448 block rootfs and are
  908. updating the binaries, or for other reasons of your own, you may find
  909. there is insufficient space in the root partition and you may wish to
  910. rebuild it to create one of a larger size.
  911.  
  912. Restructuring other partitions is fairly easy, as you can archive
  913. them, etc., but the root partition requires a bit of trickery as
  914. detailed below.
  915.  
  916. If you want to expand the root partition to occupy a larger space you
  917. reserved for it earlier, repeat this procedure twice, copying it away
  918. and back again.
  919.  
  920. 1. Create the new partition for root, and give it a partition type which
  921. makes it an ordinary partition, e.g. 0x42534448 "BSDH"
  922.  
  923. 2. Start up NetBSD
  924.  
  925. 3. Format the new partition, make a mount point and mount it, e.g.
  926.  
  927.    newfs /dev/rsd6h
  928.    mkdir /newroot
  929.    mount /dev/sd6h /newroot
  930.    
  931. 4. Use the following commands to copy the partition. Note the l option
  932. to tar (local file system only) which stops it trying to copy other
  933. partitions which may be mounted to the root one, and from incestuously
  934. trying to copy /newroot.
  935.  
  936.    cd /
  937.    tar clfp - | (cd /newroot ; tar xvlfp - )
  938.  
  939. 5. Shut down and return to AmigaOS, e.g.
  940.  
  941.    umount -av
  942.    umount /newroot
  943.    sync ; sync ; sync
  944.    reboot
  945.  
  946. 6. When AmigaOS boots, enter HDToolBox and alter the partition types,
  947. changing the "newroot" partition to root (0x42534452 "BSDR") and
  948. removing the "BSDR" label from the old root partition.
  949.  
  950. 7. Boot NetBSD and check that your new root partition is working.
  951.  
  952.  
  953. NetBSD FTP Sites
  954. ----------------
  955.  
  956. The NetBSD files are available from a number of places. Please use the
  957. site nearest you. I have not given numeric addresses as these are
  958. subject to change; if you can't use symbolic addresses at your site,
  959. hassle your site admin :-)
  960.  
  961.   Site Name                 Location     NetBSD-Amiga Top Directory
  962.   ---------                 --------     --------------------------
  963.  
  964.   ftp.eunet.ch *            Switzerland  pub/NetBSD-Amiga/
  965.   ftp.luth.se               Sweden       pub/NetBSD/NetBSD-Amiga/
  966.   ftp.hrz.uni-kassel.de     Germany      pub/machines/amiga/NetBSD/
  967.   ftp.uni-regensburg.de     Germany      pub/os/NetBSD/NetBSD-Amiga/
  968.   ftp.funet.fi              Finland      pub/amiga/unix/NetBSD-Amiga/
  969.   att2.cs.mankato.msus.edu  USA **       pub/mirrors/ftp.eunet.ch/NetBSD-Amiga/
  970.  
  971. * ftp.eunet.ch should only be used outside office hours, Swiss time
  972. (2 hours ahead of GMT, 8 hours ahead of USA's EST)
  973.  
  974. ** The administrators of att2... request that you use fsp rather than
  975. ftp if at all possible.
  976.  
  977. The "home" of NetBSD in general is sun-lamp.cs.berkeley.edu
  978.  
  979. 22-Dec-93
  980.  
  981. ----
  982.