- Inside the Mac OS, install the program refit: this will
show a boot menu where you may then choose to chain-boot into
grub. Also, prepare partitions. Then install Debian or Ubuntu in some
partition. (I am not providing further instructions on this: see
the debian wiki.
AFAICR the first time, some years ago, I installed Debian/Lenny using
a CD and boot-camp mode, then I used 'debootstrap' to install all the
rest).
- Install needed packages and generate the
grub.cfg
# apt-get install grub-efi-amd64
# update-grub
- mount EFI partition
# mkdir /efi
# mount /dev/sda1 /efi
- if you have any previous working EFI grub install,
from here on you may want to substiture /efi/efi/grub
with a different directory. (Note that by the rEFit menu
you may select any of your GRUB instances).
- create the directory for the grub instance
# mkdir /efi/efi/grub
- cd into this directory for the following commands
# cd /usr/lib/grub/x86_64-efi
- copy all stuff that http://grub.enbug.org/TestingOnEFI tells to copy
# cp *.mod fs.lst command.lst /efi/efi/grub
- newer versions of grub (Debian jessie or later) search modules in
a different directory
# mkdir /efi/efi/grub/x86_64-efi
# cp *.mod fs.lst command.lst /efi/efi/grub/x86_64-efi
- create EFI image
# grub-mkimage -d . -O x86_64-efi \
-o /efi/efi/grub/grub.efi -p /efi/grub \
part_gpt hfsplus fat ext2 normal \
chain boot configfile linux multiboot \
loadenv gzio echo test search
- copy /boot/grub/grub.cfg into /efi/efi/grub/
and possibly edit it to load the correct video driver, in my case
function load_video {
set debug=fb
insmod efi_gop
#insmod vbe
}
or otherwise use efi_uga on older MacBooks.
(Moreover, if your root partition
is crypted, you will need to copy the linux kernel and initrd
in a non crypted partition, say /efi/linuxboot,
and modify /efi/grub/grub.cfg consequently).
- In Debian/squeeze
it seems that nouveau drivers do not work in efi mode, blacklist them:
create a file
/etc/modprobe.d/efi_boot.conf
containing just
blacklist nouveau
In Debian/wheezy and Ubuntu/lucid , they are fine.
- In Debian/squeeze you may need to load some modules quite early
(in particular if you have a crypted root partition: otherwise
the keyboard will not work at the moment when the initrd will
ask you the password). To this end, append to the file
/etc/initramfs-tools/modules these lines:
#as suggested by http://grub.enbug.org/TestingOnMacbook
fbcon
#and I would further add
hid_apple
hid
applesmc
input_polldev
#moreover Vladimir 'phi-coder/phcoder' Serbinenko
#told me also to add
uhci_hcd
ehci_hcd
ohci_hcd
then regenerate the initrd
# update-initramfs -u
- Again, it seems that Debian/wheezy does not need those
(I have a crypted root partition, and I can enter the password
without problems).
- Using NVIDIA. The nouveau driver in Debian/wheezy works
fine, but does not provide (yet, at Sep 2011) any GL acceleration.
So I installed the nvidia stuff. There are two problems
with the nvidia stuff:
- once the X server starts,
if you type ctrl-alt-F? to go back to a
text consoles, it will be all pitch black;
- the screen backlight cannot be adjusted
(but, warning! if you change it, and you go into sleep mode and then
out, then it will be changed: so if you dim it too much,
and you sleep in/out, your screen will be pitch black!)