OpenWRT Firebox Part 2

I’ve started using the Firebox mentioned previously as my main device. I upgraded it to 14.07 and had to go through the installation process again, so I’ll document some of the quirks involved in getting it to work.

Front LCD

Easy Way

Download the precompiled sdeclcd.so here and put it in /usr/lib/lcdproc. Change LCDd.conf to use the ‘sdeclcd’ driver, and make sure the driver folder is set to /usr/lib/lcdproc/.

Hard Way

First, you need to get the install the OpenWRT buildroot. It doesn’t matter that much what you do in the configuration process, as long as you select x86 as your architecture, and you elect to build the toolchain. Then, download lcdproc with sdeclcd from here. First, follow the instructions here to set up your environment vars. Make sure you have the prerequisites installed, and follow the build instructions normally (run ./autogen.sh), except the configure command should be ‘./configure –build=your-arch-here –host=i486-openwrt-linux-uclibc’. You can get your own architecture from ./config.guess. Then, use ‘make CC=i486-openwrt-linux-uclibc-gcc LD=i386-openwrt-linux-uclibc-ld’ (this is the big quirk here, it needs to be i386 rather than the i486 which you use everywhere else). Then, wait for it to finish compiling, and copy server/drivers/sdeclcd.so into /usr/lib/lcdproc on the device, and change LCDd.conf to use the ‘sdeclcd’ driver. In the same file, ensure that the driver folder is set to /usr/lib/lcdproc/ rather than the default server/drivers/ (remember the trailing slash). After that, the LCD should work, and you can customize it further in the lcdproc configuration files. Make sure you have both the lcdproc and LCDd services enabled so that they will autostart with the machine.

Fan Control, Temp Monitoring

The ‘kmod-hwmon-w83627hf’ package will get hardware monitoring up and running. The /sys/devices/platform/w83627hf.656/pwm1 file controls fan speed. Simply send any value from 0 to 255 to it. I have found that with good thermal paste, the device can run fine (reasonable temperatures + 100% stable) with the fans completely off. The ‘sensors’ package will be able to read the temperatures out of the box.

Note that if you make use of the pwm control to lower the fan speeds past a certain point, you won’t get meaningful fan speed readings. This is because the PWM is applied directly to the fan’s input voltage, so the tach output ends up getting modulated both by the fan’s tachometer and by the input. You can partially mitigate this by increasing the frequency in pwm1_freq, but it will almost always give garbage values for low RPM.

Mounting

The ‘mountd’ package can handle mounting, such as mounting your boot partition.

Expansion

Obviously, you’ll need to install kernel modules for things that you connect to the USB port or the PCIe slots. I haven’t tested booting off of a USB drive or an expansion card, but USB booting has been reported to work and I don’t see why addon boots wouldn’t work either.

Some people report being able to solder a miniPCI slot onto the unpopulated connector. You’ll need a taller connector since it will have to clear a few other components.

If you’re going to solder wires to the USB connector, it can help to simply solder the ground connector somewhere else so that the work area doesn’t get too cluttered. The connector to the right (looking from the front of the box) is the functional one, while the other one seems to be missing some supporting components that would be required in order for it to work.

BIOS Flashing

Follow the instructions here to flash the BIOS. The flashed version will allow you to access the BIOS from an 115200 baud serial connection.

Note that you can still use a USB keyboard with the BIOS, which is a bit more responsive than sending keystrokes over the serial port. It works even when USB keyboard support is switched off in the BIOS. I wasn’t able to get the VGA port to work (always got signal out of range errors on both a monitor and a TV). If you want to try to do anything with it, keep in mind that it uses 2mm pitch rather than the more common .1″ (.254mm) pitch, so normal connectors won’t work on it.

Common Issues

Problem 1: BIOS seems to spew garbage data over the serial port.

Sometimes, the modified BIOS won’t output at the correct baud rate. Try 9600 or 19200. Once you enter the setup, save and quit, and it should be back to the normal 115200. Sometimes just POSTing will fix the problem upon next boot.

Problem 2: lcdproc claims the driver sdeclcd.so cannot be found, even though the file exists and I told it to look in the right folder.

The error handling doesn’t differentiate between a nonexistent file and a file that it had trouble loading. It usually means the file wasn’t cross-compiled correctly. Either check your cross-compilation, or download my precompiled version above. If something went terribly wrong with the compilation (e.g. it compiled for the wrong architecture), then it will usually give a more descriptive error. However, if it’s not blatantly wrong, then LCDd will claim the file does not exist.

Problem 3: USB devices don’t work, and I see errors when I plug them in.

This can happen if you switched the two data lines around when you soldered it, or are trying to use the nonfunctional port.

Problem 4: My CF card (>2GB) won’t work.

Go into the BIOS setup, and manually set the number of heads to 2. The BIOS will see the capacity wrong, but this shouldn’t cause problems once the OS is up and running. However, it’s likely that the BIOS won’t be able to see anything past the incorrect capacity, so make sure you have a boot partition at the beginning of the drive.

Instead of pressing Del to enter setup, use Tab. Instead of Esc to skip memory test or go up one level in the BIOS setup, press Esc twice.

Problem 6: Linux only sees about 900MB of RAM.

Compile the kernel with 4GB HIGHMEM support.

I Need a Short Version

Here’s basically everything you need to know from this post and the last all in one regarding basic installation, from start to finish:

0. Optionally, follow the instructions to mod the BIOS here.
1a. If you still have the original firmware on the CF card, just delete everything except the boot partition and replace it with one big partition.
1b. If you have a blank card, clear it off in fdisk and create a small boot partition (6mb should be fine) and a root partition, and install GRUB to the boot partition (these instructions are for legacy grub, not grub2, so install grub2 at your own peril).
2. Download the kernel (openwrt-x86-generic-vmlinuz in the OpenWRT downloads folder). Put it in the boot partition.
3. Edit grub’s menu.lst to point to look like this, replacing sda5 with whatever your root partition is:

This entry was posted
on Friday, October 31st, 2014 at 21:31 and is filed under linux.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

There’s mention of a pre-compiled ‘sdeclcd.so’ driver but there is no link on the page? What version of lcdproc is it compiled for? I’m running 5.4 and before I start stuffing around with cross-compiling I was hoping there was a pre-compiled driver somewhere.