Dual boot MintPPC / OSX Leopard

Recently I bought this beautiful iMac G5 iSight 20 inch. I swapped the custom HDD with a 500 Gb Samsung 850 EVO SSD mounted on a NewerTech AdapaDrive. I also replaced the faulty SuperDrive (thank you ifixit.com for your excellent guides). My idea was to have MintPPC running on this machine together with OSX Leopard, the last MacOS that will run on this machine. So how do we get this accomplished?

Most people will install MintPPC on a Mac which had OSX or OS9 installed on it. In that case, the hard drive has an Apple partitioning scheme, which is visible because the hard disk has the distinct 31.5 kb Apple partition map as the first partition. Gentoo has a nice page explaining all of this. Without this partitioning scheme, Apple New World machines would not be able to boot. So, if you would like to install MintPPC on a hard disk that did not yet have Apple MacOS on it before, you will have to create a partition table on the disk with an Apple partitioning scheme. You can do this from a MacOS installation DVD. Just before installation of MacOS, the installer gives the opportunity to launch Disk Utility. With this program, it is possible to get an Apple partition map on the disk. You can leave the whole disk empty as the MintPPC installer will later on partition the whole drive like you need to.

First install MintPPC according to the Installation Instructions. It is important to leave free space of at least 10Gb for OSX when you are at the partitioning stage. In my case, as it is a G5 iMac, I followed the instructions to partition the drive into seven partitions. I will go into detail as to what they are.

The first partition is the Apple Partition Map, we don’t need to make this one. We now create 6 more partitions.

The first partition which you have to create is a 1Mb NewWorld boot block, flagged as bootable. This partition has a hfs file system and will later be used to install yaboot, a bootloader for PowerPC machines like Macs.

The second partition we will create is a 1Gb ext2 partition mounted at /boot (note that you don’t need this one on G3, G4, see installation instructions). On this partition will reside the kernels and init ram disks.

The third partition we are going to create is a 10 or 20Gb ext4 partition mounted at / (root). This partition will contain all the system files to run Linux.

The fourth partition we will create is the swap partition. This one should be the amount of installed RAM memory and 500 Mb. So in my case, I have 2 Gb RAM, the swap will be 2.5 Gb.

The fifth partition we are going to make is 10 or 20 Gb or anything you like really, as home partition, mounted at /home with an ext4 file system. This partition will be used to host all user files.

The sixth partition that is left should be at least 10 Gb and we will leave it without a file system (empty). Later on, after MintPPC is installed, we will create a hfs+ (journaled hfs) file system on this partition for OSX.

It will look like this:

    #                    type name                length   base    ( size )  system

/dev/sda1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/sda2 Apple_Bootstrap bootstrap 1954 @ 64 (977.0k) NewWorld bootblock
/dev/sda3 Apple_UNIX_SVR2 boot 1953126 @ 2018 (953.7M) Linux native
/dev/sda4 Apple_UNIX_SVR2 root 39062501 @ 1955144 ( 18.6G) Linux native
/dev/sda5 Apple_UNIX_SVR2 swap 5859376 @ 41017645 ( 2.8G) Linux swap
/dev/sda6 Apple_UNIX_SVR2 home 39062501 @ 46877021 ( 18.6G) Linux native
/dev/sda7 Apple_HFS untitled 204800000 @ 85940224 ( 97.7G) HFS

Just follow the instructions for installing MintPPC. Now that we have MintPPC installed and booted into it, we need to install some programs:

sudo apt install gparted hfsplus hfsprogs

Now launch gparted from the menu. Be careful with gparted, it can ruin everything on the disk!
In gparted scan the disk. You will see all the partitions. In the empty partition you can now create a hfs+ file system. It will look similar to what I have (I have an extra 8th ext4 partition for mirroring Debian ports).

GParted on my iMac G5 with 500 Gb SSD

Now it is time to get the OSX installation DVD. Reboot into the OSX installer and install OSX in the partition you just formatted. After the installation is finished your Mac will boot into OSX and will not ‘see’ Linux anymore. The OSX installer has reconfigured open firmware to boot directly into OSX. We will have to restore yaboot and make yaboot dual boot OSX and Linux.

Boot again from your MintPPC image and go back to rescue mode (see Installation Instructions for more details). We will do the following again in a shell:

yabootconfig -b /dev/sda2
ybin -v
exit

Now reboot and let the Mac boot from the hard disk. You will have the option now to boot MintPPC, do that. In MintPPC we will now adapt yaboot so it will also give the possibility to boot OSX. For that you need to edit /etc/yaboot.conf and make sure you have the following lines added:

