[Android Software Development] jermaine151:
Mac OS X Yosemite – Dual boot Ubuntu 14.10 from an external USB Drive​

*I am making this guide on my late 2013 MacBook Pro 13” Retina:

Model Name:	MacBook Pro
Model Identifier:	MacBookPro11,1
Processor Name:	Intel Core i5
Processor Speed:	2.4 GHz
Number of Processors:	1
Total Number of Cores:	2
L2 Cache (per Core):	256 KB
L3 Cache:	3 MB
Memory:	8 GB
Boot ROM Version:	MBP111.0138.B11
SMC Version (system):	2.16f68

This guide assumes that you DO NOT already have rEFInd installed and that you ARE familiar with installing Linux.. I currently have 2 Operating systems on my internal 256GB SSD (Windows 8 and OS X Yosemite) and I have an external USB 3.0 enclosure with a 256GB SSD installed. That’s where I want to install and boot Ubuntu 14.10 from. Let’s get started…

Make a complete backup of your Macbook Pro!!

Make sure that you’re booted into OS X.

Install rEFInd

Download the zip version 0.8.4 or later of reFind: http://www.rodsbooks.com/refind/getting.html and unzip it.

Open a terminal and change to the extracted folder directory.

Run this command:

sudo ./install.sh

Enter your password to confirm. You should now have reFind installed and if you reboot to verify, you should see its boot menu. If you have 2 Mac OS X entries, one of them will be for your normal OS X partion and the second contains recovery in the description. Boot back up your normal OS X installation.

Download Ubuntu 14.10 Desktop 64 bit: http://www.ubuntu.com/download/alternative-downloads

In the terminal convert the iso to an img:

hdiutil convert -format UDRW -o ubuntu14.10.img ubuntu-14.10-desktop-amd64.iso

OS X will add a .dmg extension to the .img file but that doesn’t matter.

Plug in your USB flash drive (I used a 4GB) and use diskutil to find out the drive number:

diskutil list

My USB drive showed as /dev/disk1

Unmount the flash drive:

diskutil unmountDisk /dev/disk1

Write the Ubuntu image to the flash drive (*Note: If you get an error about 1M, change it to 1m)

sudo dd if=ubuntu14.10.img.dmg of=/dev/rdisk1 bs=1M

*Note: I used /dev/rdisk1 instead of /dev/disk1

Eject the flash drive:

diskutil eject /dev/disk1

Connect your external USB target disk and partition it as 1 partition, in Disk Utility. Make sure to hit options and verify that the partition scheme is GUID prior to hitting apply.

Now we are ready for the fun part; installing Ubuntu 14.10.

Power off your Macbook and connect the USB flash drive with the Ubuntu installer as well as your USB target disk (In my case it’s my external enclosure with a 256GB SSD).

When you get to the rEFInd menu, choose the option that says boot Legacy OS from FAT and press enter.

When the Ubuntu installer loads, choose the “Install Ubuntu” option.

When you get to the screen that reads something like “Erase everything”, choose the “Something else” option and click continue.

It will bring up a list of your current partitions. Find the USB target disk, which should be obvious by it’s size. You should see 2 partitions on your target disk: EFI boot partition and a HFS+ partition.

DO NOT DELETE the EFI partition! Delete the other partition and then create a partition for your root mount point “/” and a swap partition. I created a 8GB swap partition and my Mac has 8GB of RAM.

BE SURE to choose the USB target disk as where to install Grub in the dropdown at the bottom of the screen. In my case it was /dev/sdb (notice no partition number).

Select your drive in the list, click install and complete the installation.

When the installation completes, hit the reboot button and if it doesn’t complete the reboot, hold down power for 5 seconds to power off. If it does complete, when you get to the rEFInd menu, choose power off.

Remove your USB installer flash drive.

Power on and if you don’t see linux in the list of operating systems in the rEFInd menu, hit “ESC” to refresh. You should see it and be able to boot to it.

Everything pretty much worked for me out of the box on Ubuntu 14.10. I did immediately change the resolution to make it easier to see.

23)	I fixed the brightness buttons by:

sudo gedit /usr/share/X11/xorg.conf.d/20-intel.conf

Add the following lines to this file:

Section "Device"
Identifier "card0"
Driver "intel"
Option "Backlight" "intel_backlight"
BusID "PCI:0:2:0" EndSection

Logout and the buttons should work to adjust the brightness.

There are more online guides if you run into other hardware compatibility problems. I will update this with problems / fixes that I run across. You're now ready to look at the building Android from source guides and run them on your Ubuntu installation.

Enjoy!