FreeBSD 10 installed with tftp on a Amilo L7320

The Background Story: TL;DR

I had a little spare time this weekend, and wanted to put a new OS on my Fujitsu Siemens Amilo L7320. The laptop is now ~8 years old, and my opensource deep-dive started with it. I installed my first Ubuntu 7.10 on this machine to replace the preinstalled Windows XP. And no dual booting, no turning back! (sadly this changed…)*

It was a deep dive, because X11 was not working and I had to hack my own xorg.conf. I hate the Via Unichrome GPU, but around Ubuntu 10.04 the openchrome driver was doing it’s job out of the box. The CD/DVD drive died after 1,5 years (before 9.10, so I had to make my on TFTP/PXE install server. You might ask why didn’t I use a USB Stick, and boot from a “USB Storage Disk” as the bios suggests. Well, the machine won’t boot from any USB Installer, because “Invalid partition table”. So no iso dd/imgwriter. It can boot from grub2 or lilo, so it needs a mbr? I don’t care. TFTP/PXE is good for me. And there were other problems, like the clock and the whole system hanged if there was no user input or cpu load (this was on kernel 2.6.35 and some more kernels above). But with Xubuntu 12.04.5 the machine was working OK. But it was time to make the change and try a new OS…. FreeBSD. Thanks to Allan & Kris.

The environment:

  1. OpenWRT 15.05 (on TL-WR740N with wifi WAN) as dhcp and gateway
  2. Ubuntu Trusty 14.04.3 (with ZFS) as tftp-boot server.
  3. Laptop (with WindowsXP*+wubi Xubuntu 12.04.5)

The idea:

  • no NFS just TFTP/PXE and USB
  • no changes in the install media (not this)

Step #1: OpenWRT

On LuCI: Netwok-> DHCP and DNS -> TFTP Settings.

Enable TFTP Server
Network boot image

This will advertise a different source for the boot image file to the clients. This way they will tftp to the Trusty Server, and not to the router.

Save & Apply

Step #2: Trusty

sudo apt-get install dnsmasq
sudo nano /etc/dnsmasq.d/tftp


Save the file with Crtl+O, exit nano with Ctrl+X. restart dnsmasq with
sudo service dnsmasq restart

Get FreeBSD 10.2 i386 mini-memstick.img and copy it to the /srv/tftp folder (don’t forget to create the folders).

Install syslinux, and copy memdisk, pxelinux.0 to the tftp folder:
sudo apt-get install syslinux
sudo cp /usr/lib/syslinux/memdisk /srv/tftp/
sudo cp /usr/lib/syslinux/pxelinux.0 /srv/tftp/

Create and edit the pxelinux.cfg folder end edit the default config file:
sudo mkdir /srv/tftp/pxelinux.cfg
sudo nano /srv/tftp/pxelinux.cfg/default

kernel memdisk
append initrd=FreeBSD-10.2-RELEASE-i386-mini-memstick raw

prompt 0
timeout 0

Save and exit. Btw this is a super page for memdisk.

Now is the time to test it. I choose a VirtualBox vm bridged to my wired connection, and selected Network boot.

You can get to the freebsd boot menu, even start the boot process, but it will eventually fail because it won’t find the rootfs. The kernel won’t see the memdisk. There are two solution for this:

  1. Mess with the boot media and use mfsbsd
  2. Create a usb stick from the same image, and use that for root fs.

Because I only have a problem with usb booting, and I don’t want to change the boot media, I choose option two.

Create the usb drive as you would normally, and after restarting, just plug it in. The freebsd kernel will find that, and do its job.

Step #3: The Install

The handbook will guide you on this. And don’t forget to add yourself to the wheel group, or you cannot su from your account. (If you forgot, you can modify this later: pw user mod username -G wheel )

Step #4: Get X11, Slim and Mate

In this part, we will install the required packages, configure the processes to start, and configure the system to use slim with any installed desktop.

pkg install xorg mate slim nano

nano /etc/rc.conf



 # Use new graphical console driver
# Asynchronous I/O

nano /home/username/.xinitrc

exec $1

chmod +x /home/username/.xinitrc
username /home/username/.xinitrc

To change between Desktop environments, press F1.

XP, even from the dead.
XP, even from the dead.
To much typing
To much typing

And the story stops here, for me at least… because the openchrome driver won’t work without strange colors and artifacts. So I am back to square 1, as with Ubuntu 7.10, hacking xorg.conf. No X11 for me.

Update: As it turns out a bug was introduced into the x11 openchrome driver. I could reproduce the same issue with Ubuntu 14.04. To solve the problem, I contacted the new maintainer, and with his help I compiled the 0.5.181 from the source. The problem disappeared…

Step #5: Get FreeBSD to dualboot.

boot0cfg -B /dev/ada0

This will write boot0 to MBR and enable dual booting to other installed OS, like Windows XP*.

*I am using Windows XP because it is the only fully functioning OS on this machine. I know it is EOL, but I enabled the POSReady registry hack. Not an insurance, I know, but I use it mostly for offline work.


Author: Gajdos Tamás

A "barefoot physicist" with some IT skills in system administration.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s