Linux macbook pro 2019

Установка Linux на MacBook с чипом T2

Захотелось ноут с красивой картинкой на дисплее, выбор пал на retina от apple. Т.к. последние линейки процессоров (М1 и М2) поддерживаются только Asahi Linux (остальные дистрибутивы в стадии тестирования у энтузиастов), а менять дистрибутив на переправе не хотелось, был приобретён представитель предыдущей линейки девайсов с T2 security chip (устанавливался на MacBook Pro 2018, 2019 и 2020, MacBook Air 13″ 2018, 2019 и 2020, iMac 27″ 2020, Mac Pro 2019, Mac mini 2018, iMac pro).

Сразу оговорюсь, что загрузиться с флешки любого дистрибутива можно, но без поддержки клавиатуры, звука, bluetooth и wifi; а процесс доустановки этих драйверов на линукс для T2 вручную похож на фантазию злого гения. В связи с этим имеет смысл взять дистрибутив с пропатченным под T2 ядром (ссылка будет ниже в соответствующем шаге).

1. Освобождение места на диске

Загрузитесь в MacOS, откройте Программы — Утилиты — Дисковая утилита. Слева выберите накопитель и кликните Разбить на разделы. В открывшемся диалоге слева на графической диаграмме мышкой нужно уменьшить размер занятого MacOs пространства, затем в освободившемся пространстве создать новый раздел (не том) с файловой системой, отличной от APFS — например, FAT или ExFAT.

2. Экспорт драйверов WiFi и Bluetooth

На T2Linux.org (почему-то, отдельно от основного описания) существует скрипт, призванный выгрузить установленные драйверы в загрузочный раздел (EFI) MacOS, чтобы позже импортировать их в Linux. Скрипт предназначен для 12й и более поздних версий MacOS, поэтому предварительно нужно обновиться, если ваша версия старше.

Итак, находясь в MacOS, скачиваем скрипт, открываем терминал и запускаем его:

user@MacBook-Pro ~ % bash Downloads/firmware.sh Detected macOS Mounting the EFI partition Password: Volume EFI on disk0s1 mounted Getting Wi-Fi and Bluetooth firmware Copying this script to EFI Unmounting the EFI partition Volume EFI on disk0s1 unmounted Run the following commands or run this script itself in Linux now to set up Wi-Fi sudo umount /dev/nvme0n1p1 sudo mkdir /tmp/apple-wifi-efi sudo mount /dev/nvme0n1p1 /tmp/apple-wifi-efi bash /tmp/apple-wifi-efi/firmware.sh

Названия дисков, конечно же, будут отличаться. Сохраните этот вывод, он пригодится.

Читайте также:  Linux архиваторы командной строки

3. Скачиваем и записываем образ дистрибутива

Тут можно выбрать дистрибутив с пропатченным ядром. Скачиваем и записываем на флешку удобным способом.

4. Загружаемся с флешки

Перезапускаем машину, удерживая клавишу Option — в отобразившемся меню выбираем самый правый источник загрузки EFI boot.

Если не удаётся — необходимо отключить защиту. Для этого перезагружаемся, удерживая Command+R, открываем «Утилиту безопасной загрузки» и выбираем «Разрешить загрузку с внешних или съемных накопителей». Затем пробуем снова.

5. Установка ОС

Процесс установки Linux на MacBook ничем не отличается от обычного за исключением одного нюанса — нельзя использовать автоматическое разбиение разделов. В ручном режиме удалите созданный на 1 шаге раздел FAT\ExFAT и в освободившемся пространстве сделайте необходимую разбивку:

  • 1 ГБ под загрузчик
  • Место под SWAP
  • ФС под монтирование / и других точек (если необходимо)

Под конец установки, как обычно, нужно извлечь носитель с дистрибом и нажать ENTER. С этого момента Linux станет автоматически запускаемой ОС.

6. Пост-установка

Итак, у нас установлена ОСь, в которой не работает Wi-Fi. Теперь нужно выполнить команды, которые были предложены скриптом на шаге #2. Открываем терминал и выполняем команды ( заменив путь к диску на свой ):

sudo umount /dev/nvme0n1p1 sudo mkdir /tmp/apple-wifi-efi sudo mount /dev/nvme0n1p1 /tmp/apple-wifi-efi bash /tmp/apple-wifi-efi/firmware.sh

T2Linux.org предоставляет облёгченные дистрибутивы (на примере Ubuntu 22.04 — 1.85 gb против 3.6 gb на оф.сайте), там присутствует минимальный набор софта, соответственно браузер и офисное ПО придётся поставить вручную.

Источник

Ubuntu on a Macbook Pro Mid 2019 (MacBookPro15,1)

Apple’s T2 Security Chip gets itself in the way as much as possible when attempting to install Linux on a Mid 2019 Macbook Pro and a lot of the available documentation for Linux-on-the-mac online is pre-T2. After quite a bit of back and forth and eventually finding the right resources I managed to get Ubuntu installed on my MacBook Pro with everything working. except the microphone.

