Don't bin that PowerPC G5 Mac....

After visiting a 4-5000 year old burial chamber (Kennet and Avon Long Barrow) recently, as you do, I returned home and stared at the PowerPC G5 Mac that I had sitting on the corner of my "to do something with" desk.

The theme of death and re-birth was prominent in my mind and whilst I did have good intentions for the G5 originally (I was going to use it as-is to do NodeJS/Arduino/Raspberry Pi type of work, but after a few hours of hacking around, I became to realise that the MacOS level was limited, with no way to upgrade and the fact it was one of the last PowerPC and not Intel processors meant that software was just not written to work on it, without jumping through a lot of hoops.  A lot of hoops.) I was somewhat at a loss as what to use the machine for.  It seemed such a shame to bin it, just because Apple had abandoned it.

Now, I acquired the G5 from a recent work colleague who was moving house and considered it too much weight/hassle to pack it up etc...checking on eBay, it was only going for £30-£50, it was advertised for sale on a work forum, no takers.  I offered to take it.  It was a little damaged cosmetically (apparently, it was originally rescued from a University skip! See, just having that kind of history begs for it to be saved and to live on!) and there were a couple of dead strip pixels on the screen, but overall it actually worked okay.  As I say, it sat on the "to do something with" desk for a bit, I then hit the annoyance as mentioned above and then as if refreshed from my "walk in the rain" I then decided that I knew what to do....

I would install LINUX onto the PowerPC G5 Mac.

Yep.

Linux.

Well, isn't that ALWAYS the aim in (machine) life? Wipe out the old OS, put a new one in place that does the same thing, but gives new life to the hardware.

Besides, I had just completed a Udemy course on ARTIFICIAL INTELLIGENCE A-Z and it was a friggin' nightmare getting the required software setup and working on my MacBook Pro (Anaconda was okay, but Kivy, etc... just took a lot of undocumented hacking and wasted days of effort) - so I got to thinking, I could install Linux onto the PowerPC G5 Mac, get that setup and I could use that solely for the AI work that I want to do.

On the afore-mentioned "to do something with" desk, I still have my ArcTuRuS robot as well as the K9 robot, in various stages of "pause".  Why are they at the "pause" stage?.... well, whilst I have the hardware setup to read and gather the data from sensors and have them connected to the internet via WiFi...I reached the point of trying to work out how to handle the "mapping the environment" problem.  I had done some reading up on how I could approach the problem, gathering the data, sending it up to a service running on the inter-webs, store the data efficiently, then use that data for retrieval for the robot to "know the environment", so it would then be more intelligent in it's surroundings.  I dabbled with a few thing, but they just did not seem right.  So, I parked the robots until I could figure out something better to use.  Well, thanks to my new job role and the above mentioned AI course, I have found my answer (I believe).  The usage of Deep Q Learning / Convolutional Neural networks.  Anyway, I digress, but for a good reason - I now want to dust off the robots and implement the new AI approach into them, so they can learn their environment via their sensors and drive around the house autonomously, learning new things as they go about it without me having to teach them.  Pretty awesome stuff that will be written up in a later post, I am sure.

So, as you can see the PowerPC G5 Mac now has a purpose.  A goal.  It must now live in order to be used for the robots.  To do that we need to install LINUX.  After a bit of research, it turns out that UBuntu is the best flavour for the job.
As I have a Macbook Pro, I used that to download the required .iso file and burn it to a USB stick.

First step: get the .iso from here:

Second step: follow these instructions to install the .iso as a bootable USB stick.  Now, I already had Etcher installed (obviously!) so it was just a case of finding a spare 8Gb USB stick, plugging it in, Erasing the content and follow the simple instructions:

