Trebizond

Thoughts on Life, History, Classics, Computers, Games, and Debian Linux

Name:
Location: Massachusetts, United States

Tuesday, November 29, 2005

Installing Debian Sarge on a Beige G3

Easier said than done! This is something I've wanted to try for a little bit now, I wouldn't say that Beige G3's are exactly widespread, but they exist in fairly large numbers for a Mac. I recall that when I first started college there were two models going around, the first iMacs and the last of the AIO's, what I now know as a Beige G3. I of course had a PC...

Flash forward a few years, oh man, 7 years I guess now, and Debian Sarge is finally out -- hehehehe, it wasn't quite that bad. I've come into possession of a bare motherboard for a beige G3, passive heatsink and all. Now these Beige G3's are beautiful for what they do -- first and foremost is a power/performance thing. These guys suck up a paltry 6W of electricity and put out performance roughly equal to a Pentium II 300, which suck up give or take 25W of electricity. The chips are passively cooled. You can overclock it by switching just one single jumper. Most importantly, perhaps, is the fact that with the switching of another jumper, you can go back and forth between a standard ATX power supply and the Mac power supply, which is physically identical to the ATX spec but they switched around the pins a bit, so if you tried to get around going through Mac support those evil Mac designers would make you suffer a fiery death, should you not know about the jumper, that is :-)

Now for the downsides of the Beige G3. It sucks. Nah, seriously, it was certainly behind the curve in certain areas, which makes life all the more difficult. Let's go through a few, shall we? The onboard NIC runs at 10 Mbps, which wouldn't be so bad, except that I find that it barely runs at that. The onboard SCSI controller is there for mostly legacy purposes and is the old 50-pin one. The onboard IDE controller was probably something close to Apple's first crack at it, and so the primary works well (with that 8gb limit that was found on like Pentium I boards), but support for the secondary drives is often touch and go. And let's not forget the ATi Rage chip on there -- we used to joke about that in college, about the Rage... on both PC's and Mac's they were a big thing and like everyone had one... such hositlity pent up inside those boxes... ah, those days... :-)

The real reason, though, why we all hate the G3's is for their buggy BIOS, called OpenFirmware -- there are quirks with it in models well beyond our little Beige G3, but with our little guy, and with my computer in particular, it is going to put you through the ringer, should you try to boot straight from the BIOS right into Debian Sarge. Having tried and failed several times, I ended up giving up on it, because to me, it wasn't worth the effort. This is what's called an "Old World" mac. "New World" macs, when they gave up on ADB, SCSI, and several other of the long-standing Macisms and went to USB, standard IDE, and other things to not be different for the sake of being different, which are like the iMac on up, those apparently don't give you much trouble trying to take Linux. Not our Old World mac, however! But that's why I'm writing this! So others won't have to go through the same things I did...

