We put Ubuntu on MacBook pro 11.3 (2013) or hackintosh on the contrary

It was time for me to change the laptop, and with extreme displeasure for myself, I found that there are simply no laptops with a 16x10 screen besides the products of one fruit company (s) on the market. I must say that the new firmware for iron is not very bad, and despite the horse's price tag, the toad was crushed, and the laptop was purchased.
In this article there will be no new methods to combat apple independence - all recipes are gleaned on the Internet. I hope that my experience will be useful to someone, but I will make a reservation right away that everything you do, guided by this article, you do at your own peril and risk, so ...

Internet break, I came to the conclusion that there are three fundamental possibilities for installing and Linux usage on poppies:
  • Using a special distribution with the mac suffix. Secretly interacts with BootCamp in order to disable EFI boot
  • Using rEFIt (or its development rEFInd)
  • Using a native apple loader (hereinafter referred to as the apple loader)

The approach with a special distribution kit with the suffix mac IMHO does not apply to the 2013 firmware - in order to make linux work after installation, many sources offer different keys for the kernel - from nolapic to nosmp, which, as you understand, is absolutely not good . Cross out.
Of the remaining two, I’m more familiar with the native loader, there are fewer entities, and indeed, although loading with rEFInd has a right to life. Let’s stop at the apple loader.
It should be noted that modern firmwares have quite an uefi bootloader, but, as usual, it’s not quite ordinary - it won’t load anything that isn’t short. There are still some nuances, but now we will not disassemble them.
In order for the apple loader to load Linux dear to our hearts, the latter should pretend osx, or rather not Linux itself, but efi grub. To do this, the following conditions must be met:
  • It should be parted like Apple HFS, respectively, with the hfs file system
  • This partin should have a System / Library / CoreServices directory with the files boot.efi and SystemVersion.plist, which in a special format describes the contents of the partisan
  • in the root of the part there must be a mach_kernel file

Subject to these conditions, the apple loader will kindly consider downloading this fake copy of macosx.

