Skip to content

Install instructions for Macbook Air OSX and Arch side by side

Notifications You must be signed in to change notification settings

badgumby/arch-macbook-air

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 

Repository files navigation

Installing Arch Linux on a 2017 Macbook Air

Install instructions for Macbook Air OSX and Arch side by side

Getting Started

Before starting you should have some knowledge of partitioning and Arch Linux. Also, I'd like to note that, more than likely, the wireless card in your Macbook Air will not be detected by the Arch boot disk (or most other distros). With that being said, you will need a USB-to-Ethernet adapter. I like this one.

Items needed for install:

  • Internet connection
  • USB-to-Ethernet Adapter
  • USB flash drive for the bootable .dmg (covered later)

Install Instructions

  1. You will first need to resize your MacOS partition. You can do this using the Mac Disk Utility. If you are using APFS(Encrypted), you will be required to reinstall MacOS first, since the encrypted file system will not allow a resize.
  2. Turn off System Integrity Protection (SIP).
  • Restart your MacOS
  • Before it starts, press and hold Command+R
  • Select Terminal from the Utility menu
  • In the terminal, enter csrutil disable
  • You should see a message similar to Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
  • Reboot your machine
  1. Download and install rEFInd.
  • Download the zip
  • Extract to a folder
  • In Terminal enter the directory that was extracted
  • Run the command sudo ./refind-install
  1. Download the current Arch Linux iso.
  2. Convert archlinux-20xx.xx.xx-x86_64.iso to .dmg format.
  • hdiutil convert -format UDRW -o archlinux-20xx.xx.xx-x86_64.iso arch-converted.dmg
  1. Write the arch-converted.dmg to a USB flash drive.
  • In a terminal, enter diskutil list
  • Identify your USB drive. In my case it was /dev/disk2
  • Once you have identified the disk, enter diskutil unmountDisk /dev/disk2 (replace disk2 with your USB drive)
  • Once unmounted, enter sudo dd if=arch-converted.dmg of=/dev/rdisk2 bs=1m (use an r before disk to access the raw drive)
  1. Boot to USB drive.
  • Power down your Macbook
  • Insert your USB-to-Ethernet Adapter
  • Power on, press and hold the Alt/Option key
  • On the UEFI selection menu, select your boot USB drive
  1. Verify network connectivity.
  • Verify adapter appears and has connetivity. Enter ip addr
  • If DHCP has not started on the NIC enter systemctl start dhcpcd@INTERFACE, where INTERFACE is the NIC name.
  • Ping Google to verify internet connection. Enter ping 8.8.8.8
  1. List devices and format unused partition.
  • Enter fdisk -l to list the disks
  • Enter sgdisk -n 0:0:0 -t 0:8300 -c 0:"data" /dev/sda3 (This assumes the partition you created is on device sda and is partition 3)
  • Inform OS of partition changes by entering partprobe /dev/sda (If device is not sda, enter correct device name)
  • Make the filesystem format using mkfs.ext4 /dev/sda3
  1. Mount the newly created partition.
  • mount /dev/sda3 /mnt
  1. Create a swap file.
  • Create the file: dd if=/dev/zero of=/mnt/swapfile bs=1M count=2048 (Change count to how big you would like it. I have it set to be 2GB)
  • Change permissions on the file: chmod 600 /mnt/swapfile
  • Inform OS to use as swap: mkswap /mnt/swapfile
  1. Perform initial install of Arch to mounted volume.
  • pacstrap /mnt base base-devel grub-efi-x86_64 linux-headers broadcom-wl-dkms wpa_supplicant dialog vim git reflector
  1. Generate the /etc/fstab.
  • genfstab -pU /mnt >> /mnt/etc/fstab
  • echo 'tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0' >> /mnt/etc/fstab
  • echo '/swapfile none swap defaults 0 0' >> /mnt/etc/fstab
  1. Enter the fresh installed Arch system.
  • arch-chroot /mnt /bin/bash
  1. Initialize the pacman-key.
  • pacman-key --init
  • pacman-key --populate archlinux
  1. Update timezone information.
  • rm /etc/localtime
  • ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
  • hwclock --systohc --utc
  1. Set hostname.
  • echo MYHOSTNAME > /etc/hostname
  1. Set your locale.
  • sed -i 's:#en_US.UTF-8 UTF-8:en_US.UTF-8 UTF-8:g' /etc/locale.gen
  • locale-gen
  • echo LANG=en_US.UTF-8 >> /etc/locale.conf
  • echo LANGUAGE=en_US.UTF-8 >> /etc/locale.conf
  • echo LC_ALL=en_US.UTF-8 >> /etc/locale.conf
  1. Set root user password.
  • passwd
  1. Allow wheel group in sudoers file.
  • sed -i '/%wheel ALL=(ALL) ALL/c\%wheel ALL=(ALL) ALL' /etc/sudoers
  1. Add user and set password.
  • useradd -m -g users -G wheel $MYUSERNAME
  • passwd $MYUSERNAME
  1. Add ext4 to /etc/mkinitcpio.conf.
  • sed -i '/^MODULES=/c\MODULES=(ext4)' /etc/mkinitcpio.conf
  1. Regenerate the initrd image.
  • mkinitcpio -p linux
  1. Edit /etc/default/grub
  • Modify line: GRUB_CMDLINE_LINUX_DEFAULT="quiet libata.force=1:noncq"
  • Add line: GRUB_DISABLE_SUBMENU=y
  1. Make grub.cfg and standalone boot.efi file.
  • grub-mkconfig -o boot/grub/grub.cfg
  • grub-mkstandalone -o arch.efi -d usr/lib/grub/x86_64-efi -O x86_64-efi --compress=xz boot/grub/grub.cfg
  1. Mount EFI partition and create. (assuming partition /dev/sda1)
  • mkdir -p /mnt/EFI
  • mount /dev/sda1 /mnt/EFI
  • mkdir -p /mnt/EFI/arch
  • cp /arch.efi /mnt/EFI/arch/arch.efi
  1. Exit chroot and reboot.
  • exit
  • reboot
  1. You should now be greeted with the rEFInd boot loader, and see an option for your Arch Linux partition.

