OpenSUSE 12.1 on a 2011 MacBook Air
There are not a lot of guides out there on how to install OpenSUSE on any Mac. And the few guides that I’ve found on installing other Linux flavors on the MacBookAir4,2 (which is how the 2011 MBA identifies itself with dmidecode) are all incorrect in many subtle ways. So I figured I should write my own. This one is targeting the somewhat experienced Linux person. Installing Linux on a Mac may not be something a complete beginner should try. So in several of the steps I am not trying to give you every little detail and command option as I am assuming you know how to use dd or how to find out which device your USB stick shows up under…
First you need to decide whether you want to keep MacOS around. It’s easy enough to do – just shrink the Mac partition using disk utility and create a FAT partition in the free space – that’s the partition you will then later replace during the install.
While booted into MacOS, install rEFIt on your MBA. This will take two reboots before it works, but then you should get the boot manager at start.
Next, ignore all the guides showing you various scripts to create bootable USB sticks for the Mac. They all try to use some sort of FAT partition and that does not work. All it takes is to dd the iso image of one of the install CDs (I chose the Gnome Live Image) onto a USB stick. Reboot your MBA and rEFIt should show you the USB stick as one bootable device (USB sticks get a strange rectangular orange badge on their logo – not sure how that is intuitive).
On the boot screen pick Installation and type nomodeset into the line for additional boot arguments; this will avoid using the Intel gfx mode setting in the install kernel which doesn’t play well with the MBA – instead it will run in VESA 1024×768 mode which is fine for installation. Hit return and after a short while you should see the graphical installer start.
Install as usual; if you decided to go for dual boot be careful with the partitioner. For me the default suggestion included reformating /dev/sda1, the EFI partition. Probably a bad idea. But you can simply pick Create Partition Setup and then chose the partition that you want to replace (the FAT partition we created earlier). And then everything seems to work smoothly. I first tried btrfs but sadly with the new kernel we’ll build in a moment that hung my computer twice – so I reinstalled with ext4. I decided to go with an LVM based solution that encrypts data on disk – that seems to be the sane approach. YaST for some reason decided to leave most of the space unused and created only a 20G root filesystem and a rather small 2G swap volume. So I manually expanded those to more reasonable values (6G of swap as I often use virtual machines and all the rest of the space for the root filesystem as I don’t want a separate home partition).
The install runs fairly smoothly after that. One hickup is that after the first reboot you can’t pick nomodeset – so you get broken graphics. Simply ignore this – YaST will start in text mode and finish the installation. After that you can reboot and once again type in nomodeset and have working graphics.
Next we need to install some packages and get you the latest kernel. Connect to your wireless network, start YaST and install at least git, gcc and make plus gsynaptics (for the touchpad).
Get the latest kernel. Right now this means top-of-git as even 3.1 is too old (you need changes that were added during the merge window). As this guide ages you can take 3.1-rcX or a later kernel.
git clone \
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Linus created a fairly cut down kernel config that I edited a bit more and which seems to work well so far – I haven’t played with all the devices (bluetooth, camera, etc), but the basics are there. Feel free to download that kernel.config, copy it to linux/.config and run make oldconfig – you should be able to use it as a starting point for your configuration.
Build the kernel, install it and its modules:
make
sudo make modules install
sudo make install
Edit the /boot/grub/menu.lst file to remove the vga= entry at the end of the kernel boot parameters, make item 0 (the new kernel) the default and reboot. You now should have a full resolution display and get rewarded with the full Gnome 3 experience (I still am not a huge fan of Gnome 3, but I told myself I just need to give it more time).
Login, open a terminal and setup sound.
alsamixer -c0
It seems that by default the outputs are mutted. Curser right and then m to unmute. ESC to exit.
Open System Settings (in Gnome3, click on your name in the upper right corner) and select Mouse and Touchpad. Turn on the features you want (like two finger scrolling).
I personally don’t like having to press fn to get to a function key, so I added
echo 2 > /sys/module/hid_apple/parameters/fnmode
to /etc/rc.d/boot.local which gives you function keys by default and special keys by pressing the fn key. The mapping for the special keys is still wrong (need to figure out how to fix that), but it’s just a few minor changes: F12 still gives you Eject even though there’s no optical drive, the volume keys are just one to the left of the labels, the screen brightness keys work, the others don’t seem to do much useful, yet. I definitely want to get the keyboard backlight keys to work.
I still don’t love the way the touchpad works (selecting text is a pain without real buttons, middle and right click are just weird, etc). I haven’t played with the webcam or bluetooth. But at this point I’d say the MacBook Air is functional with OpenSUSE. And it is a beautiful and very light machine…
Update: Linux-3.2-RC1 is out and it contains the changes needed to support the MBA, including the keyboard fix. I also updated the kernel .config file linked here to make it play nicer with the SUSE infrastructure (which really wants dm_mod to be a module) and to support kvm, tun/tap interfaces and ethernet bridges. We are getting there…
Comments(7)