So here we go.


  1. we are preparing an installation flash drive using Unetbootin from mirror.yandex.ru/ubuntu-releases/13.10/ubuntu-13.10-desktop-amd64.iso ( note, not the mac version !!! )
  2. boot into osx, resize the partition (I left 160GB under osx, although this method allows you to do without osx at all, but for me - let it be)
  3. we reboot, holding Alt at boot time to select a download source. Our flash drive is seen in two versions - you need to select the efi boot option.
  4. in the grub menu, select try ubuntu. When booting from a USB flash drive, it makes sense to edit the kernel boot parameters line by adding libata.force = noncq to it - the internet has complaints about periodic 20-30 second system fading when accessing the disk.
  5. We connect to the Internet - for this we set the proprietary drivers WiFi System Settings-> Software & Updates-> Additional Drivers , where we turn on the Broadcom 802.11 driver and connect to the neighboring WiFi
  6. put gdisk
    sudo apt-get install gdisk
  7. using gdisk, create a 10 megabyte partition ( hereinafter, this partition will be referred to as a 10MB partition ). It is necessary to retreat 128 megabytes from the partition with osx - otherwise the latter will be very worried. It is convenient to use + 128M and + 10M as partisan placement parameters. It is imperative to set the type of AF00 partition — Apple HFS / HFS + — otherwise the apple loader does not recognize the partition as loadable.
  8. at this point it makes sense to reboot into osx and check the drive. There you can also format it in Mac OS Extended (not a journaled version, otherwise there will be difficulties from under Linux) and rename it to Ubuntu, although in this instruction we will do everything from under linux, as we may want to demolish osx entirely.
  9. reboot alt again from the flash drive and go to try ubuntu (do not forget to add libata.force = noncq)
  10. run the installer (Install Ubuntu 13.10)
  11. mark up the partitions for installation to taste - I made root 20G and everything else - home. Swap did not - you can always create a file.
  12. Next, we put ubuntu with one remark - we do not reboot at the end of the installation. ( Please note that the computer name contains a plaintive inscription saying that it was not possible to read DMI correctly. This is better fixed, otherwise the invitation will occupy half the screen in the terminal )
  13. after the installation is completed, without rebooting (although if you reboot, it's okay, but you will need to boot from the flash drive again, since our Linux does not pretend to be osx), we mount our installation that we just received
    mkdir /tmp/u
    sudo mount /dev/sda4 /tmp/u
    sudo cp /etc/resolv.conf /tmp/u/etc/resolv.conf
    sudo mount --bind /dev /tmp/u/dev
    sudo mount --bind /proc /tmp/u/proc
    sudo mount --bind /sys  /tmp/u/sys

    • we copied resolv.conf - this is required so that name resolution works normally in the chroot environment. At the start of our installed ubuntu, this file will be recreated by Network Manager.
    • can still mount / dev / pts

  14. in fact, go to chroot:
    sudo chroot /tmp/u/ 
  15. install hfs and gdisk support
    sudo apt-get install hfsprogs icnsutils gdisk 
    (since we are doing this from chroot, these packages will be delivered to our new installation)
  16. format the created 10MB partition (in my case / dev / sda3)
    sudo mkfs.hfsplus /dev/sda3 -v Ubuntu
  17. find out the UUID 10MB of the partition using blkid
  18. edit / etc / fstab - change the mount / boot / efi to the UUID that you defined in the previous step and the file system from vfat to auto
  19. remount / boot / efi
    umount /boot/efi
    mount boot/efi
  20. we correct the file / usr / sbin / grub-install, commenting on the verification of the file system type - something like
        if test -n "$efidir"; then
            efi_fs=`"$grub_probe" --target=fs "--device-map=${device_map}" "${e$
    #       if test "x$efi_fs" = xfat; then :; else
    #           gettext_printf "%s doesn't look like an EFI partition.\n" "${ef$
    #           efidir=
    #       fi
        fi
    

  21. run grub-install
  22. create a fake osx installation:
    • touch /boot/efi/mach_kernel
    • mkdir -p /boot/efi/System/Library/CoreServices
    • create the file /boot/efi/System/Library/CoreServices/SystemVersion.plist with the following contents:
      ProductBuildVersionProductNameUbuntuProductVersion13.10

    • create link on grubx64.efi
      ln /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/System/Library/CoreServices/boot.efi
  23. we correct / etc / default / grub,
    casting the line to the form: GRUB_CMDLINE_LINUX_DEFAULT = "libata.force = noncq"
  24. perform
    update-grub
  25. overloaded.

At this stage, we already have a workable system into which we can boot using alt and which we can quite choose from under osx (boot disk) as the main one.

Some notes:


  • after reboot, I changed the UUID 10MB of the partition - I had to fix fstab again
  • I have not yet been able to establish the reason for the appearance and disappearance of the third item called “Windows” in the apple loader, but in general it doesn’t interfere.
  • it makes sense to put the kernel 3.12, for example, from here .
  • NVidia's closed drivers get up trivially, though the backlight control breaks down. The situation improves slightly by adding grub acpi_backlight = vendor
  • After installing Ubuntu, the apple loader is sometimes thoughtful - it is treated with a NVRAM reset - at startup, simultaneously press and hold alt + cmd + P + R and wait for the second pa-pa!
  • There is no sound, but it is easily treated with this patch (this patch is also suitable for the native module from kernel 3.11)
  • you can reassign the behavior of the keys F1..F12 to the usual one, i.e. without fn
    echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
    sudo update-initramfs -u -k all
  • from decoration - you can put a picture with a cute cat named .VolumeIcon.icns in / boot / efi - it will be displayed in the apple loader menu for our Ubuntu

In the following series:


  • cast to a usable, high-resolution, ubuntu theme view - for now, you can switch the resolution to a lower one. ( The roots of the difficulties go back to LAS gnome in which some wee good people dug tightly 96DPI, and editing this defayna leads to ambiguous results. )
  • filing switching to integrated graphics and vice versa to discrete. there are high hopes for the 3.13 kernel - a lot of good changes in integrated graphics from intel.

Have a good hack!

Also popular now: