Sunday, January 15, 2012

Minimal Debian install on a Vortex86

For our SolarNode installations (part of the SolarNetwork) we use a minicomputer with a Vortex86.  This is a system on chip (SoC) x86 compatible CPU which has all the bells and whistles on one piece of silicon.

JrMX with Vortex86 inside
We had until recently been installing a standard Ubuntu distribution which was working very nicely.  Problem was this distribution was full of many unneeded software modules.

Over the break I finally got around to sorting out a bare bones installation that only contains what we need (no GUI required!).  Not only does this increase performance and reduce disk space requirements, but it enhances security by keeping deployed software to a minimum (less software equals less security updates).

Here is the process we have used to build a bare bones SD boot image with the latest native WiFi support (no ndiswrapper here) on a Norhtec JrMX.  Read on... 

First up: Find yourself an Ubuntu or Debian based PC to prepare your bootable SD card.  Make sure you have unetbootin or similar installed (usefull for creating a bootable SD or USB stick from an iso).

# sudo apt-get install unetbootin

Use unetbootin to create a bootable SD card (I used a 4GB) using this Debian squeeze mini iso.

Now boot the JrMX (with network cable connected) from the freshly made bootable SD card and complete the installation process (could take a while with lots of downloading).

Once finished, there will likely be some additional packages you will want to install e.g. ssh-server, ntp, wicd, wicd-curses etc.

# apt-get install ssh-server
# apt-get install ntp
# apt-get install wicd
# apt-get install wicd-curses

FYI: We use wicd-curses to configure WiFi from command line (instead of the NetworkManager GUI or similar).

Now, get Ready for the Kernel upgrade and WiFi driver install...

Squirt the stuff (Kernel and WiFi Driver) across to the JrMX from your desktop (connected using network cable at this point in time).
e.g.

$ scp linux-image-2.6.34.10-vortex86-sg_1.2_i386.zip  philipc@10.1.1.11:
$ scp RTL8188_8192SU_usb_linux_v2.6.6.0.20110401.zip philipc@10.1.1.11:


Now, on the JrMX box (ssh in or login using physical keyboard and monitor), install the new kernel and the kernel headers:

# unzip linux-image-2.6.34.10-vortex86-sg_1.2_i386.zip
# dpkg -i linux-image-2.6.34.10-vortex86-sg_1.2_i386.deb
# dpkg -i linux-headers-2.6.34.10-vortex86-sg_1.2_i386.deb


Now Install RTL8188SU Linux driver (for WiFi), but first we need to sort out the missing build link to the header source files:

# rmdir -–ignore-fail-on-non-empty /lib/modules/2.6.34.10-vortex86-sg/build
# ln -sf /usr/src/linux-headers-2.6.34.10-vortex86-sg /lib/modules/2.6.34.10-vortex86-sg/build

Download and unzip the latest RTL8188SU driver (which is actually the same as RTL8192SU driver).  The one I specifically used is here, or you can get it from the realtek site. 

#unzip RTL8188_8192SU_usb_linux_v2.6.6.0.20110401.zip

Note: This works great, but readme instructions from the older rtl8188_8192.zip (this one is from the robosavvy site) are much more informative.  Follow the readme instructions which are summarised below ('make' and 'make install' basically)...

Note: You will also need the following to build the drivers (if you want, remove with apt-get remove at the end):

# apt-get install build-essential

Extract, build and install WiFi drvier from unzipped source dir
:

# cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/driver
# tar -xzf rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401.tar.gz
# cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401
# make

  ...
  Building modules, stage 2.

  MODPOST 1 modules
  CC      /home/solar/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/8712u.mod.o
  LD [M]  /home/solar/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/driver/rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20110401/8712u.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.34.10-vortex86-sg'


# make install
install -p -m 644 8712u.ko  /lib/modules/2.6.34.10-vortex86-sg/kernel/drivers/net/wireless/
/sbin/depmod -a 2.6.34.10-vortex86-sg


# shutdown -r now


NOW LETS GET THAT WiFi GOING!


Check a few things:

# ifconfig wlan0 up
# iwlist wlan0 scan
# iwconfig


Configure the WiFi connection (use wicd-curses, it's like NetworkManager, but a command line tool! Just follow your nose...)

#wicd-curses

Yea Ha!!!! It all works :)

You may want to turn off a few other things as well, but this is a great starting point for a minimal install.

Enjoy!

Note: Please make sure you see Matt's update on this post as well.