Now for why Apple sucks! Rather than try to support as much of their hardware as they could, they decided to make sure that if you were using a beige G3 and wanted to us OS X that you would suffer dearly for not shelling out another $1500 to Mac central. If the OS X support were better (i.e., support for the 3d acceleration, the "Personality Cards" (and maybe that should go in the sucky section), etc etc, I'd be using that and putting all my GNU software on another *NIX. Oh well :-)

So here's the setup: I've got a Beige G3 Desktop, with its standard CD-ROM drive, 4gb IDE drive, plenty of memory added in, and for add-on cards, an Adaptec 2940 SCSI with a 4gb off of that, and then for what I'm really using: An Acard ATA-66 controller card (to get the improved speed of ATA-66 along with the support for large drives), a 20GB drive attached to the IDE controller card, and a Digital Corp. 10/100 NIC. Man, I miss Digital. Anyways -- continuing :-) Mac OS 9 is installed with the basic, normal setup.

I also ended up needing brief access to another computer and a copy of Knoppix to get some files off of that 20GB hard drive. I personally then used a third computer to transfer files back to the Beige G3, but that's not strictly necessary.

My original hope had been to install Sarge on the 20gb all by itself, and have the computer boot right to it. Not so much. If you're going to try to boot straight to Linux, you're going to have to use the quik bootloader, and that'll require your root partition, at least, to be on the primary channel of IDE0, or in other words, you'll have to wipe the Mac partition clean, essentially, and just use Linux. Not too bad an idea -- and I even tried that -- except that OpenFirmware, not so friendly. It would never seem to boot properly to that first hard drive. The difficulty with that and experimenting, as well, is that to get back to the install, you essentially have to re-install OS 9 to then quickly blow it away again. Kind of a pain. To me, at least, not worth the effort.

Our other option for all of this is BootX. BootX is a Mac application that shoots you to Linux (or the Mach Microkernel, another long, painful story for NuBus Macs), and that's how we're going to get started, at least, and perhaps how we're going to continue. Let's get started, then, shall we?


There are going to be 3 basic stages. First stage is going to be setting up our bootloader, BootX, and getting the base install from the netinst CD onto the hard drive. Second stage is going to be booting into the initial installation. The third stage will be getting the newly-installed Kernel off of the linux partition and back onto the Mac OS drive. Fourth and last stage is some of the clean-up problems I encountered and stabilizing your Debian Sarge experience.

Stage 1:

(1) I'll assume that:

(a) your Mac is connected to the Internet (failing this, you'll need to use another computer to do step 2)
(b) you're running OS 9
(c) you have gotten ahold of the Debian Sarge Netinst CD, burned it somehow, and that it is now in your CD drive. You probably already know, but just to make sure, you want the PowerPC Netinst CD, because your CPU is a PowerPC.
(d) you are computer-saavy enough to have, for instance, put that 20gb disk into a computer, and be able to put it into another.

(2) Download the last BootX from PengiunPPC here. Unpacking it gives you a folder with various items underneath.

(3) Follow the instructions that the BootX program gives you for setting it up. Briefly, you open up the Macintosh Hard Drive, Go to the System Folder, and you copy the BootX extention to the Extentions folder, the BootX App to the Control Panel, and you copy that empty Linux kernels as a new folder in the System Folder. Feel free to close the BootX folder that we just copied all of that stuff from, we're done with it.

(4) We've got that NetInst CD in the drive. Inside the "install" folder is a "powerpc" folder. Copy all of the stuff from inside that "powerpc" folder to that empty Linux Kernels folder that we put in the System Folder in step 3. Once it's done copying, feel free to close everything we have open. Keep the CD in the drive.

Let's review Stage 1: You've downloaded theBootloader into Mac OS 9, you've copied all of the necessary files to appropriate locations, and you've copied the files we need for the next steps. Not too shabby!

Stage 2:

(5) Now we're going to go to the little Apple in the upper left hand corner of the screen, to control panels, and then to BootX.



(6) It should bring up the Main screen as seen to my left! The kernel should read vmlinuz by default, and you can keep it that way!

(7) Your mileage may vary (YMMV), but I didn't need any kernel arguments, and I made the "No video driver" checked.


(8) Now, let's click on the options, and it should bring up a screen that looks like the screen to the right.

(9) The important one here is the "Use Specified Ramdisk." That one is going to bring up a little file selection menu. Go to the System Folder-->Linux Kernels-->initrd.gz

(10) Click OK to get back to the main screen.

(11) Now, cross your fingers, and use that silly one-button mouse to click the big Linux button. It should, hopefully, begin to sputter out tons of information about what the computer is doing right now. No need to worry! Eventually, it should bring you to a blue screen that asks you to choose your language.

(12) For this part, please refer to the Debian installation manual for help running through the setup program. It's fairly straightforward, If there are an abudance of comments maybe I'll write up a quick walkthrough. I'll put down some things to note:
(a) Because I had two network cards (the onboard and my add-in 10/100), it asked me to choose which one I wanted. It should be fairly evident from the description it gives you.
(b) If you want to use quik, that root partition HAS to be ext2. In the default paritioning, it's probably going to default you to use ext3, so you may have to manually edit the parition table. It's not difficult, but it's another good reason to stick with BootX. As a word to the wise, BE CAREFUL WHEN YOU PARTITION. If you're using BootX, don't you dare re-partition or erase the Mac OS parition. Otherwise there won't be anything left for you to boot from, and when you come back from the restart at the end, you'll get a disk with a question mark instead of a smiling Macintosh.
(c) If you decide to do what I did, you're going to want to install all of the files into one parition, in my case, it was easy to pick out that 20gb drive.
(d) It took a while for the old CD-ROM to read information off of the CD. On more than one occassion, before I got the pattern of this write-up, it asked me which Kernel I wanted. the straight PowerPC will do nicely :-)

(13) Because I used BootX, the install will eventually screamed at me that it could not continue because it could not install quik. I simply continued past it, and in the menu option, it gives you a choice to "Continue without bootloader." It gave me the message “You will need to boot manually with the /boot/vmlinux kernel on partition /dev/hde2 and root=/dev/hde2 passed as kernel argument." Write down what it tells you. It should then ask you to remove the disk and restart. Go ahead, but shut it down before it comes back up. We need to do some things first (If you miss the window, not a problem, just go into Mac OS and shut down from there)

Let's Review Stage 2: You've gone ahead and loaded up the Debian install from the Boot-X bootloader, and in the processes that followed, you've partitioned and formatted a drive. You've also installed the basic files that we need to run Linux! Congratulations!

Stage 3:

(14) Great, we now have a very basic, basic linux system on that hard drive. What could be wrong? Well, in order to use BootX we need the kernel and the initial ramdisk that was generated during that installation. Problem is that OS 9 doesn't read linux file systems. We need some way to get that kernel off of the hard drive and onto the Mac partition. I agonized over this quite a bit, the easiest way is probably to get another computer, preferrably a PC. OS X will also probably read this information, so if you had such a machine lying around, well, you probably wouldn't be installing Linux on an old G3, but who knows?
(15) This is where your creativity comes in a little bit. I'll tell you what I did, and then give you some suggestions about what to do. I have a third computer that runs an FTP server. What I did was attach our fresh linux hard drive to a PC (an x86), and then I inserted Knoppix into the cd-rom, and booted from the cdrom. That gave me access to the fresh linux hard drive. From there, I uploaded the files that you'll learn about in Step 16 to the FTP server, and from there I put the hard drive back in the Mac, loaded up Mac OS 9, and went through ftp to download those files. There are several options here, as noted above, an OS X machine should read the linux partition, another linux box will naturally be able to do it. Once you have access to the hard drive, you can offload it to a little USB pen drive, you can email it to yourself if you have a large enough webmail account, burn it onto a CD. Somehow, though, you're going to need to get the file off of the hard drive and onto the Mac.
(16) However you do it, here's what needs to be done:
(a) Inside the "boot" folder, copy the vmlinux-2.6.8-powerpc and the initrd.img-2.6.8-powerpc to your "escape hatch," however you're getting the file from the hard drive to the Mac.
(b) Put the hard drive back into the G3 you're working on.
(c) Load up Mac OS 9
(d) Go to the System Folder-->Linux Kernels, and erase everything there.
(e) Copy the vmlinux-... and the initrd-... to the Linux Kernels.

Let's review Stage 3: Tricky stage, and it's good for some improvisation. Obviously, it's not the ideal situation, but we've removed the hard drive we just installed Linux on, we've somehow gotten two files from it, and we've put the hard drive back, replacing the install kernel with our now-set-up kernel.

Stage 4: Almost there!

(18) Now that we have the new kernel/initrd on there, using Boot X boot to them as in Stage 2 -- the installation process should continue.
(19) I ended up having to apt-get all of the X11 and Gnome stuff once I got through the install process, because for whatever reason when I picked the desktop pieces to install, it didn't do that. YMMV, but I really did end up having to do quite a bit of apt-get afterwards. It did work, though, once all of that happened, amazingly enough the PPC stuff works just beautifully, like the x86 stuff :-) Who woulda thunk it? The Debian developers, I guess :-)

I tried getting the sound to work briefly before I had to end my little experiment, and it was not a happy experience at all, I ended up "losing" the NICs and I never really had a chance to go back and take a look at how to fix it, so be careful with that G3 sound :-)

If you have any comments/questions, please leave 'em and I'll try to help if I can!

Special thanks first and foremost to all those who contribute to Debian, what would we do without you? Also to the keepers of Penguin PPC, and to Benjamin Herrenschmidt for making BootX.

0 Comments:

Post a Comment

<< Home