I’ve had to do this a few times on different machines and on each occasion I’ve had to rely on my google skills to identify and refer to a number of resources that helped me on the way. This is written to help myself and others get it right first time and save what could otherwise be hours of frustration. This guide assumes a basic level of Linux know-how and covers installing Arch Linux onto a target USB flash drive (/dev/sdX for the purposes of this guide) using a source USB flash drive (/dev/sdY). Furthermore, it details how to go about installing Arch on a EUFI machine without having to install a bootloader should you wish to go that route.
Prepare source flash drive
Firstly, download the Arch Linux ISO file and write it to a flash drive as follows (where sdY represents the flash drive):
wipefs --all /dev/sdY
dd bs=4M if=/path/to/archlinux.iso of=/dev/sdY && sync
Configure BIOS and boot from source flash drive
Turn off compatibility mode and secure boot in the UEFI BIOS, connect network cable, and reboot target machine from flash drive you’ve just prepared.
Partition target flash drive
After the boot sequence is completed insert the target flash drive on which you wish to install Arch Linux and determine its device name:
lsblk
Partition the target flash drive with 512MB partition of type ef00 and the remainder as a regular Linux partition using gdisk:
gdisk /dev/sdX
If you need to wipe out existing partitions etc. on the target flash drive use expert mode (press x) and zap the gpt tables, mbr etc. (press z). Then relaunch gdisk as above.
Once in gdisk press n and follow the prompts to size the partition table and set its type: +512MB and ef00 respectively. When done with the first partition press n again and create a second (Linux) partition utilising the remaining space on the flash drive. When done press w and confirm writing of the partition tables.
Format partitions on target flash drive
Format the partitions FAT32 and EXT4 respectively:
sync
mkfs.fat -F32 /dev/sdX1
mkfs.ext4 /dev/sdX2
Now mount the Linux partition to /mnt and EFI System Partition to /mnt/boot
mount /dev/sdX2 /mnt
mkdir /mnt/boot
mount /dev/sdX1 /mnt/boot
Install the base system, generate an fstab (note the use of -U to utilise UUIDs for device identification) and load temp files to ram:
pacstrap /mnt base
genfstab -U -p /mnt >> /mnt/etc/fstab
nano /mnt/etc/fstab
Add the following to fstab to minimise unnecessary writes to the flash drive:
tmpfs /var/log tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
Chroot into and configure the base system
Change myhostname below to whatever you’d like your RoonBridge to be identified as on your network e.g. roonbridgenuc
arch-chroot /mnt /bin/bash
hwclock --systohc --utc
echo myhostname > /etc/hostname
Add the same hostname to /etc/hosts and edit the file to place it in the correct location so the line looks as follows:
127.0.0.1 localhost.localdomain localhost myhostname
::1 localhost.localdomain localhost myhostname
echo myhostname >> /etc/hosts
nano /etc/hosts
Set locale by uncommenting the locale you wish to use, save the file and activate the locale
nano /etc/locale.gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
locale-gen
Create a symbolic link /etc/localtime to your subzone file /usr/share/zoneinfo/Zone/SubZone using this command:
ln -s /usr/share/zoneinfo/Africa/Johannesburg /etc/localtime
Setup Dynamic IP, firstly by ascertaining ethernet device name, then by copying a sample profile from /etc/netctl/examples to /etc/netctl and modifying it by changing eth0 to the Ethernet port shown by ip l. It is typically going to be something along the lines of eno1:
ip l
cd /etc/netctl
cp examples/ethernet-dhcp my_network
nano /etc/netctl/my_network
netctl enable my_network[/code]
Set the root password:
[code]passwd[/code]
Install some essentials (only install intel-ucode [basically intel microcode updates] if you're running Intel hardware):
[code]pacman -S intel-ucode openssh mc ffmpeg samba[/code]
Enable root login via ssh:
[code]cd /etc/ssh/
cp sshd_config sshd_config.org
nano sshd_config[/code]
Find the following line in /etc/ssh/sshd_config
[code]#PermitRootLogin prohibit-password[/code]
Remove the # and change prohibit-password to yes
[code]PermitRootLogin yes[/code]
Enable sshd
[code]systemctl enable sshd.service[/code]
**Configure the boot sequence**
Now you have a decision to make...use a bootloader or bypass it. Bypassing makes for a faster boot and is great if your EUFI BIOS can boot an OS directly.
_**If you want to use a bootloader**_
Install a UEFI bootloader.
[code]pacman -S dosfstools
pacman -S gummiboot
gummiboot install
Determine device UUIDs and create a configuration file to add an entry for Arch Linux to the gummiboot manager:
blkid >> /boot/loader/entries/arch.conf
nano /boot/loader/entries/arch.conf
Remove UUID entries other than that pertaining to the flash drive and add the following (using your device UUID):
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=Insert_Linux_Partition_UUID_Here rw
Flush cache and exit chroot session
sync && exit
If you don’t want to use a bootloader:
Flush cache and exit chroot session
sync && exit
List EFI boot entries in BIOS and flush cache
efibootmgr -v
sync
Use efibootmgr to delete all firmware boot entries efibootmgr -b # -B
where # is the entry number you want to delete
When you’ve deleted all entries efibootmgr should return a message along the lines of “BIOS will attempt recovery/ detection on reboot.”
Now what is needed is the ability to have the EFISTUB point to the UUID of the Linux partition on the flash drive you’ve just installed to in order to ensure that the correct device is referenced for booting regardless of what other drives are present on the machine. In my case it was /dev/sdb2. Typing in a UUID from a terminal window seems like a stupid idea unless you’re really accurate with your typing. I got around that by capturing the UUIDs in a file, editing it to remove the crud, and turning it into a bash script by adding the efibootmgr line I needed and then running the resulting script.
Once the file was loaded in nano I added the efibootmgr line referencing the partition UUID for /dev/sdb2 (i.e. the root partition of my Arch install). It reads as follows:
Capture UUIDs in a file for editing and later execution
blkid > blkids.sh
nano blkids.sh
Now delete the crud…all you want to retain is the UUID of /dev/sdb2 (i.e. the root partition of the Arch install) and use that string in a call to efibootmgr to point it to your Arch install. This is what a completed line should look like:
efibootmgr -d /dev/sdb -p 1 -c -L "Arch" -l /vmlinuz-linux -u "root=UUID=Insert_Linux_Partition_UUID_Here rw initrd=/intel-ucode.img initrd=/initramfs-linux.img"
Save the changes, make the file executable and execute it
chmod +x blkids.sh
./blkids.sh
Flush cache and reboot from the target flash drive (remember to remove the source USB flash drive during reboot sequence):
sync && exit
umount -R /mnt
sync
reboot
This should leave you at the Linux CLI faced with a login prompt.
Install Roon Bridge or RoonServer
All that remains now is to login as root, download and run the Roon Bridge or Roon Server installation script.
If you’re wanting to use the device only as a Roon endpoint, install Roon Bridge:
curl -O http://download.roonlabs.com/builds/roonbridge-installer-linuxx64.sh
chmod +x roonbridge-installer-linuxx64.sh
./roonbridge-installer-linuxx64.sh
If you’re wanting to use the device as a Roon Server and endpoint, install Roon Server:
curl -O http://download.roonlabs.com/builds/roonserver-installer-linuxx64.sh
chmod +x roonserver-installer-linuxx64.sh
./roonserver-installer-linuxx64.sh