2013년 10월 31일 목요일

Install Ubuntu 13.04 + linux 3.11 and dual-boot with OSX on Macbook Air, 2013

Macbook Air(MBA) is one of greatest machine for hackers. I bought MBA 2010 when 11" model released and used to hack with it.

One day, I attended linux forum and requested torvalds's signature on my MBA. He refused to have a signature on MBA, but I persuaded him with my promise to install linux on my MBA. After the event, I got torvalds's signature on my MBA and installed Ubuntu 12.04 on it. And, it was really great. MBA's mobility and linux. It's really cool hacking environment.

Recently, because MBA 2010 was too old, I bought MBA 2013 11" model and installed Ubuntu 13.04. Because Ubuntu 13.04 didn't support MBA well, I also build and installed linux 3.11 official version with some patch on it. Now, I'm enjoying my hacking life.

Because the installation was not so easy, I want to record / share my experience here.
Because the time I installed Ubuntu was about 2 months ago, some parts may not be up to date. Just hope it can be a little help to somebody :)


0. Install Environment
My MBA is 11" model published from 2013(6,1). I also upgraded it's cpu, RAM, SSD.

1. Download Ubuntu Image and Burn Install CD
Ubuntu distribute installation CD image for Mac in seperate way. Go to the link below and download 13.04 for mac image(ubuntu-13.04-desktop-amd64+mac.iso) and burn CD using it.
http://releases.ubuntu.com/raring/

I think live USB will be Ok, too. But, in my case, because my USB broken, I did with CD using USB CD driver.

2. SSD Partition
Make partition on SSD for Ubuntu installation. Open disk utility from Mac OSX(If hard to find, use spotlight).
Select SSD, enter to Partition tab, reduce partition size for Macintosh HD partition as you want to.
If my explanation is too concise, see the link below:
http://osxdaily.com/2009/11/20/resize-partitions-in-mac-os-x-with-disk-utility/

3. Boot to Ubuntu Install Image
Connect Live CD or Live USB you made from step 1, restart MBA. Before MBA powered on, press Option(alt) key. You should press it as soon as you pressed power button to turn on MBA. Then, booting partition selection screen like below photo will be displayed.

The USB displayed as Windows. Looks like OSX think it's just Windows if user trying to boot from other media such as CD or USB. It's annoying but, just select it. Then, MBA boot to Ubuntu in Live CD or Live USB.

4. rEFIt Install
Pressing option key every time can be annoying. The program rEFIt can help it. rEFIt is boot option selection / managing program. You can download from the link below:
http://refit.sourceforge.net/#download
Just execute downloaded rEFIt and execute install file. Then rEFIt be installed. Now, when you restart MBA, it doesn't boot to OSX automatically, rather ask you which partition you want to boot.

Actually, the developer of rEFIt doesn't support it any more. He is now developing same purpose program with new name rEFInd. It'd rather to use it. I just used rEFIt because I didn't know rEFInd at that time.


5. Ubuntu Install
Ubuntu installation is very easy. Just install Ubuntu as usually you did on other computer. It will ask you whether want to remove OSX and install Ubuntu on entire SSD. If you want dual-booting with Ubuntu and OSX, you should not remove OSX. Just install Ubuntu beside of OSX.

After Ubuntu installation completed, you can see screen below after reboot.

After select tux(the cute penguin) from this screen, grub bootloader comes. Select Ubuntu from grub bootloader. Now, it should boot to Ubuntu... But, not... It doesn't boot and screen stuck. We will solve this problem in next step.

6. Add nosmp on linux parameter
You can adjust linux boot parameter from grub by pressing key 'e'. You can boot successfully by adding nosmp on parameter.

There would be exist the line start with next content in second line from end of screen.
linux        /boot/vmlinuz-3.8.0 root=UUID=

Just enter ' nosmp'(without quotation mark, with one whitespace) on last of the line and press f10 key. Now, it will boot to Ubuntu.

7. Add nosmp permanently
Now we succeed to boot to Ubuntu. But, type nosmp every time boot to Ubuntu from grub may be very annoying and uncomfortable. You can add nosmp to boot parameter permanently.
Open /etc/default/grub file and find the line start with GRUB_CMDLINE_LINUX_DEFAULT=".Type nosmp inside quotation mark. It may need super user permission to edit the file.
After that, save and close file, and update grub config using the command below:
$ sudo update-grub