Once that was done, it was a case of unplugging the USB stick and sticking it in the back of the PowerPC G5 Mac.....
Switching on the Mac...oh, it just boots back into MacOS....hang on a minute.... I have a non-Apple keyboard plugged in, so after a bit of googling I find that the LEFT-ALT key is the "cmd" key and that the [Windows] key is the "option" key.  I try the reboot and hold the "option" key to select a drive to boot from.  Well, it works, kinda.  I just see the internal HDD, no USB.  Hmmmm....
After a bit of googling...okay, a lot of googling...I find one option that worked okay for me.
Reboot and HOLD, [LEFT-ALT], [Windows], [O] and [F] so that the Mac boots into the "Open Framework" command line.

Then type: boot ud:,\\:tbx;
(Obviously! Of course you knew to do that to boot the USB stick....I mean, it's obvious, isn't it?!?!)

Once you do that, then the Mac will boot from the USB stick and you get to see the boot up from UBuntu (yay!):

There were a couple of options available, I chose not to use the "default" (not sure if that was right or wrong, but it seemed to work out for me).  After a quick google, it looks like the G5 is a 64-bit machine - I'm sure something will tell me I'm wrong if it isn't.

I typed: live-powerpc64
This then starts running UBuntu from the USB stick.  Give it a minute and you should see this splash screen:

Looking good!  After pressing [Continue] you get the option to install locally:

 Select to nuke the existing HDD:

Yes, I'm really really sure!  Do it already....

 After a reasonably short period of time, you then get informed that it's "job done".  Note that a 3rd pixel stripe has appeared on the screen - that wasn't there earlier.....and spookily it disappears again later and has not returned as of yet.

The Mac will restart, you'll get a prompt to take the USB stick out the back of the machine and it'll continue to boot from the internal HDD:

It'll boot into different screens a few times, just leave it be.  It's probing the hardware, UFO style:
 Then you'll see that it gets to the internal HDD:

 And this is an important bit to notice.  It does not pick up the WiFi properly, we'll have to add the firmware for that later on:

Whilst it was doing the setup, Sashenka was "helping me", by chewing on a pigs ear (her favourite task of the day)

And there we have it!  Ubuntu is now running on the PowerPC G5 Mac:

SWEEEEEEEEEET!

A quick little dig around and it all looks good, it even runs at a very impressive speed too!  Wow!  There is going to be plenty of usage for this little machine after-all.

Obviously, it was time to do some Updates, that took 10 mins or so.  Now, the smart people in the room will be wondering,...."but how can you do updates with no network connection?".  It's called plugging in a wired cat5 cable intot he back of the machine and trailing it over the floor and plugging it into the router.  For now, that is the way to get this to work.  Download all the updates and reboot when needed:

Right, now for WiFi, you just have to do the following:

type: sudo apt-get install firmware-b43-installer
Now, you can either reboot here (if you're used to Windows), or you can do the following:

type: sudo modprobe -r b43
type: sudo modprobe b43

and then go take a look at [Networking], you'll see your WiFi router listed, click on it...then go over to the router, turn it upside down and try and enter the code correctly the first time :-)


Right, you are now done!  You have a PowerPC G5 Mac running a proper version of UBuntu LINUX that is actually very usable and useful!

Naturally, I then updated everything (again)

and then installed NodeJS and NPM - yep, they installed and worked a treat, blimey, they wouldn't run on the MacOS previously.  Am very happy that I have them running.  Pythin 2.7 is installed and working.
I installed jupyter, so I could run jupyter notebook.  That works fine.

Anaconda though, that proved more trouble-some, but I worked out I don't really need that.

To get Spyder2 to run,
type: sudo apt-get install spyder

then to run,
type: spyder

you'll see that it throws an error in relation to html5lib.  I found a work-around:
type: sudo pip install html5lib==0.9999999

unfortunately, this does get the Spyder IDE to appear briefly, but then I get a:
Segmentation fault (core dumped)

response.  :-(  ah, I'll get there.  It was only a flashy IDE, it's not totally essential, python still works from the command line  :-D


Anyway, that was that.  I did a thing.  It worked.  I wrote it down, so if I need to do it again, I can follow my own instructions.  Now, time to go figure out what I need to get my robots "alive".



Comments