summaryrefslogtreecommitdiff
blob: 6857d38f420830090d7962910c50a7e42ecd2123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<?xml version='1.0' encoding="UTF-8"?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/Attic/gentooppc-quickstart.xml,v 1.7 2003/11/15 00:35:18 neysx Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">

<guide link="/doc/en/gentooppc-quickstart.xml">
<title>Gentoo Linux PPC Quickstart Guide</title>
<author title="Gentoo PPC Developer"><mail link="daybird@gentoo.org">David Chamberlain</mail></author>
<author title="Maintainer"><mail link="rajiv@gentoo.org">Rajiv Manglani</mail></author>

<abstract>This guide is intended for those already familiar with Gentoo
Linux.  It will point out the major differences you need to be aware of
between the PPC port and the x86 version.  If you aren't familiar with Gentoo,
you should read the full Gentoo Install Guide first.
</abstract>

<version>1.0.2</version>
<date>12 May 2003</date>

<chapter>
<title>  Pre-Install</title>
<section>
<body>
<warn>This document is out-of-date. Please follow the <uri link="http://www.gentoo.org/doc/gentoo-ppc-install.html">Gentoo Linux/PPC Installation Guide</uri> instead.</warn>
<p>If you're only going to have Linux on this box, you're ready to start.  If
you
want OS9 and/or OSX, you'll need to set up your disk from the Mac environment
first.  There's a thorough guide here:
<uri>http://people.debian.org/~branden/ibook.html</uri>.  Also look here:
<uri>http://www.oreillynet.com/pub/a/mac/2002/03/29/ibook_linux.html</uri>.</p>
<p>One important difference from these procedures: you won't need to go into Open
Firmware to boot the installer - you'll be booting from the CD once your Mac
partitions are in place and installed</p>
<p>
Don't get carried away making lots of partitions - when you look at the drive
in mac-fdisk, you're going to see that Apple already has at least 8 partitions 
at the start of your drive for its drivers, and you're going to need an extra
one for a kind of fake MBR we'll be using.  Since I've been using Linux, I've
suspected that the large number of partitions on my drive has made OSX rather 
crash-happy.  Still, one thing to consider is making a smallish, plain HFS 
("Apple Standard") partition so you can comfortably swap files between Linux 
and Mac - that's the one format they can both read (though deleting files on 
HFS has given me quite a few Linux kernel panics; and after I removed this shared
partition, OSX stopped crashing).</p>
<note>
Most OSX users seem to agree it's a good idea to have a separate
partition for OS9 ("Classic"), even though you can install it on the same one 
as OSX.</note>
</body>
</section></chapter>

<chapter>
<title>  Using the Install CD</title>
<section>
<body>

<p>
You can download the iso for the install CD from <uri>http://ftp.sunsite.dk/projects/gentooppc/build</uri>.  If you burn it as a CD master, it will be able to boot your Mac.  With the CD in the drive, power-on the Mac while holding down the C key.  Alternatively, hold down the Option key for a boot menu and choose the CD.  Older Macs may require arcane combinations of the keys C, D, Shift, Option etc.  If you have one of these, experiment.  Or you could even check the <uri link="http://www.info.apple.com/support/manuals.html">manual</uri>.
</p>

<note>If you have an older Mac that doesn't use Open Firmware, or one that uses
 an older version of OF (most machines previous to the "Blue and White" G3), 
you're going to have to use <uri link="http://master.penguinppc.org/~benh">BootX</uri> 
to boot the CD (included as a StuffIt archive on the GentooPPC boot image).  This 
must be installed and configured on MacOS first.  See 
<uri link="http://penguinppc.org/projects/bootx">these docs</uri> for some 
(light) instructions.  You'll need to copy the "initrd" ramdisk and the kernel 
(vmlinux) from the "boot" folder on the cd into your Mac system folder, then point 
BootX towards them. Be sure to read the ReadMe included with BootX - it will tell 
you what you need to know.
</note>
<p>
While you're logged into the ftp site, see if there's a version of
<path>build-ppc.tar.bz2</path> that's more recent than the CD image.  If there
is, grab it too - it probably has something you want in it.
</p>

<p>
If you've successfully booted from the CD, you'll have a chance to choose your
boot mode.  Note that nearly all Macs made in the last four years or so are
so-called "New-World" machines and can use the default boot mode.
</p>

</body>
</section>
</chapter>

<chapter>
<title>  Setting Up</title>
<section>
<body>
<p>
Unlike the x86 boot CD, the PPC version will almost certainly activate all
necessary hardware without the need to modprobe.  You'll see instructions for
bringing up the network - yes, there's no need to look for your ethernet
driver.  If ifconfig doesn't work right off the bat, you can poke around in
/lib/modules to see if there are any drivers you can load - apparently the 
pci autodetection doesn't always pick up the sungem cards on iBooks, so you 
might need to "modprobe sungem".</p>
<p>
There are, on the other hand, some other useful drivers in /lib/modules - in
particular Firewire.  If you want to use a Firewire drive (or a
powerbook in Target Disk mode :-) during install - e.g. to load a newer build
tarball - try:</p>
<pre>
# modprobe ieee1394
<codenote>actually I think that's built in to the kernel</codenote>
# modprobe ohci1394
# modprobe sbp2
</pre>

<p>This should attach your drive as an emulated scsi device - check 
<c>dmesg</c> to see where it shows up.  If it doesn't work, try unloading and 
reloading the modules a couple of times to check - firewire support has come a 
long way, but it's still kinda sketchy, especially - irony of ironies - on the 
PPC side.</p>

<note>No, I haven't tried Target Disk with Linux - it's an idea 
though...</note>

<p>Once you get the network set up, you're ready to partition, which you do
using <c>mac-fdisk</c>.  It's pretty straightforward - use "p" after partition
numbers to select default starting and ending blocks.  See the guides mentioned above, 
and don't forget to make the special bootstrap partition using the "b" command - this 
is our version of a MBR (though it's not needed if you have to use BootX instead of 
Yaboot).  If you make this the first (non-driver)
partition,the Mac will try to boot from it first; but note that you don't have
to do it this way.  Once you're done installing, you can boot into Open
Firmare (Cmd-Option-O-F) and issue some cryptic Forth commands to tell the
machine which partition to boot from: <c>setenv boot-device
hd:9,\\:tbxi</c>.  Obviously you'd have to swap in the appropriate
partition number for the 9 here.</p>
<note>Since i'm concerned about having too many partitions, I
kept /boot on the root partition.  No unforseen problems so far.  And OSX hasn't 
crashed since I removed my shared HFS partition.
</note>
<note>What with all those Apple partitions, it's a good idea to write down the 
important partition numbers and names somewhere.</note>
</body>
</section></chapter>

<chapter>
<title>  Install</title>
<section>
<body>
<p>
You can follow through most of the standard Gentoo install guide now.  Make
sure your net connection is working (e.g. put an entry in 
<path>/etc/resolv.conf)</path>;
make your linux filesystem(s) and mount it.  Unpack the
build tarball onto <path>/mnt/gentoo</path> - note that if you want to grab an
updated tarball now, wget is available - mount proc, copy over 
<path>/etc/resolv.conf</path> and <c>chroot</c> in.</p>
<p>
Now you can run <c>emerge sync</c>, but first check <path>/etc/make.conf</path> - 
set SYNC to rsync://rsync.gentoo.org/gentoo-portage.  You're ready to bootstrap and 
emerge system.</p>
<note>I strongly recommend getting all the sources before starting: before
bootstrap, you should <c>emerge --fetchonly</c> baselayout, gcc, glibc,
binutils and gettext. Before <c>emerge system</c>, <c>emerge --fetchonly system</c>.
</note>
<impo>Many Macs don't have an eject button for the CD, and the eject key on the 
keyboard won't work in Linux (unless you so configure it later on).  The boot image 
<i>should</i> allow you to issue the command <c>eject -r</c> to pop out the CD.  Once you've
booted from it and copied or untarred everything you need to your linux partition,
you don't need it in there anymore.  If you want to use another CD, perhaps to load 
an updated build tarball or to use program sources ("distfiles") downloaded on a 
faster connection elsewhere, then just unmount the boot CD (if you've mounted it), 
<c>eject -r</c>, and insert the other CD.  Once you're able to emerge stuff, just
<c>emerge eject</c> to make sure you have this command available.  See the main install 
guide for instructions on how to direct Portage to pull distfiles from a CD.</impo>
<note>Be sure that <path>/etc/make.conf</path> has the ppc settings: open it up in nano and
see if the ppc compiler flags are uncommented.  You'll see that you have a choice of two predefined
sets of flags.  The lower optimisations are obviously more reliable.  If your make.conf becomes messed up
for some reason, you can find the original in the most recent ppc directory in 
<path>/usr/portage/sys-apps/portage/files</path>.</note>
</body>
</section></chapter>

<chapter>
<title>  Configuring your system</title>
<section>
<body>
<p>
The main difference you'll find here from x86 Linux is the bootloader, yaboot 
(unless you need to use BootX - see above).
 It's a lot like lilo: settings go in <path>/etc/yaboot.conf</path> - here's
mine:</p>
<pre>
## /etc/yaboot.conf
##
## run: "man yaboot.conf" for details. Do not make changes until you have!!
## see also: /usr/share/doc/yaboot/examples for example configurations.
##
## For a dual-boot menu, add one or more of:
## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ

## our bootstrap partition:
boot=/dev/hda9

##hd: is open firmware speak for hda
device=hd:
partition=11

root=/dev/hda11
delay=5
defaultos=macosx
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

#################
## This section can be duplicated if you have more than one kernel or set of
## boot options
#################
image=/boot/vmlinux
	label=Linux
	read-only
##################

macos=/dev/hda13
macosx=/dev/hda12
enablecdboot
enableofboot
</pre>

<p>Once <path>yaboot.conf</path> is set up how you want it, you run
<c>mkofboot -v</c> to install the settings in the bootstrap partition.  Don't forget 
this!  If all goes well, and you have the same options as me, your next reboot will 
give you a simple, five-entry boot menu.  If you update your yaboot config later on, 
you'll just need to run <c>ybin</c> to update the bootstrap partition - mkofboot is 
for initial setup only.
</p>

<note>
Yaboot has some functionality for setting config at boot time, so take a look at
<uri>http://penguinppc.org/projects/yaboot</uri> for more info.
</note>

<p>As for configuring and compiling your kernel, the default config you'll get
with the gentoo ppc sources will have most of the important stuff set up
already.  There are usually very few alternative drivers for Mac hardware, and
the necessary ones will almost certainly be preselected.  Still, use the
'help' option in <c>make menuconfig</c> if you have any doubts.
Note that you'll have trouble making a bzImage.  Stick with <c>make 
vmlinux</c> unless you know what you're doing.  In other words, after configuring 
the kernel, do this:</p>
<pre>
# make dep; make clean; make vmlinux; make modules; make modules_install
<codenote>kernel image will be found at top level of /usr/src/linux directory</codenote>
<codenote>remember to mount /boot if you have it on a separate partition ;-)</codenote>
# cp vmlinux /boot
# cp System.map /boot
</pre>
<impo>To install the PPC version of the kernel sources, you want to emerge 
<i>sys-kernel/ppc-sources</i>.
Currently that's the only kernel package for ppc - but it does include the XFS 
patch, unlike
most of the x86 kernel source packages.</impo>
<note>If you want to know who Ben is, see <uri>http://penguinppc.org/~benh</uri>
or <uri>http://ppckernel.org</uri>.  He's the PPC kernel maintainer, and most 
PPC linux users use sources from his tree, not the kernel.org tree.
</note>

<p>Another ppc quirk is the difficulty of setting up XFree.  First, if you
want to use direct rendering with a video card, try loading the appropriate kernel 
module first, just to be sure.  Second, I've had best luck recently with
<c>XFree86 --configure</c>; and we now have an ebuild for the ppc-only xeasyconf
(<c>emerge x11-misc/xeasyconf</c>) - an excellent program written specially for us by Mark Guertin.  Still, what the config programs think should work
may not.  Your usb mouse will probably be <path>/dev/input/mice</path>, by the
way. If you don't know what hardware (e.g. video card) you have, try emerging 
pci-utils, then issue the command <c>lspci</c>.  It may pick up the relevant details.</p>

<note>
"Option" "UseFBdev" is your friend :-)
</note>

<p>Configuring <i>sound</i> for linux on a Mac is also a black art, but it can be done.  
Load the modules (<c>modprobe</c>) in <path>kernel/drivers/sound</path> (<i>soundcore</i> and <i>dmasound_pmac</i>), install a mixer (e.g. aumix), play around.  Note that in KDE, you'll need to tell the sound server to use OSS, with 8-bit sound only.  If you want to try Alsa, the relevant driver is <i>snd-card-awacs</i>, but you'll still need soundcore (kernel) and snd (alsa) loaded first.  To use Alsa in KDE, also load the alsa-oss compatibility modules (snd-pcm, snd-pcm-plugin, snd-pcm-oss, snd-mixer-oss) and tell the Arts soundserver to use OSS, not Alsa (yes, really).  This applies to Alsa 0.5 - it may change when Alsa 0.9 becomes mainstream.</p>
<note>If you compile dmasound into the kernel, you won't be able to unload it to try Alsa (so use modules instead).</note>


<p>If you want to try to access your hfs+ partition(s), take a look at the
<i>hfsplus</i> utilities mentioned on the penguinppc site, and the kde
component <i>kio-mac</i> - I haven't tried these yet, but they're supposed to let you read your mac partitions in konqueror.  Look for ebuilds soon.
</p>

