Annotation of wikisrc/tutorials/how_to_install_netbsd_on_a_power_macintosh_g4___40__grey__41__.mdwn, revision 1.4

1.1       mspo        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: 
1.2       maya       31:     # pdisk /dev/rwd0c
1.1       mspo       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/wd0x
                     69: 
                     70: Note: Don't care about error messages that newfs couldn't touch the disklabel - that's right since we've created everything with pdisk.
                     71: 
                     72: #Mounting root
                     73: 
                     74: Mount the root partition to /mnt2 and create following directories:
                     75: 
                     76:     # mount /dev/wd0a /mnt2
                     77:     # cd /mnt2
                     78:     # mkdir etc tmp usr var home
                     79: 
                     80: #Create fstab
                     81: 
                     82: Create the file fstab that should match your wd0 disklabel configuration.
                     83: 
                     84:     # echo /dev/wd0a / ffs rw 1 1 >> /mnt2/etc/fstab
                     85:     # echo /dev/wd0b none swap sw 0 0 >> /mnt2/etc/fstab
                     86:     # echo /dev/wd0e /tmp ffs rw 1 2 >> /mnt2/etc/fstab
                     87:     # echo /dev/wd0g /var ffs rw 1 2 >> /mnt2/etc/fstab
                     88:     # echo /dev/wd0f /usr ffs rw 1 2 >> /mnt2/etc/fstab
                     89:     # echo /dev/wd0h /home ffs rw 1 2 >> /mnt2/etc/fstab
1.4     ! maya       90:     # echo ptyfs /dev/pts ptyfs rw 0 0 >> /mnt2/etc/fstab
1.1       mspo       91: 
                     92: #Umount
                     93: 
                     94: Unmount /mnt2 again and enter sysinst.
                     95: 
                     96:     # cd /
                     97:     # umount /mnt2
                     98:     # sysinst
                     99: 
                    100: #Using Sysinst
                    101: 
                    102: 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.
                    103: 
                    104: #First boot
                    105: 
                    106: Now we're ready for the first boot. Exit sysinstall and enter reboot.
                    107: 
                    108:     # reboot
                    109: 
                    110: Leave the installation CD in your drive and enter:
                    111: 
                    112:     boot cd:,ofwboot.xcf hd:3,/netbsd
                    113: 
                    114: Wait until netbsd boots into single user mode and use /bin/sh.
                    115: 
                    116: * Set your terminal to VT100 
                    117: 
                    118:     # export TERM=vt100
                    119: 
                    120: * Remount root read-write using: 
                    121: 
                    122:     # mount -uw /
                    123: 
                    124: Cd to /etc and edit your rc.conf:
                    125: 
                    126:     cd /etc
                    127:     vi rc.conf
                    128: 
                    129: Please set:
                    130: 
                    131:     rc_configured=YES
                    132:     wscons=YES
                    133:     hostname=my.powermac.g4
1.4     ! maya      134:     dhcpcd=yes
1.1       mspo      135: 
1.4     ! maya      136: Please use /etc/ifconfig.gem0 if you don't have a DHCP Server in your network and remove dhcpcd=yes from rc.conf
1.1       mspo      137: 
1.4     ! maya      138: Right now, set up your network. Either use dhcpcd to configure your network via DHCP
1.1       mspo      139: 
1.4     ! maya      140:     # dhcpcd gem0  
1.1       mspo      141: 
                    142: or manually specify your network using ifconfig.
                    143: 
                    144:     # ifconfig gem0 192.168.0.124 netmask 255.255.255.0
                    145: 
                    146: Fetch pkgsrc.tar.gz
                    147: 
                    148:     ftp -a ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz 
                    149: 
                    150: and extract it to /usr
                    151: 
                    152:     tar xvfz pkgsrc.tar.gz -C /usr
                    153: 
                    154: Install hfsutils from sysutils
                    155: 
                    156:     # cd /usr/pkgsrc/sysutils/hfsutils 
                    157:     # make install clean 
                    158: 
                    159: Format your boot partition through:
                    160: 
                    161:     # hformat /dev/wd0d
                    162: 
                    163: Place your ofwboot.xcf file of your installation cdrom (mount /dev/cd0a /mnt) to that partition:
                    164: 
                    165:     # hcopy /mnt/ofwboot.xcf :
                    166: 
                    167: 
                    168: Reboot and enter OpenFirmware and enter following commands:
                    169: 
                    170:     # eject cd 
                    171: 
                    172: You don't need the installation disk anymore.
                    173: <pre><code>
                    174:    reset-nvram
                    175:    setenv auto-boot? false
                    176:    setenv boot-device hd:2,ofwboot.xcf
                    177:    setenv boot-file hd:3,/netbsd
                    178:    reset-all
                    179: </pre></code>
                    180: Next time you reboot your mac you get kicked into OpenFirmware directly. Just type:
                    181: 
                    182:     boot 
                    183: 
                    184: and you will boot into NetBSD :-)
                    185: 
                    186: #XF86Config
                    187: 
                    188: As for X11 here is my XF86Config file:
                    189: <pre><code>
                    190: Section "Files" 
                    191:     FontPath    "/usr/X11R6/lib/X11/fonts/local/"
                    192:     FontPath    "/usr/X11R6/lib/X11/fonts/misc/"
                    193:     FontPath    "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
                    194:     FontPath    "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
                    195:     FontPath    "/usr/X11R6/lib/X11/fonts/Type1/"
                    196:     FontPath    "/usr/X11R6/lib/X11/fonts/CID/"
                    197:     FontPath    "/usr/X11R6/lib/X11/fonts/Speedo/"
                    198:     FontPath    "/usr/X11R6/lib/X11/fonts/75dpi/"
                    199:     FontPath    "/usr/X11R6/lib/X11/fonts/100dpi/"
                    200: EndSection
                    201: 
                    202: Section "ServerFlags"
                    203:     Option      "blank time"    "10"    # 10 minutes
                    204:     Option      "standby time"  "20"
                    205:     Option      "suspend time"  "30"
                    206:     Option      "off time"      "60"
                    207:     Option      "PCI type"      "UniNorth"
                    208: EndSection
                    209: 
                    210: Section "InputDevice"
                    211:     Identifier "Keyboard1"  
                    212:     driver  "keyboard"      
                    213:     option "protocol" "wskbd"
                    214:     option "device"  "/dev/wskbd1"
                    215:     Option  "AutoRepeat"    "500 5"
                    216:     Option      "XkbRules"      "xfree86"
                    217:     Option      "XkbModel"      "macusb"
                    218:     Option      "XkbLayout"     "us"
                    219:     Option      "XkbModel"      "macusb"
                    220:     Option      "XkbLayout"     "us"
                    221: EndSection
                    222: Section "InputDevice"
                    223:     Identifier  "Mouse1"
                    224:     Driver      "mouse"
                    225:     Option      "Protocol"      "wsmouse"
                    226:     Option      "Device"        "/dev/wsmouse0"
                    227:     Option      "ZAxisMapping"  "4 5"
                    228: EndSection  
                    229: Section "Monitor"
                    230:     Identifier  "Generic Monitor"
                    231:     HorizSync   27-100         # multisync
                    232:     VertRefresh 50-75         # multisync 
                    233:     Option      "dpms"
                    234: EndSection
                    235: Section "Device"
                    236:     Identifier  "Rage128 Pro"
                    237:     Driver      "ati"
                    238:     BusID       "PCI:0:16:0"
                    239: EndSection
                    240: Section "Screen"
                    241:     Identifier          "Screen1"
                    242:     Device              "Rage128 Pro"
                    243:     Monitor             "Generic Monitor"
                    244:     DefaultDepth        16      
                    245:     HorizSync   27-100         # multisync
                    246:     VertRefresh 50-75         # multisync 
                    247:     Option      "dpms"
                    248: EndSection  
                    249: Section "Device"
                    250:     Identifier  "Rage128 Pro"
                    251:     Driver      "ati"
                    252:     BusID       "PCI:0:16:0"
                    253: EndSection
                    254: Section "Screen"
                    255:     Identifier          "Screen1"
                    256:     Device              "Rage128 Pro"
                    257:     Monitor             "Generic Monitor"
                    258:     DefaultDepth        16      
                    259:     SubSection "Display"
                    260:         Depth           8
                    261:         Modes           "1280x1024"
                    262:     EndSubSection
                    263:     SubSection "Display"
                    264:         Depth           16
                    265:         Modes           "1024x768"
                    266:     EndSubSection
                    267:   EndSection
                    268: Section "ServerLayout"
                    269:     Identifier  "Main Layout"
                    270:     Screen      "Screen1"
                    271:     InputDevice "Mouse1"        "CorePointer"
                    272:     InputDevice "Keyboard1"     "CoreKeyboard"
                    273: EndSection
                    274: </pre></code>
                    275: That's it, you now have a working NetBSD system on your G4. 

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