User:Nathanlkoch/Tutorials/MacPro

From Gentoo Wiki
Jump to:navigation Jump to:search

Apple Mac Pro 1,1 and 2,1 - Gentoo amd64

The following tutorial is for a Mac Pro 1,1.

Mine has been modified to use 2,1 firmware and also has an updated SMC.

EFI mod

https://github.com/joelgraff/macproupgrade

Shop

Ebay Listing 1, Ebay Listing 2

The Mac Pro 1,1 CPU Compatibility list can be found here. https://forums.macrumors.com/threads/mac-pro-cpu-compatibility-list.1954766/

I paid around 50 dollars for mine at the time of the upgrade.

Btrfs Install

User:Nathanlkoch/Tutorials/BTRFS Encryped Root On UEFI

Follow this tutorial but keep in mind. We will need to change a few variables with grub and video in our portage/make.conf

Make a relatively large /boot part. A few gigs.

Xorg/Wayland

nouveau

Install

The nouveau setup is iffy. You will need to specify a GLX variable.

https://forums.gentoo.org/viewtopic-t-1074672-start-0.html

Set your video flags and grub platform in make.conf.

FILE /etc/portage/make.conf
GRUB_PLATFORMS="efi-32"
VIDEO_CARDS="nouveau v4l"

I would provide my COMMON_FLAGS and CPU_FLAGS_X86 but your results may vary as I upgraded my CPU. As a good rule of thumb Install resolve-march-native and cpuid2cpuflags before building world as it will allow you to set all of this before your initial compile. I have an Nvidia 7300 that came with these original Mac Pros. The nvidia legacy drivers can be a cumbersome and I was having issues with rebuilds and kernel hacking. The nouveau drivers should have you covered for awhile. Graphics are relatively snappy.

root #emerge -av nvidia-firmware

You may also want to add vaapi and vdpau use flags to your make.conf which are enabled via the nvidia-firmware bundle.Continue on with building world and follow my tutorial and handbook until you get to genkernel.

root #env-update

LZ4 loads faster but takes up more space. I like to use it.

FILE /etc/genkernel.conf
COMPRESS_INITRD_TYPE="zstd"

Download the following pre-configured kernel config for genkernel.

Kernel 5.15.89 LTS EFI

https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.89.tar.xz

root #genkernel --luks --btrfs --oldconfig --save-config --menuconfig --install --bootloader=grub all

Load 5kernel into genkernel menuconf. Save as .config. Exit out of menuconf. The kernel will build and install.

Kernel 6.2.X EFI

https://git.kernel.org/torvalds/t/linux-6.2-rc4.tar.gz Full Path

root #genkernel --luks --btrfs --oldconfig --save-config --menuconfig --install --bootloader=grub all

Load 6kernel into genkernel menuconf. Save as .config. Exit out of menuconf. The kernel will build and install.

https://github.com/anathonous/Apple/tree/main/MacPro1_1


nvidia-drivers

Warning
After further investigation this doesn't actually provide a working kernel driver just a functioning glx provider which is enough to get X and Wayland to display properly. Use the Legacy driver and patcher provided below under the kernel section.

Follow the NVIDIA/nvidia-drivers#Configuration page

Install

Set your video flags and grub platform in make.conf.

FILE /etc/portage/make.conf
GRUB_PLATFORMS="efi-32"
VIDEO_CARDS="nvidia"

I would provide my COMMON_FLAGS and CPU_FLAGS_X86 but your results may vary as I upgraded my CPU. As a good rule of thumb Install resolve-march-native and cpuid2cpuflags before building world as it will allow you to set all of this before your initial compile. I have an Nvidia 7300 that came with these original Mac Pros. The nvidia legacy drivers can be a cumbersome and I was having issues with rebuilds and kernel hacking. The nouveau drivers should have you covered for awhile. Graphics are relatively snappy.

You may also want to add vaapi and vdpau use flags to your make.conf which are enabled via the nvidia-firmware bundle.

Continue on with building world and follow my tutorial and handbook until you get to genkernel.

Genkernel

LZ4 loads faster but takes up more space. I like to use it.

FILE /etc/genkernel.conf
COMPRESS_INITRD_TYPE="zstd"
FILE /etc/portage/package.mask/nvidia
>x11-drivers/nvidia-drivers-391
FILE /etc/portage/package.use/ffmpeg
media-video/ffmpeg -video_cards_nvidia
root #env-update
root #emerge -av nvidia-firmware nvidia-drivers

Download the following pre-configured kernel config for genkernel.

Kernel 5.15.89 LTS EFI

https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.89.tar.xz

root #genkernel --luks --btrfs --oldconfig --save-config --menuconfig --install --bootloader=grub all

Load 5kernel into genkernel menuconf. Save as .config. Exit out of menuconf. The kernel will build and install.

I am finding I am getting better performance out of the 5.15 Kernel.

Kernel 6.1 Kernel
root #genkernel --luks --btrfs --oldconfig --save-config --menuconfig --install --bootloader=grub all

Load 6kernel into genkernel menuconf. Save as .config. Exit out of menuconf. The kernel will build and install.

Other configs available below.

https://github.com/anathonous/Apple/tree/main/MacPro1_1

Kernel

Most importantly you will need to set your kernel flags for nouveau or nvidia which is what I struggled with the most. This tutorial will also work for you on any other linux distro but you will need to set your kernel flags accordingly. The configs I provided already have them set.

https://www.cyberciti.biz/tips/compiling-linux-kernel-26.html

EFI

KERNEL EFI
Processor type and features  -----> 
    [ * ] EFI runtime service support
    [ * ]    EFI stub support
    [   ]       EFI mixed-mode support


Device Drivers  ---->
   Firmware Drivers  ---->
      [ * ] Mark VGA/VBE/EFI FB as generic system framebuffer 
      EFI ( Extensible Firmware Interface ) ---->
          [ * ] EFI Variable Support to sysfs
          [   ] Export efi runtime maps to sysfs
          [   ] Enable EFI fake memory map
          <  > EFI Bootloader Control
          <  > EFI capsule loader
          <  > EFI Runtime Service Tests Support
          [ * ] Apple Device Properties
          [   ] Reset memory attack mitigation
          [ * ] EFI Runtime Configuration Interface Table Version 2 Support
          [ * ] Clear Busmaster bit on PCI bridges during ExitBootServices()

Nouveau Framebuffer

KERNEL NOUVEAU
Device Drivers  ---->
  Graphics ----->
       [ * ] VGA Arbitration
       (16) Maximum number of GPUs
       < * > Direct Rendering Manager ( XFree86 4.1.0 and higher DRI support) ---->
        < * > Nouveau
           [ * ] Nouveau legacy context support
           <5> Maximum debug level
           <3> Default debug level
           [ * ] Support for backlight control
       <   > Simple framebuffer driver
*Everything else should be off   
              Frame buffer devices ----->
                      [ * ] Enable firmware EDID
                      [   ] Framebuffer foreign endianness support -----
                      [ * ] Enable Video Mode Handling Helpers 
                      [ * ] Enable Tile Blitting Support
                      [   ] EFI-based Framebuffer Support
                      < * > Simple framebuffer support

Nvidia Framebuffer

KERNEL NVIDIA
Device Drivers  ---->
  Graphics ----->
       [ * ] VGA Arbitration
       (16) Maximum number of GPUs
       < * > Direct Rendering Manager ( XFree86 4.1.0 and higher DRI support) ---->
        < * > Nouveau
           [ * ] Nouveau legacy context support
           <5> Maximum debug level
           <3> Default debug level
           [ * ] Support for backlight control
*Everything else should be off
               Frame buffer devices ----->
                      [ * ] Enable firmware EDID
                      [   ] Framebuffer foreign endianness support -----
                      [ * ] Enable Video Mode Handling Helpers 
                      [ * ] Enable Tile Blitting Support
                      [ * ] EFI-based Framebuffer Support
                      < * > Simple framebuffer support

NVIDIA Driver

TODO: The following nvidia patcher will download and patch the legacy driver so you can use it on modern kernels.

Nvidia Driver: https://www.nvidia.com/Download/driverResults.aspx/156163/en-us/

Nvidia Patcher: https://www.if-not-true-then-false.com/2020/inttf-nvidia-patcher/

Grub bootloader

Install grub efi-32(i386-efi) with --removable flag.

root #grub-install --target=i386-efi --efi-directory=/boot --removable
FILE /etc/default/grub
...
GRUB_ENABLE_CRYPTODISK=y
GRUB_CMDLINE_LINUX_DEFAULT=" crypt_root=UUID=THE_UUID_OF_LUKSDISK quiet"
...

We'll use grub-mkconfig to generate the grub.cfg

root #grub-mkconfig -o /boot/grub/grub.cfg

Reboot. The system can take a bit to boot.Finished.

Finalize

Mac Pro Gentoo Current Dec 30 2022.png

Try FreeBSD

For the longest time I was using FreeBSD on it. I also wrote a Tutorial.

https://wiki.freebsd.org/MacPro1%2C1