Initial Success and Failure

Getting started with this process was a bit of a minefield. The first resource I came across was How to Install and Dual-Boot Linux and macOS, an extremely detailed and useful documentation piece with one minor caveat (that I didn’t take heed of initially):

As of right now, you cannot install Linux on the internal SSD of a newer MacBook Pro or Mac Pro (2018 or later). You can still install on an external drive, however.

Despite the warning I did manage to eventually cobble together a working base Ubuntu install using Ubuntu 20.04, a bootable USB-C drive (notably: not a USB-A adapter), and rEFInd. In the end I had a functional Ubuntu installation on the same internal SSD as my macOS install but none of the peripherals (keyboard, trackpad, speakers, touchbar, wireless, etc.) worked and Ubuntu was unable to find drivers for them. This failure/success finally led me down the proper path of seeking out a T2-supported version of Linux.

Читайте также:  Linux scp с паролем

Getting it Done Right (on a T2 MacBook)

This process is mostly a mashing of various guides and notes about specific conditions for the MacBook Pro Mid 2019 (MacBookPro15,1). I’ve cited sources throughout the text am mostly just interested in organizing this proces all in one place.

1. Create Bootable Media

A USB-C device may be necessary for this process. Using a regular USB-A device through an adapter might not be supported for bootable media.

  1. Download the zip files from the latest release of mbp-ubuntu (the livecd.zip file and any other livecd.zX files).
  2. Join the zip files together: cat livecd.z* > livecd_full.zip.
  3. And unzip them: unzip livecd_full.zip.
  4. Create a bootable device from the resulting ISO image (e.g., with a program like Etcher).

2. Prepare Your Hard Drive

  1. Open the Disk Utility application (located in /Applications/Utilities).
  2. Select the internal Apple SSD entry in the left pane.
  3. Click the Partition button.
  4. Create a new partition (not volume) of at least 32GB with «MS-DOS (Fat)» as the format. This is where Ubuntu will be installed so choose a size appropriate for what you want to do with the system. See Partition a physical disk in Disk Utility on Mac for additional guidance on this process.

If the option to add a partition is not available it may be because additional disk space is being used by snapshots. Follow the steps below to free up this space and try to create the new partition again.

  1. Open the Disk Utility application (located in /Applications/Utilities).
  2. Select the primary volume group in the left pane (probably named «Macintosh HD»).
  3. Select View > Show APFS Snapshots from the menu bar.
  4. Select all the snapshots and click the delete icon (-).
  5. Return to the partition options (see above) and try again.

3. Boot the Bootable Media

  1. Boot in to macOS Recovery mode and open the Startup Security Utility (see About Startup Security Utility on a Mac with the Apple T2 Security Chip).
  2. Select «No Security» in Secure Boot.
  3. Select «Allow booting from external and removable media» in Allowed Boot Modes.
  4. Close the Startup Security Utility.
  5. Insert the bootable media created previously directly in to a USB-C port.
  6. Restart in to the Startup Disk Manager (see Change your Mac startup disk).
  7. Select and continue from the bootable media labeled «EFI Boot». There may be more than one option with the same label — try the last first and if it does not work just repeat the previous step and try another one.
  8. When prompted select the Ubuntu Live environment and use the kernel with suffix «hwe-bigsur».
Читайте также:  Minecraft for linux install

4. Install Ubuntu!

  1. In the Ubuntu Live environment click the «Install Ubuntu» application on the desktop.
  2. Set install options as desired.
  3. On the «Installation Type» step choose «Something else» and click Continue.
  4. Select the partition created previously (the current type should be «fat32» and the device should be something like /dev/nvme0n1p3). Be very careful to select the correct partition here as the next steps will erase it for the Ubuntu install.
  5. Click delete partition (-).
  6. Select the «free space» entry created by the partition removal.
  7. Click add partition (+), set the size to 1024MB, the type to «ext4» and the mount point to /boot.
  8. Select the «free space» entry again.
  9. Click add partition (+), set the size to all the remaining space, the type to «ext4» and the mount point to root (/).
  10. Select the /boot partition for «Device for bootloader installation».
  11. Continue the installation, shutting down the computer and removing the bootable media after completion.
  12. Start in to the Startup Disk Manager (see Change your Mac startup disk) again.
  13. Select the new EFI Boot option.

You should now be booted in to Ubuntu with a mostly functional system!

5. Getting Wifi Working

6. Celebrate!

That’s it! Everything (except the microphone. ) should now be working in Ubuntu — even the touchbar! The t2linux wiki also has an audio guide with some options that may get the microphone working but I was not able to get it functional from information in that guide (or anywhere else). I’ll update this space if I ever do have success!

Pretty much all of the information compiled for this post stems in one way or another from the wonderful marcosfad/mbp-ubuntu repo. Pop in there and contribute to the maintainers of that repo if this guide was helpful in any way.

© Christopher Charbonneau Wells 2016-2022

Источник

Оцените статью
Adblock
detector