macosx=/dev/sda7
defaultos=linux

You may also set your default operating system to macosx. We will now have to copy these settings into open firmware:

ybin -v

Now reboot one last time and you will see the option to boot into OSX in the yaboot menu. You will now be able to boot in MintPPC as well as OSX. Enjoy !

Experimenting with building installer images

As we all know, powerpc and ppc64 are no longer officially supported by Debian. Adrian Glaubitz does a great job to mirror the packages for the supported architectures to Debian-ports. There is a price to pay though: not everything works as it used to be when powerpc had official releases. There are two things that bother me at the moment. The first is the fact that when using the Debian installer images, there is no working bootloader installed. The modern Debian uses Grub and this does not yet work for us powerpc users. A solution to this is to execute a shell from the menu of debian-installer to get yaboot installed in the bootstrap partition (see installation instructions MintPPC). I do not particularly like this. Secondly, as Debian-ports is updated daily, very often packages cannot be built automatically as the introduction of some package may lead to unsuccessful building of other packages. This leads to a situation wherein the installer is sometimes able to install MintPPC and at other times it is not. People who want to install MintPPC have to then be lucky that the Debian-ports repo is ‘on their side’ so to speak.

To counter those problems I am now experimenting with creating my own installer images. Last night I was finally able to create debian-installer for ppc64 with a 64-bits version of yaboot-installer in it. If this works, as I hope it should, it will install a Debian system with yaboot as bootloader, like it used to be in the past. Apparently Lubuntu 16.04 still uses yaboot and why not? It works great. Later on I will also build a 32-bits version of Debian-installer with yaboot-installer. What I am now most interested in is to see whether I can incorporate said Debian-installer into a DVD installation image. The latter image should contain all the required packages for installing the Debian core of MintPPC. I just have to wait for the right moment when all packages on Debian-ports allow one to install MintPPC. I will then make a snapshot of Debian-ports and create my own DVD image. Last weekend I was able to mirror powerpc and ppc64 Debian-ports to my iMac G5. So I have now access to all packages for powerpc and ppd64 and can create something out of it at any moment.

In the future this should lead to a downloadable iso, which can be copied onto a DVD (or set of CD’s) which allows for installation of MintPPC without the need of downloading the packages from Debian-ports over the internet while installing. It should then be much easier and more successful as the packages have been tested before and will always give a stable system from where one can upgrade to the latest (semi rolling releases).

MintPPC for G5 not working yet

Yesterday it was “saxfun” in the Macrumors forum who successfully installed MintPPC for the first time on his PowerBook G4. It shows that the MintPPC installation image for G3 and G4, which is 32-bits, works well. Another person (MacBoer on the same forum) tried the 64-bits image on his G5 iMac but he was unsuccessful. This result was to be expected as the MintPPC repository only has 32-bits packages at the moment. I am working to build the architecture specific MintPPC packages on my iMac G5. I have to first get a working Debian sid on this machine. Luckily, the same person who tried to install MintPPC on his G5, was finally able to install ppc64 Debian sid with some help. We now know how to do it. Apparently there is a problem with 64-bits yaboot. Said package cannot handle kernels which reside on ext4. Switching to ext3 was the solution. I will in due course adapt the installation instructions page to make installations on G5 successful as well.

When the installation of MintPPC on G5 works out of the box I will write another blog post to announce it. I will then have updated the Installation instructions page. So please be a little bit patient as MintPPC for G5 is coming…

Installer

What a journey it is to get MintPPC automatically installed. Yesterday I finally made a breakthrough. The installer is now able to detect my local repository, the Debian-ports repository, to add the required keys and to start downloading and installing all required packages to get to the MintPPC desktop. There is still one problem, which is the same for Debian: Grub. The recent debian-installers ditched yaboot for grub and we are now, after installing the system, left on our own to install the yaboot bootloader. I will try a little bit more to get the yaboot-installer to work in the recent debian-installer but if that fails, I will leave it at that.

There are some minor things that need to be done. I am working on that. One problem I encountered is that mint-artwork breaks the system. I will need to rebuild the package for recent sid. Some other small details are the configuration of the wallpaper for smaller monitors. If that is finished I will try to dump my installer iso somewhere in Google drive so you can start testing the alpha release.

Manual installation MintPPC

I will give some guidance on how to manually install the Mint layer on top of Debian sid. Debian sid can be installed as described in my other post.

If you end up with a black screen after booting, follow this page.

First we need to make sure we have the right PATH settings, so as root:
export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin

Then we need to make sure you as user is added to the sudoers list to perform administrative tasks in your system.

