File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_install_netbsd_on_a_power_macintosh_g4___40__grey__41__.mdwn
Revision 1.6: download - view: text, annotated - select for diffs
Sat Apr 15 06:09:22 2017 UTC (3 years, 7 months ago) by maya
Branches: MAIN
CVS tags: HEAD
Markdown. no indenting normal text, even though my editor syntax highlights it.

    1: **Contents**
    2: 
    3: [[!toc]]
    4: 
    5: #Requirements
    6: 
    7: You will need an Apple Power Macintosh G4, the NetBSD macppc installation CD-ROM and a working internet connection.
    8: The installation CD-ROM
    9: 
   10: You can download the NetBSD/macppc installation CD-ROM from the NetBSD [[Mirrors|Get_BSD]].
   11: For example from: <ftp://ftp3.de.netbsd.org/pub/NetBSD/iso/3.0.1/macppccd-3.0.1.iso>
   12: 
   13: #Booting
   14: 
   15: Please hold down the Keys *Apple+Alt+O+F*, after the Apple boot tone sounds to enter OpenFirmeware and enter:
   16: 
   17:     boot cd:,ofwboot.xcf netbsd.macppc
   18: 
   19: #Sysinst
   20: 
   21: Now, wait until sysinst shows up, but don't start the normal installation. We need to create an Apple HFS partition first that are readable by OpenFirmware. The current NetBSD disklabel isn't able to create the partitions yet. 
   22: 
   23: #Configure the Network
   24: 
   25: Please configure now your integrated gem0 (100baseTX) or wi0 (WLAN) NIC to have an internet connection to match your local network configuration and exit the sysinst program.
   26: 
   27: #Partitioning the hard disk
   28: 
   29: Now we're going to partition the disk. Enter:
   30: 
   31:     # pdisk /dev/rwd0c
   32: 
   33: to start the pdisk program. Create a new partition map using i.
   34: 
   35: Create a partition with offset at 2p with the size 32m and type Apple_HFS using the C option. Name it boot.
   36: 
   37: Create a partition with offset at 3p with size Xg and bzb bit a (root) using the c option. Name is root. Now if you want to have the whole system on one partition (root) assign the rest of disk space here.
   38: 
   39: Create a partition with offset at 4p with size Xg and bzb bit b (swap) using the c option. Name is swap.
   40: 
   41: If you want to create further partitions like /tmp /var /home do the following
   42: 
   43: Create a partition with offset at 5p with size 1g and bzb bit e (tmp) using c option. Name is tmp.
   44: 
   45: Create a partition with offset at 6p with size 1g and bzb bit f (var) using c option. Name is var.
   46: 
   47: Create a partition with offset at 7p with size 5g and bzb bit g (usr) using c option. Name is usr.
   48: 
   49: Dump the partition configuration using p.
   50: 
   51: If you have configured the new partition map, it should look like this:
   52: <pre><code>
   53:    1: Apple partition map
   54:    2: 32m HFS boot
   55:    3: 1g Apple_UNIX_SVR2 root /    a
   56:    4: 1g Apple_UNIX_SVR2 swap      b
   57:    5: 1g Apple_UNIX_SVR2 tmp       e
   58:    6: 1g Apple_UNIX_SVR2 var       f
   59:    7: 5g Apple_UNIX_SVR2 usr  /usr g
   60:    8: *g Apple_UNIX_SVR2 home      h
   61: </code></pre>
   62: Write the partition map using w. 
   63: 
   64: #Newfs
   65: 
   66: Now newfs your partitions:
   67: 
   68:     # newfs /dev/rwd0x
   69: 
   70: Replacing x with the partition name.
   71: 
   72: Note: Don't care about error messages that newfs couldn't touch the disklabel - that's right since we've created everything with pdisk.
   73: 
   74: #Mounting root
   75: 
   76: Mount the root partition to /mnt2 and create following directories:
   77: 
   78:     # mount /dev/wd0a /mnt2
   79:     # cd /mnt2
   80:     # mkdir etc tmp usr var home
   81: 
   82: #Create fstab
   83: 
   84: Create the file fstab that should match your wd0 disklabel configuration.
   85: 
   86:     # echo /dev/wd0a / ffs rw 1 1 >> /mnt2/etc/fstab
   87:     # echo /dev/wd0b none swap sw 0 0 >> /mnt2/etc/fstab
   88:     # echo /dev/wd0e /tmp ffs rw 1 2 >> /mnt2/etc/fstab
   89:     # echo /dev/wd0g /var ffs rw 1 2 >> /mnt2/etc/fstab
   90:     # echo /dev/wd0f /usr ffs rw 1 2 >> /mnt2/etc/fstab
   91:     # echo /dev/wd0h /home ffs rw 1 2 >> /mnt2/etc/fstab
   92:     # echo ptyfs /dev/pts ptyfs rw 0 0 >> /mnt2/etc/fstab
   93: 
   94: #Umount
   95: 
   96: Unmount /mnt2 again and enter sysinst.
   97: 
   98:     # cd /
   99:     # umount /mnt2
  100:     # sysinst
  101: 
  102: #Using Sysinst
  103: 
  104: In sysinst just use Re-install sets and proceed with the installation. After finishing these steps (equivalent to standard installation and which will create all device nodes in /dev) you can configure your Timezone and set a root password through going to the Utilities menu again.
  105: 
  106: #First boot
  107: 
  108: Now we're ready for the first boot. Exit sysinstall and enter reboot.
  109: 
  110:     # reboot
  111: 
  112: Leave the installation CD in your drive and enter:
  113: 
  114:     boot cd:,ofwboot.xcf hd:3,/netbsd
  115: 
  116: Wait until netbsd boots into single user mode and use /bin/sh.
  117: 
  118: * Set your terminal to VT100 
  119: 
  120:     # export TERM=vt100
  121: 
  122: * Remount root read-write using: 
  123: 
  124:     # mount -uw /
  125: 
  126: Cd to /etc and edit your rc.conf:
  127: 
  128:     cd /etc
  129:     vi rc.conf
  130: 
  131: Please set:
  132: 
  133:     rc_configured=YES
  134:     wscons=YES
  135:     hostname=my.powermac.g4
  136:     dhcpcd=yes
  137: 
  138: Please use /etc/ifconfig.gem0 if you don't have a DHCP Server in your network and remove dhcpcd=yes from rc.conf
  139: 
  140: Right now, set up your network. Either use dhcpcd to configure your network via DHCP
  141: 
  142:     # dhcpcd gem0  
  143: 
  144: or manually specify your network using ifconfig.
  145: 
  146:     # ifconfig gem0 192.168.0.124 netmask 255.255.255.0
  147: 
  148: Fetch pkgsrc.tar.gz
  149: 
  150:     ftp -a ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz 
  151: 
  152: and extract it to /usr
  153: 
  154:     tar xvfz pkgsrc.tar.gz -C /usr
  155: 
  156: Install hfsutils from sysutils
  157: 
  158:     # cd /usr/pkgsrc/sysutils/hfsutils 
  159:     # make install clean 
  160: 
  161: Format your boot partition through:
  162: 
  163:     # hformat /dev/wd0d
  164: 
  165: Place your ofwboot.xcf file of your installation cdrom (mount /dev/cd0a /mnt) to that partition:
  166: 
  167:     # hcopy /mnt/ofwboot.xcf :
  168: 
  169: 
  170: Reboot and enter OpenFirmware and enter following commands:
  171: 
  172:     # eject cd 
  173: 
  174: You don't need the installation disk anymore.
  175: <pre><code>
  176:    reset-nvram
  177:    setenv auto-boot? false
  178:    setenv boot-device hd:2,ofwboot.xcf
  179:    setenv boot-file hd:3,/netbsd
  180:    reset-all
  181: </pre></code>
  182: Next time you reboot your mac you get kicked into OpenFirmware directly. Just type:
  183: 
  184:     boot 
  185: 
  186: and you will boot into NetBSD :-)
  187: 
  188: #XF86Config
  189: 
  190: As for X11 here is my XF86Config file:
  191: <pre><code>
  192: Section "Files" 
  193:     FontPath    "/usr/X11R6/lib/X11/fonts/local/"
  194:     FontPath    "/usr/X11R6/lib/X11/fonts/misc/"
  195:     FontPath    "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
  196:     FontPath    "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
  197:     FontPath    "/usr/X11R6/lib/X11/fonts/Type1/"
  198:     FontPath    "/usr/X11R6/lib/X11/fonts/CID/"
  199:     FontPath    "/usr/X11R6/lib/X11/fonts/Speedo/"
  200:     FontPath    "/usr/X11R6/lib/X11/fonts/75dpi/"
  201:     FontPath    "/usr/X11R6/lib/X11/fonts/100dpi/"
  202: EndSection
  203: 
  204: Section "ServerFlags"
  205:     Option      "blank time"    "10"    # 10 minutes
  206:     Option      "standby time"  "20"
  207:     Option      "suspend time"  "30"
  208:     Option      "off time"      "60"
  209:     Option      "PCI type"      "UniNorth"
  210: EndSection
  211: 
  212: Section "InputDevice"
  213:     Identifier "Keyboard1"  
  214:     driver  "keyboard"      
  215:     option "protocol" "wskbd"
  216:     option "device"  "/dev/wskbd1"
  217:     Option  "AutoRepeat"    "500 5"
  218:     Option      "XkbRules"      "xfree86"
  219:     Option      "XkbModel"      "macusb"
  220:     Option      "XkbLayout"     "us"
  221:     Option      "XkbModel"      "macusb"
  222:     Option      "XkbLayout"     "us"
  223: EndSection
  224: Section "InputDevice"
  225:     Identifier  "Mouse1"
  226:     Driver      "mouse"
  227:     Option      "Protocol"      "wsmouse"
  228:     Option      "Device"        "/dev/wsmouse0"
  229:     Option      "ZAxisMapping"  "4 5"
  230: EndSection  
  231: Section "Monitor"
  232:     Identifier  "Generic Monitor"
  233:     HorizSync   27-100         # multisync
  234:     VertRefresh 50-75         # multisync 
  235:     Option      "dpms"
  236: EndSection
  237: Section "Device"
  238:     Identifier  "Rage128 Pro"
  239:     Driver      "ati"
  240:     BusID       "PCI:0:16:0"
  241: EndSection
  242: Section "Screen"
  243:     Identifier          "Screen1"
  244:     Device              "Rage128 Pro"
  245:     Monitor             "Generic Monitor"
  246:     DefaultDepth        16      
  247:     HorizSync   27-100         # multisync
  248:     VertRefresh 50-75         # multisync 
  249:     Option      "dpms"
  250: EndSection  
  251: Section "Device"
  252:     Identifier  "Rage128 Pro"
  253:     Driver      "ati"
  254:     BusID       "PCI:0:16:0"
  255: EndSection
  256: Section "Screen"
  257:     Identifier          "Screen1"
  258:     Device              "Rage128 Pro"
  259:     Monitor             "Generic Monitor"
  260:     DefaultDepth        16      
  261:     SubSection "Display"
  262:         Depth           8
  263:         Modes           "1280x1024"
  264:     EndSubSection
  265:     SubSection "Display"
  266:         Depth           16
  267:         Modes           "1024x768"
  268:     EndSubSection
  269:   EndSection
  270: Section "ServerLayout"
  271:     Identifier  "Main Layout"
  272:     Screen      "Screen1"
  273:     InputDevice "Mouse1"        "CorePointer"
  274:     InputDevice "Keyboard1"     "CoreKeyboard"
  275: EndSection
  276: </pre></code>
  277: That's it, you now have a working NetBSD system on your G4. 

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb