What is it?

The Linksys Gigadrive is a low-end network-attached-storage (NAS) device based on a Cyrix MediaGX single-board computer (possibly derived from the Cyrix Marmot design, if the SMI data can be believed). It features a 20GB ATA drive (IBM or Seagate) and a single 100Mbps ethernet interface (Davicom DM9102).

There are headers on the board for keyboard and video interfaces, and it's possible to pick up the TxD and RxD lines for the first serial port to add a console (you will need external line drivers for this). Memory is a standard 16MB SO-DIMM, and easily upgraded. There's an external parallel port, for the advertised print server feature, and a second IDE header on the board.

       Installing FreeBSD

Comments relating to this unit refer to an early retail model; modifications may have been made in later production systems or subsequent "firmware" upgrades.

Linksys' own software is a lightly-warmed-over RedHat 5.2 install, locked down for a single purpose, but basically stock. Removing the drive and mounting it in another system makes examining their CGI setup quite easy, and reveals that their "upgrade" interface offers the perfect security hole for subverting the system.

The "upgrade" interface has the following expectations:

  • The uploaded file must be a gzipped tarball.
  • The tarball must contain a directory "rpm", in turn containing an executable shellscript named "install.sh". This script is run as root.
  • The tarball must, when extracted in verbose mode, emit at least one '0' character. (This actually looks like a bug.)

The quickest way to get FreeBSD up and running on this unit is to take the drive out and install it in another system. The Davicom ethernet device is not the most wonderful, but it's a good fit for this system and well supported by the 'dc' driver. You should be OK with the GENERIC kernel, but it can be trimmed down if space is an issue.

A more elaborate approach would be to build a toolkit which could be dowloaded via the "update" interface, and which would subsequently provide a mechanism for installing FreeBSD from a remote source. Some work has progressed on this, but nothing is yet ready for general consumption. If you're interested in participating, send me some mail.

By building and loading the gigadrive KLD you can add support for the unit's front-panel LEDs and soft power-off capability. The gigadrivecontrol program lets you tune the LEDs and monitor the back-panel 'reset' switch, and the driver is compatible with the '-p' flags to shutdown(8) and halt(8).