The best way to do this, but it doesn’t always work, is to do the following (as root):
usermod -aG sudo your_user_name

If the former does not work, edit /etc/sudoers and add under %sudo ALL=(ALL:ALL) ALL

username ALL=(ALL:ALL) ALL
Make sure you change “username” with the name of the user that you want to grant access to.

We are first going to adapt the /etc/apt/sources.list file:
sudo apt edit-sources
Add the following lines:

for MintPPC32:
deb http://u58733p55594.web0093.zxcs-klant.nl/repo unstable main
deb http://u58733p55594.web0093.zxcs-klant.nl/wicknix ./

for MintPPC64:
deb http://u58733p55594.web0093.zxcs-klant.nl/repo-64 unstable main
deb http://u58733p55594.web0093.zxcs-klant.nl/xeno74 ./

Then we update the repo:
sudo apt update

You will see that we will need my public gpg key:
wget http://u58733p55594.web0093.zxcs-klant.nl/repo/key/public.gpg.key

gpg --no-default-keyring --keyring ./temp-keyring.gpg --import public.gpg.key

gpg --keyring ./temp-keyring.gpg --no-default-keyring --export -a > mintppc.asc

rm temp-keyring.gpg

sudo mv mintppc.asc /etc/apt/keyrings

To know more about importing public keys the right (Debian) way, see this link.

Edit the file /etc/apt/sources.list, and in between deb and the url, add [signed-by=/etc/apt/keyrings/mintppc.asc]

For MintPPC32 it will look like:
#MintPPC32 repository
deb [signed-by=/etc/apt/keyrings/mintppc.asc] http://u58733p55594.web0093.zxcs-klant.nl/repo unstable main
#MintPPC32 additional repository
deb [signed-by=/etc/apt/keyrings/mintppc.asc] http://u58733p55594.web0093.zxcs-klant.nl/wicknix ./

For MintPPC64 it will look like:
#MintPPC64 repository
deb [signed-by=/etc/apt/keyrings/mintppc.asc] http://u58733p55594.web0093.zxcs-klant.nl/repo-64 unstable main
#MintPPC64 additional repository
deb [signed-by=/etc/apt/keyrings/mintppc.asc] http://u58733p55594.web0093.zxcs-klant.nl/xeno74 ./

sudo apt update

Now we are going to install MintPPC specific packages and some other packages to install a desktop. During installation select lxdm as display manager instead of lightdm. We will install these:

sudo apt install
task-lxde-desktop lxdm mint-artwork mint-artwork-lxde mint-common \
mint-lxde-default-settings mint-x-icons mint-y-icons mint-l-icons mint-themes \
mint-backgrounds-tina mint-backgrounds-ulyana mintsystem mint-l-theme xdg-user-dirs \
xdg-user-dirs-gtk libglib2.0-bin hfsutils evince \
firmware-linux-nonfree firmware-amd-graphics package-update-indicator \
brasero mtpaint pidgin xpad l3afpad arcticfox sealion sylpheed \
gnome-screenshot mesa-utils mesa-utils-extra mint-cursor-themes \
gnome-themes-extra network-manager network-manager-gnome \
gucharmap galculator scrot preload xserver-xorg-video-nouveau sudo

To download this task and execute it:
wget http://u58733p55594.web0093.zxcs-klant.nl/task-mintppc
chmod u+x task-mintppc
./task-mintppc

To install the right airport driver have a look here.

Make sure that you have configured the right display (or login) manager, if it has not already been done during package installation:
sudo dpkg-reconfigure lxdm
Select lxdm, then ok

Now we delete the display manager package lightdm if it is present:
sudo apt remove lightdm

Installing MintPPC in the usual way is done within an installer medium and a preseed file. Packages are installed and only after that, regular users are created. In this way, the newly created user gets all the MintPPC specific tweaks. As we now start from a system where user(s) are already set up, installing these MintPPC specific packages will not affect those users.

You have to either create a new user, or do a trick (in that case skip the following step).

So, in order to have a nice desktop, we have to create a new user which will be you. Give that user administration rights and then after everything is set up, delete the old user account. Users can be created and deleted from the Menu, Preferences, Users and Groups. After the new user is created, logout from this session (Menu, Logout and click Logout).

