Motivations This work was initiated when two needs happen to cross : on one path a colleague who participate on our research project on teaching climate change needed some linux machines for his higher secondary school and had some of those iMacs unused; on the other path during one of my voluntary participations on linux and free software aproposed asked the same question.
Aknowledgements
great thanks to Éric Lejan, distinguished Apple user who provided valuable advices, tricks and support all along this work.
Summary
- Beforehand remarks
-
Preparing an vintage iMac bootable key "iMac2006_key" a. Building and formatting an USB key i. Create partitions i. Check and format
b. Install bootloader c. Install System on iMac2006_key i. Last amendments on EFI partition 1. Installing debian gnu-linux on a vintage iMac with our iMac2006_key a. Install standard linux system b. Low level configuration of the new linux system c. Advanced configuration of the new linux system
* Downloads *
- debian unofficial non-free image https://astrofloyd.wordpress.com/2014/01/14/linux-only-installation-on-2006-macbook-using-refind/
1. Beforehand remarks
All this work did not enable to get the Radeon mobility X1600 to work
, here are some reasons that were identified :
* There is no driver `RV530` in the package `firmware-amd-graphics`
* The driver is required at early boot stage but even if `clover` may do the job, last usable version (1000) is too old and no configuration fits the needs
* In some tests during the boot process the machine claimed a BIOS driver which is peculiar for an `EFI` system
You may have participated to "install parties" and may wonder why I waste my time to write a tutorial that exists in many places on the net. In fact if you tackle this particular iMac with your ordinary tools like alinux live key
or linux install key
you might be very surprised because this vintage tool will probably not see your key as bootable and will never boot ! If you use one of the tricks available (and mostly hidden) on the net, you may succeed in booting installing it, you will not get a graphics display which is more than weird for an apple computer...
Those problems arise because this iMac sometimes known as vintage or collector is the first iMac-Intel, it was born at the beginning of the era of EFI
in february 2006 and died the same year in october replaced by more stable and conventional models. We shall discover all the paricularities along the installation.
Another impotant point to have in mind is that this is an old machine that may have slept for long time and the "CMOS RAM battery" ("PRAM battery" in apple language) may be too weak to fullfill its job and in that case the iMac does not boot! Do not panic if you get the famous "blankscreen of the death" check the little battery and replace it if needed.
To be safe before any attempt clone your hard disk (that will be very usefull when the mac refuses to boot with the internal disk once modified), format a spare disk, check that you have 2 partitions on the disk : an ESP
(EF) and an HFS+
with the clone of he system and the data.
2. Preparing an vintage iMac bootable key "iMac2006_key"
As described in the previous chapter we canot use an ISO linux image or a legacy boot install USB key this machine has the following requirements :
* provide USB key with GPT partition table
* provide USB key with EFI partition
bearing an /EFI
or /efi
folder
* provide a 32bit
booting program named BOOT.EFI
2.1. Building and formatting an USB key
To do this first step we need to install a grub-efi 32bit
on an USB key which is a little tricky if you run a 64bit linux machine
. I will not consider other source OS than linux. debian
distribution contain packages to install a 32 bit grub on a disk that's why I have choosen to use it. Of course it is possible to install the 32bit packages on a 64 bit machine, very easily if you run multiarch support
BUT I ran into serious trouble when I tried that... I cannot confirm that I did not any wrong typing but that was the firstcause of pain (in a long list...). To avoid those problems :
* create an USB debian 32 bit live key, I use the unofficial non-free image because of some of the firmware needed by my laptop but any debian live image will do (if your harware drivers are all free)
* boot your computer on this image
You are now running a lightweight debian stable 32bit. We have to add some packages dedicated to our goal with the command
sudo apt update
sudo apt install gparted grub-efi grub-efi-ia32 grub-efi-ia32-bin grub-customizer
Packages and all the required dependencies are installed
Take an empty USB key that will be used to install debian
on the iMac. The key must be empy everything that might be on the key will be erased and totally lost. You can erase and format your key using gparted
, take extreme care on these operations there is no way to go back, do not erase your internal hard disk do not erase the key on which you have booted.
Create partitions
Many methods are possible for this step, I'll use the command line one, in this situation my hard disk is /dev/sda
, the key used to boot the 32 bit system is /dev/sdb
, the key we want to use is /dev/sdc
. I'll use /dev/sdX
in this text but /dev/sdX
is /dev/sdc
in my case.
sudo gdisk /dev/sdX
type
o # creates a new GPT partition table
n # create a new partition
1 # first partition on the key
enter # accept the default first sector proposed
+100M # create a partition of 100MB size
0ef00 # create an EFI (esb) partition
n # create a new partition
2 # second partition on the key
enter # accept the default first sector proposed
enter # accept the default last sector proposed
0700 # create microsoft basic data partition
w #execute the commands
y # confirm
Check and format
Use sudo gparted
to check that the structure is correct and format in fat32 both partitions. At the end of the process you should have two partitions on your disk dev/sdX
:
* EFI system fat 32 100Mio
* Microsoft basic data (rest of the key)
2.2. Install bootloader
To install the bootloader we need to have acces to the new partitions we have just created we need to create mounting poionts and mount them.
sudo mkdir /mnt/disk1
sudo mkdir /mnt/disk2
sudo mount /dev/sdX1 /mnt/disk1
sudo mount /dev/sdX2 /mnt/disk2
sudo grub-install --target=i386-efi --efi-directory=/mnt/disk1 --bootloader-id=boot.efi --boot-directory=/mnt/disk2/boot --removable /dev/sdX
Bootloader is installed we can go back to our standard linux laptop for the next steps.
sudo umount /mnt/disk1
sudo umount /mnt/disk2
Eject iMac2006_key.
2.3. Install System on iMac2006_key
Go back to your c"comfortable" computer plug in the iMac2006_key. To avoid any interference with ordinary files I mount the partitions on mnt/disk1 and mnt/disk2 mount points. My iMac2006_key is identified as /dev/sdh
so here /dev/sdh
is /dev/sdX
.
sudo umount /dev/sdX2
sudo mount /dev/sdX1 /mnt/disk1
sudo mount /dev/sdX2 /mnt/disk2
Last amendments on EFI partition
The first spacial feature is that the iMac will recognize as bootable keys that bear a boot.efi
file. We have to change the boot name of our iMac2006_key to make it visible to the iMac.
cd /mnt/disk1/EFI/BOOT/
sudo cp BOOTIA32.EFI BOOT.EFI
Add system on the iMac2006_key
Dowload the iso 32bit image
you want to install on your iMac I choosed debian-live-10.3.0-i386-gnome+nonfree.iso
then uncompress the system on your iMac2006_key.
sudo 7z x /pathTo/debian-live-9.1.0-amd64-gnome+nonfree.iso -o/mnt/disk2
#click A to replace all the "old" files provided by grub-install with files provided by the distribution you want to install
The extraction/copy will take some time. and finally you'll get the following structure on your key :
cd /mnt/disk2
ls
boot/ '[BOOT]'/ d-i/ dists/ EFI/ firmware/ isolinux/ live/ pool/
sudo cp -r EFI/debian/ grub
sudo mv EFI liveEFI
Your iMac2006_key is ready to install a system on the iMac. Unfortunately we have some new problems to tackle because of the Radeon Mobility X1600 graphic board
installed on the iMac. It will not be possible to boot on the brand new linux live but the installer works perfectly. It is also possible to boot the live image without graphics which could be usefull in case of any trouble by enabling remote login. Edit /boot/grub/grub.cfg
and add "nomodeset" on kernel command line.
Let's use the install program.
sudo umount /mnt/disk1
sudo umount /mnt/disk2
retrieve the USB key
3. Installing debian gnu-linux on a vintage iMac with our iMac2006_key
Here starts the tricky part of the process !
3.1. Install standard linux system
switch off the iMac plug in the iMac2006_key, switch on the iMac and as soon as you hear the chime press one of the alt keys
after few seconds you'll see the two possible boot disks choose the external key click enter
. You get a white screen then the grub boot screen. Unfortunately there is no operational graphics driver then you must choose one of the available install methods. The graphic method functions properly.
Do not interrupt the installation and wait for the iMac to reboot on its own.
When the iMac reboots choose advanced menu and recovery boot, click on "e" to edit the boot menu and add nomodeset
or radeon.modeset=0
at the end of the line starting with linux
. The imac will boot in standalone mode without trying to activate the radeon mobility X1600
board that will bring a standard standalone linux behaviour and will enable further work.
Note that at that point this iMac is fully operationnal in console mode or a as a terminal server.
3.2. Low level configuration of the new linux system
When the iMac is booted in linux standalone we need to install some packages, start some services and remove some locks to work comfortably. We will start the network, install and start the ssh
server, remove the standalone lock. On the standalone shell on the iMac type the following commands
apt update
apt upgrade
apt install openssh-server
apt systemctl start network-manager
rm /run/nologin
It is now possible to join on the iMac from a remote machine. We created the user moonraker with sudo capability, we can login from any computer on the same network :
ssh moonraker@192.168.***.***
At this point we have a fully operationnal hackintosh with no graphics if we add the nomodeset
option to the linux command line in the grub.cfg file.
4. All the tricks that did not work
Trying to cheat on the driver
Using Bootloader managers
On the linux side with rEFInd
On Apple side with Clover
Even if linux works on the iMac we need to find a way to activate the graphics interface. The problem is that the radeon mobility X1600
driver must be loaded during the early stages of booting process. To do that we are going to install rEFInd
boot manager and modify the configuration to provide yhe drivers
sudo apt install refind refind-install
add contrib non-free in /etc/apt/sources.list
sudo apt install firmware-b43-installer
add module name to /etc/modules to load at boot time lsinitramfs /boot/initrd.img-4.19.0-8-686 | m
cp /lib/firmware/radeon/R520_cp.bin /lib/firmware/radeon/RV530_cp.bin /usr/share/metainfo/firmware-amd-graphics.metainfo.xml
(cpio -id; zcat | cpio -id) < /boot/initrd.img-4.19.0-8-686
F10 key ==> File Edit Search Buffers Windows System Help
!/bin/sh -e
PREREQS=""
prereqs() { echo "$PREREQS"; }
case "$1" in prereqs) prereqs exit 0 ;; esac
. /usr/share/initramfs-tools/hook-functions
cp /lib/firmware/radeon/R520_cp.bin "$DESTDIR/usr/lib/firmware/radeon/RV530_cp.bin"
https://www.mediafire.com/file/hnzneqtomdk/ATI_Mobility_Radeon_X1300%252C_X1400_and_X1600_series.rar/file
Commentaires