📜 ⬆️ ⬇️

We put Ubuntu on MacBook pro 11.3 (2013) or vice versa

The time has come for me to change the laptop, and with extreme displeasure for myself, I found that there are simply no laptops with a 16x10 screen, except for the products of one fruit company (s). I must say that for the gland the new bug is not very bad, and despite the horse price tag, the toad was crushed and the laptop was purchased.
In this article there will be no new methods of dealing with apple separatism - all recipes are drawn on the Internet. I hope that my experience will be useful to someone, but at once I will make a reservation, everything you do, guided by this article - you do at your own peril and risk, so ...

Break the Internet, I came to the conclusion that there are three fundamental possibilities for installing and using Linux on Macs:

The approach with a special distribution kit with the mac suffix imho is not applicable to the 2013 bug - 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 suitable . Cross out.
Of the remaining two, the native loader application is more dear to me — fewer entities, and in general, although loading with rEFInd is perfectly entitled to life. Let us stop at the apple loader.
It should be noted that modern uefi loaders have quite a uefi, but, as usual, not quite normal - everything that does not work will not be loaded. There are still some nuances, but now we will not analyze them.
In order for the apple loader to load Linux dear to our heart, the latter must pretend to be osx, or rather not Linux itself, but efi grub. To do this, the following conditions must be met:

If these conditions are met, the apple loader will kindly consider the possibility of downloading this fake copy of macosx.

So here we go.


  1. Prepare installation flash drive using Unetbootin from mirror.yandex.ru/ubuntu-releases/13.10/ubuntu-13.10-desktop-amd64.iso ( note, not mac version !!! )
  2. boot into osx, resize partishen (I left 160GB for osx, although this method allows you to do without osx, but for me - let it be)
  3. reboot while holding Alt while loading to select the source of the load. Our flash drive is seen in two versions - you need to choose the efi boot option.
  4. In the grub menu, select try ubuntu. When booting from a flash drive, it makes sense to edit the kernel boot options string by adding libata.force = noncq to it - there are complaints on the internet about periodic 20 -30 second fading of the system when accessing the disk.
  5. We connect to the Internet - for this we install the perimeter driver WiFi System Settings-> Software & Updates-> Additional Drivers , where we turn on the Broadcom 802.11 driver and connect to the neighboring WiFi
  6. we put gdisk
    sudo apt-get install gdisk 
  7. using gdisk we create a megabyte size 10 partition ( hereinafter, this partition will be referred to as 10MB partition ). It is necessary to retreat 128 megabytes from partishen with osx - otherwise the latter will be very worried. It is convenient to use + 128M and + 10M as partitioning parameters. It is imperative to set the type of AF00 partitions - Apple HFS / HFS + - otherwise the apple loader does not recognize partishen as suitable for loading.
  8. At this stage, it makes sense to reboot into osx and check the disk. It can also be formatted in Mac OS Extended (not a journalized version, otherwise there will be difficulties from under Linux) and rename it to Ubuntu, although in this manual we will do everything from under linux, because we may want to demolish osx entirely.
  9. again we reboot on alt 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. we mark up partisens for installation to taste - I made root 20G and everything else is home. Swap did not - you can always create a file.
  12. Next, we install ubuntu with one remark - do not reboot at the end of the installation. ( Please note that the computer name contains a plaintive message that it was not possible to correctly read the DMI. This is better corrected, otherwise the invitation in the terminal will take up half of the screen )
  13. after the installation is completed, without rebooting (although, if you reboot, that's okay, but you will need to boot from the flash drive again, since our Linux is not yet pretending to be osx) we are mounting our just-received installation
     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 in order for the chroot environment to work properly name resolution. When our installed ubuntu starts, this file will be recreated by the Network Manager.
    • you can still mount / dev / pts

  14. Actually, go to chroot:
     sudo chroot /tmp/u/ 
  15. we put support for hfs and gdisk
     sudo apt-get install hfsprogs icnsutils gdisk 
    (since we are doing this from chroot, these packages will be supplied in our new installation)
  16. format the created 10MB partishen (in my case / dev / sda3)
     sudo mkfs.hfsplus /dev/sda3 -v Ubuntu 
  17. we find out UUID 10MB partishen by means of blkid
  18. edit / etc / fstab - change mount / boot / efi to UUID, which was defined in the previous step and the file system from vfat to auto
  19. remount / boot / efi
     umount /boot/efi mount boot/efi 
  20. edit the file / usr / sbin / grub-install, commenting on the file system type check - 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 osx fake install:
    •  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 content:
       <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList- 1.0.dtd"> <plist version="1.0"> <dict> <key>ProductBuildVersion</key> <string></string> <key>ProductName</key> <string>Ubuntu</string> <key>ProductVersion</key> <string>13.10</string> </dict> </plist> 

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

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

Some notes:



In the following series:



Have a good hack!

Source: https://habr.com/ru/post/207100/


All Articles