If you don’t want to create a new user you have to copy everything from /etc/skel into your home folder. Go to your home folder and issue:
cp -r /etc/skel/* .
cp -r /etc/skel/.* .


Now log into into LXDE with your new user account and choose the Mint-LXDE session. You will then see the MintPPC desktop. For some reason I don’t know yet, the file manager PCManFM does not display the icons the first time I log in. After logging out and in again, you will see the nice icon set in the Home folder. There is one thing I don’t like, which I have to fix, is the background. Right click on the desktop and click Desktop Preferences (can also be done via the Menu, Preferences, Desktop Preferences). Choose Wallpaper mode ‘Stretch and crop to fill the monitor area’.


To get sound working install alsa-utils and launch alsamixer sudo apt install alsa-utils
alsamixer

Then hit fn+F6 (SoundByLayout)
go to the right and make sure you have PCM at 80<>80
ESC to exit alsamixer

You should have sound now…

Do not do the following in virtual emulated environment (qemu):
To tweak Debian to Linux Mint Debian, install debian-system-adjustments:

sudo apt install debian-system-adjustments

Make sure you also edit /etc/apt/sources.list and remove or add an # in front of the deb-src entry for Debian, as there is none in Debian-ports.

To make SeaLion browser work in MintPPC64 do the following in /usr/lib/powerpc64-linux-gnu:
sudo ln -s libffi.so.8 libffi.so.6
SeaLion was compiled in an older version of Debian, therefore we need to soft link the old library to the newer one.

Reboot into MintPPC. At Grub you now see LMDE 6 Faye if you are not in an emulated (qemu) environment. Boot into MintPPC and that’s it folks.
Enjoy your MintPPC desktop!

I hope that you will enjoy your new desktop. Please give me feedback!

Installation woes

For the past couple of days I have been trying to get MintPPC installed in an easy way onto my iBook. I found out that using a preseed file with a repository elsewhere won’t work as the modern Debian netinstaller does not accept repositories as the installer environment does not have gpg to its disposal. Downloading a key works but the installer then fails to incorporate it (add-key). I also looked into live-build, a Debian tool to create live environments. Unfortunately this won’t work on PPC based computers: it only has support for i386 and amd64. Basically I am a little bit stuck here now. There is one more option that I am going to try now and that is trying to customize the Jessie Netinstallation CD / DVD to have MintPPC specific packages and other packages which are not in Debian-ports in an extra pool and to then repackage the whole stuff using a modified keyring, incorporating my own gpg key. Hopefully that will lead me somewhere. If not, the only option I can think of is for users to install Debian sid LXDE, add the MintPPC repository manually in the /etc/apt/sources.list and to then install all packages by hand. I could make a small script to get this all done. The latter is not ideal but might be the only way.

Configuration of Mint-LXDE

Wow, finally I got ‘mint-lxde-default-settings’ working. This package deals with all tweaks to get a Mint-LXDE desktop. The package will provide newly created users with a beautiful looking desktop, which is already quite similar to Linux Mint. I think I have the most difficult part behind me now. Soon, volunteers may start testing MintPPC. For that, I will make a post about how to install the MintPPC layer on top of Debian sid. I attached two desktop pictures so you have an idea how it is going to look like!

Installing Debian sid LXDE

For those of you who are willing to go down the rabbit hole, I hereby present a quick guide to get Debian sid with an LXDE desktop installed reliably on PowerPC based computers.

Quick installation guide

Install an lxde-desktop with the latest sid image:
https://cdimage.debian.org/cdimage/ports/snapshots/2023-06-18/debian-12.0.0-powerpc-NETINST-1.iso

If you boot into a black screen, follow this page.


Then after reboot make sure that you have ntp installed
apt install ntp
as you need to have the correct time and date. On my old iBook the battery that keeps the date and time correct is dead, so syncing with a time server is needed. You may need to add:
deb [arch=all] http://ftp.debian.org/debian sid main
to the apt sources list with
apt edit-sources
then update
apt update
apt install ntp

then make sure you have the correct time and date

We also want to fix the Home folder:
apt install xdg-userdirs xdg-user-dirs-gtk

Then it is time to edit the apt sources file again:
apt edit-sources
and add the following line:
deb http://ftp.ports.debian.org/debian-ports unstable main
apt update
then it will complain about the missing key for debian-ports (outdated needs to be changed, key is old):
gpg --recv-keys 81DCBC61
gpg -a --export 81DCBC61 | sudo apt-key add -

uncomment the DVD/CD deb line as well as the sid repository you just added
apt edit-sources
and then update
apt update

The better way to have the right key is to download debian-ports-archive-keyring and install it with
dpkg -i debian-ports-archive-keyring_20xx.xx.xx
use the correct date

If everything went well you are in sid/bullseye!
cat /etc/debian_version

Reboot and enjoy your Debian sid LXDE.

Please feel free to give comments and corrections to this guide. I will try to make a wiki post out of it later.