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

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

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