<p>Another powerful linux-ppc tool is <i>MOL</i> (Mac on Linux).  If you have a
partition with OS9 or lower, you should be able to run that system at 
near-native speed <i>within</i> Linux.  Configuration can be a bit tricky, but it's pretty darn cool.  To install just type <c>emerge mol</c>.  Now you can run Photoshop, or view Flash and Shockwave animations on the web, without rebooting :-).
</p>

<p>Well, there it is.  Things are functioning very well right now, but the
more people we can get testing, the better.  If you want to try your hand at
making an architecture-independent ebuild, take a look at <path>
/usr/portage/media-sound/mpg123/mpg123r-r1.ebuild</path>.  Note also that any
ebuild that downloads binary files will probably be broken, unless the author has included alternate ppc binaries (see new <path>xanim</path> ebuilds.)
</p>
<note>A quick tip: the Linux console doesn't position itself quite right on my iMac screen (DV400/2000):  <c>fbset -move right</c> fixes the problem.
</note>
</body>
</section>
</chapter>

<chapter>
<title>  BootX Troubleshooting</title>
<section>
<body>
<p>Some notes culled from the mailinglist:</p>
<ul>
<li>If you get errors trying to boot from BootX, turn off extensions and/or vitual memory
when you start up MacOS</li>
<li>Install with BootX (courtesy Gerk):
<ol>
<li> Uncompress the BootX_1.2.2.sit archive from the cd to a known location on your hard disk.</li>
<li> Copy from the file vmlinux from the /boot folder on the Gentoo CD into the Linux Kernels folder inside the BootX folder you just uncompressed on the hard disk</li>
<li> Copy the initrd.img from the /boot folder on the Gentoo CD in the BootX folder</li>
<li> Double click the BootX App</li>
<li>Click on the 'options' button and then select the initrd.img you copied as your ramdisk</li>
<li> Click ok</li>
<li> Set the ramdisk size to 24000</li>
<li> Add the following text to the kernel args pane: rw</li>
<li> Click on the Linux button and start the install (optionally click save prefs)</li>
</ol></li>
<li>If the initrd ramdisk still mounts as read-only, you can remount it as read-write like so:
<c>#mount /dev/root / -o remount,rw</c></li>
<li>Many important commands on the initrd are symlinks to busybox.  If you get a "command
not found" error, the link may have been lost - just remount as rw (if necessary) and make
the link yourself.</li>
<li>The SUSE site listed below can be especially useful for bootX problems.</li>
</ul>

</body>
</section>
</chapter>

<chapter>
<title>  Resources</title>
<section>
<body>

<ul>
<li>
Installing Debian on the iBook: 
	<ol>
	<li><uri>http://people.debian.org/~branden/ibook.html</uri></li>
 	<li><uri>http://www.oreillynet.com/pub/a/mac/2002/03/29/ibook_linux.html</uri></li>
	</ol>
</li>

<li>
Lots and lots of great info at <uri link="http://tuxppc.org/">tuxppc</uri> (inc very useful <uri link="http://forums.tuxppc.org/">forums</uri>)
</li>

<li>
<uri link="http://penguinppc.org/">penguinppc</uri>
</li>

<li>
<uri link="http://sdb.suse.de/sdb/en/html/keylist.PPC.html">SUSE Linux Knowledgebase</uri>
PPC articles (useful for troubleshooting).
</li>

<li>Debian PPC's list of <uri link="http://www.debian.org/ports/powerpc/inst/install">supported
hardware</uri>.  GentooPPC should support the same machines, though in practice it wil probably
take a little while for us to put together a boot disk that will work for everyone.
</li>

<li>
Debian's PPC <uri link="http://lists.debian.org/debian-powerpc/">mailing list archive</uri>.
</li>

<li>
Linux on PowerPC <uri link="http://lppcfom.sourceforge.net/">FAQ-O-Matic</uri> (outdated,
but still of some use, especially for older machines).
</li>

<li>
<uri link="http://ppckernel.org/">ppckernel</uri>
</li>

<li>
<uri link="http://www.maconlinux.net/">Mac-on-Linux</uri>
</li>

<li>
<uri link="http://www.gentoo.org/doc/build.html">Gentoo Linux x86 Install
Guide</uri>
</li>

<li>
<uri link="http://www.netneurotic.net/mac/openfirmware.html">Open Firmware 
Guide</uri>
</li>

<li>
<uri link="http://www.info.apple.com/support/manuals.html">Apple Manuals</uri>
</li>

</ul>

</body>
</section>
</chapter>

</guide>