LinuxPPC on a PowerBook G3 LinuxPPC on a PowerBook G3:
This is a totally UN-OFFICIAL installation/help guide, and before reading any of this you should go to http://www.linuxppc.com/userguide/ and read that about 6 thousand times.
-Seti
[email protected]
To install LinuxPPC Lite on a PowerBook G3 you do NOT need Open Firmware, Quik, installer.coff, BootVariables, or a floppy drive.
Step 1. Download LinuxPPC Lite. (RPMS, base, bin) Download ramdisk.image.gz
***You need to download the files in BINARY format.***
Step 2. Download BootX 1.01 and kernel 2.1.130 at Benjamin Herrenschmidt's site. Place the BootX extension in the extensions folder and place the control panel/app in the control panels folder. The kernel should be downloaded as a binary file.
Step 3. Rename the kernel to "vmlinux" and place it inside your system folder. Place ramdisk.image.gz in your system folder too.
How the files should be arranged on your system:
Inside your main hard drive you should have a folder called "RedHat" containing the folders RPMS, base, and bin. Inside your system folder you should have "vmlinux" and "ramdisk.image.gz" Inside your extensions you should have the BootX extension. And lastly, the BootX control panel should go in the control panels folder. Don't worry about the MacOS cutting off the end of the long RPM file names, the Red Hat installer will still recognize them.
System Folder
vmlinux
ramdisk.image.gz
Extensions
BootX Extension
Control Panels
BootX App
Macintosh HD:
RedHat
base
comps.pmac
comps.pmac.all
comps.pmac.X11
hdlist
skeleton.cgz
uglist
bin
genhdlist
RPMS
apache-1.2.6-1b.ppc.rpm
basesystem-4.9-2.noarch.rpm
bash-1.14.7-6b.ppc.rpm
bc-1.04-2b.ppc.rpm
bdflush-1.5-7b.ppc.rpm
bootpc-061-2b.ppc.rpm
chkconfig-0.9-2c.ppc.rpm
cracklib-2.5-4b.ppc.rpm
cracklib-dicts-2.5-4b.ppc.rpm
crontabs-1.6-1a.noarch.rpm
dev-2.5.4-1b.ppc.rpm
dhcpcd-0.65-1b.ppc.rpm
e2fsprogs-1.10-1b.ppc.rpm
eject-1.5-1b.ppc.rpm
elm-2.4.25-11a.ppc.rpm
etcskel-1.3-4A.noarch.rpm
filesystem-1.3.1-2a.noarch.rpm
fileutils-3.16-6b.ppc.rpm
ftp-0.10-1b.ppc.rpm
gawk-3.0.2-2b.ppc.rpm
gdbm-1.7.3-8b.ppc.rpm
giflib-3.0-3.ppc.rpm
gimp-1.0.0-1.ppc.rpm
gimp-data-extras-1.0.0-1.noarch
gimp-libgimp-1.0.0-1.ppc.rpm
glib-1.0.4-1.ppc.rpm
glibc-0.961212-1h.ppc.rpm
grep-2.1-1b.ppc.rpm
gtk+-1.0.4-1.ppc.rpm
gzip-1.2.4-10a.ppc.rpm
hdparm-3.1-5b.ppc.rpm
indexhtml-5.0-2.noarch.rpm
info-3.9-7a.ppc.rpm
initscripts-3.32-1a.ppc.rpm
kbdconfig-1.5-1b.ppc.rpm
kdeadmin-1.0-1a.ppc.rpm
kdebase-1.0-1b.ppc.rpm
kdegames-1.0-1a.ppc.rpm
kdegraphics-1.0-1a.ppc.rpm
kdelibs-1.0-1a.ppc.rpm
kdemultimedia-1.0-1a.ppc.rpm
kdenetwork-1.0-1a.ppc.rpm
kdesupport-1.0-1a.ppc.rpm
kdeutils-1.0-1b.ppc.rpm
kdextras-beta4-1a.ppc.rpm
kernel-pmac-2.1.24-2.ppc.rpm
kernel-pmac-modules-2.1.24-9807
ldconfig-1.9.5-2a.ppc.rpm
less-321-4b.ppc.rpm
libg++-2.8.1.980306-1c.ppc.rpm
libgr-2.0.13-4b.ppc.rpm
libjpeg-6a-1b.ppc.rpm
libpng-0.96-1b.ppc.rpm
libtermcap-2.0.8-6b.ppc.rpm
libtiff-3.4-1b.ppc.rpm
logrotate-2.5-2b.ppc.rpm
losetup-2.7f-1a.ppc.rpm
MAKEDEV-2.3.1-1a.noarch.rpm
mingetty-0.9.4-5b.ppc.rpm
mktemp-1.4-2b.ppc.rpm
modemtool-1.21-1a.noarch.rpm
modutils-2.1.85-2a.ppc.rpm
mount-2.7f-1a.ppc.rpm
mouseconfig-2.22-1b.ppc.rpm
ncftp-2.4.3-1a.ppc.rpm
ncurses-1.9.9e-6b.ppc.rpm
net-tools-1.432-2a.ppc.rpm
netcfg-2.19-3b.noarch.rpm
netkit-base-0.10-5b.ppc.rpm
netscape-communicator-4.05-3a.ppc.rpm
nfs-server-clients-2.2beta29-2b
pam-0.59-5b.ppc.rpm
pamconfig-0.51-4a.noarch.rpm
passwd-0.50-10b.ppc.rpm
pdisk-0.7-1a.ppc.rpm
perl-5.004-2b.ppc.rpm
pine-3.96-3b.ppc.rpm
pmac-utils-1.1.1-1.ppc.rpm
portmap-4.0-7b.ppc.rpm
ppp-2.3.5-1a.ppc.rpm
procmail-3.10-11b.ppc.rpm
procps-1.2.7-1a.ppc.rpm
psmisc-16-1b.ppc.rpm
pwdb-0.54-6c.ppc.rpm
python-1.5.1-2c.ppc.rpm
python-tkinter-1.5.1-2c.ppc.rpm
python-_tkinter-1.5.1-2c.ppc.rpm
pythonlib-1.22-1a.noarch.rpm
qt-1.33-1rh5a.ppc.rpm
quik-1.3.0-1.ppc.rpm
rc.local-linuxppc-1-5.noarch.rpm
redhat-release-5.0-1a.noarch.rpm
rootfiles-1.5-3a.noarch.rpm
routed-0.10-3b.ppc.rpm
rpm-2.5-2.ppc.rpm
sed-2.05-9b.ppc.rpm
sendmail-8.8.8-3a.ppc.rpm
setconsole-1.0-3a.noarch.rpm
setserial-2.12-3b.ppc.rpm
setup-1.9.1-1f.noarch.rpm
setuptool-1.0-1a.noarch.rpm
sh-utils-1.16-8b.ppc.rpm
shadow-utils-970616-11a.ppc.rpm
stat-1.5-6b.ppc.rpm
sysklogd-1.3-19c.ppc.rpm
SysVinit-2.74-1a.ppc.rpm
telnet-0.10-2b.ppc.rpm
termcap-9.12.6-7a.noarch.rpm
textutils-1.22-4b.ppc.rpm
time-1.7-4b.ppc.rpm
timeconfig-2.1-3a.ppc.rpm
timetool-2.3-5b.noarch.rpm
tmpwatch-1.5-1b.ppc.rpm
type1inst-0.6.1-2.noarch.rpm
usercfg-3.5-6c.noarch.rpm
util-linux-2.7-11a.ppc.rpm
vim-4.6-4c.ppc.rpm
vixie-cron-3.0.1-20a.ppc.rpm
which-1.0-7b.ppc.rpm
X11R6.3-01-1r.ppc.rpm
X11R6.3-100dpi-fonts-01-1r.ppc.rpm
X11R6.3-75dpi-fonts-01-1r.ppc.rpm
X11R6.3-Cirrus-01-1s.ppc.rpm
X11R6.3-fonts-01-1r.ppc.rpm
X11R6.3-libs-01-1r.ppc.rpm
X11R6.3-man-01-1r.ppc.rpm
X11R6.3-PMac-01-1s.ppc.rpm
xfreefonts-0.10-9.noarch.rpm
xinitrc-1.3-5b.noarch.rpm
xpm-3.4j-1b.ppc.rpm
zlib-1.0.4-2b.ppc.rpm
Step 4. Back up all your data. Format your hard drive with Drive Setup. I formatted my disk into 3 parts:
MacOS - HFS (1.0 Gig) (NOT HFS+)
root - HFS (970 megs)
swap - HFS (72 megs)
You can use the mac version of pdisk to figure out what device numbers your partitions are (/dev/hdaX) and how big they are. It is very helpful to write this information down so you don't erase the wrong partition.
Step 5. Re-install MacOS 8.5 on the MacOS HFS partition, upgrade to 8.5.1. Place all the RedHat/Linux files where they should be. (as they were above).
Step 6. Open the BootX App, for root device enter the partition that your system/kernel files are on. Enter /dev/hdaX (X being the partition number, it is 7 on my machine, oh btw hda means the drive is IDE) Check the use ramdisk option. Check the no video driver option.
Step 7. If you have any trouble booting into linux try using another kernel. Otherwise the installer will take you step by step through the installation process.
A note about using fdisk to partition your disk: What I did was deleted the root partition (970 megs) and then created a new partition that began and ended at the same spot as the root partition. I did the same thing with my swap partition. That was an easy way for me to create the two Apple_UNIX_SVR2 partitions. If you mess up just press q. w writes the partitions and should only be used when you're sure you have it set up right.
When the installer asks if you want to install quik select NO. Also when it asks for bootvariables do not type anything, just select OK.
If the installer says it cannot find the components file or FATAL error opening RPMS then you need to re-download the base directory and it's files (BINARY FORMAT!). You might have to re-download genhdlist (in the bin directory) as well.
Step 8. To boot into your new linux system change the root device in BootX to the partition you installed linux on. Un-click the use ramdisk option, (it runs the installer)
gcc/g++
If you want to develop applications and compile them you need to downlaod egcs (gcc/g++, C and C++ compiler)
Download the following R4 rpms: (DO NOT download any R5 rpms, it will screw your system)
kernel-headers-2.1.24-1.ppc.rpm
groff-1.11a-3b.ppc.rpm
binutils-2.9.1-1a.ppc.rpm
egcs-1.0-2e.ppc.rpm
egcs-as-gcc-1.0-2e.ppc.rpm
egcs-c++-1.0-2e.ppc.rpm
egcs-fixes-1-1.noarch.rpm
egcs-objc-1.0-2e.ppc.rpm
glibc-static-0.961212-1h.ppc.rpm
glibc-devel-0.961212-1h.ppc.rpm
libg++-devel-2.8.1.980306-1c.ppc.rpm
You can put these on your MacOS HFS drive and then mount the drive while in linux.
"mount -nr /dev/hdaX /mnt" (X being the partition number) will mount the MacOS HFS drive in /mnt as read-only, so the HFS partition is not messed up accidently.
To install the packages type: rpm -i package_name
The packages should be installed in the order they are listed.
If you get errors with iostream.h/streambuf.h that look like:
/opt/egcs/include/g++/streambuf.h:403: warning: invalid type `void *' for default argument to `ios *' In file included from test.c:1:
/opt/egcs/include/g++/iostream.h:50: warning: invalid type `void *' for default argument to `ostream *'
/opt/egcs/include/g++/iostream.h:123: warning: invalid type `void *' for default argument to `ostream *'
It's because the header files are gcc's, not egcs's. For example, at line 50 of iostream.h, change it from
ostream(streambuf* sb, ostream* tied= NULL);
to
ostream(streambuf* sb, ostream* tied= (ostream*)NULL);
If you are uncomfortable doing this you can get the source for the fixed iostream.h at: lists.linuxppc.com
Other very useful packages:
findutils-4.1-21a.ppc.rpm
finger-0.10-2b.ppc.rpm
tar-1.12-1b.ppc.rpm
ytalk-3.0.3-2b.ppc.rpm
man-1.4j-3b.ppc.rpm
man-pages-1.17-1a.noarch.rpm
tcl-8.0p2-4b.ppc.rpm
tk-8.0p2-4b.ppc.rpm
You need to install tcl and then tk if you want to run netcfg.
Extra info:
-KDE Startup:
To stop KDE from starting every time you boot linux disable it in /etc/inittab
Change:
x:3:once:/opt/kde/bin/kdm -nodaemon
to
#x:3:once:/opt/kde/bin/kdm -nodaemon
-Shadowed Passwords:
LinuxPPC-Lite does not enable shadowed passwords upon initial installation. To enable shadowing you should be familiar with /etc/passwd and how it works.
DO NOT DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
And you should probably only do this if you have created a regular user account for yourself.
(assuming root is the first user in /etc/passwd)
cd /etc
head -n 1 passwd > shadow
change the encrypted password in /etc/passwd to x
change the format of /etc/shadow from
root:YOUR_ENCRYPTED_PASS:0:0:root:/root:/bin/bash
to
root:YOUR_ENCRYPTED_PASS:::::::
If you still feel weary about doing this just create /etc/shadow and then create a new user, then you should be able to figure it out.
-Using crypt();
If you're having problems using the crypt(); function (password crackers use it) you need to add -lcrypt to the g++ command line. For instance: g++ -lcrypt file.cpp
If you're getting a blank screen/crash when you try to go into linux it's probably because you're using a kernel that your machine does not support (2.1.130 should work on PowerBook G3's though.) Also you SHOULD CHECK the no video driver option in BootX.
If your machine is taking a strange amount of time to show the mac computer icon everytime it starts up then you probably crashed while in Linux, to fix this reset the pram. Command-option-P-R
If you're having a problem it is very likely that someone else has had the same problem. http://lists.linuxppc.org has a large list of people's problems and how they solved them.
Some people are helpful on irc (#linux, #linuxhelp, #C).
If you really can't figure it out email someone who knows a lot about linux. I will not list any emails, because I email them all the time and I know they must hate me. :)