Monday, February 17, 2014

Install Slackware64 14.1 on a MacBook Pro 5.2

The MacBook feels its ages after upgrading to OS X Mavericks‎, it is slow and I really don't have a usage of the OS X itself. So I start my journey to install my favorite Slackware to it.

There are a few helpful sites that describe the installation of Linux on a MacBook:

Disk Partition

There are some problems that I encounter that is quite unique to this machine. I shrank the OS X partition and created a new 40G FAT partition and boot up the newly burned Slackware64 14.1 DVD. It could not boot using EFI mode, and fallback to the legacy BIOS boot mode.

After boot up, I partition the disk using cgdisk, remove the FAT partition and recreate one for Linux. An interesting thing shows up, after selected my target / partition and the ESP, it ask me whether to include an MSDOS partition to be mounted, with the same device number of my main Linux partition. I ignored it, and proceed to install the "A" and "AP" part only. Then when come to install Lilo, it stucks forever without progress. Google around, does not show any direct related problem. Then I found some mentioning of gpartsync tool, it seems in rEFInd (which I chose as my boot manager), there is one included name "gptsync_x64.efi", turn it on from the config and reboot, it does not work for me. Then I reboot into Linux with the DVD and use fdisk, Och, there is a FAT partition there. To play safe, I repartition the disk again in OS X and redo the installation with both GPT and MBR table matched, it seems fine, except it prompt me with 2 identical Linux partitions for my root mount point, I chose one and ignored the other and proceed. Lilo still complaining about config problem about append command, then I remove the append line use standard text mode only. It finally installed. There must be something wrong for what I have done for the partition, but I don't want to experiment and re-install again.

Booting Up

Since the stock kernel has EFI stub build in, I copy the huge kernel to the EFI/slackware64 and create a refind_linux.conf manually

"Boot with defaults"         "root=/dev/sda4 ro"
I hope rEFInd could pick it up and boot me into Linux directly from EFI. I restart the box, the rEFInd boot manager has the Linux choice show up, boot it, kernel complains about conflicting frame buffer driver between EFI VGA and nouveau and stops. I think it should be able to resolve it with the extra parameter "video=efifb"

I reboot and boot the Linux with BIOS mode and Lilo bring up the system. But I only have one CPU show up, it seems this is a known problem. I install the the rest packages from D, X, XAP, N, L, KDE, TCL, XFCE, Y, etc. Then download the 3.10.20 kernel source and config it to use nouveau driver only for frame buffer. It boots up fine and now I have the two CPU cores available.

There is a long delay (around 30 to 40 seconds) before rEFInd show its menu. This seems a known problem on certain MacBook. I tried the clearing the NVRAM entries method first, but it did not work for me. Then I tried using the fallback filename method, rename EFI/refind to EFI/BOOT and rename refind_x64.efi to bootx64.efi. It seems work, I now got around 6 seconds of delay. Not sure if that is normal, but at least its bearable.

Nouveau and X.org

X does not work, it said DRM is not working. I download the latest binary driver from nvidia, and it seems working fine, except after exit from X.org, I got an black screen and has to blind type commands to shutdown the machine. At system boot, I use efifb for the frame buffer driver. It seems it is a common problem, fellow slackers have the same problem "Cannot access TTYs after installing nvidia drivers on macbook pro".

The touch pad respond badly, almost like not working, google around, it seems the default setting of synaptics does not work well, I ended up with this settings under /usr/share/X11/xorg.conf.d/50-synaptics.conf

Section "InputClass"
 Identifier "touchpad"
 Driver "synaptics"
 MatchDevicePath "/dev/input/event*"
 MatchIsTouchpad "on"
 Option "FingerLow" "10"
 Option "FingerHigh" "20"
 Option "TapButton1" "1"
 Option "TapButton2" "2"
 Option "MinSpeed" "0.65"
 Option "MaxSpeed" "0.85"
 Option "TapButton3" "3"
 Option "VertTwoFingerScroll" "true"
EndSection
MinSpeed of 1 is still too fast when accessing some small links, 0.65 seems reasonable for me.

To handle the hotkeys, I used pommed-light, after a few tweak, I got it compile and running, the sound volume control works. Others are still testing.

Annoying things of the system

The iSight built-in web-cam does not work. At first, the system does not recognize the device at all, listing the usb device as some kind of development board. Even booting back to OS X does not recognize the webcam anymore. Using solution in {CODIUM();}, I manage to get the iSight webcam recognized correctly again under OS X and under Linux, lsusb recognize the device as iSight, but no luck getting it working. I don't really making use of it, so it is not a very big problem for me.

The bootup sound before the boot manger is really annoying, looking around the web, seems there are lots of people complaining. I follow the advice from MacTrast, and tried the 3 methods: overwrite the nvram settings, install a control application to mute the bootup sound, and mute the sound device before power off. Mute the sound before poweroff/reboot does not work too well and it seems does not work from Linux. Set the nvram value to 0 or 80 does not work either. The StartNinja apps seems to work first, but then I drained my battery completely and lost the setting, and I thought it did not work until I try the 2nd time, consider working.

Post a Comment