mbp-manjaro/README.md

340 lines
14 KiB
Markdown
Raw Normal View History

2020-07-09 22:27:52 -04:00
# mbp-manjaro
This repository contains the build scripts for compiling isos using the mbp-manjaro-kernel. With these iso files you can run Manjaro on 2018+ Macbook models with the T2 Chip.
Kernel Source: https://github.com/JPyke3/mbp-manjaro-kernel
2020-07-09 22:29:31 -04:00
Extra Modules: https://github.com/JPyke3/extramodules-mbp-manjaro
2020-07-13 19:57:38 -04:00
Repository: https://jacobpyke.xyz/archlinux/
2020-07-09 22:27:52 -04:00
## Releases
2020-09-13 16:37:49 -04:00
### [Download the latest releases here](https://drive.google.com/drive/folders/16BK16Ig2BX3MzktFFPaX04-B2PTAhd8R?usp=sharing)
2020-07-09 22:27:52 -04:00
## Installation Proccess
2020-07-11 05:47:33 -04:00
#### Hardware requirements:
* USB-C to ethernet cable adapter.
* Whilst you can install this over WiFi, it would make it alot easier to use an Adapter. If you would like to use the WiFi to set up Manjaro then refer to the "In order to get WiFi working" Section after you have booted Manjaro
* USB-C to USB Adapter
2020-07-11 00:19:56 -04:00
2020-07-11 05:47:33 -04:00
### Steps
1. Partition your drive in MacOS ready for a linux install. You can either use Disk Utility or use Bootcamp, important thing is, is that you have two partitions (Your MacOS partition and your new linux one) (It isn't recommended that you totally delete MacOS as firmware updates are applied through it).
2020-09-13 16:37:49 -04:00
2. Flash your iso to a USB Stick, If you want a easy way to do this. Use [Balena Etcher](https://www.balena.io/etcher/). For a more command line way of doing this, use dd.
2020-07-11 05:47:33 -04:00
3. Disable MacOS secure boot. [Apple's Documentation](https://support.apple.com/en-au/HT208330)
2020-07-11 05:50:40 -04:00
a. Turn on your Mac, then press and hold Command (⌘)-R immediately after you see the Apple logo to start up from macOS Recovery.
b. When you see the macOS Utilities window, choose Utilities > Startup Security Utility from the menu bar.
c. When you're asked to authenticate, click Enter macOS Password, then choose an administrator account and enter its password.
d. Set the first option to "No Security", and the second to "Allow booting from External Media".
e. Reboot your Mac.
2020-09-13 16:37:49 -04:00
4. Once Secure boot is diabled, fully shutdown your Computer and Power it on again whilst holding the Option (⌥) key.
2020-07-11 05:47:33 -04:00
5. Select the yellow EFI System using the arrow keys and hit enter.
2020-09-13 16:37:49 -04:00
6. Scroll down to `Boot x86 64 {Your Edition}` using the arrow keys and press enter.
7. After booting into Manjaro, open a terminal window and run this command:
2020-07-11 05:47:33 -04:00
```
2020-09-13 16:37:49 -04:00
systemctl start systemd-timesyncd.service
2020-07-11 05:47:33 -04:00
```
8. Open the installer and proceed normally until you hit the partitioning stage
9. Click Manual Partitioning
2020-09-13 16:37:49 -04:00
10. Click on `/dev/nvme0n1p1` then press edit at the bottom of the install window, change the Change the Mount Point: `/boot`, after that click okay.
11. Usually, the MacOS partition is mounted to `/dev/nvme0n1p2` (Double check this, the Installer should recognize this partition as an `Apple APFS` Partition). Ignore the MacOS partition.
13. Delete the partition you created before, this is usually mounted to `/dev/nvme0n1p3`.
14. These next steps involve partitioning the `/`(Root) and `/home`(Home) partitions of your Linux filesystem, if you know what you are doing feel free to skip to the next step (15).
a. Create a `51200 MiB` partition with `ext4` as the file system. Change the mount point to `/` and click okay.
b. Use the remaining disk space to create an `ext4` file system. Change the mount point to `/home`.
15. Click Next, on the next screen a warning will appear about EFI System Partition Configuration. Just ignore it and click okay.
16. Continue the rest of the setup as normal. Once the installer has finished do not restart the system.
17. Open a terminal, and type:
2020-07-11 05:47:33 -04:00
```
sudo fdisk -l.
```
The root password is 'manjaro'
2020-09-13 16:37:49 -04:00
18. Scroll up to the disk named /dev/nvme0n1. Note down the names of the 50G Linux partition and the 300M EFI SYSTEM partition.
2020-07-11 05:47:33 -04:00
In my case these were mounted at /dev/nvme0n1p1 (EFI System) and /dev/nvme0n1p3 (Linux Filesystem).
2020-09-13 16:37:49 -04:00
19. Copy this command into a terminal, substitute the two fields in { } with your EFI System and Linux Filesystem names
2020-07-11 05:47:33 -04:00
```
sudo mount {Linux Filesystem} /mnt; sudo mount {EFI System} /mnt/boot
```
2020-09-13 16:37:49 -04:00
20. Run this command, take note of the UUID (Note this command has a space in the grep command `"/ "`, It is there for a reason)
2020-07-11 05:47:33 -04:00
```
cat /mnt/etc/fstab | grep "/ "
```
2020-09-13 16:37:49 -04:00
21. Open a new terminal, and run this command
2020-07-11 05:47:33 -04:00
```
manjaro-chroot /mnt
```
2020-09-13 16:37:49 -04:00
22. Run this command to install systemd-boot
2020-07-11 05:47:33 -04:00
```
bootctl --path=/boot --no-variables install
```
2020-09-13 16:37:49 -04:00
23. and then this one to mask systemd from not touching a EFI var (Causes a kernel panic)
2020-07-11 05:47:33 -04:00
```
systemctl mask systemd-boot-system-token.service
```
2020-09-13 16:37:49 -04:00
24. Open the file /boot/loader/entries/manjaro.conf in your favorite text editor (If you are a beginner use the command below)
2020-07-11 05:47:33 -04:00
```
nano /boot/loader/entries/manjaro.conf
```
2020-09-13 16:37:49 -04:00
25. Paste in the block of text below (Note for beginners to paste into a terminal its usually control + shift + v)
2020-07-11 05:47:33 -04:00
```
title Manjaro Linux
2020-09-13 16:37:49 -04:00
linux /vmlinuz-5.7-x86_64-mbp
2020-07-11 05:47:33 -04:00
initrd /intel-ucode.img
2020-09-13 16:37:49 -04:00
initrd /initramfs-5.7-x86_64-mbp.img
2020-07-11 05:47:33 -04:00
options root="UUID={change_this_value}" rw
```
2020-09-13 16:37:49 -04:00
26. Change back to your other terminal with the values, And copy the UUID from the other terminal, replacing {change_this_value} (Including the brackets).
27. Save the file (Use ctrl+x if you copied my command from above, press the y button and then press enter).
28. Run the command below:
2020-07-11 05:47:33 -04:00
```
echo -e 'default manjaro.conf\rtimeout 4\rconsole-mode max\reditor no' > /boot/loader/loader.conf
```
2020-09-13 16:37:49 -04:00
29. Press control + d
30. Run this command:
2020-07-11 05:47:33 -04:00
```
sudo umount -R /mnt
```
Reboot your computer, Remembering to move the USB boot flash drive, and welcome to Manjaro :)
2020-07-11 07:42:06 -04:00
#### Footnote - Touchbar & AUDIO
2020-07-11 06:34:25 -04:00
2020-07-11 07:42:06 -04:00
Small Footnote to the install setup. At this stage I forgot to compile the ISO images with the images to include the touchbar & audio package, this will be fixed upon next release. In the meantime run this on your new system to get your touchbar and audio working:
2020-07-11 06:34:25 -04:00
```
2020-07-11 07:42:06 -04:00
sudo pacman -S macbook12-spi-driver-dkms audio-fix-mbp
2020-07-11 06:34:25 -04:00
```
2020-07-11 07:42:06 -04:00
then reboot.
2020-07-11 06:34:25 -04:00
2020-07-11 05:47:33 -04:00
## In order to get WiFi working
1. Boot into OSX and run the following in terminal: `ioreg -l | grep C-4364`
It will show something like:
```
"RequestedFiles" = ({"Firmware"="C-4364__s-B2/kauai.trx","TxCap"="C-4364__s-B2/kauai-X3.txcb","Regulatory"="C-4364__s-B2/kauai-X3.clmb","NVRAM"="C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt"})
| | | | "images" = {"C-4364__s-B2/kauai-X3.txcb"={"imagetype"="TxCap","required"=No,"imagename"="C-4364__s-B2/kauai-X3.txcb"},"C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt"={"imagetype"="NVRAM","required"=Yes,"imagename"="C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt"},"C-4364__s-B2/kauai-X3.clmb"={"imagetype"="Regulatory","required"=Yes,"imagename"="C-4364__s-B2/kauai-X3.clmb"},"C-4364__s-B2/kauai.trx"={"imagetype"="Firmware","required"=Yes,"imagename"="C-4364__s-B2/kauai.trx"}}
```
It'll be different depending on your exact model.
2. There are three files to note down. A `.trx` (for me: `C-4364__s-B2/kauai.trx`), a `.clmb` (for me: `C-4364__s-B2/kauai-X3.clmb` and a `.txt` (for me: `C-4364__s-B2/P-kauai-X3_M-HRPN_V-u__m-7.5.txt`
3. Look for the corrisponding files in this repository: https://packages.aunali1.com/apple/wifi-fw/18G2022/ (Thank you Aunali1)
4. Boot back into linux and place the files in the following locations:
5. Copy the trx to `/lib/firmware/brcm/brcmfmac4364-pcie.bin` (e.g. `sudo cp kauai.trx /lib/firmware/brcm/brcmfmac4364-pcie.bin`)
6. The clmb to `/lib/firmware/brcm/brcmfmac4364-pcie.clm_blob` (e.g. `sudo cp kauai-X3.clmb /lib/firmware/brcm/brcmfmac4364-pcie.clm_blob`)
7. The txt to something like `/lib/firmware/brcm/brcmfmac4364-pcie.Apple Inc.-MacBookPro15,1.txt`. You will need to replace `15,1` with your model number. (e.g. `sudo cp P-kauai-X3_M-HRPN_V-u__m-7.5.txt /lib/firmware/brcm/brcmfmac4364-pcie.Apple Inc.-MacBookPro15,1.txt`).
2020-07-11 05:50:40 -04:00
a. [Identifying your MacBook Pro Model](https://support.apple.com/en-us/HT201300) or [Identifying your MacBook Air Model](https://support.apple.com/en-au/HT201862)
2020-07-11 05:47:33 -04:00
2020-07-14 17:14:17 -04:00
- Credit to [@mikeeq](https://github.com/mikeeq) for the write up.
2020-07-12 03:14:34 -04:00
#### Footnote - WiFi using iwd (Recommended!)
The way I recommend getting WiFi to work in linux is using iwd instead of wpa_supplicant. Below is how you would configure iwd.
```
sudo pacman -S iwd
systemctl stop wpa_supplicant
systemctl mask wpa_supplicant
sudo nano /etc/NetworkManager/NetworkManager.conf
```
paste in this at the end:
```
[device]
wifi.backend=iwd
```
Run:
```
systemctl enable iwd
```
then reboot.
#### Footnote - WiFi using wpa_supplicant
In the next release this will not be required, but in order to have the wifi work after reboot run the following commands (NOTE: This is a bit tempremental as wpa_supplicant really doesn't work that well with the chips in the MacBooks):
2020-07-11 07:42:06 -04:00
```
sudo pacman -S wifi-fix-mbp
systemctl start wifi-fix.service; systemctl enable wifi-fix.service
```
2020-07-11 05:47:33 -04:00
## FAQ
#### Issues Updating Because of the MBP Repository
When you update the system, you may recieve errors about my key being corrupted, if that occurs open a terminal and run this
```
sudo pacman-key --recv-key 2BA2DFA128BBD111034F7626C7833DB15753380A --keyserver keyserver.ubuntu.com
```
2020-07-14 08:20:22 -04:00
#### When I click on the EFI Partition I boot into MacOS!
Yes, sadly I made a mistake in the very early builds. This is because the earlier builds used a different naming scheme before i adopted the manjaro standard of naming the kernel `linuxXX-mbp`
In order to fix this fire up the live usb again. Once you boot into manjaro mount your EFI partition mount `/dev/nvme0n1p1 /mnt` edit the file `nano /mnt/loader/entries/manjaro.conf` and chane the line:
```
linux /vmlinuz-linux56-mbp
```
to
```
linux /vmlinuz-5.6-x86_64-mbp
```
and also change line:
```
initrd /initramfs-linux56-mbp.img
```
to
```
initrd /initramfs-5.6-x86_64-mbp.img
```
After that try the EFI System partition again.
**Note, after your first update with pacman the kernel will revert back to the old names, in order to ensure you still get the latest updates revert these lines back after runing sudo pacman -Syu once.**
2020-07-11 23:54:29 -04:00
#### Switch Touchbar to Function Keys
Run this in your terminal:
```
sudo bash -c "echo 2 > /sys/class/input/*/device/fnmode"
```
2020-07-09 22:27:52 -04:00
2020-09-13 16:37:49 -04:00
#### The Repo doesn't work!
The old repository was on port 8080, this is no longer how I want to move forward and this repo has been taken down and off this port.
In order to switch to the new repository run this in a terminal:
```
sudo sed -i 's/http:\/\/jacobpyke.xyz:8080/https:\/\/jacobpyke.xyz/' /etc/pacman.conf
```
2020-07-09 22:27:52 -04:00
## Building for yourself
2020-07-10 00:04:37 -04:00
2020-09-07 06:06:03 -04:00
### Option 1: Docker
First, you need to ensure that docker isn't using `overlay` or `overlay2` filesystems. This can be verified by running `docker info`. And will be shown next to `Storage Driver`.
2020-09-10 18:56:37 -04:00
In the event that you are running `overlay`, [Look at this docker documentation](https://docs.docker.com/storage/storagedriver/vfs-driver/) on how to switch to VFS.
*Note, this doesn't work on OSX or Windows, I am working closely with the Manjaro Devs on this one.*
2020-09-07 06:06:03 -04:00
**Quick Docker Install Script - Tested on Arch**
```
sh -c "$(curl -fsSL "https://raw.githubusercontent.com/JPyke3/mbp-manjaro/master/build-in-docker.sh")"
```
**Docker Command**
```
docker run --privileged \
-v ~/manjaro-mbp-iso:/root/out \
2020-09-10 18:56:37 -04:00
-v {PATH-TO-REPO}:/root/iso-profiles\
2020-09-07 06:06:03 -04:00
--env KERNEL=linux57-mbp\
--env EDITION=gnome\
jpyke3/mbp-manjaro-buildiso
```
#### Command Breakdown
- `--privileged`
- This is required for allowing the filesystems to be created. (This is a security risk! Read for yourself the documentation on this flag)
- `-v`
- Create a folder on your host filesystem to retrieve the compiled files from the container
2020-09-10 18:56:37 -04:00
- Ensure that `{PATH-TO-REPO}` is replaced by the absolute path to this repo's files.
2020-09-07 06:06:03 -04:00
- `--env`
- There are two environment variables:
- `KERNEL`: This is used for defining which kernel version to use. All packages will follow the `-mbp` naming scheme.
- `EDITION`: This is used for defining which edition of manjaro you would like to install.
## Option 2: Manually on an existing Manjaro Install
2020-07-10 00:04:37 -04:00
First Install Manjaro Tools:
```
pamac install manjaro-tools-iso git
```
2020-07-09 22:27:52 -04:00
Clone the repository to your home directory
```
git clone https://github.com/JPyke3/mbp-manjaro ~/iso-profiles
```
run a command corrisponding to your preferred version of Manjaro:
##### xfce
```
buildiso -f -p xfce -k linux56-mbp
```
##### GNOME
```
buildiso -f -p gnome -k linux56-mbp
```
##### KDE-Plasma
```
buildiso -f -p kde -k linux56-mbp
```
##### i3wm
```
buildiso -f -p i3 -k linux56-mbp
```
##### Cinnamon
```
buildiso -f -p cinnamon -k linux56-mbp
```
##### Budgie
```
buildiso -f -p budgie -k linux56-mbp
```
#### File Locations
Navigate to the directory for your iso file. If Using xfce GNOME or KDE go to:
```
cd /var/cache/manjaro-tools/iso/manjaro/{NAME_OF_EDITION}/20.0.3/
```
If on i3wm Cinnamon or Budige navigate to:
```
cd /var/cache/manjaro-tools/iso/community/{NAME_OF_EDITION}/20.0.3/
```
2020-07-10 00:11:25 -04:00
2020-09-11 16:08:56 -04:00
## Known Limitations
### Architect / TTY
All TTY's will overscan on these models. This is known and being actively worked on.
2020-07-10 00:11:25 -04:00
## Notable Resources
Build Manjaro ISOs with Buildiso: https://wiki.manjaro.org/Build_Manjaro_ISOs_with_buildiso
2020-07-10 00:11:52 -04:00
2020-07-10 00:11:25 -04:00
Apple BCE DKMS Git: https://aur.archlinux.org/packages/apple-bce-dkms-git/
2020-07-10 00:11:52 -04:00
2020-07-10 00:11:25 -04:00
Manjaro Core Packages: https://gitlab.manjaro.org/packages/core
2020-07-10 00:11:52 -04:00
2020-07-10 00:11:25 -04:00
2018+ MBP Discord Server: https://discord.gg/fgDd8Vr
2020-07-10 00:11:52 -04:00
2020-07-10 00:11:25 -04:00
Arch MBP 2018 (Out of Date): https://gist.github.com/TRPB/437f663b545d23cc8a2073253c774be3
## Noteworthy Helpers
* Aunali1 (Arch Linux MBP and DKMS Modules): https://github.com/aunali1
* MCMrARM (Original Drivers): https://github.com/MCMrARM
* mikeeq (Fedora Linux MBP): https://github.com/mikeeq
* TRPB (Original Arch Linux Guide): https://github.com/TRPB
* marcosfad (Ubuntu MBP): https://github.com/marcosfad
2020-09-13 16:37:49 -04:00
## Noteworthy GitHub Repo's
* Keyboard, Trackpad, Audio and Suspend: https://github.com/MCMrARM/mbp2018-bridge-drv
* Arch Linux Kernel Patches: https://github.com/aunali1/linux-mbp-arch
* DKMS Module for loading Patches: https://github.com/aunali1/apple-bce-arch
2020-07-10 00:11:25 -04:00
## Other MBP Distributions
* Ubuntu: https://github.com/marcosfad/mbp-ubuntu
* Fedora: https://github.com/mikeeq/mbp-fedora
* Arch: https://github.com/aunali1/linux-mbp-arch
2020-07-10 00:23:15 -04:00
## TODO
- [ ] Fix KDE and Budgie Versions
- [ ] Automate WiFi Installation
- [ ] Test Installer on Every Edition
2020-07-14 17:14:17 -04:00
- [x] xfce
- [x] GNOME
2020-07-10 00:23:15 -04:00
- [ ] KDE-Plasma
2020-09-10 18:56:37 -04:00
- [x] Cinnamon
2020-07-10 00:23:15 -04:00
- [ ] Budige
2020-09-11 16:08:56 -04:00