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

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

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