8. Let WiFi Work
Now, we can boot, but problem still exist. First, WiFi. It's because Ubuntu 13.04 have no device driver for MBA's WiFi. Download deb file from the link below:
http://launchpadlibrarian.net/138967184/dkms_2.2.0.3-1.1ubuntu3_all.deb
Install the deb file using the command below and reboot. Now, WiFi will work.
$ sudo dpkg -i path/to/downloaded/deb_file

9. Change To EFI Mode for Whole Cores
nosmp parameter from step above means we will use only one core in MBA. It was just a work-around for boot because MBA doesn't support bios way booting properly. It's shameful to use only one core in Multi-core era. You can use whole cores if you boot linux with EFI mode.See next link and change Ubuntu to EFI mode:
https://help.ubuntu.com/community/UEFI#Converting_Ubuntu_into_EFI_mode

The link's content says, in concisely, just install a program named boot-repair using next command,
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)

And change Ubuntu to EFI mode using the program.

After changed to EFI mode, remove nosmp from /etc/default/grub file, and sudo update-grub to make it effect.

Now, restart MBA. You should able to see lots of boot options like below photo.
Boot to Ubuntu in EFI mode.

Now, you can use whole cores in MBA.

Also, you may see lots of error message while booting. If it's too annoying, Open /etc/default/grub again and insert libata.force=noncq as we did with nosmp. Also, never forget to sudo update-grub.

10. Install linux 3.11
Problem still exist. fn key doesn't works, track pad works as just a mouse, not track pad(can't scroll using two fingers), speaker doesn't works. But, first, let's go to kernel 3.11 version.

Download 3.11.0 linux source code from kernel.org or git repository and build / install the kernel using Ubuntu 13.04's config file as usually do.
Kernel build / installation may be out of focus of this article. See other articles about kernel build / install from Ubuntu(e.g., http://dry-kiss.blogspot.kr/2014/01/how-to-build-install-linux-kernel-on.html).

11. Apply patches for Keyboard / Track pad / Speaker
Keyboard / Track pad / Speaker still not works although you installed 3.11.0 kernel. But, there exist patches for those problems. Latest kernel maybe already merged those patches. But, because this is just my experience sharing, I will say about that.

Download links below and save each of them as file. The link is just a text file. You can just open the link in browser and copy-and-taste the contents, save as a text file.
http://www.miek.nl/downloads/2013/macbookair-3.11.patch
https://bugzilla.kernel.org/attachment.cgi?id=107811

Go back to the kernel source you built and use command below to apply each patches:
$ patch -p1 < path/to/downloaded/patch

Now, build and install the patch applied kernel source again, boot to the kernel.
Now, Keyboard, Trackpad, Speaker problems all solved and works properly.

Wish your Happy Hacking! :D



Remaining Problem
Still one problem exist. Monitor brightness adjust button works well after MBA boot to linux. But, once it goes to sleep and comes back, monitor brightness become only brightest state or darkest state.

Referenced Web Pages



2013년 10월 20일 일요일

GRAVITY




[주의] 스포일러라면 스포일러라 할 내용이 있습니다.













정리해 보자면 상처를 받고 자신의 근원(지구, 고향, 가족, 직장)을 떠나 일탈하던 여인이 일탈한 곳으로부터도 버림을 받고 헤매다가 결국은 친구의 희생과 자신의 근원에 대한 재인식으로 상처를 치유받고 돌아오게 되는 이야기.

라이언은 딸을 잃는 아픔을 겪고 지구에서도 직장을 제외하면 정처없이 드라이브를 하며 방황했고, 우주로 일탈해 고요함이 가장 좋다고 이야기했다. 하지만 우주에서도 위성 파편이라는 형태로 버림을 받고 삶을 포기하려고도 하지만 맷의 희생으로 목숨을 건지고 지구에 대한 그리움과 다시 설 동기를 얻게 되어 지구로 돌아오게 된다.

이를 통해 인간을 매개로 해 생명체와 그 근원과의 관계를 중심으로 생명체의 삶의 형태를 잘 그려낸, 다큐멘터리에 가까운 영화라고 생각한다.

연어의 고향 회귀, 가출 청소년의 귀가 등의 다큐멘터리에 대입해보면 대략 비슷하다.

뻔하다면 뻔하고 숭고하다면 숭고한 주제를 수많은 볼거리와 상징성 등을 통해 흥행적으로도 예술적으로도 손색이 없게 표현해낸 수작.