Change F1-F12 Keys to Not Require FN Keypress

To set this temporarily (in your current session only), use the following command:

echo "2" | sudo tee /sys/module/hid_apple/parameters/fnmode

To set this permanently (starts on next boot), use the following command:

echo "options hid_apple fnmode=2" | sudo tee /etc/modprobe.d/hid_apple.conf


Install Yay AUR Helper and Pacman Wrapper (https://github.com/Jguer/yay)

  1. Create a directory for the yay PKGBUILD files and enter it.

    mkdir ~/yay cd ~/yay

  2. Download yay PKGBUILD from AUR.

    wget --no-check-certificate https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yay --output-document=./PKGBUILD

  3. Run makepkg to build and install yay.

    makepkg -si

  4. You can now install packages from the Arch User Repository using a similar command:

    yay -S google-chrome


Shutdown Messages

  • If you receive a message similar to A stop job is running for Session c2 of user xx, you can decrease the timeout from 90 seconds (default) in the following config file:

    /etc/systemd/system.conf

    Uncomment and change time on line: DefaultTimeoutStartSec=10s

    Uncomment and change time on line: DefaultTimeoutStopSec=10s

  • If you receive a bunch of messages similar to Failed to remount '/oldroot/sys/fs/cgroup/pids' or Remounting '/oldroot/sys/fs/cgroup/pids', you can hide these by adding shutdown to HOOKS in the /etc/mkinitcpio.conf file. Then rebuild the initrd image.

    sudo mkinitcpio -p linux

About

Install instructions for Macbook Air OSX and Arch side by side

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published