Skip to content

Instantly share code, notes, and snippets.

@jpuskar
Forked from olpoco/fedora.md
Last active August 7, 2017 20:52
Show Gist options
  • Save jpuskar/19824c0b66a9a6b5387096ab786dfb38 to your computer and use it in GitHub Desktop.
Save jpuskar/19824c0b66a9a6b5387096ab786dfb38 to your computer and use it in GitHub Desktop.
Installing Fedora 23 on Macbook Pro Retina 2016, and attaching Airport Extreme

Installing Fedora on Macbook Pro retina

  1. Download Fedora 25 iso, create a usb bootable media

  2. Use diskutil list to figure out which drive is the usb, on macbook pro with 1 hardrive, the usb is /dev/disk2

  3. Umount the disk using diskutil unmountDisk /dev/disk2 or use Mac's Disk Utility (just umount, don't eject, umount removes it from directory structure and eject disconncet it altogether)

  4. Use dd(a low level cp) to write iso content into the usb drive, sudo dd if=~/Downloads/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/rdisk2 bs=8m, this will take a bit of time, make sure you wait until it's done, additionally compare the size or checksum to make sure all has been copied (not that necessary since if it weren't copied, it'll err at boot time)

  5. Use Disk Utility to shrink Mac's harddrive to create partition for the subsequent fedora installation

  6. Boot to recovery mode (cmd+r) and disable SIP (terminal -> csrutil disable; reboot).

  7. Boot to OS X.

  8. Download Refind and install it (sudo ./refind-install).

  9. Reboot with the fedora USB stick, and boot Fedora.

  10. click on "next steps" and install Fedora on the newly allocated partition, at the end it'll reboot

  11. once rebooted, it'll boot directly into fedora (you can't boot into mac anymore), this is because Fedora installed grub as bootloader which doesn't recognize OS X, don't panic, you can reboot and hold down Cmd + R, which will boot into Mac's recovery, at which point, you can choose Mac's partition as default startup disk, see here, do that

  12. once you are in Mac OS again, install rEFInd, a boot manager that'd allow you to select Mac partition at boot. It sounds complicated, but really you just have to 1) disable Mac's SIP 2) download and run the ./refind_install script, detailed instructions here, and then reboot. (you could also install it before installing fedora at step 5 but it'll be overwritten when Fedora is installed)

  13. now on start, you'll be given the option to select the OS to boot into, awesome!!

issues

Mac's hardware is customized for OS X, so it's like to have small issues with Linux. Things that I have run into

Wifi

Once I close the lid, wifi turns off and never turn on again, I get it back up by removing wifi's kernel module and re-add it. somewhat a hack but it works

rmmod brcmfmac; modprobe brcmfmac

brcmfmac is Mac's wifi driver from Broadcom, I found it by doing lsmod | grep 802, (lsmod list all kernel modules, grep 8021 to look for strings containing 802 because 802.11 is the wifi standard). rmmod removes the module and modprobe add the module. The wifi problem still turns up during shutdown, so I normally remove the module before shutdown..

Airport Extreme shared disk

I have an Airport Extreme with an external hard drive attached to it as a network drive. It's got 1TB so I can dump all my stuff and access from all my computers at home. Airport Extreme supports both apple's AFP file transfer protocol and Microsoft SMB/CIFS protocol. Linux can mount SMB drives, so awesome we can just mount it as external hard drive. I setup the shared drive using mac's Airport Utilities and selected device password as password protection (basically means the password is same as wifi password). Time to mount it on Fedora! The mount command I used is

sudo mount -t cifs -o username=sheldon,uid=1000,gid=1000,sec=ntlm "//10.0.1.1/Mr NetworkDrive" ~/ExternalHDD/

-t cifs tells it to use CIFS standard, uid and gid tell it mounted folder's user and group (since you are running with sudo as root, by default it'd mount as root). It'll ask for password (same as wifi as we set it up as "using device password". sec=ntlm is very important, as it looks like Airport extreme only supports ntlm(v1)?? To let it mount automatically, I added this to /etc/fstab

//10.0.1.1/Mr\040NetworkDrive   /home/sheldon/ExternalHDD       cifs    username=sheldon,password=password,uid=1000,gid=1000,sec=ntlm  0       0

note that if you have space in the drive name you need to replace it with \040 in the fstab file

play videos

I wanted to play avi file with vlc, so I had to install rpmfusion(a repo that contains "software that the Fedora Project or Red Hat doesn't want to ship"), and dnf install vlc

remap keys

https://wiki.archlinux.org/index.php/Apple_Keyboard swap COMMAND and ALT

echo options hid_apple swap_opt_cmd=1 | sudo tee -a /etc/modprobe.d/hid_apple.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment