Install Arch Linux natively on DigitalOcean VPS

I’ve been one to complain that DO dropped support for Arch Linux, others have done hacky workarounds that wind up still using the locked down kernels that DO provides. Recently they added FreeBSD to their list of supported Operating Systems with a mention that they would allow fully custom kernels to be used. In this I saw a door to freedom of choice again.

If you want to give it a go here’s what I did.

Create a FreeBSD Droplet.

Connect via the Console Access in DigtalOcean admin and elevate yourself to root.

Add some tools we’re going to need:
replace $editor with your favorite editor assuming it doesn’t come prepackaged on FreeBSD 10.1

# pkg install grub2 wget e2fsprogs $editor

1422310835N2ZiM

Partition adding a bios-boot partition, replace swap for /boot and install grub2

# swapoff -a
# gpart delete -i 1 /dev/vtbd0
# gpart delete -i 2 /dev/vtbd0
# gpart add -t \!21686148-6449-6E6F-744E-656564454649 -i 1 -s 2M /dev/vtbd0
# gpart add -t linux-data -i 2 /dev/vtbd0
# gpart show /dev/vtbd0

You should now have a layout that looks like this:
1422311676MzY2Y

# mkfs.ext3 /dev/vtbd0p2
# mount -t ext2fs /dev/vtbd0p2 /boot
# grub-install /dev/vtbd0

Grub should return a polite completed message:
1422312090MDdhN

Download the arch install media from your favorite mirror with wget and place it in /boot
Note: Since you’ve passed the point of no return it is imperative to verify the md5sum or sha1sum as you won’t be able to download another copy once you’ve committed to a reboot.

Configure grub to boot the Arch Linux install media:
my /boot/grub/grub.cfg looks like this:

Reboot and you should be greeted with grubs boot menu:
1422313453YzBkO

From here you can install Arch Linux and live happily ever after.

Note: To install you’ll need to configure your networking statically, the pertinent information for your network can be found at the bottom of the Console Access page in the Digital Ocean Admin.
1422313762ZTg1M
1422313767NGI4O

Some Notes on installation:

If you wish to continue to use the second partition as /boot in your installation as I did you’ll need to remount /run/archiso/img_dev RW and bindmount it to your /boot inside /mnt before you chroot.

# mount /dev/vda3 /mnt/
# mkdir /mnt/boot
# mount -o remount,rw /run/archiso/img_dev
# mount -o bind /run/archiso/img_dev /mnt/boot

Continue your install as normal.

A special thanks WonderWoofy for all the support and ideas that got this going.

Thanks to kaictl for proofreading this.

Thanks to Rick for his article that covered how to set the bios-boot flag with gpart under FreeBSD.

systemd-networkd with wpa_supplicant to manage wireless with roaming support

Finally fed up with the many tools for managing wireless and even wired connections that just seem to cause more problems than the underlying tools I discussed with a friend the idea of networkd supporting roaming profiles for wireless. Searching around he found some super good information and this is what I ended up doing. I created these files:

The following finished off the setup:

# rm /etc/resolv.conf
# systemctl enable systemd-networkd
# systemctl enable wpa_supplicant@wlp3s0
# systemctl enable systemd-resolved
# systemctl start systemd-networkd
# systemctl start wpa_supplicant@wlp3s0
# systemctl start systemd-resolved
# ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

I also elected to start using systemd-timesyncd.

# systemctl enable systemd-timesyncd
# systemctl start systemd-timesyncd

For a static ip replace DHCP=yes with the following:

Address=192.168.0.42/24
Gateway=192.168.0.1

The guide which this was pilfered from suggests using:
wpa_passphrase <ESSID> <passphrase> >> wpa_supplicant-wlp3s0.conf
to add new networks to the network pool. Happily borrowed from here

CoreDuo Mac Mini archlinux headless boot

It’s been said many a time across the interweb that the early Intel, and perhaps current Intel Mac Mini’s often refuse to boot to Linux in CSM ( Legacy ) mode without a monitor plugged in. Today I decided to do some research and found that the GPU doesn’t get powered unless it detects a monitor and the firmware of the mini wont pass off control until the GPU is powered. To bypass this I found a few howto’s and the one that really worked involved 3 68Ohm resistors placed into a DVI to VGA adapter to trick the GPU into thinking it had a display attached. Here’s what it looks like:

12310565334_90a6b5d02a_c

Thanks to Nick Oneill and his post about the exact fix I used, now I can perform updates on my headless mac mini and reboot via remote knowing fully well it will be able to boot on it’s own.