MacBook Air 11-inch (Late 2010) revive


Recently, I revived my old laptop HP Pavilion dv3, due to the need of second computer to do my research study.

Since it is revived, and works smoothly, I then revived a tablet which was not used, Samsung Galaxy Tab 10.1 (P7500). I flashed the AOSP 7.1.2 Nougat. And it is revived also. However, the hardware specification is too antique, it can neither install Google Chrome nor Firefox. Most of the apps failed to run. ūüė©

Then lastly, there is a MacBook Air 11-inch (Late 2010), which I have installed Arch Linux onto it before. However, because it has been long time didn’t update all the packages, there are a lot of troubles.

For instance, after partial upgrade, when I ran pacman or pacman-key --init, it complained about

error while loading shared libraries: libreadline.so.6

Even after I boot with Arch Linux LiveUSB, this issue was hardly to be solved. This is because existing packages fulfil the dependencies, but the linked shared libraries’ versions were different.

Another issue was that it complained about

error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

This is even worst. The final solution was to install the latest gnupg, gnutls, and libassuan (as described here). Once pacman can work, then all the upgrades should work fine.

 

MacBook hot (heat) issue

After finished upgrading Arch Linux, there was an issue that I noticed when I first time installed Arch Linux on Mac. The machine was very hot, and the fan was spinning loudly. I firstly thought it was because of the WiFi device driver issue, because this happened even I run Arch Linux with TTY only.

I tried to install macfanctld (according to this), thermald, and cpupower (according to this). But none them solved the over heating issue.

Then after some readings from the forum (such as this post), the possible root cause was the graphic card driver issue, which Nouveau is not compatible with Mac. In order to solve this, I found the solution here (related post here) which allows me to use NVidia graphic card driver. This is a fantastic solution. I tested, and it works.

One thing to note. In the description of the solution, it says

cat << EOF
setpci -s "00:17.0" 3e.b=8
setpci -s "04:00.0" 04.b=7
EOF

Where the “00:17.0” and “04:00.0” may differ for each machine. However, “3e.b” and “04.b”, are just magic number that I just follow them. Though I don’t know what they mean actually.

Now MacBook Air is revived without overheating issue.

Advertisements

Arch Linux in MacBook Air


This is not a new stuff. You can get some tutorials from Internet. And it is very interesting when I did this, because I learnt new things. The following procedures are based on what I remembered. So, it may not be 100% accurate, since I am a forgetful person. ūüėÖ

What I did was reading the Arch Linux Wiki page. Then, followed the instructions as much as possible, and do some trials and errors. Remember to backup everything necessary. And try this at your own risk.

MacBook Air preparation

Before installing, firstly do the partition using Mac OS X itself. The tool can be found in /Applications/Utilities/Disk Utility.app. Then select the drive, not partition, at the left-hand panel. Next, click the “Partition” tab at the right. Make sure that you have enough disk space for the Arch Linux installation including the disk space for /home. In my case, I created three partitions at the end of the drive. One for root, one for swap, and one for /home. These three partitions are formatted in FAT32.

Since MacBook Air uses EFI to boot, and I am new to UEFI boot, so I installed rEFIt (Mac disk image). After installing rEFIt, reboot the MacBook then will show the options like this. That means, you have successfully installed rEFIt.

Arch Linux installation

Firstly, make sure you know how to install Arch Linux. Then, prepare a live USB for Arch Linux installation. Insert the USB to MacBook, then reboot, and hold the Alt/Option key. Then you will be shown a screen to choose booting into rEFIt or Arch Linux UEFI.

Choose Arch Linux UEFI and boot into Arch Linux for installation. Firstly, format the 3 partitions created in Mac OS X to what you want. In my case, I formatted /dev/sda3 and /dev/sda5 to ext4, and /dev/sda4 to swap. Next, we need to edit the partition type of the formatted partitions. This is done by using cgdisk instead of cfdisk, because MacBook is using GPT partition table. At the same time, you can see which partition is the EFI system partition. In my case, it is /dev/sda1, and it is FAT32 format. Hence, I mounted /dev/sda3 to /mnt, /dev/sda5 to /mnt/home, and /dev/sda1 to /mnt/boot.

Get the internet connection using netctl. Then proceed pacstrap as usual, arch-chroot and do some configurations.

Then, the GRUB installation took me some time. I used GRUB instead of gummiboot, because I know nothing about gummiboot yet. Follow the Wiki instruction, and please note that $esp refers to the mount point of the EFI system partition. In my case, it is /boot (after arch-chroot). After installation of GRUB, then generate the GRUB configuration file.

After installation, I found that there are /boot/EFI/Apple/, /boot/EFI/grub/ and some other files in /boot mount point.

Reboot.

If success, no need to hold the Alt/Option key, rEFIt will prompt you to choose to boot into Mac OS X or GRUB. Boot into Arch Linux through GRUB to check whether you succeed or not.

Post-installation

After installing Arch Linux, do the configurations, add users, install packages, install desktop environments, X11, setup the audio, install NetworkManager, etc.

There are three more things I concerned: i) graphics card, ii) touchpad, and iii) keyboard.

I installed Nouveau driver for the graphics card instead of NVIDIA. As the graphics card is GeForce 320M, it is under the N50 family (refers here). Therefore, I tried to install nvidia-340xx and nvidia-340xx-libgl. But the X11 does not work. At the end, I use Nouveau driver.

Next, the Synaptics input driver works fine in MacBook Air. But there is a little unexpected behaviour. Clicking (not tapping) the bottom-right cordern of the touchpad does not produce a right-click, but still a left-click. But in Mac OS X, clicking at bottom-left and bottom-right are different. Furthermore, some configurations have been done, such as two fingers tap and three fingers tap.

Finally, the keyboard is also configured based on the Wiki. I configured the Fn key and also swapped the Alt/Option key with the Command key. So that it works more like usual keyboard layout.

So, the demo video above first shows the rEFIt, then boot into Arch Linux using GRUB. As I have installed many desktop environments, I chose GNOME and launched the session.