Skip to content

Instantly share code, notes, and snippets.

@renesugar
Forked from andrsd/arch-mac-mini.md
Created September 6, 2022 19:28
Show Gist options
  • Save renesugar/b718e74d8410fb487414bc5f5d4151cb to your computer and use it in GitHub Desktop.
Save renesugar/b718e74d8410fb487414bc5f5d4151cb to your computer and use it in GitHub Desktop.

Revisions

  1. @andrsd andrsd revised this gist Apr 9, 2016. 1 changed file with 36 additions and 1 deletion.
    37 changes: 36 additions & 1 deletion arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -104,10 +104,45 @@ Bluetooth
    ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"
    ```

    WiFi
    ----

    Let's assume `wlan` is out interface for this setup.

    * Install [b43-firmware](https://aur.archlinux.org/packages/b43-firmware/) from AUR
    * `pacman -S wpa_supplicant`
    * `# vim /etc/wpa_supplicant/wpa_supplicant-wlan.conf`

    ```
    ctrl_interface=/run/wpa_supplicant
    update_config=1
    ```
    * `# wpa_supplicant -B -i wlan -c /etc/wpa_supplicant/wpa_supplicant-wlan.conf`
    * `# wpa_cli`

    ```
    > scan
    > scan_results
    > add_network
    > set_network 0 ssid "MYSSID"
    > set_network 0 psk "passphrase"
    > enable_network 0
    > save_config
    ```
    * Or instead of `wpa_cli`, do `wpa_passphrase MYSSID passphrase > /etc/wpa_supplicant/wpa_supplicant-wlan.conf `

    * `# dhcpcd wlan`

    Use systemd to start the service:

    * `# ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/lib/dhcpcd/dhcpcd-hooks/`
    * `# systemctl enable dhcpcd@wlan`

    References
    ----------

    * [1] https://wiki.archlinux.org/index.php/MacBook
    * [2] https://wiki.archlinux.org/index.php/USB_flash_installation_media
    * [3] https://wiki.archlinux.org/index.php/Installation_guide
    * [4] http://mjg59.dreamwidth.org/7468.html
    * [4] http://mjg59.dreamwidth.org/7468.html
    * [5] https://wiki.archlinux.org/index.php/Broadcom_wireless
  2. @andrsd andrsd revised this gist Apr 9, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -98,6 +98,7 @@ Bluetooth

    * Install `bluez bluez-libs bluez-utils`
    * `udev` rule in `/etc/udev/rules.d/10-local.rules`:

    ```
    # Set bluetooth power up
    ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"
  3. @andrsd andrsd revised this gist Apr 9, 2016. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -93,6 +93,16 @@ Reboot
    - `# umount -R /mnt`
    - `# reboot`

    Bluetooth
    ---------

    * Install `bluez bluez-libs bluez-utils`
    * `udev` rule in `/etc/udev/rules.d/10-local.rules`:
    ```
    # Set bluetooth power up
    ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"
    ```

    References
    ----------

  4. @andrsd andrsd revised this gist Apr 8, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Install Arch Linux
    ==================
    Install Arch Linux on Mac mini
    ==============================

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1].
    We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system.
  5. @andrsd andrsd revised this gist Apr 8, 2016. 1 changed file with 15 additions and 8 deletions.
    23 changes: 15 additions & 8 deletions arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -34,30 +34,37 @@ Boot from LiveUSB
    Installation
    ------------

    1. Connect to network
    - Connect to network
    - `$ wifi-menu` to setup wireless networking (assuming DHCP is available)
    2. Setup time

    - Setup time
    - `$ timedatectl set-ntp true`
    - Check its status `$ timedatectl status`
    3. Partition the drive again ;-)

    - Partition the drive again ;-)
    - `# cgdisk`
    - Remove the `Arch tmp` partition we created earlier.
    - Remember to create 128 MB gap after OS X partitions, by typing `+128M` for the start of the partition.
    - Add new `Arch boot` partition (~ 100 MB)
    - Add new `Arch root` partition (fill the space)
    - Swap file can be created later if needed
    4. Create file systems

    - Create file systems
    - `# mkfs.ext2 /dev/<arch boot>`
    - `# mkfs.ext4 /dev/<arch root>`
    5. Mount the partitions

    - Mount the partitions
    - `# mount /dev/<arch root> /mnt`
    - `# mkdir /mnt/boot`
    - `# mount /dev/<arch boot> /mnt/boot`
    6. Edit mirror list

    - Edit mirror list
    - `# vim /etc/pacman.d/mirrorlist` it will be used pac the next step, so take good care of it here
    7. Install the base packages

    - Install the base packages
    - `# pacstrap /mnt base`
    8. Configure the system

    - Configure the system
    - `# genfstab -U -p /mnt >> /mnt/etc/fstab`
    - `# arch-chroot /mnt /bin/bash`
    - `# echo <computer name> > /etc/hostname`
  6. @andrsd andrsd revised this gist Apr 8, 2016. 1 changed file with 77 additions and 64 deletions.
    141 changes: 77 additions & 64 deletions arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -5,76 +5,89 @@ We will be creating dual boot for OS X and Linux with no special boot loader. Fo
    We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system.
    We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

    1. Prepare the disk in Mac OS X (El Capitan)
    - Open `Disk Utility` and select the disk (not partition), click `Partition` (top tool bar)
    - There are at least 3 partitions: __EFI__, __OS X__, __Recovery__. Only __OS X__ will be shown.
    - Repartition your disk as follows:
    1. OS X (size: ~ tens of GB, type HFS+, for OS X)
    2. Arch tmp (size: ~ 10 GB, FAT, will be removed later)
    Prepare the disk in Mac OS X (El Capitan)
    -----------------------------------------

    2. Create LiveUSB that we will boot from
    - Download the `.iso` from [download page](https://www.archlinux.org/download/)
    - Open `Terminal`
    - `$ diskutil list` and find out its name (let's say it is `/dev/disk2`)
    - `$ diskutil unmountDisk /dev/disk2` to unmount the drive
    - `# dd if=/path/to/arch-linux-image.iso of=/dev/rdisk2 bs=1m` (we replaced `disk` with `rdisk` which is the "raw" disk in OS X and a lot faster, it is not a typo)
    - `$ diskutil eject /dev/disk2`
    - Open `Disk Utility` and select the disk (not partition), click `Partition` (top tool bar)
    - There are at least 3 partitions: __EFI__, __OS X__, __Recovery__. Only __OS X__ will be shown.
    - Repartition your disk as follows:
    1. OS X (size: ~ tens of GB, type HFS+, for OS X)
    2. Arch tmp (size: ~ 10 GB, FAT, will be removed later)

    3. Boot from LiveUSB
    - Hold `Alt` while booting
    - Select the USB disk
    - Welcome to Arch Linux installer ;-)
    Create LiveUSB that we will boot from
    -------------------------------------

    4. Installation
    1. Connect to network
    - `$ wifi-menu` to setup wireless networking (assuming DHCP is available)
    2. Setup time
    - `$ timedatectl set-ntp true`
    - Check its status `$ timedatectl status`
    3. Partition the drive again ;-)
    - `# cgdisk`
    - Remove the `Arch tmp` partition we created in 1.
    - Remember to create 128 MB gap after OS X partitions, by typing `+128M` for the start of the partition.
    - Add new `Arch boot` partition (~ 100 MB)
    - Add new `Arch root` partition (fill the space)
    - Swap file can be created later if needed
    4. Create file systems
    - `# mkfs.ext2 /dev/<arch boot>`
    - `# mkfs.ext4 /dev/<arch root>`
    5. Mount the partitions
    - `# mount /dev/<arch root> /mnt`
    - `# mkdir /mnt/boot`
    - `# mount /dev/<arch boot> /mnt/boot`
    6. Edit mirror list
    - `# vim /etc/pacman.d/mirrorlist` it will be used pac the next step, so take good care of it here
    7. Install the base packages
    - `# pacstrap /mnt base`
    8. Configure the system
    - `# genfstab -U -p /mnt >> /mnt/etc/fstab`
    - `# arch-chroot /mnt /bin/bash`
    - `# echo <computer name> > /etc/hostname`
    - `# ln -s /usr/share/zoneinfo/<zone>/<subzone> /etc/localtime`
    - `# nano /etc/locale.gen` uncomment locales you want
    - `# locale-gen`
    - `# echo LANG=<your_locale> > /etc/locale.conf`
    - TODO: setup wireless networking
    - `# mkinitcpio -p linux`
    - `# passwd`
    - `# pacman -S gptfdisk`
    - Download the `.iso` from [download page](https://www.archlinux.org/download/)
    - Open `Terminal`
    - `$ diskutil list` and find out its name (let's say it is `/dev/disk2`)
    - `$ diskutil unmountDisk /dev/disk2` to unmount the drive
    - `# dd if=/path/to/arch-linux-image.iso of=/dev/rdisk2 bs=1m` (we replaced `disk` with `rdisk` which is the "raw" disk in OS X and a lot faster, it is not a typo)
    - `$ diskutil eject /dev/disk2`

    5. Boot loader
    - `# mkdir /boot/efi`
    - `# mount /dev/<EFI partition>`
    - `# pacman -S grub efibootmgr`
    - `# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch`
    - `# grub-mkconfig -o /boot/grub/grub.cfg`
    Boot from LiveUSB
    -----------------

    - Hold `Alt` while booting
    - Select the USB disk
    - Welcome to Arch Linux installer ;-)

    Installation
    ------------

    1. Connect to network
    - `$ wifi-menu` to setup wireless networking (assuming DHCP is available)
    2. Setup time
    - `$ timedatectl set-ntp true`
    - Check its status `$ timedatectl status`
    3. Partition the drive again ;-)
    - `# cgdisk`
    - Remove the `Arch tmp` partition we created earlier.
    - Remember to create 128 MB gap after OS X partitions, by typing `+128M` for the start of the partition.
    - Add new `Arch boot` partition (~ 100 MB)
    - Add new `Arch root` partition (fill the space)
    - Swap file can be created later if needed
    4. Create file systems
    - `# mkfs.ext2 /dev/<arch boot>`
    - `# mkfs.ext4 /dev/<arch root>`
    5. Mount the partitions
    - `# mount /dev/<arch root> /mnt`
    - `# mkdir /mnt/boot`
    - `# mount /dev/<arch boot> /mnt/boot`
    6. Edit mirror list
    - `# vim /etc/pacman.d/mirrorlist` it will be used pac the next step, so take good care of it here
    7. Install the base packages
    - `# pacstrap /mnt base`
    8. Configure the system
    - `# genfstab -U -p /mnt >> /mnt/etc/fstab`
    - `# arch-chroot /mnt /bin/bash`
    - `# echo <computer name> > /etc/hostname`
    - `# ln -s /usr/share/zoneinfo/<zone>/<subzone> /etc/localtime`
    - `# nano /etc/locale.gen` uncomment locales you want
    - `# locale-gen`
    - `# echo LANG=<your_locale> > /etc/locale.conf`
    - TODO: setup wireless networking
    - `# mkinitcpio -p linux`
    - `# passwd`
    - `# pacman -S gptfdisk`

    Boot loader
    -----------

    - `# mkdir /boot/efi`
    - `# mount /dev/<EFI partition>`
    - `# pacman -S grub efibootmgr`
    - `# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch`
    - `# grub-mkconfig -o /boot/grub/grub.cfg`

    6. Reboot
    - `# exit` or `Ctrl + D`
    - `# umount -R /mnt`
    - `# reboot`
    Reboot
    ------

    - `# exit` or `Ctrl + D`
    - `# umount -R /mnt`
    - `# reboot`

    References:
    References
    ----------

    * [1] https://wiki.archlinux.org/index.php/MacBook
    * [2] https://wiki.archlinux.org/index.php/USB_flash_installation_media
  7. @andrsd andrsd revised this gist Apr 8, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer
    - Open `Terminal`
    - `$ diskutil list` and find out its name (let's say it is `/dev/disk2`)
    - `$ diskutil unmountDisk /dev/disk2` to unmount the drive
    - `# dd if=/path/to/arch-linux-image.iso of=/dev/rdisk2 bs=1m` (we replaced `disk` with `rdisk` with os the "raw" disk in OS X and a lot faster, it is not a typo)
    - `# dd if=/path/to/arch-linux-image.iso of=/dev/rdisk2 bs=1m` (we replaced `disk` with `rdisk` which is the "raw" disk in OS X and a lot faster, it is not a typo)
    - `$ diskutil eject /dev/disk2`

    3. Boot from LiveUSB
  8. @andrsd andrsd revised this gist Apr 8, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer
    3. Partition the drive again ;-)
    - `# cgdisk`
    - Remove the `Arch tmp` partition we created in 1.
    - Remember to create 128Mb gap after OS X partitions, by typing `+128M` for the start of the partition.
    - Remember to create 128 MB gap after OS X partitions, by typing `+128M` for the start of the partition.
    - Add new `Arch boot` partition (~ 100 MB)
    - Add new `Arch root` partition (fill the space)
    - Swap file can be created later if needed
  9. @andrsd andrsd revised this gist Apr 8, 2016. 2 changed files with 2 additions and 13 deletions.
    11 changes: 0 additions & 11 deletions 00-intro.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +0,0 @@
    Building Home Media Server
    ==========================

    This describes a way how to build a simple media server at home.

    Hardware:
    - Mac mini (late 2012)

    Software:
    - Arch linux
    - Kodi
    4 changes: 2 additions & 2 deletions 01-install-arch-linux.md → arch-mac-mini.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Install Arch Linux
    ------------------
    ==================

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1].
    We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system.
    @@ -73,7 +73,7 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer
    - `# exit` or `Ctrl + D`
    - `# umount -R /mnt`
    - `# reboot`

    References:

    * [1] https://wiki.archlinux.org/index.php/MacBook
  10. @andrsd andrsd revised this gist Apr 8, 2016. 1 changed file with 9 additions and 5 deletions.
    14 changes: 9 additions & 5 deletions 01-install-arch-linux.md
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,7 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer
    - There are at least 3 partitions: __EFI__, __OS X__, __Recovery__. Only __OS X__ will be shown.
    - Repartition your disk as follows:
    1. OS X (size: ~ tens of GB, type HFS+, for OS X)
    2. Arch HFS boot (size: 100 MB, type HFS+, for booting using Apple boot loader)
    3. Arch tmp (size: ~ 10 GB, FAT, will be removed later)
    2. Arch tmp (size: ~ 10 GB, FAT, will be removed later)

    2. Create LiveUSB that we will boot from
    - Download the `.iso` from [download page](https://www.archlinux.org/download/)
    @@ -50,9 +49,9 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer
    - `# vim /etc/pacman.d/mirrorlist` it will be used pac the next step, so take good care of it here
    7. Install the base packages
    - `# pacstrap /mnt base`
    8 Configure the system
    8. Configure the system
    - `# genfstab -U -p /mnt >> /mnt/etc/fstab`
    - `# arch-chroot /mnt`
    - `# arch-chroot /mnt /bin/bash`
    - `# echo <computer name> > /etc/hostname`
    - `# ln -s /usr/share/zoneinfo/<zone>/<subzone> /etc/localtime`
    - `# nano /etc/locale.gen` uncomment locales you want
    @@ -61,9 +60,14 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer
    - TODO: setup wireless networking
    - `# mkinitcpio -p linux`
    - `# passwd`
    - `# pacman -S gptfdisk`

    5. Boot loader
    - TODO
    - `# mkdir /boot/efi`
    - `# mount /dev/<EFI partition>`
    - `# pacman -S grub efibootmgr`
    - `# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch`
    - `# grub-mkconfig -o /boot/grub/grub.cfg`

    6. Reboot
    - `# exit` or `Ctrl + D`
  11. @andrsd andrsd revised this gist Apr 7, 2016. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions 01-install-arch-linux.md
    Original file line number Diff line number Diff line change
    @@ -27,30 +27,30 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer
    - Welcome to Arch Linux installer ;-)

    4. Installation
    4.1. Connect to network
    1. Connect to network
    - `$ wifi-menu` to setup wireless networking (assuming DHCP is available)
    4.2. Setup time
    2. Setup time
    - `$ timedatectl set-ntp true`
    - Check its status `$ timedatectl status`
    4.3. Partition the drive again ;-)
    3. Partition the drive again ;-)
    - `# cgdisk`
    - Remove the `Arch tmp` partition we created in 1.
    - Remember to create 128Mb gap after OS X partitions, by typing `+128M` for the start of the partition.
    - Add new `Arch boot` partition (~ 100 MB)
    - Add new `Arch root` partition (fill the space)
    - Swap file can be created later if needed
    4.4. Create file systems
    4. Create file systems
    - `# mkfs.ext2 /dev/<arch boot>`
    - `# mkfs.ext4 /dev/<arch root>`
    4.5. Mount the partitions
    5. Mount the partitions
    - `# mount /dev/<arch root> /mnt`
    - `# mkdir /mnt/boot`
    - `# mount /dev/<arch boot> /mnt/boot`
    4.6. Edit mirror list
    6. Edit mirror list
    - `# vim /etc/pacman.d/mirrorlist` it will be used pac the next step, so take good care of it here
    4.7. Install the base packages
    7. Install the base packages
    - `# pacstrap /mnt base`
    4.8 Configure the system
    8 Configure the system
    - `# genfstab -U -p /mnt >> /mnt/etc/fstab`
    - `# arch-chroot /mnt`
    - `# echo <computer name> > /etc/hostname`
  12. @andrsd andrsd revised this gist Apr 7, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions 01-install-arch-linux.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Install Arch Linux
    ------------------

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [wiki][1].
    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1].
    We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system.
    We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

    @@ -72,7 +72,7 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer

    References:

    * [1]: https://wiki.archlinux.org/index.php/MacBook
    * [2]: https://wiki.archlinux.org/index.php/USB_flash_installation_media
    * [3]: https://wiki.archlinux.org/index.php/Installation_guide
    * [4]: http://mjg59.dreamwidth.org/7468.html
    * [1] https://wiki.archlinux.org/index.php/MacBook
    * [2] https://wiki.archlinux.org/index.php/USB_flash_installation_media
    * [3] https://wiki.archlinux.org/index.php/Installation_guide
    * [4] http://mjg59.dreamwidth.org/7468.html
  13. @andrsd andrsd revised this gist Apr 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 01-install-arch-linux.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Install Arch Linux
    ------------------

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [][1].
    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [wiki][1].
    We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system.
    We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

  14. @andrsd andrsd revised this gist Apr 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 01-install-arch-linux.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Install Arch Linux
    ------------------

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1].
    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [][1].
    We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system.
    We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

  15. @andrsd andrsd revised this gist Apr 7, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions 01-install-arch-linux.md
    Original file line number Diff line number Diff line change
    @@ -72,7 +72,7 @@ We will install from an USB thumb drive (will need at least 1GB in size), newer

    References:

    * [1] https://wiki.archlinux.org/index.php/MacBook
    * [2] https://wiki.archlinux.org/index.php/USB_flash_installation_media
    * [3] https://wiki.archlinux.org/index.php/Installation_guide
    * [4] http://mjg59.dreamwidth.org/7468.html
    * [1]: https://wiki.archlinux.org/index.php/MacBook
    * [2]: https://wiki.archlinux.org/index.php/USB_flash_installation_media
    * [3]: https://wiki.archlinux.org/index.php/Installation_guide
    * [4]: http://mjg59.dreamwidth.org/7468.html
  16. @andrsd andrsd revised this gist Apr 7, 2016. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  17. @andrsd andrsd revised this gist Apr 7, 2016. 2 changed files with 13 additions and 8 deletions.
    10 changes: 2 additions & 8 deletions home-media-server.md → install-arch-linux.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,8 @@
    Building Home Media Server
    ==========================

    Hardware: Mac mini (late 2012)

    Install Arch Linux
    ------------------

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1].
    We will keep all data on an external hadr drive, so we do not need huge amount of space for the linux system.
    We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system.
    We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

    1. Prepare the disk in Mac OS X (El Capitan)
    @@ -80,5 +75,4 @@ References:
    * [1] https://wiki.archlinux.org/index.php/MacBook
    * [2] https://wiki.archlinux.org/index.php/USB_flash_installation_media
    * [3] https://wiki.archlinux.org/index.php/Installation_guide
    * [4] http://mjg59.dreamwidth.org/7468.html
    *
    * [4] http://mjg59.dreamwidth.org/7468.html
    11 changes: 11 additions & 0 deletions intro.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    Building Home Media Server
    ==========================

    This describes a way how to build a simple media server at home.

    Hardware:
    - Mac mini (late 2012)

    Software:
    - Arch linux
    - Kodi
  18. @andrsd andrsd created this gist Apr 7, 2016.
    84 changes: 84 additions & 0 deletions home-media-server.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,84 @@
    Building Home Media Server
    ==========================

    Hardware: Mac mini (late 2012)

    Install Arch Linux
    ------------------

    We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1].
    We will keep all data on an external hadr drive, so we do not need huge amount of space for the linux system.
    We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

    1. Prepare the disk in Mac OS X (El Capitan)
    - Open `Disk Utility` and select the disk (not partition), click `Partition` (top tool bar)
    - There are at least 3 partitions: __EFI__, __OS X__, __Recovery__. Only __OS X__ will be shown.
    - Repartition your disk as follows:
    1. OS X (size: ~ tens of GB, type HFS+, for OS X)
    2. Arch HFS boot (size: 100 MB, type HFS+, for booting using Apple boot loader)
    3. Arch tmp (size: ~ 10 GB, FAT, will be removed later)

    2. Create LiveUSB that we will boot from
    - Download the `.iso` from [download page](https://www.archlinux.org/download/)
    - Open `Terminal`
    - `$ diskutil list` and find out its name (let's say it is `/dev/disk2`)
    - `$ diskutil unmountDisk /dev/disk2` to unmount the drive
    - `# dd if=/path/to/arch-linux-image.iso of=/dev/rdisk2 bs=1m` (we replaced `disk` with `rdisk` with os the "raw" disk in OS X and a lot faster, it is not a typo)
    - `$ diskutil eject /dev/disk2`

    3. Boot from LiveUSB
    - Hold `Alt` while booting
    - Select the USB disk
    - Welcome to Arch Linux installer ;-)

    4. Installation
    4.1. Connect to network
    - `$ wifi-menu` to setup wireless networking (assuming DHCP is available)
    4.2. Setup time
    - `$ timedatectl set-ntp true`
    - Check its status `$ timedatectl status`
    4.3. Partition the drive again ;-)
    - `# cgdisk`
    - Remove the `Arch tmp` partition we created in 1.
    - Remember to create 128Mb gap after OS X partitions, by typing `+128M` for the start of the partition.
    - Add new `Arch boot` partition (~ 100 MB)
    - Add new `Arch root` partition (fill the space)
    - Swap file can be created later if needed
    4.4. Create file systems
    - `# mkfs.ext2 /dev/<arch boot>`
    - `# mkfs.ext4 /dev/<arch root>`
    4.5. Mount the partitions
    - `# mount /dev/<arch root> /mnt`
    - `# mkdir /mnt/boot`
    - `# mount /dev/<arch boot> /mnt/boot`
    4.6. Edit mirror list
    - `# vim /etc/pacman.d/mirrorlist` it will be used pac the next step, so take good care of it here
    4.7. Install the base packages
    - `# pacstrap /mnt base`
    4.8 Configure the system
    - `# genfstab -U -p /mnt >> /mnt/etc/fstab`
    - `# arch-chroot /mnt`
    - `# echo <computer name> > /etc/hostname`
    - `# ln -s /usr/share/zoneinfo/<zone>/<subzone> /etc/localtime`
    - `# nano /etc/locale.gen` uncomment locales you want
    - `# locale-gen`
    - `# echo LANG=<your_locale> > /etc/locale.conf`
    - TODO: setup wireless networking
    - `# mkinitcpio -p linux`
    - `# passwd`

    5. Boot loader
    - TODO

    6. Reboot
    - `# exit` or `Ctrl + D`
    - `# umount -R /mnt`
    - `# reboot`

    References:

    * [1] https://wiki.archlinux.org/index.php/MacBook
    * [2] https://wiki.archlinux.org/index.php/USB_flash_installation_media
    * [3] https://wiki.archlinux.org/index.php/Installation_guide
    * [4] http://mjg59.dreamwidth.org/7468.html
    *