Setting Up a Development Machine

Just a few days ago, I completed a home server build. Today I decided to have a clean OS reinstallation on my development machine due to several reasons:

  • Firstly, the root partition on this machine is nearing full capacity (thank you, my past self).
  • Secondly, I’m consistently encountering __common_interrupt: 1.55 No irq handler for vector errors during system bootup. There’s a thread in the Arch Forum discussing this issue. Despite my efforts to resolve it through various ombinations of kernel parameters as suggested in the thread, I have not succeeded. It appears that the only viable solution is a BIOS firmware upgrade.
  • Finally, there exists a paradoxical issue: I cannot decrypt the root partition without using my bluetooth keyboard, yet I cannot use my bluetooth keyboard until the root partition is decrypted and mounted (because the bluetooth driver sits in the root partition). This presents a typical chicken and egg problem. My current hack around is to use a wired USB keyboard to decrypt the root parition. However, I desperately want to abandon this workaround.

/img/keyboard-not-found-press-any-key.png

Caution: flashing the motherboard BIOS is a high risk operation. Please ensure you have thoroughly read and understand the motherboard upgrade instructions before proceeding.

The Gigabyte X570 Aorus Master motherboard that I’m using offers a convenient Q-Flash utility embedded in the ROM, which greatly simplifies the BIOS upgrading process. All I have to do is to download the latest firmware onto a USB drive and follow the instructions in the Q-Flash manual.

/img/x570-aorus-master.png

The installation process is not much different from the OS installation on my home server, except that there is no need for a RAID configuration or remote disk unlocking.

However, I do want to have my bluetooth keyboard operational before the root partition is decrypted and mounted, thereby eliminating the need for a separate wired keyboard solely for the purpose of root partition decryption.

To use bluetooth devices at this early stage, We need to bring the bluetooth service into the initramfs. Luckily, a mkinitcpio hook designed for this specific purpose exists, thanks to the resourceful Arch Linux Community.

A few things to note about this hook:

  • It does not work in conjunction with the systemd hook in /etc/mkinitcpio.conf.
  • The project README says that it has only been tested on installations that use rEFInd as the boot loader. I’m using systemd-boot, formerly known as gummiboot, and this hook functions perfectly fine in this environment.

We want the bluetooth adapter to power up automatically post-boot. Therefore, I need to add the line AutoEnable=true to the Policy section in the bluetooth adapter configuration file /etc/bluetooth/main.conf:

# In /etc/bluetooth/main.conf
[Policy]
AutoEnable=true

Of course, the initial pairing of the bluetooth keyboard with the system needs to be performed manually. This is a one-time requirement. From the subsequent reboot onward, my keyboard will be fully functional just before I’m prompted to enter the disk decryption key.