Installing FreeBSD 10 on an alix apu.1c4

Wed 09 April 2014
By momo

I just got an alix apu.1c4 in the mail. It is a great board for ~200Euro with a great set of features, you can find more on it here.

First step is to pick up the BIOS-Update here.
Then unpack the file:

tar xjvf apu_tinycore.tar.bz2

Now we have to create a FAT filesystems on our flashdrive, in my case: /dev/sdc.

mkfs.fat -I /dev/sdc

Then mount the filesystem and copy the files to the flashdrive:

mount /dev/sdc /mnt
cp -rv alix/* /mnt

And then make it bootable using syslinux:

syslinux /dev/sdc
umount /dev/sdc

Then connect a serial console to the alix and boot from the stick.
If the OS starts up complaining about not finding its home you'll have to mount it yourself:

mount /dev/sda /mnt
cd /mnt
./autostart.sh

Once this is done you'll be greeted with this prompt:

[+48.5 C][root@box:/mnt]$

Now tell it to update the BIOS:

flashrom -w apu140405.rom

Please not that 140405 was the newest BIOS by the time of writing this post, you'll find your respective file using ls. Once the Process is finished type reboot and you'll be greeted with the new BIOS revision.

Now that we're done with the BIOS upgrade we'll install FreeBSD.

Therefore download the current 64bit freebsd-memstick img from freebsd.org and copy it on your flashdrive by using

dd if=FreeBSD-10.0-RELEASE-amd64-memstick.img of=/dev/sdc

Now we have to change some stuff on the memstick image to boot via serial console. Therefore mount the flashdrives first partition to /mnt (If you're running linux you might encounter some difficulties mounting ufs2 in rw mode, boot a FreeBSD liveimage or a virtual machine if you don't figure out how to mount it).

mount /dev/da0s1a /mnt

Now we'll create a new file located at /mnt/boot/loader.conf do so using your favorite text editor:

console="comconsole"

Now all we need is a working tty, therefore edit the /etc/ttys so the lines starting with ttyu0-3 look like this:

ttyu0   "/usr/libexec/getty std.9600"   vt100   on  secure
ttyu1   "/usr/libexec/getty std.9600"   vt100   on  secure
ttyu2   "/usr/libexec/getty std.9600"   vt100   on  secure
ttyu3   "/usr/libexec/getty std.9600"   vt100   on  secure

That's it. Now unmount the flashdrive:

umount /mnt

Insert the stick into your alix and connect your serial console.
The BIOS is running at 115200 Baud per default, the FreeBSD installer at 9600 Baud so you'll have to switch during setup.

Once your memstick is booted install FreeBSD as you like.

Once the installation is complete the installer will put you into a chrooted environment of your installed FreeBSD.
IMPORTANT If you forget this step your FreeBSD will fail to start a shell on the serial console:

We will perform the step from the memstick on the installed FreeBSD again. As you are already in the chrooted FreeBSD we will now edit the /etc/ttys as we did before. Change all lines with ttyu1-3 to the following:

ttyu0   "/usr/libexec/getty std.9600"   vt100   on  secure
ttyu1   "/usr/libexec/getty std.9600"   vt100   on  secure
ttyu2   "/usr/libexec/getty std.9600"   vt100   on  secure
ttyu3   "/usr/libexec/getty std.9600"   vt100   on  secure

And again edit the /boot/loader.conf and insert the following:

console="comconsole"

or you wont be able to boot into single user mode.

Once you're done type exit to leave the chroot environment, shutdown, remove the flashdrive, and finally boot your new FreeBSD.

TRIM Support

Once you've booted and verified that everything is working reboot into single user mode.

For every partition(except boot and swap) we will activate TRIM Support:

tunefs -t enable /dev/ada0p2

and disable journaling:

tunefs -j disable /dev/ada0p2

Repeat this step for every partition!

That's it, we're done. Enjoy your FreeBSD!

Pages

Categories

Tags