Update 2/17/2014: Added tip on reloading the wireless module
Update 2/5/2014: Added instructions for a shared partition and better backlight driver installation
With Fedora 20 out, it was time to refresh my Macbook Air (model 6,2) installation and see what I could get working. You might have seen my earlier post using Fedora 19 but this time around, things went much smoother. I’ve also tried to cover the initial installation with a little more detail, so hopefully that will help out someone just getting going.
Step 0 – Uninstall rEFIt
If you had previously installed Fedora on your Macbook like myself, you probably installed rEFIt as your bootloader. Since that project is no longer maintained, you’ll want to uninstall it and move to the newer Refind bootloader. I uninstalled Refit using their instructions and it worked fine. After uninstalling, I made sure I could boot into OSX by just rebooting and it worked.
Step 1 – Install Refind
I followed the Refind Mac OSX Instructions and while it was a few steps of pasting things into the terminal, it went very smoothly. Since I have the MBA 6,2 model, I kept the 64 bit binary and drivers. Also, the instructions mention that you can remove drivers to optimize boot time but I only removed the HFS driver.
Step 2 – Build Fedora 20 USB Key
Step 3 – Install
With the newly created USB key plugged in, you’ll want to restart and immediately hold down the Option key on your Mac. That will pull up the boot device options and you can select the ‘Fedora Media’ option.
Note – I wasn’t able to successfully check the media. When I tried, I received errors about a devmapper device not being present. Continuing without checking worked fine for me.
Important - I’m going to describe how to do a clean install as that is what I normally do. This is going to delete any existing Fedora installation you might have. Also, if you mess up partitions, it could delete some of your Mac data as well. This is the point where you need to triple check that you have all your stuff backed up. I don’t claim this installation is fool-proof nor do I want anyone accidentally reformatting their machine as a part of this effort. Make sure if that happens, that you aren’t going to permanently lose anything.
Step 3.1 – Partitions
Since I had Fedora 19 installed on encrypted partitions, it was a little confusing for me at first how to make sure the Fedora 20 partitions were created properly. The following steps did the trick for me:
- Select the encrypted partitions and unencrypt ALL of them
- At this point, you should see the Fedora 19 partitions recognized, including swap
- Delete all of the Fedora 19 partitions. Remember – clean install being described
- Click the link to auto-create the Fedora 20 partitions
- Apply the changes
Sharing a partition with OSX
I wanted to share some data and documents between my OSX instance and my Fedora setup. To do this, I actually changed the mount point of the /home partition in the Fedora 20 list to /mnt/shared (I had left enough space on the / partition). I also changed the filesystem to Linux HFS+. I assume that is just a non-journaled HFS+ partition. Anyway, it created on install and mounts up on Linux. The only thing I had to do was sync the UID of my Linux user with my already existing Mac user of the same name. To do that, I switched to runlevel 1 and just ran (replace the contents in the braces with your values):
sudo init 1 # Put in root password usermod -u <MAC_UID> <LINUX_USER> chown -R <LINUX_USER> /home/<LINUX_USER>
After doing this, I was successfully able to read and write files when booted into Linux or Mac OSX. I symlinked most of my directories like ~/Documents to that share.
At this point, you’ll let the install proceed as normal and you’ll create your users, root password, etc. From this point on, I’ll assume you are running these steps from your newly installed Fedora machine.
Step 4 – Update
First odd thing I hit was that after the installation, PackageKit was telling me everything was up to date, so I had to run yum at the command line:
sudo yum update
That worked fine and applied a few hundred updates. Reboot to get the new kernel.
Step 5 – RPM Fusion (extra packages)
You’ll want to install RPM Fusion to get the wireless drivers among other things. You can either following the RPM Fusion docs or following these condensed steps:
- Click this link on your Fedora machine and install it (free repo)
- Click this link on your Fedora machine and install it (non-free repo).
Step 6 – Wireless
Now with the RPM Fusion repos, you can just install the broadcom wireless drivers:
sudo yum install kernel-devel akmod-wl
Reloading the wireless module
After updating my kernel, the wireless module didn’t load automatically for me. I’m fairly new to akmods so I’m not sure if the new akmod wasn’t built, loaded or what. However, here is what I did to fix
# Make sure the module built for your kernel sudo akmods # See if the module is loaded (if no results, it's not) sudo lsmod | grep wl # Manually load the module sudo modprobe wl
Step 7 – Backlight
Once of the most annoying things for me with Fedora 19 on my Macbook was that the backlight would always go to 100% after a resume. Luckily Patrik Jakobsson came to the rescue and implemented a new kernel module specifically for the Macbook Air 6,2. The source of his driver is located here and while you could build it manually, I’ve tried to simplify the experience a bit.
Step 7.1 – Add MattOnCloud Repository
I’ve created a yum repository that contains a built version of this code for Fedora as well as some of the other fixes below. I’m keeping the source on GitHub and pull requests are definitely appreciated. This was my first attempt at a package that would automatically rebuild with kernel updates so install at your own risk… To install my repository, run:
sudo rpm -Uvh https://files-oncloud.rhcloud.com/yum/RPMS/x86_64/oncloud-repo-0.4-1.fc20.x86_64.rpm
Step 7.2 – Install backlight kernel module
This should install the module and will create a X11 configuration for you in /etc/X11/xorg.conf.d/01-backlight.conf that will switch the default backlight driver for the Intel configuration. Again, happy for any ideas on a better way to do this. To install this, run:
sudo yum install mba6x_bl-kmod
I really wanted to have a nice RPM that would update with new kernels, but I couldn’t get it working. However, I spent some time automating a simpler build, so I should have fairly good coverage on kernel versions. Check out the source if you need to build a specific one for your kernel – https://github.com/matthicksj/mba-fixes.
Step 8 – SSD errors and Keyboard mapping
The next things I hit were some sporadic SSD errors. In this thread, I found that I was able to set a queue depth to 1 and my errors largely went away. Also, the tilde is mapped improperly so you need to apply a fix for that. I’ve bundled both of these fixes as systemd service and a udev rule that will run at startup. To install these, run:
sudo yum install mba-fixes
I went ahead and ran Fedy to setup a bunch of other random things, including the better IO scheduler for a SSD. I would probably recommend doing that – there are a couple of options, but Fedy is pretty nice.
The end result with Fedora 20 is an impressive setup. Mini-display to VGA projection actually works this time around which was a huge win for me. Sound also works right out of the box. Performance seems solid and I’ll be tracking battery life and updating.
I’ll keep you updated!